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

Sp3FloatSMatrix.hpp

00001 #ifndef __Sp3FloatSMatrix_H__
00002 #define __Sp3FloatSMatrix_H__
00003 
00004 
00024 #include <stdio.h>
00025 #include "FloatVector.hpp"
00026 
00027 #include "AFSymMatrix.hpp"
00028 
00029 class Sp3FloatSMatrix : 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 Sp3FloatSMatrix(int w, int nmax);
00042 Sp3FloatSMatrix(const Sp3FloatSMatrix& m);
00043 Sp3FloatSMatrix operator=(const Sp3FloatSMatrix& m);
00044 
00045 virtual ~Sp3FloatSMatrix()
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 virtual int numberOfItems(){return nItems;}
00056 virtual int getMaxItems(){return maxItems;}
00057 
00058 virtual void addItem(int x,int y, float value=0);
00059 
00060 virtual bool getItem(int index, int* x,int* y, float* value);
00061 virtual bool setItem(int index, float value);
00062 
00063 // base 0
00064 virtual void set0(int i, int j, float value);
00065 virtual float get0(int i, int j);
00066 
00067 // base 1
00068 virtual void set(int i, int j, float value){ set0(i-1,j-1, value); }
00069 virtual float get(int i, int j){ return get0(i-1,j-1); }
00070 
00071 // computations
00072 virtual void setAll(float value=0.0);
00073 
00074 virtual float det();
00075 virtual float trace();
00076 
00077 virtual float norme2();
00078 virtual float sum();
00079 virtual float sum2();
00080 virtual float sigma(){return 0.0;}
00081 
00082 virtual float minimum();
00083 virtual float maximum();
00084 
00085 // scalar single operations
00086 void operator+=(float value);
00087 void operator-=(float value);
00088 void operator*=(float value);
00089 void operator/=(float value);
00090 
00091 virtual void add(float value);
00092 virtual void subst(float value);
00093 virtual void mult(float value);
00094 virtual void div(float value);
00095 
00096 virtual void add(AFloatMatrix& m){}
00097 virtual void subst(AFloatMatrix& m){}
00098 
00099 // u= A*v including implicit transposition
00100 virtual FloatVector* mult_Av(FloatVector* v, FloatVector* result=0);
00101 virtual FloatVector* mult_ATv(FloatVector* v, FloatVector* result=0);
00102 // u= v*A
00103 virtual FloatVector* mult_vA(FloatVector* v, FloatVector* result=0)     { return mult_ATv(v, result); }
00104 virtual FloatVector* mult_vAT(FloatVector* vt, FloatVector* result=0){ return mult_Av(vt, result); }
00105 
00106 // sub vector usage
00107 // u= A*v
00108 FloatVector* mult_Av(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0);
00109 FloatVector* mult_ATv(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0);
00110 // u= v*A
00111 FloatVector* mult_vA(FloatVector* v, int row0, int col0, bool incremental=false, FloatVector* result=0)
00112                         { return mult_ATv(v, col0, row0, incremental, result); }
00113 FloatVector* mult_vAT(FloatVector* vt, int row0, int col0, bool incremental=false, FloatVector* result=0)
00114                         { return mult_Av(vt, col0, row0, incremental, result); }
00115 
00116 // incomplete factorisation
00117 virtual AFloatMatrix* ilu0();
00118 virtual AFloatMatrix* iluth(double threshold=0.001);
00119 
00120 virtual void output();  
00121 };
00122 
00123 #endif
00124 
00125 
00126          
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