X-Git-Url: https://scm.cri.mines-paristech.fr/git/linpy.git/blobdiff_plain/6ec23dc57252ffe01aa60595fc499f580381e4a9..5b661514c1bbabd8205fdbd22a0ba0f6b1ac6305:/pypol/domains.py?ds=sidebyside diff --git a/pypol/domains.py b/pypol/domains.py index cd118e8..10d12c5 100644 --- a/pypol/domains.py +++ b/pypol/domains.py @@ -5,9 +5,8 @@ import re from fractions import Fraction from . import islhelper -from .islhelper import mainctx, libisl, isl_set_basic_sets -from .geometry import GeometricObject -from .coordinates import Point +from .islhelper import mainctx, libisl +from .geometry import GeometricObject, Point from .linexprs import Expression, Symbol @@ -331,7 +330,7 @@ class Domain(GeometricObject): def _fromislset(cls, islset, symbols): from .polyhedra import Polyhedron islset = libisl.isl_set_remove_divs(islset) - islbsets = isl_set_basic_sets(islset) + islbsets = islhelper.isl_set_basic_sets(islset) libisl.isl_set_free(islset) polyhedra = [] for islbset in islbsets: @@ -439,6 +438,12 @@ class Domain(GeometricObject): strings = [repr(polyhedron) for polyhedron in self.polyhedra] return 'Or({})'.format(', '.join(strings)) + def _repr_latex_(self): + strings = [] + for polyhedron in self.polyhedra: + strings.append('({})'.format(polyhedron._repr_latex_().strip('$'))) + return '${}$'.format(' \\vee '.join(strings)) + @classmethod def fromsympy(cls, expr): import sympy