Optimizable.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //////////////////////////////////////////////////////////////////////
  2. //
  3. // Optimizable.h: interface of the Optimizable class.
  4. //
  5. // Written by Matthias Wacker
  6. //
  7. //////////////////////////////////////////////////////////////////////
  8. #ifndef _OPTIMIZABLE_H_
  9. #define _OPTIMIZABLE_H_
  10. #include "optimization/Opt_Namespace.h"
  11. namespace opt=optimization;
  12. /*!
  13. \class
  14. */
  15. class Optimizable
  16. {
  17. public:
  18. /*!
  19. default Constructor
  20. */
  21. Optimizable();
  22. /*!
  23. Constructor.
  24. */
  25. Optimizable(unsigned int numOfParameters);
  26. /*!
  27. Copy Constructor
  28. */
  29. Optimizable(const Optimizable &optimizable);
  30. /*!
  31. Destructor.
  32. */
  33. virtual ~Optimizable();
  34. /*!
  35. operator=
  36. */
  37. Optimizable & operator=(const Optimizable &opt);
  38. /*!
  39. get Number of Parameters
  40. */
  41. inline unsigned int getNumOfParameters(){return m_numOfParameters;};
  42. /*!
  43. Evaluation of objective function.
  44. \param parameter double matrix (numOfParameters X 1) ^= column vector
  45. \return objective function value
  46. */
  47. virtual double evaluate(const opt::matrix_type &parameter) = 0;
  48. /*!
  49. Evaluation of objection function
  50. \param parameterset [x_1, x_2, x_3, .... ,x_n]
  51. \return doubleMatrix containing
  52. [evaluate(x_1), .... evaluate(x_n)];
  53. can be overloaded for parallel computation
  54. */
  55. opt::matrix_type evaluateSet(const opt::matrix_type &parameterSet);
  56. protected:
  57. /*!
  58. the number of parameters
  59. */
  60. unsigned int m_numOfParameters;
  61. };
  62. #endif