00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef HxIndxMatrix_H
00011 #define HxIndxMatrix_H
00012
00013 #include "HxIndxArray.h"
00014 #include "HxMatrix.h"
00015
00016
00017 class IndxMatrixHeaderT {
00018 public:
00019 friend STD_OSTREAM& operator<<(STD_OSTREAM& os,
00020 const IndxMatrixHeaderT& l)
00021 {return os << l.cols <<
00022 ((l.cols == 1) ? HxString(" column, ") :
00023 HxString(" columns, ")) << l.rows <<
00024 ((l.rows == 1) ? HxString(" row") :
00025 HxString(" rows"));}
00026 int cols;
00027 int rows;
00028 };
00029
00030 class indexedMatrix : public indexedArray<float, IndxMatrixHeaderT> {
00031 public:
00032 void add(HxString& key, HxMatrix& v);
00033 void search(HxMatrix& target, int n = 10);
00034
00035 int nElems() const;
00036 int nCol() const;
00037 int nRow() const;
00038
00039 friend STD_OSTREAM& operator<<(STD_OSTREAM& os,
00040 const indexedMatrix& l)
00041 {return l.put(os);}
00042
00043 int arraySize(const IndxMatrixHeaderT& header) const
00044 {return header.rows*header.cols;}
00045
00046 virtual double compare(float *e1, float *e2,
00047 const IndxMatrixHeaderT& header) const;
00048 };
00049
00050
00051 #endif