00001 #ifndef __CG_NR_H__
00002 #define __CG_NR_H__
00003
00004
00027 #include "AbsTriDiagIterativeLS.hpp"
00028
00029 class CG_NR : public AbsTriDiagIterativeLS
00030 {
00031 protected:
00032
00033 double alpha;
00034 double beta;
00035
00036 RealVector* r;
00037 RealVector* p;
00038
00039 RealVector* ap;
00040
00041 RTriDiagonalMatrix* At;
00042
00043
00044 public:
00045
00046 CG_NR(int asize, int iterMax, double eps=1e-4):AbsTriDiagIterativeLS(asize, iterMax, eps)
00047 {
00048 r= new RealVector(N);
00049 p= new RealVector(N);
00050
00051 ap= new RealVector(N);
00052
00053 At= new RTriDiagonalMatrix(N);
00054 }
00055
00056 virtual ~CG_NR(){delete r; delete p; delete ap; delete At;}
00057
00058 virtual bool iterate();
00059
00060 virtual void output()
00061 {
00062 printf("CG NR ");
00063 AbsTriDiagIterativeLS::output();
00064 }
00065
00066 virtual void output(FILE* file)
00067 {
00068 fprintf(file, "CG NR ");
00069 AbsTriDiagIterativeLS::output(file);
00070 }
00071 };
00072
00073 #endif
00074
00075