////////////////////////////////////////////////////////////////////// // // ArmijoLineSearcher.h: interface of the AxA3dNUMArmijoLineSearcher class. // // Written by: Matthias Wacker // ////////////////////////////////////////////////////////////////////// #ifndef _ARMIJO_LINE_SEARCHER_H_ #define _ARMIJO_LINE_SEARCHER_H_ #include #include "LineSearcher.h" namespace OPTIMIZATION { /*! class for the brent line search HowToUse: * use setX0() to set the offset * use setH0() to set the search direction * use setGk() to set the gradient in x0 * call init() * call optimize() (returns lambda) */ class ArmijoLineSearcher : public LineSearcher { public: typedef LineSearcher SuperClass; typedef SuperClass::matrix_type matrix_type; /*! default constructor */ ArmijoLineSearcher(); /*! constructor */ ArmijoLineSearcher(CostFunction *costFunc, OptLogBase *loger); /*! Copy constructor \param opt .. optimizer to copy */ ArmijoLineSearcher( const ArmijoLineSearcher &lin); /*! operator = */ ArmijoLineSearcher & operator=(const ArmijoLineSearcher &lin); /*! Destructor. */ virtual ~ArmijoLineSearcher(); /*! set Parameters @param gamma reduction Factor of step width test @param L divisor for computation of sk ( > 0 ) @param sigma multiplicative parameter for test (0, 0.5) */ void setGammaLSigma(double gamma, double L, double sigma); /*! local search setup @param xk start point @param gk gradient at xk @param dk descent direction from xk */ void setXkGkDk(const matrix_type xk, const matrix_type gk, const matrix_type dk); /*! optimize returns a double.. */ double optimize(); protected: //! an internal parameter double m_dGamma; //! an internal paramter double m_dL; //! an internal parameter double m_dSigma; //! gradient in xk matrix_type m_gk; //! iteration direction from xk matrix_type m_dk; };//class }//namespace #endif