X-Git-Url: https://scm.cri.mines-paristech.fr/git/linpy.git/blobdiff_plain/25ce908cffca380f930182a77c1e5a4491042a1c..2de96003a48ae1ed91c853f38c72374a832824de:/doc/examples.rst?ds=inline diff --git a/doc/examples.rst b/doc/examples.rst index e69de29..793ecbe 100644 --- a/doc/examples.rst +++ b/doc/examples.rst @@ -0,0 +1,22 @@ +Pypol Examples +============== + +Creating a Square +----------------- + To create any polyhedron, first define the symbols used. Then use the polyhedron functions to define the constraints for the polyhedron. This example creates a square:: + + >>> x, y = symbols('x y') + >>> # define the constraints of the polyhedron + >>> square = Le(0, x) & Le(x, 2) & Le(0, y) & Le(y, 2) + >>> print(square) + >>> And(Ge(x, 0), Ge(-x + 2, 0), Ge(y, 0), Ge(-y + 2, 0)) + + Several unary operations can be performed on a polyhedron. For example: :: + + >>> ¬square + + +Plot Examples +------------- + +