14.2.3 Class BoundInterfaceConstraint¶
- mosek::fusion::BoundInterfaceConstraint¶
Interface to either the upper bound or the lower bound of a ranged constraint.
This class is never explicitly instantiated; is is created by a
RangedConstraint
to allow accessing a bound value and the dual variable value corresponding to the relevant bound as a separate object. The constraint\[b_l \leq a^T x \leq b_u\]has two bounds and two dual variables; these are not immediately available through the
RangedConstraint
object, but can be accessed through aBoundInterfaceConstraint
.- Implements:
- Members:
BoundInterfaceConstraint.dual – Get the dual solution values of the constraint.
BoundInterfaceConstraint.index – Get a single element from a one-dimensional constraint.
BoundInterfaceConstraint.slice – Create a slice constraint.
Constraint.getModel – Return the model that the constraint belongs to.
Constraint.getND – Return the number of dimensions in the constraint shape.
Constraint.getShape – Return the constraint’s shape.
Constraint.getSize – Return the total number of elements in the constraint.
Constraint.level – Get the primal solution values of the constraint.
Constraint.remove – Remove the constraint from the model.
Constraint.update – Update part of a constraint.
SliceConstraint.toString – Create a human readable string representation of the constraint.
- BoundInterfaceConstraint.dual¶
shared_ptr<ndarray<double,1>> dual()
Get the dual solution value of the constraint as an array.
- Return:
(
double
[])
- BoundInterfaceConstraint.index¶
Constraint::t index(int idx) Constraint::t index(shared_ptr<ndarray<int,1>> idxa)
Get a single element from a one-dimensional constraint.
- Parameters:
idx
(int
) – The element index.idxa
(int
[]) – Array of integer coordinates in each dimension.
- Return:
- BoundInterfaceConstraint.slice¶
Constraint::t slice(int first, int last) Constraint::t slice(shared_ptr<ndarray<int,1>> firsta, shared_ptr<ndarray<int,1>> lasta)
Create a slice constraint.
- Parameters:
first
(int
) – Index of the first element in the slice.last
(int
) – Index of the first element after the end of the slice.firsta
(int
[]) – The indexes of first elements in the slice along each dimension.lasta
(int
[]) – The indexes of first elements after the end of the slice along each dimension.
- Return: