Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxIndxMatrix.h

00001 /*
00002  *  Copyright (c) 2000, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *  Author(s):
00006  *  Jan-Mark Geusebroek (mark@wins.uva.nl)
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

Generated on Mon Jan 27 15:48:45 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001