Expression#
- class gamspy._algebra.expression.Expression(left: OperandType, data: str | MathOp | ExtrinsicFunction, right: OperandType)[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
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)'