123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- #ifndef _COST_FUNCTION_H_
- #define _COST_FUNCTION_H_
- #include "core/optimization/blackbox/Optimizable.h"
- #include "core/optimization/blackbox/Definitions_core_opt.h"
- namespace OPTIMIZATION {
-
- class CostFunction : public Optimizable
- {
- public:
- typedef Optimizable SuperClass;
- typedef OPTIMIZATION::matrix_type matrix_type;
-
-
- CostFunction();
-
- CostFunction(unsigned int numOfParamters);
-
-
- CostFunction(const CostFunction &func);
-
-
- virtual ~CostFunction();
-
- CostFunction &operator=(const CostFunction &costFunc);
- inline bool hasAnalyticGradient(){return m_hasAnalyticGradient;}
-
- virtual const OPTIMIZATION::matrix_type getAnalyticGradient(const OPTIMIZATION::matrix_type &x);
-
-
- inline bool hasAnalyticHessian(){return m_hasAnalyticHessian;}
-
- virtual const OPTIMIZATION::matrix_type getAnalyticHessian(const OPTIMIZATION::matrix_type & x);
-
- inline unsigned int getNumberOfEvaluations(){return m_numEval;};
-
- inline void resetNumberOfEvaluations(){m_numEval = 0;};
-
- virtual void init();
-
- bool setX0(const OPTIMIZATION::matrix_type &x0);
-
- bool setH0(const OPTIMIZATION::matrix_type &H0);
-
- double evaluateSub(double lambda);
-
- virtual OPTIMIZATION::matrix_type getFullParamsFromSubParams(const OPTIMIZATION::matrix_type &x)
- {
- matrix_type fullparamvec(x);
- return x;
- }
- protected:
-
- bool m_hasAnalyticGradient;
-
-
- bool m_hasAnalyticHessian;
-
- OPTIMIZATION::matrix_type m_x_0;
-
- OPTIMIZATION::matrix_type m_h_0;
-
- unsigned int m_numEval;
- };
-
- }
- #endif
|