MyCostFunction.h 559 B

1234567891011121314151617181920212223242526
  1. #ifndef _MYCOSTFUNCTION_H
  2. #define _MYCOSTFUNCTION_H
  3. //#include <cppunit/extensions/HelperMacros.h>
  4. #include "core/optimization/blackbox/CostFunction.h"
  5. namespace OPTIMIZATION
  6. {
  7. //define a simple cost function for one-dimensional or two-dimensional data
  8. class MyCostFunction : public CostFunction
  9. {
  10. public:
  11. MyCostFunction(const int & dim, bool verbose) : CostFunction(dim), m_bVerbose(verbose)
  12. {}
  13. virtual double evaluate(const OPTIMIZATION::matrix_type & x);
  14. private:
  15. bool m_bVerbose;
  16. }; //class
  17. }//namespace
  18. #endif