Regina 7.0 Calculation Engine
|
Represents a combinatorial isomorphism from one dim-manifold triangulation into another. More...
#include <triangulation/generic.h>
Public Member Functions | |
Isomorphism (unsigned nSimplices) | |
Creates a new isomorphism with no initialisation. More... | |
Isomorphism (const Isomorphism &src) | |
Creates a copy of the given isomorphism. More... | |
Isomorphism (Isomorphism &&src) noexcept | |
Moves the given isomorphism into this new isomorphism. More... | |
~Isomorphism () | |
Destroys this isomorphism. More... | |
Isomorphism & | operator= (const Isomorphism &src) |
Copies the given isomorphism into this isomorphism. More... | |
Isomorphism & | operator= (Isomorphism &&src) noexcept |
Moves the given isomorphism into this isomorphism. More... | |
void | swap (Isomorphism &other) noexcept |
Swaps the contents of this and the given isomorphism. More... | |
unsigned | size () const |
Returns the number of simplices in the source triangulation associated with this isomorphism. More... | |
int & | simpImage (unsigned sourceSimp) |
Determines the image of the given source simplex under this isomorphism. More... | |
int | simpImage (unsigned sourceSimp) const |
Determines the image of the given source simplex under this isomorphism. More... | |
Perm< dim+1 > & | facetPerm (unsigned sourceSimp) |
Returns a read-write reference to the permutation that is applied to the (dim + 1) facets of the given source simplex under this isomorphism. More... | |
Perm< dim+1 > | facetPerm (unsigned sourceSimp) const |
Determines the permutation that is applied to the (dim + 1) facets of the given source simplex under this isomorphism. More... | |
FacetSpec< dim > | operator[] (const FacetSpec< dim > &source) const |
Determines the image of the given source simplex facet under this isomorphism. More... | |
bool | isIdentity () const |
Determines whether or not this is an identity isomorphism. More... | |
Triangulation< dim > | apply (const Triangulation< dim > &original) const |
Applies this isomorphism to the given triangulation, and returns the result as a new triangulation. More... | |
void | applyInPlace (Triangulation< dim > &tri) const |
Applies this isomorphism to the given triangulation, modifying the given triangulation directly. More... | |
Isomorphism | operator* (const Isomorphism &rhs) const |
Returns the composition of this isomorphism with the given isomorphism. More... | |
Isomorphism | operator* (Isomorphism &&rhs) const |
Returns the composition of this isomorphism with the given isomorphism. More... | |
Isomorphism | inverse () const |
Returns the inverse of this isomorphism. 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... | |
bool | operator== (const Isomorphism &other) const |
Determines whether this and the given isomorphism are identical. More... | |
bool | operator!= (const Isomorphism &other) const |
Determines whether this and the given isomorphism are not identical. 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 Isomorphism< dim > | identity (unsigned nSimplices) |
Returns the identity isomorphism for the given number of simplices. More... | |
static Isomorphism< dim > | random (unsigned nSimplices, bool even=false) |
Returns a random isomorphism for the given number of simplices. More... | |
Protected Attributes | |
unsigned | nSimplices_ |
The number of simplices in the source triangulation. More... | |
int * | simpImage_ |
Stores the simplex of the destination triangulation that each simplex of the source triangulation maps to. More... | |
Perm< dim+1 > * | facetPerm_ |
The permutation applied to the facets of each source simplex. More... | |
Represents a combinatorial isomorphism from one dim-manifold triangulation into another.
In essence, a combinatorial isomorphism from triangulation T to triangulation U is a one-to-one map from the simplices of T to the simplices of U that allows relabelling of both the simplices and their facets (or equivalently, their vertices), and that preserves gluings across adjacent simplices.
More precisely: An isomorphism consists of (i) a one-to-one map f from the simplices of T to the simplices of U, and (ii) for each simplex S of T, a permutation fS of the facets (0,...,dim) of S, for which the following condition holds:
Isomorphisms can be boundary complete or boundary incomplete. A boundary complete isomorphism satisfies the additional condition:
A boundary complete isomorphism thus indicates that a copy of triangulation T is present as an entire component (or components) of U, whereas a boundary incomplete isomorphism represents an embedding of a copy of triangulation T as a subcomplex of some possibly larger component (or components) of U.
Note that for all types of isomorphism, triangulation U is allowed to contain more simplices than triangulation T.
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 triangulations that this isomorphism class works with. This must be between 2 and 15 inclusive. |
|
inline |
Creates a new isomorphism with no initialisation.
The images of the simplices and their vertices must be explicitly set using simpImage() and facetPerm().
nSimplices | the number of simplices in the source triangulation associated with this isomorphism. This is allowed to be zero. |
|
inline |
Creates a copy of the given isomorphism.
src | the isomorphism to copy. |
|
inlinenoexcept |
Moves the given isomorphism into this new isomorphism.
This is a fast (constant time) operation.
The isomorphism that is passed (src) will no longer be usable.
src | the isomorphism to move. |
|
inline |
Destroys this isomorphism.
Triangulation< dim > regina::Isomorphism< dim >::apply | ( | const Triangulation< dim > & | original | ) | const |
Applies this isomorphism to the given triangulation, and returns the result as a new triangulation.
An isomorphism represents a combinatorial map from a triangulation T to a triangulation U. This routine treats the given triangulation as the domain T, and returns the corresponding range U. The given triangulation T is not modified in any way.
In more detail: A new triangulation U is returned, so that this isomorphism represents a one-to-one, onto and boundary complete isomorphism from T to U. That is, T and U will be combinatorially identical triangulations, and this isomorphism describes the mapping from the simplices of T and their facets to the simplices of U and their facets.
InvalidArgument | the number of simplices in the given triangulation is not equal to size() for this isomorphism. |
original | the triangulation to which this isomorphism should be applied. |
void regina::Isomorphism< dim >::applyInPlace | ( | Triangulation< dim > & | tri | ) | const |
Applies this isomorphism to the given triangulation, modifying the given triangulation directly.
This is similar to apply(), except that instead of creating a new triangulation, the simplices and vertices of the given triangulation are modified in-place.
See apply() for further details on how this operation is performed.
InvalidArgument | the number of simplices in the given triangulation is not equal to size() for this isomorphism. |
tri | the triangulation to which this isomorphism should be applied. |
|
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.
|
inline |
Returns a read-write reference to the permutation that is applied to the (dim + 1) facets of the given source simplex under this isomorphism.
Facet i of source simplex sourceSimp will be mapped to facet facetPerm(sourceSimp)[i]
of simplex simpImage(sourceSimp)
.
If the dimension dim is 2 or 3, then you can also access this permutation through the dimension-specific alias edgePerm() or facePerm() respectively.
setFacetPerm(sourceSimp, perm)
instead.sourceSimp | the index of the source simplex containing the original (dim + 1) facets; this must be between 0 and size()-1 inclusive. |
|
inline |
Determines the permutation that is applied to the (dim + 1) facets of the given source simplex under this isomorphism.
Facet i of source simplex sourceSimp will be mapped to face facetPerm(sourceSimp)[i]
of simplex simpImage(sourceSimp)
.
If the dimension dim is 2 or 3, then you can also access this permutation through the dimension-specific alias edgePerm() or facePerm() respectively.
sourceSimp | the index of the source simplex containing the original (dim + 1) facets; this must be between 0 and size()-1 inclusive. |
|
inlinestatic |
Returns the identity isomorphism for the given number of simplices.
This isomorphism sends every simplex and every vertex to itself.
nSimplices | the number of simplices that the new isomorphism should operate upon. |
Isomorphism< dim > regina::Isomorphism< dim >::inverse |
Returns the inverse of this isomorphism.
simpImage(0)
, ..., simpImage(size()-1)
must be a permutation of 0, ..., size()-1
.bool regina::Isomorphism< dim >::isIdentity |
Determines whether or not this is an identity isomorphism.
In an identity isomorphism, each simplex image is itself, and within each simplex the facet/vertex permutation is the identity permutation.
true
if this is an identity isomorphism, or false
otherwise.
|
inline |
Determines whether this and the given isomorphism are not identical.
Two isomorphisms are considered identical if they act on the same number of top-dimensional simplices, and all destination simplex numbers and facet permutations are the same for both isomorphisms.
In particular it is only the simplex, facet and vertex labels that matter: an isomorphism does not refer to a specific triangulation, and there is no sense in which the two isomorphisms need to act on the same triangulations and/or point to the same destination Simplex objects.
It is safe to compare isomorphisms of different sizes (in which case this routine will return true
).
other | the isomorphism to compare with this. |
true
if and only if this and the given isomorphism are not identical. Isomorphism< dim > regina::Isomorphism< dim >::operator* | ( | const Isomorphism< dim > & | rhs | ) | const |
Returns the composition of this isomorphism with the given isomorphism.
This follows the same order convention as Regina's permutation classes: the composition a * b
first applies the right-hand isomorphism b, and then the left-hand isomorphism a.
rhs.simpImage(i)
over all i must be less than this->size()
.Isomorphism< dim > regina::Isomorphism< dim >::operator* | ( | Isomorphism< dim > && | rhs | ) | const |
Returns the composition of this isomorphism with the given isomorphism.
This follows the same order convention as Regina's permutation classes: the composition a * b
first applies the right-hand isomorphism b, and then the left-hand isomorphism a.
rhs.simpImage(i)
over all i must be less than this->size()
.Isomorphism< dim > & regina::Isomorphism< dim >::operator= | ( | const Isomorphism< dim > & | src | ) |
Copies the given isomorphism into this isomorphism.
It does not matter if this and the given isomorphism use different numbers of simplices; if they do then this isomorphism will be resized as a result.
This operator induces a deep copy of src.
src | the isomorphism to copy. |
|
noexcept |
Moves the given isomorphism into this isomorphism.
This is a fast (constant time) operation.
It does not matter if this and the given isomorphism use different numbers of simplices; if they do then this isomorphism will be resized as a result.
The isomorphism that is passed (src) will no longer be usable.
src | the isomorphism to move. |
|
inline |
Determines whether this and the given isomorphism are identical.
Two isomorphisms are considered identical if they act on the same number of top-dimensional simplices, and all destination simplex numbers and facet permutations are the same for both isomorphisms.
In particular it is only the simplex, facet and vertex labels that matter: an isomorphism does not refer to a specific triangulation, and there is no sense in which the two isomorphisms need to act on the same triangulations and/or point to the same destination Simplex objects.
It is safe to compare isomorphisms of different sizes (in which case this routine will return false
).
other | the isomorphism to compare with this. |
true
if and only if this and the given isomorphism are identical.
|
inline |
Determines the image of the given source simplex facet under this isomorphism.
This operator returns by value: it cannot be used to alter the isomorphism.
source | the given source simplex facet; this must be one of the (dim + 1) facets of one of the size() simplices in the source triangulation. |
|
static |
Returns a random isomorphism for the given number of simplices.
This isomorphism will reorder simplices 0 to nSimplices-1
in a random fashion, and for each simplex a random permutation of its (dim + 1) vertices will be selected.
All possible isomorphisms for the given number of simplices are equally likely.
This routine is thread-safe, and uses RandomEngine for its random number generation.
nSimplices | the number of simplices that the new isomorphism should operate upon. |
even | if true , then every simplex will have its vertices permuted with an even permutation. This means that, if the random isomorphism is applied to an oriented triangulation, it will preserve the orientation. |
|
inline |
Determines the image of the given source simplex under this isomorphism.
If the dimension dim is 2, 3 or 4, then you can also access this image through the dimension-specific alias triImage(), tetImage() or pentImage() respectively.
setSimpImage(sourceSimp, image)
instead.sourceSimp | the index of the source simplex; this must be between 0 and size()-1 inclusive. |
|
inline |
Determines the image of the given source simplex under this isomorphism.
If the dimension dim is 2, 3 or 4, then you can also access this image through the dimension-specific alias triImage(), tetImage() or pentImage() respectively.
sourceSimp | the index of the source simplex; this must be between 0 and size()-1 inclusive. |
|
inline |
Returns the number of simplices in the source triangulation associated with this isomorphism.
Note that this is always less than or equal to the number of simplices in the destination triangulation.
|
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.
|
noexcept |
Swaps the contents of this and the given isomorphism.
It does not matter if this and the given isomorphism use different numbers of simplices; if so then they will be adjusted accordingly.
other | the isomorphism whose contents are to be swapped with this. |
|
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.
|
inline |
Writes a detailed text representation of this object to the given output stream.
out | the output stream to which to write. |
|
inline |
Writes a short text representation of this object to the given output stream.
out | the output stream to which to write. |
|
protected |
The permutation applied to the facets of each source simplex.
This array has size nSimplices_.
|
protected |
The number of simplices in the source triangulation.
|
protected |
Stores the simplex of the destination triangulation that each simplex of the source triangulation maps to.
This array has size nSimplices_.