Remove license and add to doc examples
[linpy.git] / doc / polyhedra.rst
1 Polyhedra Module
2 ================
3
4 Polyhedron class allows users to build and inspect polyherons. Polyhedron inherits all methods from the :class:`Domain` class.
5
6 .. py:class:: Polyhedron(Domain)
7
8 .. py:method:: __new__(cls, equalities=None, inequalities=None)
9
10 Create and return a new Polyhedron from a string or list of equalities and inequalities.
11
12 .. attribute:: equalities
13
14 Returns a list of the equalities in a polyhedron.
15
16 .. attribute:: inequalities
17
18 Returns a list of the inequalities in a polyhedron.
19
20 .. attribute:: constraints
21
22 Returns a list of the constraints of a polyhedron.
23
24 .. py:method:: make_disjoint(self)
25
26 Returns a polyhedron as a disjoint.
27
28 .. py:method:: isuniverse(self)
29
30 Return ``True`` if a polyhedron is the Universe set.
31
32 .. py:method:: aspolyhedron(self)
33
34 Return the polyhedral hull of a polyhedron.
35
36 .. py:method:: __contains__(self, point)
37
38 Report whether a polyhedron constains an integer point
39
40 .. py:method:: subs(self, symbol, expression=None)
41
42 Subsitute the given value into an expression and return the resulting
43 expression.
44
45 .. py:method:: fromstring(cls, string)
46
47 Create and return a Polyhedron from a string.
48
49
50 To create a polyhedron, the user can use the following functions to define equalities and inequalities as the constraints.
51
52 .. py:function:: Eq(left, right)
53
54 Returns a Polyhedron instance with a single constraint as *left* equal to *right*.
55
56 .. py:function:: Ne(left, right)
57
58 Returns a Polyhedron instance with a single constraint as *left* not equal to *right*.
59
60 .. py:function:: Lt(left, right)
61
62 Returns a Polyhedron instance with a single constraint as *left* less than *right*.
63
64 .. py:function:: Le(left, right)
65
66 Returns a Polyhedron instance with a single constraint as *left* less than or equal to *right*.
67
68 .. py:function:: Gt(left, right)
69
70 Returns a Polyhedron instance with a single constraint as *left* greater than *right*.
71
72 .. py:function:: Ge(left, right)
73
74 Returns a Polyhedron instance with a single constraint as *left* greater than or equal to *right*.