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

AFloatMatrix.hpp

00001 #ifndef __AFloatMatrix_H__
00002 #define __AFloatMatrix_H__
00003 
00025 #include <stdio.h>
00026 #include "FloatVector.hpp"
00027 
00028 #include "Simple1DIndexList.hpp"
00029 
00030 class AFloatMatrix
00031 {
00032 public:
00033 virtual ~AFloatMatrix(){}
00034 
00035 virtual AFloatMatrix* copy()=0;
00036 virtual AFloatMatrix* t(AFloatMatrix* result=0)=0;
00037 
00038 virtual int size() const{ return getWidth()*getHeight(); }
00039 
00040 virtual int getWidth() const=0;                         // use of abstract is better for dynamic block size,...
00041 virtual int getHeight() const=0;
00042 
00043 // base 0
00044 virtual void set0(int i, int j, float value)=0;
00045 virtual float get0(int i, int j)=0;
00046 
00047 virtual Simple1DIndexList* indexesInRow0(int k, Simple1DIndexList* oldRow=0){ return 0; }
00048 virtual Simple1DIndexList* indexesInCol0(int k, Simple1DIndexList* oldCol=0){ return 0; }
00049 
00050 // base 1
00051 virtual void set(int i, int j, float value)=0;
00052 virtual float get(int i, int j)=0;
00053 
00054 virtual Simple1DIndexList* indexesInRow(int k, Simple1DIndexList* oldRow=0){ return 0; }
00055 virtual Simple1DIndexList* indexesInCol(int k, Simple1DIndexList* oldCol=0){ return 0; }
00056 
00057 
00058 // computations
00059 virtual void setAll(AFloatMatrix* from, bool t=false)=0;
00060 virtual void setAll(float value=0.0)=0;
00061 
00062 virtual float det()=0;
00063 virtual float trace()=0;
00064 
00065 virtual float norme2()=0;
00066 virtual float sum()=0;
00067 
00068 virtual float minimum()=0;
00069 virtual float maximum()=0;
00070 virtual float mean(){return sum()/size();}
00071 virtual float sigma()=0;
00072 
00073 // scalar single operations
00074 virtual void add(float value)=0;
00075 virtual void subst(float value)=0;
00076 virtual void mult(float value)=0;
00077 virtual void div(float value)=0;
00078 
00079 // vector single operations
00080 virtual void add(AFloatMatrix& m)=0;
00081 virtual void subst(AFloatMatrix& m)=0;
00082 
00083 // Krylov Spaces (Verify!!!)
00084 // FloatVector** arnoldi(AFloatMatrix* h); // H(n-1,n-1)
00085 
00086 // u= A*v including implicit transposition
00087 virtual FloatVector* mult_Av(FloatVector* v, FloatVector* result=0)=0;
00088 virtual FloatVector* mult_ATv(FloatVector* v, FloatVector* result=0)=0;
00089 // u= v*A
00090 virtual FloatVector* mult_vA(FloatVector* v, FloatVector* result=0)=0;
00091 virtual FloatVector* mult_vAT(FloatVector* vt, FloatVector* result=0)=0;
00092 
00093 // sub vector usage
00094 // u= A*v
00095 virtual FloatVector* mult_Av(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0)=0;
00096 virtual FloatVector* mult_ATv(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0)=0;
00097 // u= v*A
00098 virtual FloatVector* mult_vA(FloatVector* v, int row0, int col0, bool incremental=false, FloatVector* result=0)=0;
00099 virtual FloatVector* mult_vAT(FloatVector* vt, int row0, int col0, bool incremental=false, FloatVector* result=0)=0;
00100 
00101 // matrix op
00102 // C= A+B
00103 virtual AFloatMatrix* gadd_A_B(AFloatMatrix* B, bool aT=false, bool bT=false, AFloatMatrix* result=0);
00104 virtual AFloatMatrix* gadd_B_A(AFloatMatrix* B, bool aT=false, bool bT=false, AFloatMatrix* result=0)
00105                 { return B->gadd_A_B(this, bT, aT, result); }
00106 // C= A-B
00107 virtual AFloatMatrix* gsubst_A_B(AFloatMatrix* B, bool aT=false, bool bT=false, AFloatMatrix* result=0);
00108 virtual AFloatMatrix* gsubst_B_A(AFloatMatrix* B, bool aT=false, bool bT=false, AFloatMatrix* result=0);
00109 // C= A*B
00110 virtual AFloatMatrix* gmult_A_B(AFloatMatrix* B, bool aT=false, bool bT=false, AFloatMatrix* result=0)
00111                                 {printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0;}
00112 virtual AFloatMatrix* gmult_B_A(AFloatMatrix* B, bool aT=false, bool bT=false, AFloatMatrix* result=0)
00113                                 {printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0;}
00114 
00115 virtual void output(){}
00116 virtual void output(FILE* file){}
00117 };
00118 
00119 #endif
00120 
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