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