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

FColSMatrix.hpp

00001 #ifndef __FColSMatrix_H__
00002 #define __FColSMatrix_H__
00003 
00004 
00025 #include <stdio.h>
00026 #include "FloatVector.hpp"
00027 #include "FloatVectorT.hpp"
00028 
00029 #include "AFSymMatrix.hpp"
00030 
00031 class FColSMatrix : public AFSymMatrix
00032 {
00033 private:
00034         
00035 FloatVector**           col;                                    // vertical columns
00036 
00037 public:
00038         
00039 FColSMatrix(int asize, float val=0.0);
00040 FColSMatrix(const FColSMatrix& v);
00041 FColSMatrix operator=(const FColSMatrix& v);
00042 
00043 virtual ~FColSMatrix();
00044 
00045 virtual AFloatMatrix* copy();
00046 virtual AFloatMatrix* t(AFloatMatrix* result=0){return 0;}
00047 
00048 // base 0
00049 void set0Col(int i, FloatVector* v){col[i]= v;}
00050 FloatVector* get0Col(int i){ return col[i]; }
00051 
00052 virtual void set0(int i, int j, float value){ col[i]->set0(j, value); }
00053 virtual float get0(int i, int j){ return col[i]->get0(j); }
00054 
00055 // base 1
00056 void setCol(int i, FloatVector* v){col[i-1]= v;}
00057 FloatVector* getCol(int i){ return col[i-1]; }
00058 
00059 virtual void set(int i, int j, float value){ col[i-1]->set(j, value); }
00060 virtual float get(int i, int j){ return col[i-1]->get(j); }
00061 
00062 // computations
00063 
00064 virtual void setAll(float value=0.0);
00065 
00066 virtual float det();
00067 virtual float trace();
00068 
00069 virtual float norme2();
00070 virtual float sum();
00071 
00072 virtual float minimum();
00073 virtual float maximum();
00074 virtual float sigma();
00075 
00076 // scalar single operations
00077 void operator*=(float value);
00078 void operator/=(float value);
00079 
00080 virtual void add(float value);
00081 virtual void subst(float value);
00082 virtual void mult(float value);
00083 virtual void div(float value);
00084 
00085 // vector single operations
00086 void operator+=(const FColSMatrix& m);
00087 void operator-=(const FColSMatrix& m);
00088 
00089 virtual void add(AFloatMatrix& m);
00090 virtual void subst(AFloatMatrix& m);
00091 
00092 // u= A*v including implicit transposition
00093 virtual FloatVector* mult_Av(FloatVector* v, FloatVector* result=0);
00094 virtual FloatVector* mult_ATv(FloatVector* v, FloatVector* result=0);
00095 // u= v*A
00096 virtual FloatVector* mult_vA(FloatVector* v, FloatVector* result=0)     { return mult_ATv(v, result); }
00097 virtual FloatVector* mult_vAT(FloatVector* vt, FloatVector* result=0){ return mult_Av(vt, result); }
00098 
00099 // sub vector usage
00100 // u= A*v
00101 FloatVector* mult_Av(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0);
00102 FloatVector* mult_ATv(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0);
00103 // u= v*A
00104 FloatVector* mult_vA(FloatVector* v, int row0, int col0, bool incremental=false, FloatVector* result=0)
00105                         { return mult_ATv(v, col0, row0, incremental, result); }
00106 FloatVector* mult_vAT(FloatVector* vt, int row0, int col0, bool incremental=false, FloatVector* result=0)
00107                         { return mult_Av(vt, col0, row0, incremental, result); }
00108 
00109 // friends
00110 friend FloatVectorT operator*(const FloatVectorT& vt, const FColSMatrix& m);    
00111 friend FloatVector operator*(const FColSMatrix& m, const FloatVector& v);       
00112 
00113 virtual void output();
00114 virtual void output(FILE* file);
00115 };
00116 
00117 #endif
00118 
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