ocra-recipes
Doxygen documentation for the ocra-recipes repository
|
Constraint class. More...
#include <Constraint.h>
Public Member Functions | |
Constraint (T *function, bool equality, const VectorXd &v=VectorXd()) | |
Constraint (T *function, const VectorXd &l=VectorXd(), const VectorXd &u=VectorXd()) | |
operator const T & () | |
virtual T & | getFunction (void) |
virtual const T & | getFunction (void) const |
Constraint class.
Given a function over and possibly over the time , we can write a constraint whose most generic expression is , with and two vectors of size having their value in and verifying . This class is a C++ translation of this mathematical writing, but distinguishes some specific cases, for the ease of use, that are enumerated by eConstraintType :
The Constraint class is templated by the type of the function on which the constraint is built. Provided the class definition of this function provides the good typedef functionType_t, the hierarchy of the Function classes is mimicked by Constraint: if B is a class deriving of A and B::functionType_t is A, then Constraint will automatically derived from Constraint. As a concrete example, if DiagonalLinearFunction derives from LinearFunction that derives from Function, then Constraint<DiagonalLinearFunction> will derive from Constraint<LinearFunction> that will itself derive from Constraint<Function>. Thus a Constraint<DiagonalLinearFunction> is also a Constraint<LinearFunction> for example.
A Constraint class inherits from FunctionInterfaceMapping of the interface of Function, an instance of Constraint can be treated as a Function, to directly call methods of function on it. Constraint<T> is however not deriving from Function.
Definition at line 100 of file Constraint.h.
|
inline |
Constraint constructor to build simple equality/inequality constraints
[in] | function | A pointer to the function on which the constraint is imposed. |
[in] | equality | True if the constraint is an equality, false if it is an inequality. |
[in] | v | An optional vector to shift the constraint |
The following cases arise:
Definition at line 576 of file Constraint.h.
|
inline |
Constraint constructor to build inequality constraints with possibly lower and upper bounds
[in] | function | A pointer to the function on which the constraint is imposed. |
[in] | l | Lower bound vector. |
[in] | u | Lower bound vector. |
The following cases arise:
Definition at line 585 of file Constraint.h.
|
inlinevirtual |
getter on the function on which the constraint is built
Definition at line 156 of file Constraint.h.
|
inlinevirtual |
Definition at line 157 of file Constraint.h.
|
inline |
Conversion operator
Definition at line 152 of file Constraint.h.