Regina 7.3 Calculation Engine
|
Represents a specific set of gluing permutations to complement a particular pairwise matching of simplex facets. More...
#include <census/gluingperms.h>
Public Types | |
using | Index = typename Perm< dim >::Index |
A native signed integer type large enough to count all permutations on dim elements. More... | |
Public Member Functions | |
GluingPerms (const FacetPairing< dim > &pairing) | |
Creates a new permutation set. More... | |
GluingPerms (FacetPairing< dim > &&pairing) | |
Creates a new permutation set. More... | |
GluingPerms (const GluingPerms< dim > &src) | |
Creates a new copy of the given gluing permutation set. More... | |
GluingPerms (GluingPerms< dim > &&src) noexcept | |
Moves the contents of the given gluing permutation set into this new gluing permutation set. More... | |
GluingPerms (std::istream &in) | |
Reads a new set of gluing permutations from the given input stream. More... | |
~GluingPerms () | |
Deallocates any memory used by this structure. More... | |
GluingPerms & | operator= (const GluingPerms &src) |
Sets this to be a copy of the given gluing permutation set. More... | |
GluingPerms & | operator= (GluingPerms &&src) noexcept |
Moves the contents of the given gluing permutation set into this new gluing permutation set. More... | |
void | swap (GluingPerms &other) noexcept |
Swaps the contents of this and the given gluing permutation set. More... | |
size_t | size () const |
Returns the total number of simplices under consideration. More... | |
const FacetPairing< dim > & | pairing () const |
Returns the specific pairing of simplex facets that this set of gluing permutations complements. More... | |
Perm< dim+1 > | perm (const FacetSpec< dim > &source) const |
Returns the gluing permutation associated with the given simplex facet. More... | |
Perm< dim+1 > | perm (size_t simp, int facet) const |
Returns the gluing permutation associated with the given simplex facet. More... | |
Index | permIndex (const FacetSpec< dim > &source) const |
Returns the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner. More... | |
Index | permIndex (size_t simp, int facet) const |
Returns the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner. More... | |
Index & | permIndex (const FacetSpec< dim > &source) |
Offers write access to the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner. More... | |
Index & | permIndex (size_t simp, int facet) |
Offers write access to the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner. More... | |
void | setPermIndex (const FacetSpec< dim > &source, Index index) |
Python-only routine that sets the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner. More... | |
void | setPermIndex (size_t simp, int facet, Index index) |
Python-only routine that sets the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner. More... | |
Triangulation< dim > | triangulate () const |
Returns the triangulation modelled by this set of gluing permutations and the associated simplex facet pairing. More... | |
void | dumpData (std::ostream &out) const |
Dumps all internal data in a plain text format to the given output stream. More... | |
std::string | data () const |
Returns all internal data in a plain text format. More... | |
Index | gluingToIndex (const FacetSpec< dim > &source, const Perm< dim+1 > &gluing) const |
Returns the index into array Perm<dim+1>::Sn_1 corresponding to the given gluing permutation from the given facet to its partner. More... | |
Index | gluingToIndex (size_t simp, int facet, const Perm< dim+1 > &gluing) const |
Returns the index into array Perm<dim+1>::Sn_1 corresponding to the given gluing permutation from the given facet to its partner. More... | |
Perm< dim+1 > | indexToGluing (const FacetSpec< dim > &source, Index index) const |
Returns the gluing permutation from the given facet to its partner that corresponds to the given index into array Perm<dim+1>::Sn_1. More... | |
Perm< dim+1 > | indexToGluing (size_t simp, int facet, Index index) const |
Returns the gluing permutation from the given facet to its partner that corresponds to the given index into array Perm<dim+1>::Sn_1. More... | |
bool | operator== (const GluingPerms &other) const |
Determines if this and the given gluing permutation set are identical. More... | |
bool | operator!= (const GluingPerms &other) const |
Determines if this and the given gluing permutation set are not identical. More... | |
void | writeTextShort (std::ostream &out) const |
Writes a short text representation of this object to the given output stream. More... | |
void | writeTextLong (std::ostream &out) const |
Writes a detailed text representation of this object to the given output stream. More... | |
std::string | str () const |
Returns a short text representation of this object. More... | |
std::string | utf8 () const |
Returns a short text representation of this object using unicode characters. More... | |
std::string | detail () const |
Returns a detailed text representation of this object. More... | |
Static Public Member Functions | |
static GluingPerms | fromData (const std::string &data) |
Reads a new set of gluing permutations from the given string. More... | |
Represents a specific set of gluing permutations to complement a particular pairwise matching of simplex facets.
Given a pairwise matching of facets (as described by class FacetPairing<dim>), each facet that is matched with some other facet will have an associated permutation of (dim + 1) elements.
If a facet is matched with some other facet, the two associated permutations in this set will be inverses. If a facet is left deliberately unmatched, it will have no associated permutation in this set.
Such a set of permutations models part of the structure of a triangulation, in which each simplex facet that is glued to another facet has a corresponding gluing permutation (and the matched facet has the inverse gluing permutation).
The main purpose of this class is to provide a way of quickly describing and manipulating the combinatorial structure of a triangulation without the overhead of a full-blown Triangulation<dim> object. In particular, this class was designed for use in census enumeration, which involves rapid construction and editing of these permutations. To convert this into a full Triangulation<dim> object, you can call triangulate().
Internally, this class stores each permutation as an index into Perm<dim+1>::Sn_1 (that is, an index into the permutation group S_dim). Importantly, you can only set permutations using these indices, via the non-const permIndex() function - access to the permutations themselves is read-only. You can use indexToGluing() and gluingToIndex() to convert between indicex and permutations, or you can use the read-only member function perm() which returns the permutation directly. Note that this correspondence is non-trivial, and depends on the details of the underlying facet pairing.
This class also supports a special "not yet chosen" permutation, represented using the permutation index -1. Attempting to convert this to a real permutation using perm() or indexToGluing() is not allowed, and will result in undefined behaviour.
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.
dim | the dimension of the underlying triangulation that is being modelled. This must be between 2 and 15 inclusive. |
using regina::GluingPerms< dim >::Index = typename Perm<dim>::Index |
A native signed integer type large enough to count all permutations on dim elements.
|
inline |
Creates a new permutation set.
All internal permutations will be marked as not yet chosen, and any attempt to query them before setting them to explicit values will result in undefined behaviour. The corresponding permutation indices will be set to -1.
This constructor induces a deep copy of the given facet pairing.
pairing | the specific pairing of simplex facets that this permutation set will complement. |
|
inline |
Creates a new permutation set.
All internal permutations will be marked as not yet chosen, and any attempt to query them before setting them to explicit values will result in undefined behaviour. The corresponding permutation indices will be set to -1.
This constructor moves the contents of the given facet pairing into this object. After it returns, pairing will no longer be usable.
pairing | the specific pairing of simplex facets that this permutation set will complement. |
|
inline |
Creates a new copy of the given gluing permutation set.
src | the gluing permutations to copy. |
|
inlinenoexcept |
Moves the contents of the given gluing permutation set into this new gluing permutation set.
This is a fast (constant time) operation.
The permutation set that is passed (src) will no longer be usable.
src | the gluing permutations to move. |
regina::GluingPerms< dim >::GluingPerms | ( | std::istream & | in | ) |
Reads a new set of gluing permutations from the given input stream.
This routine reads data in the format written by dumpData().
InvalidInput | The data found in the input stream is invalid, incomplete, or incorrectly formatted. |
in | the input stream from which to read. |
|
inline |
Deallocates any memory used by this structure.
std::string regina::GluingPerms< dim >::data | ( | ) | const |
Returns all internal data in a plain text format.
This gluing permutation sert can be recreated from this text data by calling fromData().
This routine may be useful for transferring objects from one processor to another.
This routine returns the same information that dumpData() writes.
|
inherited |
Returns a detailed text representation of this object.
This text may span many lines, and should provide the user with all the information they could want. It should be human-readable, should not contain extremely long lines (which cause problems for users reading the output in a terminal), and should end with a final newline. There are no restrictions on the underlying character set.
void regina::GluingPerms< dim >::dumpData | ( | std::ostream & | out | ) | const |
Dumps all internal data in a plain text format to the given output stream.
This object can be recreated from this text data by calling the input stream constructor for this class.
This routine may be useful for transferring objects from one processor to another.
This routine outputs the same information that data() returns.
out | the output stream to which the data should be written. |
|
static |
Reads a new set of gluing permutations from the given string.
This routine reads data in the format written by data().
InvalidArgument | The data found in the given string is invalid, incomplete, or incorrectly formatted. |
data | the data from which to reconstruct a gluing permutation set. |
Index regina::GluingPerms< dim >::gluingToIndex | ( | const FacetSpec< dim > & | source, |
const Perm< dim+1 > & | gluing | ||
) | const |
Returns the index into array Perm<dim+1>::Sn_1 corresponding to the given gluing permutation from the given facet to its partner.
This need not be the index into Perm<dim+1>::Sn_1 that is currently stored for the given facet.
Indices into array Perm<dim+1>::Sn_1 are stored internally in the array permIndices_. Full gluing permutations on the other hand are used in constructing triangulations.
source | the simplex facet under investigation. |
gluing | a possible gluing permutation from the given simplex facet to its partner according to the underlying facet pairing. |
Index regina::GluingPerms< dim >::gluingToIndex | ( | size_t | simp, |
int | facet, | ||
const Perm< dim+1 > & | gluing | ||
) | const |
Returns the index into array Perm<dim+1>::Sn_1 corresponding to the given gluing permutation from the given facet to its partner.
This need not be the index into Perm<dim+1>::Sn_1 that is currently stored for the given facet.
Indices into array Perm<dim+1>::Sn_1 are stored internally in the array permIndices_. Full gluing permutations on the other hand are used in constructing triangulations.
simp | the simplex under investigation; this must be strictly less than the total number of simplices under consideration. |
facet | the facet of the given simplex under investigation; this must be between 0 and dim inclusive. |
gluing | a possible gluing permutation from the given simplex facet to its partner according to the underlying facet pairing. |
|
inline |
Returns the gluing permutation from the given facet to its partner that corresponds to the given index into array Perm<dim+1>::Sn_1.
This index into Perm<dim+1>::Sn_1 need not be the index that is currently stored for the given facet.
Indices into array Perm<dim+1>::Sn_1 are stored internally in the array permIndices_. Full gluing permutations on the other hand are used in constructing triangulations.
If the given simplex facet and its partner according to the underlying facet pairing are facets x and y of their respective simplices, then the resulting gluing permutation will map x to y.
source | the simplex facet under investigation. |
index | an index into Perm<dim+1>::Sn_1; this must be between 0 and dim!-1 inclusive. |
|
inline |
Returns the gluing permutation from the given facet to its partner that corresponds to the given index into array Perm<dim+1>::Sn_1.
This index into Perm<dim+1>::Sn_1 need not be the index that is currently stored for the given facet.
Indices into array Perm<dim+1>::Sn_1 are stored internally in the array permIndices_. Full gluing permutations on the other hand are used in constructing triangulations.
If the given simplex facet and its partner according to the underlying facet pairing are facets x and y of their respective simplices, then the resulting gluing permutation will map x to y.
simp | the simplex under investigation; this must be strictly less than the total number of simplices under consideration. |
facet | the facet of the given simplex under investigation; this must be between 0 and dim inclusive. |
index | an index into Perm<dim+1>::Sn_1; this must be between 0 and dim!-1 inclusive. |
|
inline |
Determines if this and the given gluing permutation set are not identical.
To be identical, the two sets must use identical facet pairings and all of their corresponding permutations must be the same.
other | the gluing permutation set to compare with this. |
true
if and only if this and the given set are not identical.
|
inline |
Sets this to be a copy of the given gluing permutation set.
src | the gluing permutations to copy. |
|
inlinenoexcept |
Moves the contents of the given gluing permutation set into this new gluing permutation set.
This is a fast (constant time) operation.
The permutation set that is passed (src) will no longer be usable.
src | the gluing permutations to move. |
|
inline |
Determines if this and the given gluing permutation set are identical.
To be identical, the two sets must use identical facet pairings and all of their corresponding permutations must be the same.
other | the gluing permutation set to compare with this. |
true
if and only if this and the given set are identical.
|
inline |
Returns the specific pairing of simplex facets that this set of gluing permutations complements.
|
inline |
Returns the gluing permutation associated with the given simplex facet.
source | the simplex facet under investigation. |
|
inline |
Returns the gluing permutation associated with the given simplex facet.
simp | the simplex under investigation (this must be strictly less than the total number of simplices under consideration). |
facet | the facet of the given simplex under investigation (between 0 and dim inclusive). |
|
inline |
Offers write access to the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner.
Note that this is not the S_n index of the gluing permutation on (dim + 1) elements, but rather the index of a permutation on just dim elements. You can use indexToGluing() and gluingToIndex() to convert between these indices and gluing permutations, or you can call perm() for read-only access to the gluing permutation directly.
As described in the class notes, this index can be a real permutation index between 0 and (dim!)-1 inclusive, or it may be the special value -1 indicating that the permutation has not yet been chosen.
source | the simplex facet under investigation. |
|
inline |
Returns the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner.
Note that this is not the S_n index of the gluing permutation on (dim + 1) elements, but rather the index of a permutation on just dim elements. You can use indexToGluing() and gluingToIndex() to convert between these indices and gluing permutations, or you can call perm() to read the gluing permutation directly.
As described in the class notes, this index could be a real permutation index between 0 and (dim!)-1 inclusive, or it could be the special value -1 indicating that the permutation has not yet been chosen.
source | the simplex facet under investigation. |
|
inline |
Offers write access to the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner.
Note that this is not the S_n index of the gluing permutation on (dim + 1) elements, but rather the index of a permutation on just dim elements. You can use indexToGluing() and gluingToIndex() to convert between these indices and gluing permutations, or you can call perm() for read-only access to the gluing permutation directly.
As described in the class notes, this index can be a real permutation index between 0 and (dim!)-1 inclusive, or it may be the special value -1 indicating that the permutation has not yet been chosen.
simp | the simplex under investigation (this must be strictly less than the total number of simplices under consideration). |
facet | the facet of the given simplex under investigation (between 0 and dim inclusive). |
|
inline |
Returns the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner.
Note that this is not the S_n index of the gluing permutation on (dim + 1) elements, but rather the index of a permutation on just dim elements. You can use indexToGluing() and gluingToIndex() to convert between these indices and gluing permutations, or you can call perm() to read the gluing permutation directly.
As described in the class notes, this index could be a real permutation index between 0 and (dim!)-1 inclusive, or it could be the special value -1 indicating that the permutation has not yet been chosen.
simp | the simplex under investigation (this must be strictly less than the total number of simplices under consideration). |
facet | the facet of the given simplex under investigation (between 0 and dim inclusive). |
void regina::GluingPerms< dim >::setPermIndex | ( | const FacetSpec< dim > & | source, |
Index | index | ||
) |
Python-only routine that sets the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner.
Note that this is not the S_n index of the gluing permutation on (dim + 1) elements, but rather the index of a permutation on just dim elements. You can use indexToGluing() and gluingToIndex() to convert between these indices and gluing permutations.
As described in the class notes, this index can be a real permutation index between 0 and (dim!)-1 inclusive, or it may be the special value -1 indicating that the permutation has not yet been chosen.
permIndex(source) = index
.source | the simplex facet under consideration. |
index | the new value of the corresponding array index. |
void regina::GluingPerms< dim >::setPermIndex | ( | size_t | simp, |
int | facet, | ||
Index | index | ||
) |
Python-only routine that sets the index into array Perm<dim+1>::Sn_1 describing how the the given facet is joined to its partner.
Note that this is not the S_n index of the gluing permutation on (dim + 1) elements, but rather the index of a permutation on just dim elements. You can use indexToGluing() and gluingToIndex() to convert between these indices and gluing permutations.
As described in the class notes, this index can be a real permutation index between 0 and (dim!)-1 inclusive, or it may be the special value -1 indicating that the permutation has not yet been chosen.
permIndex(simp, facet) = index
.simp | the simplex under consideration (this must be strictly less than the total number of simplices under consideration). |
facet | the facet of the given simplex under consideration (between 0 and dim inclusive). |
index | the new value of the corresponding array index. |
|
inline |
Returns the total number of simplices under consideration.
|
inherited |
Returns a short text representation of this object.
This text should be human-readable, should use plain ASCII characters where possible, and should not contain any newlines.
Within these limits, this short text ouptut should be as information-rich as possible, since in most cases this forms the basis for the Python __str__()
and __repr__()
functions.
__str__()
will use precisely this function, and for most classes the Python __repr__()
function will incorporate this into its output.
|
inlinenoexcept |
Swaps the contents of this and the given gluing permutation set.
other | the set whose contents should be swapped with this. |
Triangulation< dim > regina::GluingPerms< dim >::triangulate | ( | ) | const |
Returns the triangulation modelled by this set of gluing permutations and the associated simplex facet pairing.
Each matched pair of facets and their associated permutations will be realised as two simplex facets in the triangulation glued together with the corresponding gluing permutation. Each unmatched facet will be realised as a boundary facet in the triangulation.
|
inherited |
Returns a short text representation of this object using unicode characters.
Like str(), this text should be human-readable, should not contain any newlines, and (within these constraints) should be as information-rich as is reasonable.
Unlike str(), this function may use unicode characters to make the output more pleasant to read. The string that is returned will be encoded in UTF-8.
void regina::GluingPerms< dim >::writeTextLong | ( | std::ostream & | out | ) | const |
Writes a detailed text representation of this object to the given output stream.
out | the output stream to which to write. |
void regina::GluingPerms< dim >::writeTextShort | ( | std::ostream & | out | ) | const |
Writes a short text representation of this object to the given output stream.
out | the output stream to which to write. |