14.2.38 Class SymmetricVariable


In some cases using this variable instead of a standard Variable can reduce the number of instantiated variables by approximately 50%.




Expression.eval – Evaluate the expression and push the result onto the work stack.

Expression.getDim – Return the d’th dimension in the expression.

Variable.antidiag – Return the anti-diagonal of a variable matrix.

Variable.asExpr – Create an expression corresponding to the variable object.

Variable.diag – Return the diagonal of a variable matrix.

Variable.dual – Get the dual solution value of the variable.

Variable.fromTril – Convert from a linear representation of the lower triangular part of a square variable into a square variable.

Variable.getModel – Return the model to which the variable belongs.

Variable.getND – Get the number of dimensions in the variable shape.

Variable.getShape – Return the shape of the variable.

Variable.getSize – Get the total number of elements in the variable.

Variable.index – Return a single entry in the variable.

Variable.level – Return the primal value of the variable as an array.

Variable.makeContinuous – Drop integrality constraints on the variable, if any.

Variable.makeInteger – Apply integrality constraints on the variable. Has no effect on elements of semidefinite matrix variables.

Variable.pick – Create a one-dimensional variable by picking a list of indexes from this variable.

Variable.remove – Remove the variable from the model.

Variable.reshape – Reshape the variable. The new shape must have the same total size as the current.

Variable.setLevel – Input solution values for this variable

Variable.slice – Create a slice variable by picking a range of indexes for each variable dimension.

Variable.toString – Create a string representation of the variable.

Variable.transpose – Transpose the variable.

Variable.tril – Convert a square variable into a linear representation of the lower triangular part of the variable.

Implemented by

SymLinearVariable, PSDVariable, SymRangedVariable