Expression
class¶
Bases: Element
Represents a mathematical expression used to encapsulate expressions in an optimization model.
The Expression
class is a subclass of the Element
class and serves as a representation of a mathematical
expression within an optimization model. It is specifically designed to encapsulate expressions and offers
methods for performing various mathematical operations on those expressions.
Note: The supported mathematical operations on an Expression
instance depend on the operations supported
in the encapsulated expression. These operations can include arithmetic operations, functions, and
any other operations defined by the underlying mathematical expression.
Source code in pyorlib/algebra/expressions/expression.py
Attributes¶
Functions¶
__add__
¶
__add__(other: Any) -> Element
Addition operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__radd__
¶
__radd__(other: Any) -> Element
Right addition operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__sub__
¶
__sub__(other: Any) -> Element
Subtraction operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rsub__
¶
__rsub__(other: Any) -> Element
Right subtraction operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__mul__
¶
__mul__(other: Any) -> Element
Multiplication operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rmul__
¶
__rmul__(other: Any) -> Element
Right multiplication operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__truediv__
¶
__truediv__(other: Any) -> Element
Division operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rtruediv__
¶
__rtruediv__(other: Any) -> Element
Right division operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__floordiv__
¶
__floordiv__(other: Any) -> Element
Floor division operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rfloordiv__
¶
__rfloordiv__(other: Any) -> Element
Right floor division operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__mod__
¶
__mod__(other: Any) -> Element
Modulo operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rmod__
¶
__rmod__(other: Any) -> Element
Right modulo operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__pow__
¶
__pow__(other: Any) -> Element
Exponentiation operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rpow__
¶
__rpow__(other: Any) -> Element
Right exponentiation operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__neg__
¶
__neg__() -> Element
Negation operation.
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
__pos__
¶
__pos__() -> Element
Positive operation.
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
__abs__
¶
__abs__() -> Element
Absolute value operation.
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
__eq__
¶
__eq__(other: Any) -> Element
Equal to comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__ne__
¶
__ne__(other: Any) -> Element
Not equal to comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__lt__
¶
__lt__(other: Any) -> Element
Less than comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__le__
¶
__le__(other: Any) -> Element
Less than or equal to comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__gt__
¶
__gt__(other: Any) -> Element
Greater than comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__ge__
¶
__ge__(other: Any) -> Element
Greater than or equal to comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__init__
¶
Initialize an Expression instance.
PARAMETER | DESCRIPTION |
---|---|
expression |
The expression value to be encapsulated.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If the expression is None. |