X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/blobdiff_plain/b3af8a414781471620fb930f819f0c63bfab87f6..a157f7c947533f4be375e55f78adfa3dae7eeef7:/pypol/linear.py diff --git a/pypol/linear.py b/pypol/linear.py index 4f3aeef..a562a3f 100644 --- a/pypol/linear.py +++ b/pypol/linear.py @@ -270,30 +270,30 @@ class Expression: def __hash__(self): return hash((self._coefficients, self._constant)) - def _canonify(self): + def _toint(self): lcm = functools.reduce(lambda a, b: a*b // gcd(a, b), [value.denominator for value in self.values()]) return self * lcm @_polymorphic_method def _eq(self, other): - return Polyhedron(equalities=[(self - other)._canonify()]) + return Polyhedron(equalities=[(self - other)._toint()]) @_polymorphic_method def __le__(self, other): - return Polyhedron(inequalities=[(other - self)._canonify()]) + return Polyhedron(inequalities=[(other - self)._toint()]) @_polymorphic_method def __lt__(self, other): - return Polyhedron(inequalities=[(other - self)._canonify() - 1]) + return Polyhedron(inequalities=[(other - self)._toint() - 1]) @_polymorphic_method def __ge__(self, other): - return Polyhedron(inequalities=[(self - other)._canonify()]) + return Polyhedron(inequalities=[(self - other)._toint()]) @_polymorphic_method def __gt__(self, other): - return Polyhedron(inequalities=[(self - other)._canonify() - 1]) + return Polyhedron(inequalities=[(self - other)._toint() - 1]) def constant(numerator=0, denominator=None): @@ -378,13 +378,6 @@ class Polyhedron: def inequalities(self): return self._inequalities - @property - def constant(self): - return self._constant - - def isconstant(self): - return len(self._coefficients) == 0 - def isempty(self): return bool(libisl.isl_basic_set_is_empty(self._bset))