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