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 Model object that the variable belongs to.
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¶
antidiag() -> Variable antidiag(int index) -> Variable
Return the antidiagonal of a square variable matrix.
- Parameters
index
(int
) – Index of the anti-diagonal- Return
(
Variable
)
- BoundInterfaceVariable.diag¶
diag() -> Variable diag(int index) -> Variable
Return the diagonal of a square variable matrix.
- Parameters
index
(int
) – Index of the anti-diagonal- Return
(
Variable
)
- BoundInterfaceVariable.dual¶
dual() -> float[]
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
(
float
[])
- BoundInterfaceVariable.pick¶
pick(int[] idxs) -> Variable pick(int[][] midxs) -> Variable pick(int[] i0, int[] i1) -> Variable pick(int[] i0, int[] i1, int[] i2) -> Variable
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¶
slice(int first, int last) -> Variable slice(int[] firsta, int[] lasta) -> Variable
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
)