Changes that need to be merged
[linpy.git] / doc / domain.rst
1 Domains Module
2 ==============
3
4 .. py:class :: Domain
5
6 .. py:method:: polyhedra(self)
7
8 Return .
9
10 Domain Properties
11 -----------------
12 .. py:method:: symbols
13
14 Returns a tuple of the symbols that exsist in a domain.
15
16 .. py:method:: dimension
17
18 Returns the number of variables that exist in a domain.
19
20 .. py:method:: disjoint
21
22 Returns a domain as disjoint.
23
24 .. py:method:: num_parameters
25
26 Returns the total number of parameters, input, output or dimensions in a domain.
27
28 .. py:method:: involves_dims(self, dims)
29
30 Returns ``True`` if a domain depends on the given dimensions.
31
32 Unary Properties
33 ----------------
34 .. py:method:: isempty(self)
35
36 Return ``True`` is a domain is empty.
37
38 .. py:method:: isuniverse(self)
39
40 Return ``True`` if a domain is the Universe set.
41
42 .. py:method:: isbounded(self)
43
44 Return ``True`` if a domain is bounded
45
46 .. py:method:: disjoint(self)
47
48 Returns a domain as disjoint.
49
50 Binary Properties
51 -----------------
52
53 .. py:method:: isdisjoint(self, other)
54
55 Return ``True`` if the intersection of *self* and *other* results in an empty set.
56
57 .. py:method:: issubset(self, other)
58
59 Test whether every element in a domain is in *other*.
60
61 .. py:method:: __eq__(self, other)
62 self == other
63
64 Test whether a domain is equal to *other*.
65
66 .. py:method:: __lt__(self, other)
67 self < other
68
69 Test whether a domain is a strict subset of *other*.
70
71 .. py:method:: __le__(self, other)
72 self <= other
73
74 Test whether every element in a domain is in *other*.
75
76 .. py:method:: __gt__(self, other)
77 self > other
78
79 Test whether a domain is a strict superset of *other*.
80
81 .. py:method:: __ge__(self, other)
82 self >= other
83
84 Test whether every element in *other* is in a domain.
85
86
87 The following methods implement unary operations on a domain.
88
89 .. py:method:: complement(self)
90 ¬self
91
92 Return the complement of a domain.
93
94 .. py:method:: simplify(self)
95
96 Return a new domain without any redundant constraints.
97
98 .. py:method:: project(self, dims)
99
100 Return a new domain with the given dimensions removed.
101
102 .. py:method:: aspolyhedron(self)
103
104 Return polyhedral hull of a domain.
105
106 .. py:method:: sample(self)
107
108 Return a single sample subset of a domain.
109
110 The following methods implement binary operations on two domains.
111
112 .. py:method:: intersection(self, other)
113 self | other
114
115 Return a new domain with the elements that are common between *self* and *other*.
116
117 .. py:method:: union(self, other)
118 self & other
119
120 Return a new domain with all the elements from *self* and *other*.
121
122 .. py:method:: difference(self, other)
123 self - other
124
125 Return a new domain with the elements in a domain that are not in *other* .
126
127 .. py:method:: __add__(self, other)
128 self + other
129
130 Return the sum of two domains.
131
132 The following methods use lexicographical ordering to find the maximum or minimum element in a domain.
133
134 .. py:method:: lexmin(self)
135
136 Return a new set containing the lexicographic minimum of the elements in the set.
137
138 .. py:method:: lexmax(self)
139
140 Return a new set containing the lexicographic maximum of the elements in the set.
141
142
143 A 2D or 3D domain can be plotted using the :meth:`plot` function. The points, verticies, and faces of a domain can be inspected using the following functions.
144
145 .. py:method:: points(self)
146
147 Return a list of the points contained in a domain.
148
149 .. py:method:: vertices(self)
150
151 Return a list of the verticies of a domain.
152
153 .. py:method:: faces(self)
154
155 Return a list of the vertices for each face of a domain.
156
157 .. py:method:: plot(self, plot=None, **kwargs)
158
159 Return a plot of the given domain.
160
161
162