00001 #ifndef __F_LimitedBFGS_NLS_H__ 00002 #define __F_LimitedBFGS_NLS_H__ 00003 00004 00059 #include <stdio.h> 00060 #include "F_IterativeNonLS.hpp" 00061 00062 #include "FloatVectorQueue.hpp" 00063 00064 00065 class F_LimitedBFGS_NLS : public F_IterativeNonLS 00066 { 00067 private: 00068 00069 int m; 00070 int k; 00071 00072 FloatVectorQueue* S; 00073 FloatVectorQueue* Y; 00074 00075 double alpha; 00076 00077 FloatVector* g; 00078 FloatVector* d; 00079 00080 FloatVector* s; 00081 FloatVector* y; 00082 00083 protected: 00084 00085 virtual FloatVector* bfgs_Hx(int level, FloatVector* d); 00086 00087 virtual FloatVector* singleSolve(AbsFObjectiveFn* fn, FloatVector* x=0); 00088 00089 public: 00090 F_LimitedBFGS_NLS(int maxIterations, int M=5, double epsilon=1.0e-4); 00091 virtual ~F_LimitedBFGS_NLS(){delete Y; delete S;} 00092 00093 virtual FloatVector* solve(AbsFObjectiveFn* fn, FloatVector* x=0); 00094 }; 00095 00096 #endif 00097