00001 #ifndef __F_GmresLS_H__ 00002 #define __F_GmresLS_H__ 00003 00047 #include <stdio.h> 00048 #include "F_IterativeLS.hpp" 00049 00050 #include "AFSymMatrix.hpp" 00051 00052 00053 class F_GmresLS : public F_IterativeLS 00054 { 00055 private: 00056 00057 int m; 00058 int i; // counter to move in Krylov spaces 00059 00060 double normb; 00061 double beta; 00062 double residu; 00063 00064 FloatVector* r; 00065 FloatVector* ap; 00066 FloatVector* w; 00067 00068 FloatVector* s; 00069 FloatVector* cs; 00070 FloatVector* sn; 00071 00072 FloatVector** v; 00073 AFSymMatrix* h; 00074 00075 protected: 00076 00077 virtual FloatVector* singleSolve(AFloatMatrix* A, FloatVector* b, FloatVector* x=0); 00078 00079 public: 00080 F_GmresLS(int maxIterations, int m=10, double epsilon=1.0e-4); 00081 virtual ~F_GmresLS(){delete[] v; delete h; delete s; delete cs; delete sn;} 00082 00083 virtual FloatVector* solve(AFloatMatrix* m, FloatVector* b, FloatVector* dest); 00084 }; 00085 00086 #endif 00087