Context Managers
- class pyomo.core.expr.nonlinear_expression[source]
Context manager for mutable nonlinear sums.
This context manager is used to compute a general nonlinear sum while treating the summation as a mutable object.
Note
The preferred context manager is
mutable_expression, as the return type will be the most specific ofSumExpression,LinearExpression, orNPV_SumExpression. This context manager will always return aSumExpression.
- class pyomo.core.expr.linear_expression[source]
Context manager for mutable linear sums.
This context manager is used to compute a linear sum while treating the summation as a mutable object.
Note
The preferred context manager is
mutable_expression.linear_expressionis an alias tomutable_expressionprovided for backwards compatibility.