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 a BoundInterfaceVariable.

Implements:

SliceVariable

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 Antidiag()
Variable Antidiag(int index)

Return the antidiagonal of a square variable matrix.

Parameters:

index (int) – Index of the anti-diagonal

Return:

(Variable)

BoundInterfaceVariable.Diag
Variable Diag()
Variable Diag(int index)

Return the diagonal of a square variable matrix.

Parameters:

index (int) – Index of the anti-diagonal

Return:

(Variable)

BoundInterfaceVariable.Dual
double[] 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 Pick(int[] idxs)
Variable Pick(int[,] midxs)
Variable Pick(int[] i0, int[] i1)
Variable Pick(int[] i0, int[] i1, int[] 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 Slice(int first, int last)
Variable Slice(int[] firsta, int[] 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)

BoundInterfaceVariable.Transpose
Variable Transpose()

Return the transpose of the current variable. The variable must have at most two dimensions.

Return:

(Variable)