LinearStandardFormCompiler
(class from pyomo.repn.plugins.standard_form)
- class pyomo.repn.plugins.standard_form.LinearStandardFormCompiler[source]
Bases:
objectCompiler to convert an LP to the matrix representation of the standard form:
\[\begin{split}\min\ & c^Tx \\ s.t.\ & Ax \le b\end{split}\]and return the compiled representation as NumPy arrays and SciPy sparse matrices.
Methods
__init__()write(model[, ostream])Convert a model to standard form
Attributes
CONFIGMember Documentation
- write(model, ostream=None, **options)[source]
Convert a model to standard form
- Return type:
- Parameters:
model (ConcreteModel) – The concrete Pyomo model to write out.
ostream – This is provided for API compatibility with other writers and is ignored here.
- Keyword Arguments:
nonnegative_vars (bool, default=False) – Convert all variables to be nonnegative variables
slack_form (bool, default=False) – Add slack variables and return \(\min c^Tx; s.t. Ax = b\)
mixed_form (bool, default=False) – Return A in mixed form (the comparison operator is a mix of <=, ==, and >=)
set_sense (InEnum[ObjectiveSense], default=<ObjectiveSense.minimize: 1>) – If not None, map all objectives to the specified sense.
show_section_timing (bool, default=False) – Print timing after each stage of the compilation process
file_determinism (InEnum[FileDeterminism], default=<FileDeterminism.ORDERED: 10>) –
How much effort do we want to put into ensuring the resulting matrices are produced deterministically:
NONE(0): NoneORDERED(10): rely on underlying component ordering (default)SORT_INDICES(20) : sort keys of indexed componentsSORT_SYMBOLS(30) : sort keys AND sort names (not declaration order)
row_order (optional) – List of constraints in the order that they should appear in the resulting
Amatrix. Unspecified constraints will appear at the end.column_order (optional) – List of variables in the order that they should appear in the compiled representation. Unspecified variables will be appended to the end of this list.