gmres.h

Go to the documentation of this file.
00001 #ifndef __gmresclass_h
00002 #define __gmresclass_h
00003 
00004 #include "mult.h"
00005 #include "cginfo.h"
00006 #include "nvector.h"
00007 
00008 /********************************************************************/
00009 
00010 namespace Gascoigne
00011 {
00012 template<class SOLVER, class PRECONDITIONER, class VECTOR>
00013 class GMRES
00014 {
00015   typedef nvector<double>  dvector;
00016 
00017   nvector<dvector> H;
00018   nvector<double>  gamma, ci, si;
00019 
00020   std::vector<VECTOR> mem;
00021   
00022   int vmax, left_precondition;
00023   
00024   void   new_memory          ();
00025   void   givens_rotation     (dvector&, int);
00026   void   solution            (VECTOR&, VECTOR&, int);
00027   double orthogonalization   (dvector&, int, VECTOR&) const;
00028   bool   reortho_test        (const VECTOR&, double) const;
00029 
00030   SOLVER&         A;
00031   PRECONDITIONER& P;
00032   
00033  public:
00034 
00035   GMRES(SOLVER&, PRECONDITIONER&, int);
00036   ~GMRES();
00037   void init();
00038 
00039   int solve          (VECTOR& x, const VECTOR& b, CGInfo& info);
00040   int restarted_solve(VECTOR& x, const VECTOR& b, CGInfo& info);
00041 };
00042 }
00043 
00044 /********************************************************************/
00045 
00046 #endif

Generated on Thu Sep 14 10:34:37 2006 for Gascoigne by  doxygen 1.4.7