00001 #ifndef __F_MgcrLS_H__ 00002 #define __F_MgcrLS_H__ 00003 00004 00037 #include <stdio.h> 00038 #include "F_IterativeLS.hpp" 00039 00040 #include "AFSymMatrix.hpp" 00041 00042 00043 class F_MgcrLS : public F_IterativeLS 00044 { 00045 private: 00046 00047 int m; 00048 int k; // counter to move in Krylov spaces 00049 int width; 00050 00051 double d; 00052 00053 FloatVector* x0; 00054 FloatVector* r; 00055 00056 FloatVector* alpha; 00057 FloatVector* c; 00058 00059 00060 FloatVector* as; 00061 FloatVector** s; 00062 00063 00064 AFSymMatrix* h; 00065 00066 protected: 00067 00068 virtual FloatVector* singleSolve(AFloatMatrix* A, FloatVector* b, FloatVector* x=0); 00069 00070 public: 00071 F_MgcrLS(int maxIterations, int m=10, double epsilon=1.0e-4); 00072 virtual ~F_MgcrLS(){delete[] s; delete alpha; delete c; delete h;} 00073 00074 virtual FloatVector* solve(AFloatMatrix* m, FloatVector* b, FloatVector* dest); 00075 }; 00076 00077 #endif 00078