Expression#
- class gamspy._algebra.expression.Expression(left: OperableType | ImplicitEquation | None, data: str | MathOp | ExtrinsicFunction, right: OperableType | str | None)[source]#
Bases:
OperableExpression of two operands and an operation.
- Parameters:
- left: str | int | float | Parameter | Variable | None
Left operand
- data: str
Operation
- right: str | int | float | Parameter | Variable | None
Right operand
- Attributes:
- representation
Methods
gamsRepr()Representation of this Expression in GAMS language.
Declaration of the Expression in GAMS
Representation of this Expression in Latex.
Examples
>>> import gamspy as gp >>> m = gp.Container() >>> a = gp.Parameter(m, name="a") >>> b = gp.Parameter(m, name="b") >>> expression = a * b >>> expression.gamsRepr() '(a * b)'
- gamsRepr() str[source]#
Representation of this Expression in GAMS language.
- Returns:
- str
Examples
>>> import gamspy as gp >>> m = gp.Container() >>> a = gp.Parameter(m, name="a") >>> b = gp.Parameter(m, name="b") >>> expression = a * b >>> expression.gamsRepr() '(a * b)'
- getDeclaration() str[source]#
Declaration of the Expression in GAMS
- Returns:
- str
Examples
>>> import gamspy as gp >>> m = gp.Container() >>> a = gp.Parameter(m, name="a") >>> b = gp.Parameter(m, name="b") >>> expression = a * b >>> expression.getDeclaration() '(a * b)'
- property representation: str#
!! processed by numpydoc !!