Core Classes

The following are the two core classes documented here:

The remaining classes are the public classes for expressions, which developers may need to know about. The methods for these classes are not documented because they are described in the NumericExpression class.

Sets with Expression Types

The following sets can be used to develop visitor patterns for Pyomo expressions.

native_numeric_types

Python set used to identify numeric constants.

native_types

Python set used to identify numeric constants and related native types.

nonpyomo_leaf_types

Python set used to identify numeric constants, boolean values, strings and instances of NonNumericValue, which is commonly used in code that walks Pyomo expression trees.

NumericValue and NumericExpression

NumericValue()

This is the base class for numeric values used in Pyomo.

NumericExpression(args)

The base class for Pyomo expressions.

Other Public Classes

NegationExpression(args)

Negation expressions.

AbsExpression(arg)

An expression object for the abs() function.

UnaryFunctionExpression(args[, name, fcn])

An expression object for intrinsic (math) functions (e.g. sin, cos, tan).

ProductExpression(args)

Product expressions.

DivisionExpression(args)

Division expressions.

SumExpression(args)

Sum expression.

Expr_ifExpression(args)

A numeric ternary (if-then-else) expression.

ExternalFunctionExpression(args[, fcn])

External function expressions

pyomo.core.expr.relational_expr.EqualityExpression(args)

Equality expression.

pyomo.core.expr.relational_expr.InequalityExpression(...)

Inequality expressions, which define less-than or less-than-or-equal relations.

pyomo.core.expr.relational_expr.RangedExpression(...)

Ranged expressions, which define relations with a lower and upper bound.

pyomo.core.expr.template_expr.GetItemExpression([args])

Expression to call __getitem__() on the base object.