Xpress variable functionality#
Note
Provided through opti_extensions.xpress.* namespace.
Add variables#
|
Create and add multiple variables (corresponding to an index-set) to the xpress problem. |
VarDict1D#
Custom subclass of dict to store Xpress problem variables with 1-dim scalar keys.
This class is not meant to be instantiated; VarDict1D is built through the |
Attributes#
The Xpress problem associated with the variables. |
|
The variable type corresponding to the xpress variables. |
|
Name to refer to 1-dim scalar keys. |
|
Name to refer to Dict values. |
Numerical operations#
Sum all variables in an expression. |
|
Sum squares of all variables in an expression. |
|
|
Sum the products of variables with corresponding coef from ParamDict1D, in an expression. |
The @ operator#
The matrix multiplication operator @ can be used instead of the dot
method. Both ParamDict1D @ VarDict1D and VarDict1D @ ParamDict1D
will produce the same result as VarDict1D.dot(ParamDict1D).
Mapping operations#
|
Get the variable for the specified key, or the default if not found. |
|
Get the variable for the specified key, or zero if it is not found. |
Views#
VarDict1D.items()VarDict1D.keys()VarDict1D.values()
VarDictND#
Custom subclass of dict to store Xpress problem variables with N-dim tuple keys.
This class is not meant to be instantiated; VarDictND is built through the |
Attributes#
The Xpress problem associated with the variables. |
|
The variable type corresponding to the xpress variables. |
|
Names to refer to each dimension of N-dim tuple keys. |
|
Name to refer to Dict values. |
Numerical operations#
|
Sum all variables, or a subset based on wildcard pattern, in an expression. |
|
Sum squares of all variables, or a subset based on wildcard pattern, in an expression. |
|
Sum the products of variables with corresponding coef from ParamDictND, in an expression. |
The @ operator#
The matrix multiplication operator @ can be used instead of the dot
method. Both ParamDictND @ VarDictND and VarDictND @ ParamDictND
will produce the same result as VarDictND.dot(ParamDictND).
Mapping operations#
|
Get the variable for the specified key, or the default if not found. |
|
Get the variable for the specified key, or zero if it is not found. |
Efficient subset selection#
|
Get a subset of the N-dim tuple keys of the Dict with a wildcard pattern. |
|
Get Dict values for all keys that match the wildcard pattern. |
Views#
VarDictND.items()VarDictND.keys()VarDictND.values()