X-Git-Url: https://scm.cri.ensmp.fr/git/linpy.git/blobdiff_plain/d2ec7dd24a7eeab018d12e3ae27d2d1c7226a7f3..e21e06be0a63f74174e03a53037e91e051c84b79:/pypol/polyhedra.py diff --git a/pypol/polyhedra.py b/pypol/polyhedra.py index f93f31e..63ecb64 100644 --- a/pypol/polyhedra.py +++ b/pypol/polyhedra.py @@ -37,7 +37,7 @@ class Polyhedron(Domain): elif isinstance(equalities, Domain): if inequalities is not None: raise TypeError('too many arguments') - return equalities.polyhedral_hull() + return equalities.aspolyhedron() if equalities is None: equalities = [] else: @@ -82,9 +82,16 @@ class Polyhedron(Domain): libisl.isl_basic_set_free(islbset) return universe - def polyhedral_hull(self): + def aspolyhedron(self): return self + def subs(self, symbol, expression=None): + equalities = [equality.subs(symbol, expression) + for equality in self.equalities] + inequalities = [inequality.subs(symbol, expression) + for inequality in self.inequalities] + return Polyhedron(equalities, inequalities) + @classmethod def _fromislbasicset(cls, islbset, symbols): islconstraints = islhelper.isl_basic_set_constraints(islbset)