X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/blobdiff_plain/cd2197879049a836b02a331adf0a00c0b87fe043..8f61fe65a53ff47b23c8527c47e2bed32c1d2e6f:/examples/squares.py diff --git a/examples/squares.py b/examples/squares.py index 4389d87..ea48fe4 100755 --- a/examples/squares.py +++ b/examples/squares.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from pypol import * +from linpy import * a, x, y, z = symbols('a x y z') @@ -9,8 +9,11 @@ sq2 = Le(2, x) & Le(x, 4) & Le(2, y) & Le(y, 4) sq3 = Le(0, x) & Le(x, 3) & Le(0, y) & Le(y, 3) sq4 = Le(1, x) & Le(x, 2) & Le(1, y) & Le(y, 2) sq5 = Le(1, x) & Le(x, 2) & Le(1, y) -sq6 = Le(1, x) & Le(x, 2) & Le(1, y) & Eq(y, 3) +sq6 = Le(1, x) & Le(x, 2) & Le(1, y) & Le(y, 3) sq7 = Le(0, x) & Le(x, 2) & Le(0, y) & Eq(z, 2) & Le(a, 3) +p = Le(2*x+1, y) & Le(-2*x-1, y) & Le(y, 1) + + universe = Polyhedron([]) q = sq1 - sq2 e = Empty @@ -69,3 +72,7 @@ print() print('sq1 has {} parameters'.format(sq1.num_parameters())) print() print('does sq1 constraints involve x?', sq1.involves_dims([x])) +print() +print('the verticies for s are:', p.vertices()) +print() +print(p.plot())