File: validityconstraints.h

package info (click to toggle)
regina-normal 7.4.1-1.1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 154,244 kB
  • sloc: cpp: 295,026; xml: 9,992; sh: 1,344; python: 1,225; perl: 616; ansic: 138; makefile: 26
file content (304 lines) | stat: -rw-r--r-- 11,831 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
/*
  This file contains docstrings for use in the Python bindings.
  Do not edit! They were automatically extracted by ../gendoc.sh.
 */

#if defined(__GNUG__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif

namespace regina::python::doc {


// Docstring regina::python::doc::ValidityConstraints
static const char *ValidityConstraints =
R"doc(Represents a set of combinatorial validity constraints for use with
polytope vertex enumeration.

Vertex enumeration routines such as DoubleDescription::enumerate()
take a cone (specifically the non-negative orthant), form the
intersection of that cone with a given linear subspace, and return the
extremal rays of the new cone that results.

In some cases we are only interested in _valid_ rays of the new cone.
The ValidityConstraints class stores a number of "validity
constraints"; a ray is then "valid" if it satisfies all of these
constraints.

Each individual constraint encodes a subset *S* of coordinate
positions, and requires that a ray can only be non-zero on at most
_one_ of those coordinate positions. Equivalently, if we were to
assume that the linear subspace is in general position with respect to
the coordinate axes (which it is often not), then the *i*th facet of
the cone would come from the hyperplane perpendicular to *i*th
coordinate; such a constraint would then require that a ray can only
lie outside at most one of the facets corresponding to the coordinate
positions in *S*.

This class is tailored specifically to constraints that come from
normal surfaces and angle structures:

* We assume that the coordinate positions are grouped into consecutive
  _blocks_, each of the same size. For instance, in standard
  coordinates for normal surfaces, there is one block per tetrahedron,
  each of size seven (since each tetrahedron provides four triangle
  coordinates and three quadrilateral coordinates).

* It is okay if there are additional coordinates that appear beyond
  these blocks (e.g., the final scaling coordinate in angle structure
  coordinates). However, these additional coordinates cannot be used
  in any validity constraints.

It is assumed that all constraints are either _local_ or _global:_

* A _local_ constraint involves coordinates within a single block
  only. It is assumed that, if local constraints are used, then
  _every_ block will use analogous local constraints (where
  "analagous" means they use the same coordinate positions relative to
  the start of each block). An example of a local constraint is the
  quadrilateral constraints from normal surface theory, which require
  that each tetrahedron has at most one non-zero quadrilateral
  coordinate.

* A _global_ constraint involves coordinates in every block; moreover,
  each block must constraint the same coordinates relative to the
  start of the block. An example of a global constraint is with almost
  normal surfaces, where we require that the entire surface has at
  most one non-zero octagonal coordinate.

You can add a full set of local constraints (one for each block) using
a single call to addLocal(), and you can add a single global
constraint by calling addGlobal().

This class implements C++ move semantics and adheres to the C++
Swappable requirement. It is designed to avoid deep copies wherever
possible, even when passing or returning objects by value.)doc";

namespace ValidityConstraints_ {

// Docstring regina::python::doc::ValidityConstraints_::__copy
static const char *__copy = R"doc(Creates a clone of the given constraint set.)doc";

// Docstring regina::python::doc::ValidityConstraints_::__eq
static const char *__eq =
R"doc(Determines whether this and the given set contain the same
constraints.

This test compares the number of coordinates in each block, the total
number of blocks, the set of local constraints, and the set of global
constraints. The local and global constraints may appear in any order,
and their individual coordinates may likewise appear in any order;
such reorderings will not affect the outcome of this test.

.. warning::
    Because this test allows for reordering, the comparison is not
    very efficient. It is assumed that this will not be a problem,
    because typical constraint sets are extremely small.

Parameter ``other``:
    the constraint set to compare against this.

Returns:
    ``True`` if and only if this and the given set contain the same
    constraints.)doc";

// Docstring regina::python::doc::ValidityConstraints_::__init
static const char *__init =
R"doc(Creates an empty set of validity constraints for vectors with the
given block structure.

See the class notes for details on how vector coordinates are assumed
to be grouped into *nBlocks* consecutive blocks, each containing
*blockSize* coordinates (possibly with some additional coordinates
beyond this block structure that are not used in any validity
constraints).

Parameter ``blockSize``:
    the number of coordinates in each block. For example, for vectors
    describing normal surfaces in standard coordinates, this block
    size would be 7 (representing the three triangle and four
    quadrilateral coordinates for each tetrahedron).

Parameter ``nBlocks``:
    the number of consecutive blocks of size *blockSize*. For example,
    for vectors describing normal surfaces in standard coordinates,
    this number of blocks would be the number of tetrahedra in the
    underlying triangulation.

Parameter ``reserveLocal``:
    indicates that we should reserve space for *reserveLocal* calls to
    addLocal(). This is purely for optimisation; it is safe to leave
    this as 0 (the default).

Parameter ``reserveGlobal``:
    indicates that we should reserve space for *reserveGlobal* calls
    to addGlobal(). This is purely for optimisation; it is safe to
    leave this as 0 (the default).)doc";

