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