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

F_IterativeLS.hpp

00001 #ifndef __F_IterativeLS_H__
00002 #define __F_IterativeLS_H__
00003 
00004 
00029 #include <stdio.h>
00030 #include "AbsFLinearSolver.hpp"
00031 
00032 
00033 class F_IterativeLS : public AbsFLinearSolver
00034 {
00035 protected:
00036 
00037 int             maxIter;
00038 double  eps;
00039 
00040 bool            converge;
00041 
00042 protected:
00043 
00044 virtual FloatVector* singleSolve(AFloatMatrix*  A, FloatVector* b, FloatVector* x=0)=0;
00045 
00046 public:
00047 F_IterativeLS(int maxIterations, double epsilon=1.0e-4){maxIter=maxIterations; eps=epsilon;}
00048 virtual ~F_IterativeLS(){}      
00049 
00050 // A * u = b
00051 virtual FloatVector* solve(AFloatMatrix*        A, FloatVector* b, bool factorisation, FloatVector* dest)
00052         { return solve(A, b, dest); }
00053 
00054 virtual FloatVector* solve(AFloatMatrix*        A, FloatVector* b, FloatVector* dest)
00055         {
00056         converge=false;
00057 
00058         for(int i=0; i<maxIter; i++)
00059                 {
00060                 dest=  singleSolve(A, b, dest);
00061 
00062                 if(converge == true)
00063                         break;
00064                 }
00065         return dest;
00066         }
00067 };
00068 
00069 #endif
00070 
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