// Docstring regina::python::doc::ValidityConstraints_::addGlobal
static const char *addGlobal =
R"doc(Adds one new global constraint to this set.

A call to addGlobal() will add a single global constraint, using
coordinates from every block. Within each block, the coordinates that
are constrained will be those listed in the given iterator range,
where these coordinate positions are given relative to the start of
each block.

As an example, for almost normal surfaces in standard coordinates, you
can encode the constraint that there is at most one octagon in the
entire surface by passing an iterator range that encodes the three
integers 7, 8, 9.

Precondition:
    The iterator type *iterator*, when dereferenced, can be assigned
    to a native C++ ``int``.

Python:
    Instead of the iterators *begin* and *end*, this routine takes a
    python list of integers.

Parameter ``begin``:
    the beginning of the list of coordinates to constraint within each
    block, relative to the start of the block, as outlined above.

Parameter ``end``:
    a past-the-end iterator indicating the end of the list of
    coordinates to constraint within each block.)doc";

// Docstring regina::python::doc::ValidityConstraints_::addLocal
static const char *addLocal =
R"doc(Adds a new family of local constraints to this set.

A single call to addLocal() will effectively add one local constraint
for every block. Each local constraint will constraint the coordinates
in the given iterator range, where these coordinate positions are
given relative to the start of each block.

For example, to encode the quadrilateral constraints for normal
surfaces in standard coordinates, you can pass an iterator range that
encodes the three integers 4, 5, 6.

Precondition:
    The iterator type *iterator*, when dereferenced, can be assigned
    to a native C++ ``int``.

Python:
    Instead of the iterators *begin* and *end*, this routine takes a
    python list of integers.

Parameter ``begin``:
    the beginning of the list of coordinates to constraint within each
    block, relative to the start of the block, as outlined above.

Parameter ``end``:
    a past-the-end iterator indicating the end of the list of
    coordinates to constraint within each block.)doc";

// Docstring regina::python::doc::ValidityConstraints_::bitmasks
static const char *bitmasks =
R"doc(Returns the list of all individual validity constraints, each
expressed as a bitmask of the given length.

Each local constraint "pattern" that was added using addLocal() will
produce many bitmasks, since there will be one local constraint for
every block. Each global constraint that was added using addGlobal()
will produce just one bitmask.

The bits corresponding to coordinate positions that are constrained
will be set to ``True``; all other bits will be set to ``False``.

Precondition:
    The given length *len* is at least the number of blocks multiplied
    by the block size.

Precondition:
    A bitmask of type *BitmaskType* is large enough to store *len*
    bits.

Python:
    This routine uses the bitmask type regina::Bitmask.

Template parameter ``BitmaskType``:
    the bitmask type used to encode each constraint; this must be one
    of Regina's own bitmask types, such as Bitmask, Bitmask1 or
    Bitmask2.

Parameter ``len``:
    the total number of coordinates in the vectors being constrained.
    Each bitmask will be created with this length.

Returns:
    the list of bitmasks describing the full set of validity
    constraints.)doc";

// Docstring regina::python::doc::ValidityConstraints_::bitmasks_2
static const char *bitmasks_2 =
R"doc(Returns the list of all individual validity constraints, each
expressed as a bitmask of the smallest possible length.

Calling ``bitmasks()`` is equivalent to calling ``bitmasks(len)``,
where *len* is the block size multiplied by the number of blocks.

As an example, this is appropriate for normal surface coordinate
systems, where the normal coordinates incorporate precisely one block
for each tetrahedron and nothing more. However, it is not appropriate
for angle structure coordinates, where there is an additional "scaling
coordinate" that appears after all the blocks.

Each local constraint "pattern" that was added using addLocal() will
produce many bitmasks, since there will be one local constraint for
every block. Each global constraint that was added using addGlobal()
will produce just one bitmask.

The bits corresponding to coordinate positions that are constrained
will be set to ``True``; all other bits will be set to ``False``.

Precondition:
    A bitmask of type *BitmaskType* is large enough to store *len*
    bits, where *len* is the block size multiplied by the number of
    blocks. Each bitmask that is returned will be created with this
    length.

Python:
    This routine uses the bitmask type regina::Bitmask.

Template parameter ``BitmaskType``:
    the bitmask type used to encode each constraint; this must be one
    of Regina's own bitmask types, such as Bitmask, Bitmask1 or
    Bitmask2.

Returns:
    the list of bitmasks describing the full set of validity
    constraints.)doc";

// Docstring regina::python::doc::ValidityConstraints_::global_swap
static const char *global_swap =
R"doc(Swaps the contents of the two given constraint sets.

This global routine simply calls ValidityConstraints::swap(); it is
provided so that ValidityConstraints meets the C++ Swappable
requirements.

Parameter ``a``:
    the first constraint set whose contents should be swapped.

Parameter ``b``:
    the second constraint set whose contents should be swapped.)doc";

// Docstring regina::python::doc::ValidityConstraints_::swap
static const char *swap =
R"doc(Swaps the contents of this and the given constraint set.

Parameter ``other``:
    the constraint set whose contents should be swapped with this.)doc";

}

} // namespace regina::python::doc

#if defined(__GNUG__)
#pragma GCC diagnostic pop
#endif