5.6. Var

class Var(TensorLike)

The decision variable to be optimized.

Properties

X

The solution of this variable.

attr

The declared attribute for variable.

start

The value for variable to warm start. Its initial value is None, which indicates that no start value specified.

Methods

__init__()

Construct a new variable.

property X: np.ndarray

The solution of this variable.

property attr: int

The declared attribute for variable.

Attributes include:

  • nonneg = 0

  • nonpos = 1

  • symmetric = 2

  • diag = 3

  • PSD = 4

  • NSD = 5

  • pos = 6

  • neg = 7

For example, if variable is declared as PSD, this value is 16(1 << 4).

property start: ArrayLike

The value for variable to warm start. Its initial value is None, which indicates that no start value specified.

__init__(name: str = None, *shape: int, **attr: bool)

Construct a new variable.

param name:

Type: str = None

The name for new variable.

param *shape:

Type: int

The variable shape.

param **attr:

Type: bool

The attribute variable has.

Attributes include:

  • nonneg

  • nonpos

  • symmetric

  • diag

  • PSD

  • NSD

  • pos

  • neg