Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

BFDiagonalMatrix.hpp

00001 #ifndef __BFDiagonalMatrix_H__
00002 #define __BFDiagonalMatrix_H__
00003 
00004 
00005 
00028 #include <stdio.h>
00029 #include "FloatVector.hpp"
00030 #include "AFSymMatrix.hpp"
00031 
00032 class BFDiagonalMatrix
00033 {
00034 private:
00035         
00036 int                             N;                              // number of matrices on the diagonal
00037 
00038 int                             totalWidth;                     // n values
00039 int                             widthSubMatrix;         // n value in sub matrix
00040 
00041 AFSymMatrix**           d;                                      // N size diagonal
00042 
00043 public:
00044         
00045 BFDiagonalMatrix(int asize, int nsub);                          // empty
00046 BFDiagonalMatrix(int asize, int nsub, float value);                             
00047 BFDiagonalMatrix(const BFDiagonalMatrix& v);
00048 BFDiagonalMatrix operator=(const BFDiagonalMatrix& v);
00049 
00050 ~BFDiagonalMatrix(){ delete d; }
00051 
00052 // total values
00053 int getWidth(){ return totalWidth; }
00054 int getHeight(){ return totalWidth; }
00055 
00056 // item size
00057 int getItemWidth(){ return widthSubMatrix; }
00058 int getItemHeight(){ return widthSubMatrix; }
00059 
00060 // number of blocks
00061 int getBlockWidth(){ return N; }
00062 int getBlockHeight(){ return N; }
00063 inline int size()const { return N; }
00064 
00065 AFSymMatrix** getDblocks(){ return d; }
00066 
00067 // base 0
00068 void setBlock0(int i, AFSymMatrix* value){ d[i]= value; }
00069 AFSymMatrix* getBlock0(int i )const { return d[i]; }
00070 // base 1
00071 void setBlock(int i, AFSymMatrix* value){ d[i-1]= value; }
00072 AFSymMatrix* getBlock(int i )const { return d[i-1]; }
00073 
00074 // base 0
00075 void set0(int i, int j, float value);
00076 float get0(int i, int j)const ;
00077 
00078 // base 1
00079 void set(int i, int j, float value);
00080 float get(int i, int j)const ;
00081 
00082 // computations
00083 float det();
00084 float trace();
00085 
00086 float sum();
00087 
00088 float minimum();
00089 float maximum();
00090 float mean(){ return sum()/size(); }
00091 
00092 // scalar single operations
00093 void operator+=(float value);
00094 void operator-=(float value);
00095 void operator*=(float value);
00096 void operator/=(float value);
00097 
00098 // u= A*v including implicit transposition
00099 FloatVector* mult_Av(FloatVector* v, FloatVector* result=0);
00100 FloatVector* mult_ATv(FloatVector* v, FloatVector* result=0);
00101 // u= v*A
00102 FloatVector* mult_vA(FloatVector* v, FloatVector* result=0)     { return mult_ATv(v, result); }
00103 FloatVector* mult_vAT(FloatVector* vt, FloatVector* result=0){ return mult_Av(vt, result); }
00104 
00105 // sub vector usage
00106 // u= A*v
00107 FloatVector* mult_Av(FloatVector* v, int col0, int row0, FloatVector* result=0);
00108 FloatVector* mult_ATv(FloatVector* v, int col0, int row0, FloatVector* result=0);
00109 // u= v*A
00110 FloatVector* mult_vA(FloatVector* v, int col0, int row0, FloatVector* result=0)
00111                         { return mult_ATv(v, row0, col0, result); }
00112 FloatVector* mult_vAT(FloatVector* vt, int col0, int row0, FloatVector* result=0)
00113                         { return mult_Av(vt, row0, col0, result); }
00114 
00115 void output();
00116 void output(FILE* file);        
00117 };
00118 
00119 #endif
00120 
00121  
SourceForge.net Logo
Restoreinpaint sourceforge project `C++/Java Image Processing, Restoration, Inpainting Project'.

Bernard De Cuyper: Open Project Leader: Concept, design and development.
Bernard De Cuyper & Eddy Fraiha 2002, 2003. Bernard De Cuyper 2004. Open and free, for friendly usage only.
Modifications on Belgium ground of this piece of artistic work, by governement institutions or companies, must be notified to Bernard De Cuyper.
bern_bdc@hotmail.com