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:: num_parameters
22 Returns the total number of parameters, input, output or dimensions in a domain.
24 .. py:method:: involves_dims(self, dims)
26 Returns ``True`` if a domain depends on the given dimensions.
28 The unary properties of a domain can be inspected using the following methods.
30 .. py:method:: isempty(self)
32 Return ``True`` is a domain is empty.
34 .. py:method:: isuniverse(self)
36 Return ``True`` if a domain is the Universe set.
38 .. py:method:: isbounded(self)
40 Return ``True`` if a domain is bounded.
42 .. py:method:: disjoint(self)
44 It is not guarenteed that a domain is disjoint. If it is necessary, this method will return a domain as disjoint.
46 The following methods compare two domains to find the binary properties.
48 .. py:method:: isdisjoint(self, other)
50 Return ``True`` if the intersection of *self* and *other* results in an empty set.
52 .. py:method:: issubset(self, other)
54 Test whether every element in a domain is in *other*.
56 .. py:method:: __eq__(self, other)
57 self == other
59 Test whether a domain is equal to *other*.
61 .. py:method:: __lt__(self, other)
62 self < other
64 Test whether a domain is a strict subset of *other*.
66 .. py:method:: __le__(self, other)
67 self <= other
69 Test whether every element in a domain is in *other*.
71 .. py:method:: __gt__(self, other)
72 self > other
74 Test whether a domain is a strict superset of *other*.
76 .. py:method:: __ge__(self, other)
77 self >= other
79 Test whether every element in *other* is in a domain.
82 The following methods implement unary operations on a domain.
84 .. py:method:: complement(self)
85 ¬self
87 Return the complement of a domain.
89 .. py:method:: simplify(self)
91 Return a new domain without any redundant constraints.
93 .. py:method:: project(self, dims)
95 Return a new domain with the given dimensions removed.
97 .. py:method:: aspolyhedron(self)
99 Return polyhedral hull of a domain.
101 .. py:method:: sample(self)
103 Return a single sample subset of a domain.
105 The following methods implement binary operations on two domains.
107 .. py:method:: intersection(self, other)
108 self | other
110 Return a new domain with the elements that are common between *self* and *other*.
112 .. py:method:: union(self, other)
113 self & other
115 Return a new domain with all the elements from *self* and *other*.
117 .. py:method:: difference(self, other)
118 self - other
120 Return a new domain with the elements in a domain that are not in *other* .
123 self + other
125 Return the sum of two domains.
127 The following methods use lexicographical ordering to find the maximum or minimum element in a domain.
129 .. py:method:: lexmin(self)
131 Return a new set containing the lexicographic minimum of the elements in the set.
133 .. py:method:: lexmax(self)
135 Return a new set containing the lexicographic maximum of the elements in the set.
138 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.
140 .. py:method:: points(self)
142 Return a list of the points contained in a domain as :class:`Points` objects.
144 .. py:method:: vertices(self)
146 Return a list of the verticies of a domain.
148 .. py:method:: faces(self)
150 Return a list of the vertices for each face of a domain.
152 .. py:method:: plot(self, plot=None, **kwargs)
154 Return a plot of the given domain.