Regina 7.0 Calculation Engine
|
Helper class that provides core functionality for a subdim-face in the skeleton of a dim-dimensional triangulation. More...
#include <triangulation/detail/face.h>
Public Member Functions | |
size_t | index () const |
Returns the index of this face within the underlying triangulation. More... | |
Triangulation< dim > & | triangulation () const |
Returns the triangulation to which this face belongs. More... | |
Component< dim > * | component () const |
Returns the component of the triangulation to which this face belongs. More... | |
BoundaryComponent< dim > * | boundaryComponent () const |
Returns the boundary component of the triangulation to which this face belongs. More... | |
bool | isBoundary () const |
Determines if this face lies entirely on the boundary of the triangulation. More... | |
size_t | degree () const |
Returns the degree of this face. More... | |
const FaceEmbedding< dim, subdim > & | embedding (size_t index) const |
Returns one of the ways in which this face appears within a top-dimensional simplex of the underlying triangluation. More... | |
auto | embeddings () const |
Returns an object that allows iteration through and random access to all of the ways in which this face appears within a top-dimensional simplex of the underlying triangluation. More... | |
auto | begin () const |
A begin function for iterating through all appearances of this face within the various top-dimensional simplices of the underlying triangulation. More... | |
auto | end () const |
An end function for iterating through all appearances of this face within the various top-dimensional simplices of the underlying triangulation. More... | |
const FaceEmbedding< dim, subdim > & | front () const |
Returns the first appearance of this face within a top-dimensional simplex of the underlying triangluation. More... | |
const FaceEmbedding< dim, subdim > & | back () const |
Returns the last appearance of this face within a top-dimensional simplex of the underlying triangluation. More... | |
bool | inMaximalForest () const |
Determines whether a codimension-1-face represents a dual edge in the maximal forest that has been chosen for the dual 1-skeleton of the triangulation. More... | |
bool | isLinkOrientable () const |
Determines if the link of this face is orientable. More... | |
bool | isValid () const |
Determines if this face is valid. More... | |
bool | hasBadIdentification () const |
Determines if this face is identified with itself under a non-identity permutation. More... | |
bool | hasBadLink () const |
Determines if this face does not have an appropriate link. More... | |
template<int lowerdim> | |
Face< dim, lowerdim > * | face (int face) const |
Returns the lowerdim-face of the underlying triangulation that appears as the given lowerdim-dimensional subface of this face. More... | |
Face< dim, 0 > * | vertex (int i) const |
A dimension-specific alias for face<0>(). More... | |
Face< dim, 1 > * | edge (int i) const |
A dimension-specific alias for face<1>(). More... | |
Face< dim, 2 > * | triangle (int i) const |
A dimension-specific alias for face<2>(). More... | |
Face< dim, 3 > * | tetrahedron (int i) const |
A dimension-specific alias for face<3>(). More... | |
Face< dim, 4 > * | pentachoron (int i) const |
A dimension-specific alias for face<4>(). More... | |
template<int lowerdim> | |
Perm< dim+1 > | faceMapping (int face) const |
Examines the given lowerdim-dimensional subface of this face, and returns the mapping between the underlying lowerdim-face of the triangulation and the individual vertices of this face. More... | |
Perm< dim+1 > | vertexMapping (int face) const |
A dimension-specific alias for faceMapping<0>(). More... | |
Perm< dim+1 > | edgeMapping (int face) const |
A dimension-specific alias for faceMapping<1>(). More... | |
Perm< dim+1 > | triangleMapping (int face) const |
A dimension-specific alias for faceMapping<2>(). More... | |
Perm< dim+1 > | tetrahedronMapping (int face) const |
A dimension-specific alias for faceMapping<3>(). More... | |
Perm< dim+1 > | pentachoronMapping (int face) const |
A dimension-specific alias for faceMapping<4>(). More... | |
void | writeTextShort (std::ostream &out) const |
Writes a short text representation of this object to the given output stream. More... | |
FaceBase (const FaceBase &)=delete | |
FaceBase & | operator= (const FaceBase &)=delete |
size_t | markedIndex () const |
Returns the index at which this object is stored in an MarkedVector. More... | |
void | writeTextLong (std::ostream &out) const |
A default implementation for detailed output. 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 constexpr Perm< dim+1 > | ordering (unsigned face) |
Given a subdim-face number within a dim-dimensional simplex, returns the corresponding canonical ordering of the simplex vertices. More... | |
static constexpr unsigned | faceNumber (Perm< dim+1 > vertices) |
Identifies which subdim-face in a dim-dimensional simplex is represented by the first (subdim + 1) elements of the given permutation. More... | |
static constexpr bool | containsVertex (unsigned face, unsigned vertex) |
Tests whether the given subdim-face of a dim-dimensional simplex contains the given vertex of the simplex. More... | |
Static Public Attributes | |
static constexpr int | dimension = dim |
A compile-time constant that gives the dimension of the triangulation containing this face. More... | |
static constexpr int | subdimension = subdim |
A compile-time constant that gives the dimension of this face. More... | |
static constexpr bool | allowsNonOrientableLinks = (subdim <= dim - 3) |
Indicates whether it is possible for a face of this dimension to have a non-orientable link. More... | |
static constexpr bool | allowsInvalidFaces |
Indicates whether it is possible for a face of this dimension to be invalid. More... | |
static constexpr int | oppositeDim = (dim - 1 - subdim) |
The dimension of the faces opposite these in a top-dimensional simplex of a dim-dimensional triangulation. More... | |
static constexpr bool | lexNumbering = (subdim <= oppositeDim) |
true if faces are numbered in lexicographical order according to their vertices, or false if faces are numbered in reverse lexicographical order. More... | |
static constexpr int | nFaces = binomSmall(dim + 1, lexDim + 1) |
The total number of subdim-dimensional faces in each dim-dimensional simplex. More... | |
Protected Member Functions | |
FaceBase (Component< dim > *component) | |
Creates a new face. More... | |
Static Protected Attributes | |
static constexpr int | lexDim = (lexNumbering ? subdim : oppositeDim) |
Whichever of subdim or oppositeDim uses lexicographical face numbering. More... | |
Friends | |
class | Triangulation< dim > |
class | TriangulationBase< dim > |
Helper class that provides core functionality for a subdim-face in the skeleton of a dim-dimensional triangulation.
Each subdim-face is described by a Face<dim, subdim> object, which uses this as a base class. End users should not need to refer to FaceBase directly.
See the Face template class notes for further information.
Neither this class nor the "end user" class Face<dim> support value semantics: they cannot be copied, swapped, or manually constructed. Their memory is managed by the Triangulation class, and their locations in memory define them. See Face<dim> for further details.
dim | the dimension of the underlying triangulation. This must be between 2 and 15 inclusive. |
subdim | the dimension of the faces that this class represents. This must be between 0 and dim-1 inclusive. |
|
inlineprotected |
Creates a new face.
The face will be initialised as belong to no boundary component.
component | the component of the underlying triangulation to which the new face belongs. |
|
inline |
Returns the last appearance of this face within a top-dimensional simplex of the underlying triangluation.
This is equivalent to calling embedding(degree()-1)
.
In most cases, the ordering of appearances is arbitrary. The exception is for codimension 2, where the appearances of a face are ordered in a way that follows the link around the face (which in codimension 2 is always a path or a cycle). In particular, for a boundary face of codimension 2, both front() and back() will refer to the two appearances of this face on the (dim-1)-dimensional boundary.
|
inline |
A begin function for iterating through all appearances of this face within the various top-dimensional simplices of the underlying triangulation.
In most cases, the ordering of appearances is arbitrary. The exception is for codimension 2, where these appearances are ordered in a way that follows the link around the face (which in codimension 2 is always a path or a cycle).
An iteration from begin() to end() will run through degree() appearances in total.
The type that is returned will be a lightweight iterator type, guaranteed to satisfy the C++ LegacyRandomAccessIterator requirement. The precise C++ type of the iterator is subject to change, so C++ users should use auto
(just like this declaration does).
Iterating from begin() to end() (that is, iterating directly over a face) is equivalent to iterating over embeddings(). Iterating directly over a face generates a tiny bit less overhead, but you may also find it to be less readable. In particular, the following three blocks of code are all equivalent:
|
inline |
Returns the boundary component of the triangulation to which this face belongs.
See the note in the BoundaryComponent overview regarding what happens if the link of the face itself has more than one boundary component. Note that such a link makes both the face and the underlying triangulation invalid.
For dimensions in which ideal and/or invalid vertices are both possible and recognised: an ideal vertex will have its own individual boundary component to which it belongs, and so will an invalid vertex boundary component if the invalid vertex does not already belong to some real boundary component.
null
if this face does not lie entirely within the boundary of the triangulation.
|
inline |
Returns the component of the triangulation to which this face belongs.
|
staticconstexprinherited |
Tests whether the given subdim-face of a dim-dimensional simplex contains the given vertex of the simplex.
face | a subdim-face number in a dim-simplex; this must be between 0 and (dim+1 choose subdim+1)-1 inclusive. |
vertex | a vertex number in a dim-simplex; this must be between 0 and dim inclusive. |
true
if and only if the given subdim-face contains the given vertex.
|
inline |
Returns the degree of this face.
This is the number of different ways in which the face appears within the various top-dimensional simplices of the underlying triangulation.
Note that if this face appears multiple times within the same top-dimensional simplex, then it will be counted multiple times by this routine.
|
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 |
|
inline |
A dimension-specific alias for faceMapping<1>().
This alias is available for all facial dimensions subdim.
See faceMapping() for further information.
|
inline |
Returns one of the ways in which this face appears within a top-dimensional simplex of the underlying triangluation.
For convenience, you can also use begin() and end() to iterate through all such appearances, or equivalently you can iterate over the lightweight object returned by embeddings().
In most cases, the ordering of appearances is arbitrary. The exception is for codimension 2, where these appearances are ordered in a way that follows the link around the face (which in codimension 2 is always a path or a cycle).
index | the index of the requested appearance. This must be between 0 and degree()-1 inclusive. |
|
inline |
Returns an object that allows iteration through and random access to all of the ways in which this face appears within a top-dimensional simplex of the underlying triangluation.
The object that is returned is lightweight, and can be happily copied by value. The C++ type of the object is subject to change, so C++ users should use auto
(just like this declaration does).
The returned object is guaranteed to be an instance of ListView, which means it offers basic container-like functions and supports C++11 range-based for
loops. The elements of the list will be read-only objects of type FaceEmbedding<dim, subdim>. For example, your code might look like:
In most cases, the ordering of appearances is arbitrary. The exception is for codimension 2, where these appearances are ordered in a way that follows the link around the face (which in codimension 2 is always a path or a cycle).
Using embeddings() is equivalent to iterating over the face itself. It generates a tiny amount of extra overhead, but also may be considered more readable. In particular, the code above is equivalent to both of the following alternatives:
|
inline |
An end function for iterating through all appearances of this face within the various top-dimensional simplices of the underlying triangulation.
See begin() for full details on how this iteration works, and what other alternatives are available.
The type that is returned will be a lightweight iterator type, guaranteed to satisfy the C++ LegacyRandomAccessIterator requirement. The precise C++ type of the iterator is subject to change, so C++ users should use auto
(just like this declaration does).
|
inline |
Returns the lowerdim-face of the underlying triangulation that appears as the given lowerdim-dimensional subface of this face.
The argument face must represent a lowerdim-face number within a subdim-simplex. This lowerdim-face number will be interpreted with respect to the inherent labelling (0, ..., subdim) of the vertices of this subdim-face. See FaceEmbedding<dim, subdim>::vertices() for details on how these map to the vertex numbers of the dim-dimensional simplices that contain this face in the overall triangulation.
See FaceNumbering<subdim, lowerdim> for the conventions of how lowerdim-faces are numbered within a subdim-simplex.
face(lowerdim, face)
; that is, the template parameter lowerdim becomes the first argument of the function.face | the lowerdim-face of this subdim-face to examine. This should be between 0 and (subdim+1 choose lowerdim+1)-1 inclusive. |
Perm< dim+1 > regina::detail::FaceBase< dim, subdim >::faceMapping | ( | int | face | ) | const |
Examines the given lowerdim-dimensional subface of this face, and returns the mapping between the underlying lowerdim-face of the triangulation and the individual vertices of this face.
The argument face must represent a lowerdim-face number within a subdim-simplex. This lowerdim-face number will be interpreted with respect to the inherent labelling (0, ..., subdim) of the vertices of this subdim-face. See FaceEmbedding<dim, subdim>::vertices() for details on how these map to the vertex numbers of the dim-dimensional simplices that contain this face in the overall triangulation.
Let F denote this subdim-face of the triangulation, and let L denote the lowerdim-face of the triangulation that corresponds to the given subface of F. Then the permutation returned by this routine maps the vertex numbers (0, ..., lowerdim) of L to the corresponding vertex numbers of F. This is with respect to the inherent labellings (0, ..., lowerdim) and (0, ..., subdim) of the vertices of L and F respectively.
In particular, if this routine returns the permutation p, then the images p[0,...,lowerdim] will be some permutation of the vertices Face<subdim, lowerdim>::ordering(face)[0,...,lowerdim].
This routine differs from Simplex<dim>::faceMapping<lowerdim>() in how it handles the images of (lowerdim+1, ..., dim):
See FaceNumbering<subdim, lowerdim> for the conventions of how lowerdim-faces are numbered within a subdim-simplex.
faceMapping(lowerdim, face)
; that is, the template parameter lowerdim becomes the first argument of the function.face | the lowerdim-face of this subdim-face to examine. This should be between 0 and (subdim+1 choose lowerdim+1)-1 inclusive. |
|
staticconstexprinherited |
Identifies which subdim-face in a dim-dimensional simplex is represented by the first (subdim + 1) elements of the given permutation.
In other words, this routine identifies which subdim-face number within a dim-dimensional simplex spans vertices vertices[0, ..., subdim]
.
vertices | a permutation whose first (subdim + 1) elements represent some vertex numbers in a dim-simplex. |
|
inline |
Returns the first appearance of this face within a top-dimensional simplex of the underlying triangluation.
This is equivalent to calling *begin()
, or embedding(0)
.
In most cases, the ordering of appearances is arbitrary. The exception is for codimension 2, where the appearances of a face are ordered in a way that follows the link around the face (which in codimension 2 is always a path or a cycle). In particular, for a boundary face of codimension 2, both front() and back() will refer to the two appearances of this face on the (dim-1)-dimensional boundary.
|
inline |
Determines if this face is identified with itself under a non-identity permutation.
For example, if this face is an edge then this routine tests whether the edge is identified with itself in reverse.
Such a face will always be marked as invalid. Note that, for standard dimensions dim, there are other types of invalid faces also. See isValid() for a full discussion of what it means for a face to be valid.
true
if and only if this face is identified with itself under a non-identity permutation.
|
inline |
Determines if this face does not have an appropriate link.
See condition (2) in the documentation for isValid() for a full description of what "appropriate" means.
A face whose link is not appropriate will always be marked as invalid. Note that there are other types of invalid faces also. See isValid() for a full discussion of what it means for a face to be valid.
true
if the link of this face is not appropriate (thereby making the face invalid), or false
if the link is appropriate.
|
inline |
Returns the index of this face within the underlying triangulation.
|
inline |
Determines whether a codimension-1-face represents a dual edge in the maximal forest that has been chosen for the dual 1-skeleton of the triangulation.
This routine is only available for faces of codimension 1; that is, (dim-1)-faces of a dim-dimensional triangulation.
When the skeletal structure of a triangulation is first computed, a maximal forest in the dual 1-skeleton of the triangulation is also constructed. Each dual edge in this maximal forest represents a (dim-1)-face of the (primal) triangulation.
This maximal forest will remain fixed until the triangulation changes, at which point it will be recomputed (as will all other skeletal objects, such as connected components and so on). There is no guarantee that, when it is recomputed, the maximal forest will use the same dual edges as before.
This routine identifies whether this (dim-1)-face belongs to the dual forest. In this sense it performs a similar role to Simplex::facetInMaximalForest(), but this routine is typically easier to use.
If the skeleton has already been computed, then this routine is very fast (since it just returns a precomputed answer).
true
if and only if this (dim-1)-face represents a dual edge in the maximal forest.
|
inline |
Determines if this face lies entirely on the boundary of the triangulation.
For dimensions in which ideal and/or invalid vertices are both possible and recognised: both ideal and invalid vertices are considered to be on the boundary.
true
if and only if this face lies on the boundary.
|
inline |
Determines if the link of this face is orientable.
This routine is fast: it uses pre-computed information, and does not need to build a full triangulation of the link.
true
if and only if the link is orientable.
|
inline |
Determines if this face is valid.
There are several conditions that might make a subdim-face of a dim-dimensional triangulation invalid:
Condition (1) is tested for all dimensions subdim and dim. Condition (2) is more difficult, since it relies on undecidable problems. As a result, (2) is only tested when dim is one of Regina's standard dimensions.
If this face is invalid, then it is possible to find out why. In non-standard dimensions, this must mean that the face fails condition (1) above. In standard dimensions, you can call the functions hasBadIdentification() and/or hasBadLink() to determine whether the failure is due to conditions (1) or (2) respectively.
true
if and only if this face is valid according to both conditions (1) and (2) above; for non-standard dimensions dim, returns true
if and only if this face is valid according to condition (1).
|
inlineinherited |
Returns the index at which this object is stored in an MarkedVector.
If this object does not belong to an MarkedVector, the return value is undefined.
|
staticconstexprinherited |
Given a subdim-face number within a dim-dimensional simplex, returns the corresponding canonical ordering of the simplex vertices.
If this canonical ordering is c, then c[0,...,subdim] will be the vertices of the given face in increasing numerical order. That is, c[0] < ... < c[subdim]. The remaining images c[(subdim + 1),...,dim] will be ordered arbitrarily.
Note that this is not the same permutation as returned by Simplex<dim>::faceMapping<subdim>():
face | identifies which subdim-face of a dim-dimensional simplex to query. This must be between 0 and (dim+1 choose subdim+1)-1 inclusive. |
|
inline |
|
inline |
A dimension-specific alias for faceMapping<4>().
This alias is available for facial dimensions subdim ≥ 5.
See faceMapping() for further information.
|
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.
|
inline |
|
inline |
A dimension-specific alias for faceMapping<3>().
This alias is available for facial dimensions subdim ≥ 4.
See faceMapping() for further information.
|
inline |
|
inline |
A dimension-specific alias for faceMapping<2>().
This alias is available for facial dimensions subdim ≥ 3.
See faceMapping() for further information.
|
inline |
Returns the triangulation to which this face belongs.
|
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 |
|
inline |
A dimension-specific alias for faceMapping<0>().
This alias is available for all facial dimensions subdim.
See faceMapping() for further information.
|
inlineinherited |
A default implementation for detailed output.
This routine simply calls T::writeTextShort() and appends a final newline.
out | the output stream to which to write. |
void regina::detail::FaceBase< dim, subdim >::writeTextShort | ( | std::ostream & | out | ) | const |
Writes a short text representation of this object to the given output stream.
The class Face<dim, subdim> may safely override this function, since the output routines cast down to Face<dim, subdim> before calling it.
out | the output stream to which to write. |
|
staticconstexpr |
Indicates whether it is possible for a face of this dimension to be invalid.
|
staticconstexpr |
Indicates whether it is possible for a face of this dimension to have a non-orientable link.
|
staticconstexpr |
A compile-time constant that gives the dimension of the triangulation containing this face.
|
staticconstexprprotectedinherited |
Whichever of subdim or oppositeDim uses lexicographical face numbering.
|
staticconstexprinherited |
true
if faces are numbered in lexicographical order according to their vertices, or false
if faces are numbered in reverse lexicographical order.
|
staticconstexprinherited |
The total number of subdim-dimensional faces in each dim-dimensional simplex.
|
staticconstexprinherited |
The dimension of the faces opposite these in a top-dimensional simplex of a dim-dimensional triangulation.
|
staticconstexpr |
A compile-time constant that gives the dimension of this face.