Regina Calculation Engine
Public Member Functions | Protected Member Functions | List of all members
regina::detail::FaceStorage< dim, codim > Class Template Reference


Helper class for storing all the ways in which a given face of codimension codim in a dim-dimensional triangulation appears within the various top-dimensional simplices. More...

#include <triangulation/detail/face.h>

Public Member Functions

size_t degree () const
 Returns the degree of this face. More...
 
const FaceEmbedding< dim, dim - codim > & 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...
 
std::vector< FaceEmbedding< dim, dim - codim > >::const_iterator begin () const
 
A begin function for iterating through all appearances of this face within the various top-dimensional simplices of the underlying triangulation. More...
 
std::vector< FaceEmbedding< dim, dim - codim > >::const_iterator 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, dim - codim > & front () const
 Returns the first appearance of this face within a top-dimensional simplex of the underlying triangluation. More...
 
const FaceEmbedding< dim, dim - codim > & 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...
 
 FaceStorage (const FaceStorage &)=delete
 
FaceStorageoperator= (const FaceStorage &)=delete
 

Protected Member Functions

 FaceStorage ()=default
 Default constructor that leaves the list of embeddings empty. More...
 
void push_back (const FaceEmbedding< dim, dim - codim > &emb)
 Internal routine to help build the skeleton of a triangulation. More...
 

Detailed Description

template<int dim, int codim>
class regina::detail::FaceStorage< dim, codim >


Helper class for storing all the ways in which a given face of codimension codim in a dim-dimensional triangulation appears within the various top-dimensional simplices.

In essence, this class provides the data structures which which a Face object stores its list of corresponding FaceEmbedding objects. All the routines in this class are inherited by Face, and so end users should not need to refer to FaceStorage directly.

The reason these data structrues belong to a separate class FaceStorage (as opposed to be being integrated directly into Face or FaceBase) is so that Regina can use different data structures for different codimensions.

See the Face and FaceEmbedding template class notes for further information.

Warning
The second template parameter is the codimension of the face, not the dimension of the face. This means that Face<dim, subdim> inherits from FaceStorage<dim, dim - codim>. This inconsistency arises because it is the codimension of the face that determines what data structures we use.
Python
This base class is not present, but the "end user" class Face<dim, subdim> is.
Template Parameters
dimthe dimension of the underlying triangulation. This must be between 2 and 15 inclusive.
codimthe codimension of the faces of the underlying triangulation. This must be between 1 and dim inclusive.

Constructor & Destructor Documentation

◆ FaceStorage()

template<int dim, int codim>
regina::detail::FaceStorage< dim, codim >::FaceStorage ( )
protecteddefault

Default constructor that leaves the list of embeddings empty.

Member Function Documentation

◆ back()

template<int dim, int codim>
const FaceEmbedding< dim, dim - codim > & regina::detail::FaceStorage< dim, codim >::back ( ) const
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.

Returns
details of the last appearance.

◆ begin()

template<int dim, int codim>
std::vector< FaceEmbedding< dim, dim - codim > >::const_iterator regina::detail::FaceStorage< dim, codim >::begin ( ) const
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.

Python
Not present. However, Python users can call the Python-only routine embeddings(), which will return all appearances (from begin() through to end()) in a Python sequence.
Returns
a iterator that points to the first appearance.

◆ degree()

template<int dim, int codim>
size_t regina::detail::FaceStorage< dim, codim >::degree ( ) const
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.

Returns
the degree of this face.

◆ embedding()

template<int dim, int codim>
const FaceEmbedding< dim, dim - codim > & regina::detail::FaceStorage< dim, codim >::embedding ( size_t  index) const
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.

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).

Parameters
indexthe index of the requested appearance. This must be between 0 and degree()-1 inclusive.
Returns
details of the requested appearance.

◆ end()

template<int dim, int codim>
std::vector< FaceEmbedding< dim, dim - codim > >::const_iterator regina::detail::FaceStorage< dim, codim >::end ( ) const
inline


An end 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.

Python
Not present. However, Python users can call the Python-only routine embeddings(), which will return all appearances (from begin() through to end()) in a Python sequence.
Returns
a "beyond the end" iterator that comes immediately after the last appearance.

◆ front()

template<int dim, int codim>
const FaceEmbedding< dim, dim - codim > & regina::detail::FaceStorage< dim, codim >::front ( ) const
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.

Returns
details of the first appearance.

◆ inMaximalForest()

template<int dim, int codim>
bool regina::detail::FaceStorage< dim, codim >::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.

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).

Returns
true if and only if this (dim-1)-face represents a dual edge in the maximal forest.

◆ push_back()

template<int dim, int codim>
void regina::detail::FaceStorage< dim, codim >::push_back ( const FaceEmbedding< dim, dim - codim > &  emb)
inlineprotected

Internal routine to help build the skeleton of a triangulation.

This routine pushes the given object onto the end of the internal list of appearances of this face within top-dimensional simplices.

Parameters
embthe appearance to push onto the end of the internal list.

The documentation for this class was generated from the following file:

Copyright © 1999-2021, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).