EqualityConstraints.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //////////////////////////////////////////////////////////////////////
  2. //
  3. // EqualityConstraints.h: interface of the EqualityConstaints class.
  4. //
  5. // Written By: Matthias Wacker
  6. //
  7. // Constraints of the form: H(x) = 0
  8. // where H is the vector of all equality constraints
  9. //
  10. //////////////////////////////////////////////////////////////////////
  11. #ifndef _EQUALITYCONSTRAINTS_H_
  12. #define _EQUALITYCONSTRAINTS_H_
  13. #include "optimization/Constraints.h"
  14. /*!
  15. class Abstract base class for all equality constraints.
  16. */
  17. class EqualityConstraints : public Constraints
  18. {
  19. public:
  20. typedef Constraints SuperClass;
  21. typedef SuperClass::matrix_type matrix_type;
  22. EqualityConstraints() : SuperClass() {};
  23. /*!
  24. Constructor.
  25. \param numOfParameters
  26. \param numOfConstraints
  27. */
  28. EqualityConstraints(unsigned int numOfParameters, unsigned int numOfConstraints): SuperClass(numOfParameters,numOfConstraints){};
  29. /*
  30. Copy constructor
  31. */
  32. EqualityConstraints(const Constraints &con):SuperClass(con){};
  33. /*!
  34. Destructor.
  35. */
  36. ~EqualityConstraints(){};
  37. /*!
  38. Initialization for the cost function
  39. */
  40. virtual void init() = 0;
  41. /*!
  42. evaluate the constraints
  43. \param x =^ position
  44. \return matrix_type containing the i-th constraint result in the i-th component
  45. */
  46. virtual matrix_type evaluate(const matrix_type & x) = 0;
  47. protected:
  48. };
  49. #endif