From: Vivien Maisonneuve Date: Fri, 4 Jul 2014 19:28:55 +0000 (+0200) Subject: Rename Domain.polyhedral_hull() into Domain.aspolyhedron() X-Git-Tag: 1.0~143 X-Git-Url: https://scm.cri.mines-paristech.fr/git/linpy.git/commitdiff_plain/cd2197879049a836b02a331adf0a00c0b87fe043?ds=inline Rename Domain.polyhedral_hull() into Domain.aspolyhedron() --- diff --git a/examples/squares.py b/examples/squares.py index e622c27..4389d87 100755 --- a/examples/squares.py +++ b/examples/squares.py @@ -55,7 +55,7 @@ print() print('lexographic min of sq2:', sq2.lexmin()) #test lexmax() print('lexographic max of sq2:', sq2.lexmax()) #test lexmax() print() -print('Polyhedral hull of sq1 + sq2 is:', q.polyhedral_hull()) #test polyhedral hull +print('Polyhedral hull of sq1 + sq2 is:', q.aspolyhedron()) #test polyhedral hull print() print('is sq1 bounded?', sq1.isbounded()) #unbounded should return True print('is sq5 bounded?', sq5.isbounded()) #unbounded should return False diff --git a/pypol/domains.py b/pypol/domains.py index dd39220..632335b 100644 --- a/pypol/domains.py +++ b/pypol/domains.py @@ -144,7 +144,7 @@ class Domain: islset = libisl.isl_set_remove_redundancies(islset) return self._fromislset(islset, self.symbols) - def polyhedral_hull(self): + def aspolyhedron(self): # several types of hull are available # polyhedral seems to be the more appropriate, to be checked from .polyhedra import Polyhedron diff --git a/pypol/polyhedra.py b/pypol/polyhedra.py index f93f31e..a6adeda 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,7 +82,7 @@ class Polyhedron(Domain): libisl.isl_basic_set_free(islbset) return universe - def polyhedral_hull(self): + def aspolyhedron(self): return self @classmethod diff --git a/pypol/tests/test_domains.py b/pypol/tests/test_domains.py index a6f643c..820d556 100644 --- a/pypol/tests/test_domains.py +++ b/pypol/tests/test_domains.py @@ -88,10 +88,10 @@ class TestDomain(unittest.TestCase): self.assertEqual(~self.universe, Empty) self.assertEqual(~self.empty, self.universe) - def test_polyhedral_hull(self): - self.assertEqual(self.square1.polyhedral_hull(), self.hull) - self.assertEqual(self.universe.polyhedral_hull(), self.universe) - self.assertEqual(self.empty.polyhedral_hull(), self.empty) + def test_aspolyhedron(self): + self.assertEqual(self.square1.aspolyhedron(), self.hull) + self.assertEqual(self.universe.aspolyhedron(), self.universe) + self.assertEqual(self.empty.aspolyhedron(), self.empty) def test_project(self): self.assertEqual(self.square1.project(symbols('x')), self.dropped)