14.2.4 Class BoundInterfaceVariable¶
- mosek::fusion::BoundInterfaceVariable¶
Interface to either the upper bound or the lower bound of a ranged variable.
This class is never explicitly instantiated; is is created by a
RangedVariable
to allow accessing a bound value and the dual variable value corresponding to the relevant bound as a separate object. The variable\[b_l \leq x \leq b_u\]has two bounds and two dual variables; these are not immediately available through the
RangedVariable
object, but can be accessed through aBoundInterfaceVariable
.- Implements:
- Members:
BaseVariable.asExpr – Create an expression corresponding to the variable object.
BaseVariable.eval – Evaluate the expression and push the result onto the work stack.
BaseVariable.fromTril – Convert from a trilinear representation into a square variable.
BaseVariable.getDim – Return the d’th dimension in the expression.
BaseVariable.getModel – Get the associated model.
BaseVariable.getND – Get the number of dimensions in the variable shape.
BaseVariable.getShape – Get the variable shape.
BaseVariable.getSize – Get the total number of elements in the variable.
BaseVariable.index – Return a variable slice of size 1 corresponding to a single element in the variable object..
BaseVariable.level – Get the primal solution value of the variable.
BaseVariable.makeContinuous – Drop integrality constraints on the variable, if any.
BaseVariable.makeInteger – Apply integrality constraints on the variable. Has no effect on elements of semidefinite matrix variables.
BaseVariable.remove – Remove the variable from the model.
BaseVariable.reshape – Reshape the variable. The new shape must have the same total size as the current.
BaseVariable.setLevel – Input solution values for this variable
BaseVariable.toString – Create a string representation of the variable.
BaseVariable.tril – Convert from a square variable to a trilinear representation.
BoundInterfaceVariable.antidiag – Return the antidiagonal of a square variable matrix.
BoundInterfaceVariable.diag – Return the diagonal of a square variable matrix.
BoundInterfaceVariable.dual – Get the dual solution value of the variable.
BoundInterfaceVariable.pick – Create a one-dimensional variable by picking a list of indexes from this variable.
BoundInterfaceVariable.slice – Create a slice variable by picking a range of indexes for each variable dimension.
BoundInterfaceVariable.transpose – Transpose the variable.
- BoundInterfaceVariable.antidiag¶
Variable::t antidiag() Variable::t antidiag(int index)
Return the antidiagonal of a square variable matrix.
- Parameters:
index
(int
) – Index of the anti-diagonal- Return:
(
Variable
)
- BoundInterfaceVariable.diag¶
Variable::t diag() Variable::t diag(int index)
Return the diagonal of a square variable matrix.
- Parameters:
index
(int
) – Index of the anti-diagonal- Return:
(
Variable
)
- BoundInterfaceVariable.dual¶
shared_ptr<ndarray<double,1>> dual()
Get the dual solution value of the variable as an array. When the selected slice is multi-dimensional, this corresponds to the flattened slice of solution values.
- Return:
(
double
[])
- BoundInterfaceVariable.pick¶
Variable::t pick(shared_ptr<ndarray<int,1>> idxs) Variable::t pick(shared_ptr<ndarray<int,2>> midxs) Variable::t pick(shared_ptr<ndarray<int,1>> i0, shared_ptr<ndarray<int,1>> i1) Variable::t pick(shared_ptr<ndarray<int,1>> i0, shared_ptr<ndarray<int,1>> i1, shared_ptr<ndarray<int,1>> i2)
Create a one-dimensional variable by picking a list of indexes from this variable.
- Parameters:
idxs
(int
[]) – Indexes of the elements requested.midxs
(int
[][]) – A sequence of multi-dimensional indexes of the elements requested.i0
(int
[]) – Index along the first dimension.i1
(int
[]) – Index along the second dimension.i2
(int
[]) – Index along the third dimension.
- Return:
(
Variable
)
- BoundInterfaceVariable.slice¶
Variable::t slice(int first, int last) Variable::t slice(shared_ptr<ndarray<int,1>> firsta, shared_ptr<ndarray<int,1>> lasta)
Create a slice variable by picking a range of indexes for each variable dimension.
- Parameters:
first
(int
) – The index from which the slice begins.last
(int
) – The index after the last element of the slice.firsta
(int
[])lasta
(int
[])
- Return:
(
Variable
)