## ipo interior-point optimisation library |
||
---|---|---|

## Links
Home · |
## Objective and constraintsA convex-optimisation model needs an objective (to be minimised or maximised) and (usually) some constraints. These are defined in the ipo::Objective and ipo::Constraint classes. To create an objective function use something like the following Objective objective { model, function, "name" };where function is an ipo_function::Function and "name" is replaced with a description of the function. Define constraints in a similar way. Once you have defined an Objective or Constraint, use the addVariable() or addArray() methods to add variables to the objective or constraint. Use the setLowerBound() or setUpperBound() methods to set an upper or lower bound on each constraint. If you do not do this the constraint will have no effect. You can set both. This only really makes sense for ipo::LinearConstraint objects or for variables. The ipo::LinearConstraint class provides constraints that are linear combinations of their variables. It provides a setValue() method. You can use it to constrain the linear combination of variables to be exactly equal to a particular value. Last modified: Tue 02 Jul 2013 04:56 pm |