This class implements linear expressions.
"""
+ __slots__ = (
+ '_coefficients',
+ '_constant',
+ '_symbols',
+ '_dimension',
+ )
+
def __new__(cls, coefficients=None, constant=0):
if isinstance(coefficients, str):
if constant:
class Symbol(Expression):
+ __slots__ = Expression.__slots__ + (
+ '_name',
+ )
+
def __new__(cls, name):
if isinstance(name, Symbol):
name = name.name
This class implements polyhedrons.
"""
+ __slots__ = (
+ '_equalities',
+ '_inequalities',
+ '_constraints',
+ '_symbols',
+ )
+
def __new__(cls, equalities=None, inequalities=None):
if isinstance(equalities, str):
if inequalities is not None: