You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: doc/OnlineDocs/developer_reference/expressions/design.rst
+28-28
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Design Details
13
13
14
14
Most Pyomo expression trees have the following form
15
15
16
-
1. Interior nodes are objects that inherit from the :class:`ExpressionBase <pyomo.core.expr.current.ExpressionBase>` class. These objects typically have one or more child nodes. Linear expression nodes do not have child nodes, but they are treated as interior nodes in the expression tree because they references other leaf nodes.
16
+
1. Interior nodes are objects that inherit from the :class:`ExpressionBase <pyomo.core.expr.ExpressionBase>` class. These objects typically have one or more child nodes. Linear expression nodes do not have child nodes, but they are treated as interior nodes in the expression tree because they references other leaf nodes.
17
17
18
18
2. Leaf nodes are numeric values, parameter components and variable components, which represent the *inputs* to the expression.
19
19
@@ -26,13 +26,13 @@ describes the standard operators in Python and their associated Pyomo expression
is used in the :data:`linear_expression <pyomo.core.expr.current.linear_expression>` context manager to
182
+
is used in the :data:`linear_expression <pyomo.core.expr.linear_expression>` context manager to
183
183
efficiently combine sums of linear terms.
184
184
185
185
@@ -192,22 +192,22 @@ interior node.
192
192
193
193
The following classes are valid interior nodes:
194
194
195
-
* Subclasses of :class:`ExpressionBase <pyomo.core.expr.current.ExpressionBase>`
195
+
* Subclasses of :class:`ExpressionBase <pyomo.core.expr.ExpressionBase>`
196
196
197
-
* Classes that that are *duck typed* to match the API of the :class:`ExpressionBase <pyomo.core.expr.current.ExpressionBase>` class. For example, the named expression class :class:`Expression <pyomo.core.expr.current.Expression>`.
197
+
* Classes that that are *duck typed* to match the API of the :class:`ExpressionBase <pyomo.core.expr.ExpressionBase>` class. For example, the named expression class :class:`Expression <pyomo.core.expr.Expression>`.
198
198
199
199
The following classes are valid leaf nodes:
200
200
201
-
* Members of :data:`nonpyomo_leaf_types <pyomo.core.expr.numvalue.nonpyomo_leaf_types>`, which includes standard numeric data types like :const:`int`, :const:`float` and :const:`long`, as well as numeric data types defined by `numpy` and other commonly used packages. This set also includes :class:`NonNumericValue <pyomo.core.expr.numvalue.NonNumericValue>`, which is used to wrap non-numeric arguments to the :class:`ExternalFunctionExpression <pyomo.core.expr.current.current.ExternalFunctionExpression>` class.
201
+
* Members of :data:`nonpyomo_leaf_types <pyomo.core.expr.numvalue.nonpyomo_leaf_types>`, which includes standard numeric data types like :const:`int`, :const:`float` and :const:`long`, as well as numeric data types defined by `numpy` and other commonly used packages. This set also includes :class:`NonNumericValue <pyomo.core.expr.numvalue.NonNumericValue>`, which is used to wrap non-numeric arguments to the :class:`ExternalFunctionExpression <pyomo.core.expr.ExternalFunctionExpression>` class.
202
202
203
203
* Parameter component classes like :class:`ScalarParam <pyomo.core.base.param.ScalarParam>` and :class:`_ParamData <pyomo.core.base.param._ParamData>`, which arise in expression trees when the parameters are declared as mutable. (Immutable parameters are identified when generating expressions, and they are replaced with their associated numeric value.)
204
204
205
-
* Variable component classes like :class:`ScalarVar <pyomo.core.base.var.ScalarVar>` and :class:`_GeneralVarData <pyomo.core.base.var._GeneralVarData>`, which often arise in expression trees. <pyomo.core.expr.current.pyomo5_variable_types>`.
205
+
* Variable component classes like :class:`ScalarVar <pyomo.core.base.var.ScalarVar>` and :class:`_GeneralVarData <pyomo.core.base.var._GeneralVarData>`, which often arise in expression trees. <pyomo.core.expr.pyomo5_variable_types>`.
206
206
207
207
.. note::
208
208
209
209
In some contexts the :class:`LinearExpression
210
-
<pyomo.core.expr.current.LinearExpression>` class can be treated
210
+
<pyomo.core.expr.LinearExpression>` class can be treated
211
211
as an interior node, and sometimes it can be treated as a leaf.
212
212
This expression object does not have any child arguments, so
213
213
``nargs()`` is zero. But this expression references variables
@@ -223,7 +223,7 @@ Pyomo defines several context managers that can be used to declare
223
223
the form of expressions, and to define a mutable expression object that
224
224
efficiently manages sums.
225
225
226
-
The :data:`linear_expression <pyomo.core.expr.current.linear_expression>`
226
+
The :data:`linear_expression <pyomo.core.expr.linear_expression>`
227
227
object is a context manager that can be used to declare a linear sum. For
228
228
example, consider the following two loops:
229
229
@@ -240,8 +240,8 @@ more efficient processing of each sum, and (b) a more compact
0 commit comments