00001 #ifndef __F_DY_CgNonLS_H__ 00002 #define __F_DY_CgNonLS_H__ 00003 00004 00045 #include <stdio.h> 00046 #include "F_IterativeNonLS.hpp" 00047 00048 00049 class F_DY_CgNonLS : public F_IterativeNonLS 00050 { 00051 private: 00052 00053 double alpha; 00054 double beta; 00055 00056 FloatVector* r; 00057 FloatVector* d; 00058 00059 bool precondFlag; 00060 FloatVector* s; // used if Hessian Preconditioning is asked 00061 00062 double delta0; 00063 double deltaNew; 00064 double deltaOld; 00065 00066 protected: 00067 00068 virtual FloatVector* singleSolve(AbsFObjectiveFn* fn, FloatVector* x=0); 00069 00070 public: 00071 F_DY_CgNonLS(int maxIterations, double epsilon=1.0e-4):F_IterativeNonLS(maxIterations, epsilon) 00072 { r=d=s= 0; precondFlag=true;} 00073 virtual ~F_DY_CgNonLS(){} 00074 00075 virtual FloatVector* solve(AbsFObjectiveFn* fn, FloatVector* x=0); 00076 }; 00077 00078 #endif 00079