📄 bfgs.hpp
字号:
#ifndef BFGS_HH#define BFGS_HH#include "Optima.hpp"#include "defs.hpp"// BFGS Quasi-Newton Optimization Method/* At the present version, you must use the CubicLineSearch procedure */// Necessite une "vraie" classe Matricetemplate <class LS>class BFGS : public Optima<LS>{ typedef typename LS::Real Real; typedef typename LS::Param Param; typedef typename LS::Vect Vect; typedef typename LS::VMat VMat; typedef typename LS::Mat Mat; typedef list<Real> mlist;public: BFGS(///pointer to the line-search object. LS* ls, ///Maximum number of iterations int iter, ///minimum accepted gradient at optimum solution Real tol, ///vebose or quiet int verb=0); ~BFGS(){;} // the BFGS search starting from model0, returns an optimum model Param optimizer(Param& model0);};template <class LS>BFGS<LS>::BFGS(LS* p, int it, Real eps, int verb) :Optima<LS>(verb){ this->ls=p; this->iterMax = it; this->tol = eps; this->iterNum = 0;}// N閏essite pour la classe MAT:// - un constructeur de matrice avec nbre de lig, nbre de col// - un constructeur de matrice avec la diagonale comme param鑤re// - le produit matrice vecteur// - une m閠hode outProduct qui construit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -