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

F_U1BiDiag.hpp

00001 #ifndef __F_U1BiDiag_H__
00002 #define __F_U1BiDiag_H__
00003 
00004 
00025 #include <stdio.h>
00026 #include "FloatVector.hpp"
00027 #include "FloatVectorT.hpp"
00028 
00029 #include "AFSymMatrix.hpp"
00030 
00031 class F_U1BiDiag : public AFSymMatrix
00032 {
00033 private:
00034         
00035 FloatVector*            u;                                      
00036 
00037 public:
00038         
00039 F_U1BiDiag(int asize, float val=0.0);
00040 F_U1BiDiag(const F_U1BiDiag& v);
00041 F_U1BiDiag operator=(const F_U1BiDiag& v);
00042 
00043 virtual ~F_U1BiDiag(){delete u;}
00044 
00045 virtual AFloatMatrix* copy(){return 0;}
00046 virtual AFloatMatrix* t(AFloatMatrix* result=0){return 0;}
00047 
00048 void load(F_U1BiDiag* m);
00049 void load(FloatVector* anU);
00050 
00051 virtual int size()const { return (2*width-1); }
00052 
00053 FloatVector* getUvalues(){ return u; }
00054 
00055 // base 0
00056 virtual void set0(int i, int j, float value);
00057 virtual float get0(int i, int j);
00058 
00059 inline void setD0(int i, float value){}
00060 inline float getD0(int i) const{ return 1.0; }
00061 
00062 virtual void setU0(int i, float value){ u->set0(i, value); }
00063 virtual float getU0(int i)const{ return u->get0(i); }
00064 
00065 // base 1
00066 virtual void set(int i, int j, float value){ set0(i-1, j-1, value); }
00067 virtual float get(int i, int j){ return get0(i-1, j-1); }
00068 
00069 inline void setD(int i, float value){}
00070 inline float getD(int i) const{ return 1.0; }
00071 
00072 virtual void setU(int i, float value){ u->set(i, value); }
00073 virtual float getU(int i)const{ return u->get(i); }
00074 
00075 // computations
00076 
00077 virtual void setAll(float value=0.0){ u->setAll(value); }
00078 
00079 // direct solvers
00080 virtual FloatVector* solve(FloatVector* b, FloatVector* x=0);           // U1x=b
00081 
00082 virtual FloatVector* linearSolverU1(FloatVector* b, FloatVector* x=0);          // U1x=b
00083 
00084 // direct inversion U
00085 AFSymMatrix* invert();          // Uinv = U^-1
00086 
00087 virtual float det(){return 0;}
00088 virtual float trace(){return 0;}
00089 
00090 virtual float norme2();
00091 virtual float sum();
00092 
00093 virtual float minimum();
00094 virtual float maximum();
00095 virtual float sigma();
00096 
00097 // scalar single operations
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 // vector single operations
00107 void operator+=(F_U1BiDiag& m);
00108 void operator-=(F_U1BiDiag& m);
00109 
00110 virtual void add(AFloatMatrix& m){}
00111 virtual void subst(AFloatMatrix& m){}
00112 
00113 // u= A*v including implicit transposition
00114 FloatVector* mult_Av(FloatVector* v, FloatVector* result=0);
00115 FloatVector* mult_ATv(FloatVector* v, FloatVector* result=0);
00116 // u= v*A
00117 FloatVector* mult_vA(FloatVector* v, FloatVector* result=0)     { return mult_ATv(v, result); }
00118 FloatVector* mult_vAT(FloatVector* vt, FloatVector* result=0){ return mult_Av(vt, result); }
00119 
00120 // sub vector usage
00121 // u= A*v
00122 FloatVector* mult_Av(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0);
00123 FloatVector* mult_ATv(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0);
00124 // u= v*A
00125 FloatVector* mult_vA(FloatVector* v, int row0, int col0, bool incremental=false, FloatVector* result=0)
00126                         { return mult_ATv(v, col0, row0, incremental, result); }
00127 FloatVector* mult_vAT(FloatVector* vt, int row0, int col0, bool incremental=false, FloatVector* result=0)
00128                         { return mult_Av(vt, col0, row0, incremental, result); }
00129 
00130 
00131 virtual void output();
00132 virtual void output(FILE* file);
00133 };
00134 
00135 #endif
00136 
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