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

Sp1FloatSMatrix.hpp

00001 #ifndef __Sp1FloatSMatrix_H__
00002 #define __Sp1FloatSMatrix_H__
00003 
00004 
00024 #include <stdio.h>
00025 #include "FloatVector.hpp"
00026 
00027 #include "AFSymMatrix.hpp"
00028 
00029 class Sp1FloatSMatrix : public AFSymMatrix
00030 {
00031 protected:
00032 
00033 int                     nItems, maxItems;
00034 
00035 int*                    ia;
00036 int*                    ja;
00037 float*          data;
00038 
00039 public:
00040         
00041 Sp1FloatSMatrix(int w, int nmax);
00042 Sp1FloatSMatrix(const Sp1FloatSMatrix& m);
00043 Sp1FloatSMatrix operator=(const Sp1FloatSMatrix& m);
00044 
00045 virtual ~Sp1FloatSMatrix()
00046         {
00047         delete[] ia;
00048         delete[] ja;
00049         delete[] data;
00050         }
00051 
00052 virtual AFloatMatrix* copy();
00053 virtual AFloatMatrix* t(AFloatMatrix* result=0){return 0;}
00054 
00055 // no diagonal
00056 virtual AFSymMatrix* copyL0();                          
00057 virtual AFSymMatrix* copyU0();
00058 // with diagonal
00059 virtual AFSymMatrix* copyL();                           
00060 virtual AFSymMatrix* copyU();
00061 // with unit diagonal
00062 virtual AFSymMatrix* copyL1();                          
00063 virtual AFSymMatrix* copyU1();
00064 
00065 virtual int numberOfItems(){return nItems;}
00066 virtual int getMaxItems(){return maxItems;}
00067 
00068 virtual void addItem(int x,int y, float value=0);
00069 
00070 virtual bool getItem(int index, int* x,int* y, float* value);
00071 virtual bool setItem(int index, float value);
00072 
00073 // base 0
00074 virtual void set0(int i, int j, float value);
00075 virtual float get0(int i, int j);
00076 
00077 // base 1
00078 virtual void set(int i, int j, float value){ set0(i-1,j-1, value); }
00079 virtual float get(int i, int j){ return get0(i-1,j-1); }
00080 
00081 // computations
00082 virtual void setAll(float value=0.0);
00083 
00084 virtual float det();
00085 virtual float trace();
00086 
00087 virtual float norme2();
00088 virtual float sum();
00089 virtual float sum2();
00090 virtual float sigma(){return 0.0;}
00091 
00092 virtual float minimum();
00093 virtual float maximum();
00094 
00095 // scalar single operations
00096 void operator+=(float value);
00097 void operator-=(float value);
00098 void operator*=(float value);
00099 void operator/=(float value);
00100 
00101 virtual void add(float value);
00102 virtual void subst(float value);
00103 virtual void mult(float value);
00104 virtual void div(float value);
00105 
00106 virtual void add(AFloatMatrix& m){}
00107 virtual void subst(AFloatMatrix& m){}
00108 
00109 // u= A*v including implicit transposition
00110 virtual FloatVector* mult_Av(FloatVector* v, FloatVector* result=0);
00111 virtual FloatVector* mult_ATv(FloatVector* v, FloatVector* result=0);
00112 // u= v*A
00113 virtual FloatVector* mult_vA(FloatVector* v, FloatVector* result=0)     { return mult_ATv(v, result); }
00114 virtual FloatVector* mult_vAT(FloatVector* vt, FloatVector* result=0){ return mult_Av(vt, result); }
00115 
00116 // sub vector usage
00117 // u= A*v
00118 FloatVector* mult_Av(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0);
00119 FloatVector* mult_ATv(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0);
00120 // u= v*A
00121 FloatVector* mult_vA(FloatVector* v, int row0, int col0, bool incremental=false, FloatVector* result=0)
00122                         { return mult_ATv(v, col0, row0, incremental, result); }
00123 FloatVector* mult_vAT(FloatVector* vt, int row0, int col0, bool incremental=false, FloatVector* result=0)
00124                         { return mult_Av(vt, col0, row0, incremental, result); }
00125 
00126 virtual void output();  
00127 };
00128 
00129 #endif
00130 
00131 
00132 
00133          
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