123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- //////////////////////////////////////////////////////////////////////
- //
- // ArmijoLineSearcher.h: interface of the AxA3dNUMArmijoLineSearcher class.
- //
- // Written by: Matthias Wacker
- //
- //////////////////////////////////////////////////////////////////////
- #ifndef _ARMIJO_LINE_SEARCHER_H_
- #define _ARMIJO_LINE_SEARCHER_H_
- #include <cmath>
- #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
|