123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- //////////////////////////////////////////////////////////////////////
- //
- // LineSearcher.h: interface of the LineSearcher class.
- //
- // Written by: Matthias Wacker
- //
- //////////////////////////////////////////////////////////////////////
- #ifndef _LINE_SEARCHER_H_
- #define _LINE_SEARCHER_H_
- #include "core/optimization/blackbox/CostFunction.h"
- #include "core/optimization/blackbox/OptLogBase.h"
- #include "optimization/Opt_Namespace.h"
- #include "optimization/InequalityConstraints.h"
- #include "optimization/EqualityConstraints.h"
- /*!
- Abstract base class of all line search optimizer.
- */
- class LineSearcher
- {
- public:
- typedef optimization::matrix_type matrix_type;
- /*!
- default constructor
- */
- LineSearcher();
- /*!
- constructor
- */
- LineSearcher(CostFunction *costFunc, OptLogBase *loger);
- /*!
- Copy constructor
- \param opt .. optimizer to copy
- */
- LineSearcher( const LineSearcher &lin);
-
- /*!
- operator =
- */
- LineSearcher & operator=(const LineSearcher &lin);
- /*!
- Destructor.
- */
- virtual ~LineSearcher();
- /*!
- search maximum?
- */
- inline void setMaximize(bool maximize){m_maximize = maximize;};
- /*!
- set x0
- */
- bool setX0(const matrix_type & x0);
- /*!
- set a direction
- */
- bool setH0(const matrix_type & H0);
- /*!
- optimize
- returns a double..
- */
- virtual double optimize() = 0;
-
- /*!
- set Constraints for penalty terms
- \returns true in case of success
- */
- bool setConstraints(InequalityConstraints *ineq,EqualityConstraints *eq);
- /*!
- evaluate penalized 1d function
- */
- double evaluateSub(double lambda);
- /*!
- penalty parameter
- */
- bool setPP(double pp);
- /*!
- set vebose to true to get more information
- */
- inline void setVerbose(bool verb){m_verbose = verb;};
- protected:
- /*!
- maximization?
- */
- bool m_maximize;
-
- /*!
- the costfunction
- */
- CostFunction *m_pFunc;
- /*!
- number of Inequality Constraints
- */
- unsigned int m_numIneq;
- /*!
- Inequality Constraints
- */
- InequalityConstraints *m_pIneq;
- /*!
- number of Equality Constraints
- */
- unsigned int m_numEq;
- /*!
- Equality Constraints
- */
- EqualityConstraints *m_pEq;
- /*
- penalty parameter
- */
- double m_PP;
-
- /*!
- Point to a loger
- */
- OptLogBase *m_pLoger;
- /*!
- verbose?
- */
- bool m_verbose;
- };
- #endif
|