4cd79d90ca32352b47eb146309d3be4c137caa96
1 Domains Module
2 ==============
4 .. py:class :: Domain
6 The properties of a domain can be are found using the following
8 .. py:method:: symbols
10 Returns a tuple of the symbols that exsist in a domain.
12 .. py:method:: dimension
14 Returns the number of variables that exist in a domain.
16 .. py:method:: disjoint
18 Returns a domain as disjoint.
20 .. py:method:: involves_vars(self, dims)
22 Returns ``True`` if a domain depends on the given dimensions.
24 The unary properties of a domain can be inspected using the following methods.
26 .. py:method:: isempty(self)
28 Return ``True`` is a domain is empty.
30 .. py:method:: isuniverse(self)
32 Return ``True`` if a domain is the Universe set.
34 .. py:method:: isbounded(self)
36 Return ``True`` if a domain is bounded.
38 .. py:method:: disjoint(self)
40 It is not guarenteed that a domain is disjoint. If it is necessary, this method will return a domain as disjoint.
42 The following methods compare two domains to find the binary properties.
44 .. py:method:: isdisjoint(self, other)
46 Return ``True`` if the intersection of *self* and *other* results in an empty set.
48 .. py:method:: issubset(self, other)
50 Test whether every element in a domain is in *other*.
52 .. py:method:: __eq__(self, other)
53 self == other
55 Test whether a domain is equal to *other*.
57 .. py:method:: __lt__(self, other)
58 self < other
60 Test whether a domain is a strict subset of *other*.
62 .. py:method:: __le__(self, other)
63 self <= other
65 Test whether every element in a domain is in *other*.
67 .. py:method:: __gt__(self, other)
68 self > other
70 Test whether a domain is a strict superset of *other*.
72 .. py:method:: __ge__(self, other)
73 self >= other
75 Test whether every element in *other* is in a domain.
78 The following methods implement unary operations on a domain.
80 .. py:method:: complement(self)
81 ¬self
83 Return the complement of a domain.
85 .. py:method:: simplify(self)
87 Return a new domain without any redundant constraints.
89 .. py:method:: project(self, dims)
91 Return a new domain with the given dimensions removed.
93 .. py:method:: aspolyhedron(self)
95 Return polyhedral hull of a domain.
97 .. py:method:: sample(self)
99 Return a single sample subset of a domain.
101 The following methods implement binary operations on two domains.
103 .. py:method:: intersection(self, other)
104 self | other
106 Return a new domain with the elements that are common between *self* and *other*.
108 .. py:method:: union(self, other)
109 self & other
111 Return a new domain with all the elements from *self* and *other*.
113 .. py:method:: difference(self, other)
114 self - other
116 Return a new domain with the elements in a domain that are not in *other* .
119 self + other
121 Return the sum of two domains.
123 The following methods use lexicographical ordering to find the maximum or minimum element in a domain.
125 .. py:method:: lexmin(self)
127 Return a new set containing the lexicographic minimum of the elements in the set.
129 .. py:method:: lexmax(self)
131 Return a new set containing the lexicographic maximum of the elements in the set.
134 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.
136 .. py:method:: points(self)
138 Return a list of the points contained in a domain as :class:`Points` objects.
140 .. py:method:: vertices(self)
142 Return a list of the verticies of a domain.
144 .. py:method:: faces(self)
146 Return a list of the vertices for each face of a domain.
148 .. py:method:: plot(self, plot=None, **kwargs)
150 Return a plot of the given domain.