1 Domains Module
2 ==============
4 .. py:class :: Domain
6 .. py:method:: polyhedra(self)
8 Return .
10 Domain Properties
11 -----------------
12 .. py:method:: symbols
14 Returns a tuple of the symbols that exsist in a domain.
16 .. py:method:: dimension
18 Returns the number of variables that exist in a domain.
20 .. py:method:: disjoint
22 Returns a domain as disjoint.
24 .. py:method:: num_parameters
26 Returns the total number of parameters, input, output or dimensions in a domain.
28 .. py:method:: involves_dims(self, dims)
30 Returns ``True`` if a domain depends on the given dimensions.
32 Unary Properties
33 ----------------
34 .. py:method:: isempty(self)
36 Return ``True`` is a domain is empty.
38 .. py:method:: isuniverse(self)
40 Return ``True`` if a domain is the Universe set.
42 .. py:method:: isbounded(self)
44 Return ``True`` if a domain is bounded
46 .. py:method:: disjoint(self)
48 Returns a domain as disjoint.
50 Binary Properties
51 -----------------
53 .. py:method:: isdisjoint(self, other)
55 Return ``True`` if the intersection of *self* and *other* results in an empty set.
57 .. py:method:: issubset(self, other)
59 Test whether every element in a domain is in *other*.
61 .. py:method:: __eq__(self, other)
62 self == other
64 Test whether a domain is equal to *other*.
66 .. py:method:: __lt__(self, other)
67 self < other
69 Test whether a domain is a strict subset of *other*.
71 .. py:method:: __le__(self, other)
72 self <= other
74 Test whether every element in a domain is in *other*.
76 .. py:method:: __gt__(self, other)
77 self > other
79 Test whether a domain is a strict superset of *other*.
81 .. py:method:: __ge__(self, other)
82 self >= other
84 Test whether every element in *other* is in a domain.
87 The following methods implement unary operations on a domain.
89 .. py:method:: complement(self)
90 ¬self
92 Return the complement of a domain.
94 .. py:method:: simplify(self)
96 Return a new domain without any redundant constraints.
98 .. py:method:: project(self, dims)
100 Return a new domain with the given dimensions removed.
102 .. py:method:: aspolyhedron(self)
104 Return polyhedral hull of a domain.
106 .. py:method:: sample(self)
108 Return a single sample subset of a domain.
110 The following methods implement binary operations on two domains.
112 .. py:method:: intersection(self, other)
113 self | other
115 Return a new domain with the elements that are common between *self* and *other*.
117 .. py:method:: union(self, other)
118 self & other
120 Return a new domain with all the elements from *self* and *other*.
122 .. py:method:: difference(self, other)
123 self - other
125 Return a new domain with the elements in a domain that are not in *other* .
128 self + other
130 Return the sum of two domains.
132 The following methods use lexicographical ordering to find the maximum or minimum element in a domain.
134 .. py:method:: lexmin(self)
136 Return a new set containing the lexicographic minimum of the elements in the set.
138 .. py:method:: lexmax(self)
140 Return a new set containing the lexicographic maximum of the elements in the set.
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.
145 .. py:method:: points(self)
147 Return a list of the points contained in a domain.
149 .. py:method:: vertices(self)
151 Return a list of the verticies of a domain.
153 .. py:method:: faces(self)
155 Return a list of the vertices for each face of a domain.
157 .. py:method:: plot(self, plot=None, **kwargs)
159 Return a plot of the given domain.