X-Git-Url: https://scm.cri.ensmp.fr/git/linpy.git/blobdiff_plain/4a5b05e6a8198c51980c14101b06a3e9e0159f4c..49ee540c88ee9e40095635cf574e2966712d5101:/pypol/linear.py diff --git a/pypol/linear.py b/pypol/linear.py index 0712e1e..5b2dc80 100644 --- a/pypol/linear.py +++ b/pypol/linear.py @@ -50,6 +50,13 @@ class Expression: This class implements linear expressions. """ + __slots__ = ( + '_coefficients', + '_constant', + '_symbols', + '_dimension', + ) + def __new__(cls, coefficients=None, constant=0): if isinstance(coefficients, str): if constant: @@ -355,6 +362,10 @@ class Constant(Expression): class Symbol(Expression): + __slots__ = Expression.__slots__ + ( + '_name', + ) + def __new__(cls, name): if isinstance(name, Symbol): name = name.name @@ -410,6 +421,13 @@ class Polyhedron: 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: