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

BSp1FloatSMatrix.hpp

00001 #ifndef __BSp1FloatSMatrix_H__
00002 #define __BSp1FloatSMatrix_H__
00003 
00004 
00026 #include <stdio.h>
00027 #include "FloatVector.hpp"
00028 
00029 #include "AFSymMatrix.hpp"
00030 
00031 class BSp1FloatSMatrix 
00032 {
00033 protected:
00034 
00035 int                     width;                  // n blocks
00036 
00037 int                     totalWidth;                     // n values
00038 int                     widthSubMatrix;         // n value in sub matrix
00039 
00040 int                     nItems, maxItems;
00041 
00042 int*                    ia;
00043 int*                    ja;
00044 AFSymMatrix**   data;
00045 
00046 public:
00047         
00048 BSp1FloatSMatrix(int w, int nmax);
00049 BSp1FloatSMatrix(const BSp1FloatSMatrix& m);
00050 BSp1FloatSMatrix operator=(const BSp1FloatSMatrix& m);
00051 
00052 virtual ~BSp1FloatSMatrix();
00053 
00054 virtual BSp1FloatSMatrix* copy();
00055 
00056 // total values
00057 int getWidth(){ return totalWidth; }
00058 int getHeight(){ return totalWidth; }
00059 
00060 // item size
00061 int getItemWidth(){ return widthSubMatrix; }
00062 int getItemHeight(){ return widthSubMatrix; }
00063 
00064 // number of blocks
00065 int getBlockWidth(){ return width; }
00066 int getBlockHeight(){ return width; }
00067 int size(){ return width*width; }
00068 
00069 
00070 virtual int numberOfItems(){return nItems;}
00071 virtual int getMaxItems(){return maxItems;}
00072 
00073 virtual void addItem(int x,int y, AFSymMatrix* value=0);
00074 
00075 virtual bool getItem(int index, int* x, int* y, AFSymMatrix** value);
00076 virtual bool setItem(int index, AFSymMatrix* value);
00077 
00078 // On items
00079 // base 0
00080 void setBlock0(int i, int j, AFSymMatrix* value);
00081 AFSymMatrix* getBlock0(int i, int j);
00082 
00083 // base 1
00084 void setBlock(int i, int j, AFSymMatrix* value){ setBlock0(i-1,j-1, value); }
00085 AFSymMatrix* getBlock(int i, int j){ return getBlock0(i-1,j-1); }
00086 
00087 // base 0
00088 virtual void set0(int i, int j, float value);
00089 virtual float get0(int i, int j);
00090 
00091 // base 1
00092 virtual void set(int i, int j, float value){ set0(i-1,j-1, value); }
00093 virtual float get(int i, int j){ return get0(i-1,j-1); }
00094 
00095 // computations
00096 virtual void setAll(float value=0.0);
00097 
00098 virtual float det();
00099 virtual float trace();
00100 
00101 virtual float norme2();
00102 virtual float sum();
00103 virtual float sigma(){return 0.0;}
00104 
00105 virtual float minimum();
00106 virtual float maximum();
00107 
00108 // scalar single operations
00109 void operator+=(float value);
00110 void operator-=(float value);
00111 void operator*=(float value);
00112 void operator/=(float value);
00113 
00114 virtual void add(float value);
00115 virtual void subst(float value);
00116 virtual void mult(float value);
00117 virtual void div(float value);
00118 
00119 
00120 // u= A*v including implicit transposition
00121 virtual FloatVector* mult_Av(FloatVector* v, FloatVector* result=0);
00122 virtual FloatVector* mult_ATv(FloatVector* v, FloatVector* result=0);
00123 // u= v*A
00124 virtual FloatVector* mult_vA(FloatVector* v, FloatVector* result=0)     { return mult_ATv(v, result); }
00125 virtual FloatVector* mult_vAT(FloatVector* vt, FloatVector* result=0){ return mult_Av(vt, result); }
00126 
00127 // sub vector usage
00128 // u= A*v
00129 FloatVector* mult_Av(FloatVector* v, int col0, int row0, FloatVector* result=0);
00130 FloatVector* mult_ATv(FloatVector* v, int col0, int row0, FloatVector* result=0);
00131 // u= v*A
00132 FloatVector* mult_vA(FloatVector* v, int col0, int row0, FloatVector* result=0)
00133                         { return mult_ATv(v, row0, col0, result); }
00134 FloatVector* mult_vAT(FloatVector* vt, int col0, int row0, FloatVector* result=0)
00135                         { return mult_Av(vt, row0, col0, result); }
00136 
00137 void output();
00138 void output(FILE* file);
00139 };
00140 
00141 #endif
00142 
00143   
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