regina::SnapPeaTriangulation Class Referenceabstract
SnapPea Triangulations

Offers direct access to the SnapPea kernel from within Regina. More...

`#include <snappea/snappeatriangulation.h>`

Inheritance diagram for regina::SnapPeaTriangulation:

## Public Types

enum | SolutionType { not_attempted, geometric_solution, nongeometric_solution, flat_solution, degenerate_solution, other_solution, no_solution, externally_computed }
| Describes the different types of solution that can be found when solving for a hyperbolic structure. More...
typedef std::vector< Tetrahedron< 3 > * >::const_iterator | TetrahedronIterator
| A dimension-specific alias for SimplexIterator, used to iterate through tetrahedra. More...
typedef FaceList< 3, 2 >::Iterator | TriangleIterator
| Used to iterate through triangles. More...
typedef FaceList< 3, 1 >::Iterator | EdgeIterator
| Used to iterate through edges. More...
typedef FaceList< 3, 0 >::Iterator | VertexIterator
| Used to iterate through vertices. More...
typedef std::map< std::pair< unsigned long, bool >, Cyclotomic > | TuraevViroSet
| A map from (r, parity) pairs to Turaev-Viro invariants, as described by turaevViro(). More...
typedef Packet | SafePointeeType
| The type of object being pointed to. More...
typedef std::vector< Simplex< dim > * >::const_iterator | SimplexIterator
| Used to iterate through top-dimensional simplices. More...
typedef std::vector< Component< dim > * >::const_iterator | ComponentIterator
| Used to iterate through connected components. More...
typedef std::vector< BoundaryComponent< dim > * >::const_iterator | BoundaryComponentIterator
| Used to iterate through boundary components. More...

## Public Member Functions

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...
Constructors and Destructors
| SnapPeaTriangulation ()
| Creates a null triangulation, with no internal SnapPea data at all. More...
| SnapPeaTriangulation (const std::string &fileNameOrContents)
| Creates a new SnapPea triangulation from the contents of SnapPea data file. More...
| SnapPeaTriangulation (const SnapPeaTriangulation &tri)
| Creates a clone of the given SnapPea triangulation. More...
| SnapPeaTriangulation (const Triangulation< 3 > &tri, bool ignored=false)
| Converts the given Regina triangulation to a SnapPea triangulation. More...
| ~SnapPeaTriangulation ()
| Destroys this triangulation. More...
Basic Properties
bool | isNull () const
| Determines whether this triangulation contains valid SnapPea data. More...
std::string | name () const
| Returns SnapPea's internal name for this triangulation. More...
Hyperbolic Structures
SolutionType | solutionType () const
| Returns the type of solution found when solving for a hyperbolic structure, with respect to the current Dehn filling (if any). More...
double | volume () const
| Computes the volume of the current solution to the hyperbolic gluing equations. More...
double | volume (int &precision) const
| Computes the volume of the current solution to the hyperbolic gluing equations, and estimates the accuracy of the answer. More...
bool | volumeZero () const
| Determines whether the current solution to the gluing equations has volume approximately zero. More...
const std::complex< double > & | shape (unsigned tet) const
| Returns the shape of the given tetrahedron, with respect to the Dehn filled hyperbolic structure. More...
double | minImaginaryShape () const
| Returns the minimum imaginary part found amongst all tetrahedron shapes, with respect to the Dehn filled hyperbolic structure. More...
MatrixInt * | gluingEquations () const
| Returns a matrix describing Thurston's gluing equations. More...
MatrixInt * | gluingEquationsRect () const
| Returns a matrix describing Thurston's gluing equations in a streamlined form. More...
Cusps
unsigned | countCusps () const
| Returns the total number of cusps (both filled and complete). More...
unsigned | countCompleteCusps () const
| Returns the total number of complete cusps (that is, unfilled cusps). More...
unsigned | countFilledCusps () const
| Returns the total number of filled cusps. More...
const Cusp * | cusp (unsigned whichCusp=0) const
| Returns information about the given cusp of this manifold. More...
bool | fill (int m, int l, unsigned whichCusp=0)
| Assigns a Dehn filling to the given cusp. More...
void | unfill (unsigned whichCusp=0)
| Removes any filling on the given cusp. More...
Triangulation< 3 > * | filledTriangulation (unsigned whichCusp) const
| Retriangulates to permanently fill the given cusp. More...
Triangulation< 3 > * | filledTriangulation () const
| Retriangulates to permanently fill all non-complete cusps. More...
MatrixInt * | slopeEquations () const
| Returns a matrix for computing boundary slopes of spun-normal surfaces at the cusps of the triangulation. More...
Algebraic Invariants
const AbelianGroup * | homologyFilled () const
| Returns the first homology group of the manifold with respect to the current Dehn filling (if any). More...
const GroupPresentation * | fundamentalGroupFilled (bool simplifyPresentation=true, bool fillingsMayAffectGenerators=true, bool minimiseNumberOfGenerators=true, bool tryHardToShortenRelators=true) const
| Returns the fundamental group of the manifold with respect to the current Dehn filling (if any). More...
Manipulating SnapPea triangulations
SnapPeaTriangulation * | protoCanonize () const
| Constructs the canonical cell decomposition, using an arbitrary retriangulation if this decomposition contains non-tetrahedron cells. More...
SnapPeaTriangulation * | protoCanonise () const
| A synonym for protoCanonize(), which constructs the canonical cell decomposition using an arbitrary retriangulation if necessary. More...
Triangulation< 3 > * | canonize () const
| Constructs the canonical retriangulation of the canonical cell decomposition. More...
Triangulation< 3 > * | canonise () const
| A synonym for canonize(), which constructs the canonical retriangulation of the canonical cell decomposition. More...
void | randomize ()
| Asks SnapPea to randomly retriangulate this manifold, using local moves that preserve the topology. More...
void | randomise ()
| A synonym for randomize(), which asks SnapPea to randomly retriangulate this manifold. More...
SnapPea Input and Output
virtual std::string | snapPea () const
| Returns a string containing the full contents of a SnapPea data file that describes this triangulation. More...
virtual void | snapPea (std::ostream &out) const
| Writes the full contents of a SnapPea data file describing this triangulation to the given output stream. More...
virtual bool | saveSnapPea (const char *filename) const
| Writes this triangulation to the given file using SnapPea's native file format. More...
Tetrahedra
Tetrahedron< 3 > * | newTetrahedron ()
| A dimension-specific alias for newSimplex(). More...
Tetrahedron< 3 > * | newTetrahedron (const std::string &desc)
| A dimension-specific alias for newSimplex(). More...
void | removeTetrahedron (Tetrahedron< 3 > *tet)
| A dimension-specific alias for removeSimplex(). More...
void | removeTetrahedronAt (size_t index)
| A dimension-specific alias for removeSimplexAt(). More...
void | removeAllTetrahedra ()
| A dimension-specific alias for removeAllSimplices(). More...
Skeletal Queries
bool | hasTwoSphereBoundaryComponents () const
| Determines if this triangulation contains any two-sphere boundary components. More...
bool | hasNegativeIdealBoundaryComponents () const
| Determines if this triangulation contains any ideal boundary components with negative Euler characteristic. More...
Basic Properties
long | eulerCharManifold () const
| Returns the Euler characteristic of the corresponding compact 3-manifold. More...
bool | isIdeal () const
| Determines if this triangulation is ideal. More...
bool | isStandard () const
| Determines if this triangulation is standard. More...
bool | isClosed () const
| Determines if this triangulation is closed. More...
bool | isOrdered () const
| Determines if this triangulation is ordered; that is, if tetrahedron vertices are labelled so that all gluing permutations are order-preserving on the tetrahedron faces. More...
Algebraic Properties
const AbelianGroup & | homologyRel () const
| Returns the relative first homology group with respect to the boundary for this triangulation. More...
const AbelianGroup & | homologyBdry () const
| Returns the first homology group of the boundary for this triangulation. More...
const AbelianGroup & | homologyH2 () const
| Returns the second homology group for this triangulation. More...
unsigned long | homologyH2Z2 () const
| Returns the second homology group with coefficients in Z_2 for this triangulation. More...
Cyclotomic | turaevViro (unsigned long r, bool parity=true, TuraevViroAlg alg=TV_DEFAULT, ProgressTracker *tracker=0) const
| Computes the given Turaev-Viro state sum invariant of this 3-manifold using exact arithmetic. More...
double | turaevViroApprox (unsigned long r, unsigned long whichRoot=1, TuraevViroAlg alg=TV_DEFAULT) const
| Computes the given Turaev-Viro state sum invariant of this 3-manifold using a fast but inexact floating-point approximation. More...
const TuraevViroSet & | allCalculatedTuraevViro () const
| Returns the cache of all Turaev-Viro state sum invariants that have been calculated for this 3-manifold. More...
Normal Surfaces and Angle Structures
bool | isZeroEfficient ()
| Determines if this triangulation is 0-efficient. More...
bool | knowsZeroEfficient () const
| Is it already known whether or not this triangulation is 0-efficient? See isZeroEfficient() for further details. More...
bool | hasSplittingSurface ()
| Determines whether this triangulation has a normal splitting surface. More...
bool | knowsSplittingSurface () const
| Is it already known whether or not this triangulation has a splitting surface? See hasSplittingSurface() for further details. More...
NormalSurface * | hasNonTrivialSphereOrDisc ()
| Searches for a non-vertex-linking normal sphere or disc within this triangulation. More...
NormalSurface * | hasOctagonalAlmostNormalSphere ()
| Searches for an octagonal almost normal 2-sphere within this triangulation. More...
const AngleStructure * | findStrictAngleStructure () const
| Searches for a strict angle structure on this triangulation. More...
bool | hasStrictAngleStructure () const
| Determines whether this triangulation supports a strict angle structure. More...
bool | knowsStrictAngleStructure () const
| Is it already known (or trivial to determine) whether or not this triangulation supports a strict angle structure? See hasStrictAngleStructure() for further details. More...
Skeletal Transformations
void | maximalForestInBoundary (std::set< Edge< 3 > * > &edgeSet, std::set< Vertex< 3 > * > &vertexSet) const
| Produces a maximal forest in the 1-skeleton of the triangulation boundary. More...
void | maximalForestInSkeleton (std::set< Edge< 3 > * > &edgeSet, bool canJoinBoundaries=true) const
| Produces a maximal forest in the triangulation's 1-skeleton. More...
bool | intelligentSimplify ()
| Attempts to simplify the triangulation using fast and greedy heuristics. More...
bool | simplifyToLocalMinimum (bool perform=true)
| Uses all known simplification moves to reduce the triangulation monotonically to some local minimum number of tetrahedra. More...
bool | simplifyExhaustive (int height=1, unsigned nThreads=1, ProgressTrackerOpen *tracker=0)
| Attempts to simplify this triangulation using a slow but exhaustive search through the Pachner graph. More...
template<typename Action , typename... Args>
bool | retriangulate (int height, unsigned nThreads, ProgressTrackerOpen *tracker, Action &&action, Args &&... args) const
| Explores all triangulations that can be reached from this via Pachner moves, without exceeding a given number of additional tetrahedra. More...
bool | threeTwoMove (Edge< 3 > *e, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a 3-2 move about the given edge. More...
bool | twoThreeMove (Triangle< 3 > *t, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a 2-3 move about the given triangle. More...
bool | oneFourMove (Tetrahedron< 3 > *t, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a 1-4 move upon the given tetrahedron. More...
bool | fourFourMove (Edge< 3 > *e, int newAxis, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a 4-4 move about the given edge. More...
bool | twoZeroMove (Edge< 3 > *e, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a 2-0 move about the given edge of degree 2. More...
bool | twoZeroMove (Vertex< 3 > *v, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a 2-0 move about the given vertex of degree 2. More...
bool | twoOneMove (Edge< 3 > *e, int edgeEnd, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a 2-1 move about the given edge. More...
bool | openBook (Triangle< 3 > *t, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a book opening move about the given triangle. More...
bool | closeBook (Edge< 3 > *e, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a book closing move about the given boundary edge. More...
bool | shellBoundary (Tetrahedron< 3 > *t, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a boundary shelling move on the given tetrahedron. More...
bool | collapseEdge (Edge< 3 > *e, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a collapse of an edge in such a way that the topology of the manifold does not change and the number of vertices of the triangulation decreases by one. More...
void | reorderTetrahedraBFS (bool reverse=false)
| Reorders the tetrahedra of this triangulation using a breadth-first search, so that small-numbered tetrahedra are adjacent to other small-numbered tetrahedra. More...
bool | order (bool forceOriented=false)
| Relabels tetrahedron vertices in this triangulation to give an ordered triangulation, if possible. More...
Decompositions
long | connectedSumDecomposition (Packet *primeParent=0, bool setLabels=true)
| Splits this triangulation into its connected sum decomposition. More...
bool | isThreeSphere () const
| Determines whether this is a triangulation of a 3-sphere. More...
bool | knowsThreeSphere () const
| Is it already known (or trivial to determine) whether or not this is a triangulation of a 3-sphere? See isThreeSphere() for further details. More...
bool | isBall () const
| Determines whether this is a triangulation of a 3-dimensional ball. More...
bool | knowsBall () const
| Is it already known (or trivial to determine) whether or not this is a triangulation of a 3-dimensional ball? See isBall() for further details. More...
Packet * | makeZeroEfficient ()
| Converts this into a 0-efficient triangulation of the same underlying 3-manifold. More...
bool | isSolidTorus () const
| Determines whether this is a triangulation of the solid torus; that is, the unknot complement. More...
bool | knowsSolidTorus () const
| Is it already known (or trivial to determine) whether or not this is a triangulation of a solid torus (that is, the unknot complement)? See isSolidTorus() for further details. More...
bool | isIrreducible () const
| Determines whether the underlying 3-manifold (which must be closed) is irreducible. More...
bool | knowsIrreducible () const
| Is it already known (or trivial to determine) whether or not the underlying 3-manifold is irreducible? See isIrreducible() for further details. More...
bool | hasCompressingDisc () const
| Searches for a compressing disc within the underlying 3-manifold. More...
bool | knowsCompressingDisc () const
| Is it already known (or trivial to determine) whether or not the underlying 3-manifold contains a compressing disc? See hasCompressingDisc() for further details. More...
bool | isHaken () const
| Determines whether the underlying 3-manifold (which must be closed and orientable) is Haken. More...
bool | knowsHaken () const
| Is it already known (or trivial to determine) whether or not the underlying 3-manifold is Haken? See isHaken() for further details. More...
bool | hasSimpleCompressingDisc () const
| Searches for a "simple" compressing disc inside this triangulation. More...
const TreeDecomposition & | niceTreeDecomposition () const
| Returns a nice tree decomposition of the face pairing graph of this triangulation. More...
Subdivisions, Extensions and Covers
bool | idealToFinite ()
| Converts an ideal triangulation into a finite triangulation. More...
void | drillEdge (Edge< 3 > *e)
| Drills out a regular neighbourhood of the given edge of the triangulation. More...
void | puncture (Tetrahedron< 3 > *tet=0)
| Punctures this manifold by removing a 3-ball from the interior of the given tetrahedron. More...
Building Triangulations
Tetrahedron< 3 > * | layerOn (Edge< 3 > *edge)
| Performs a layering upon the given boundary edge of the triangulation. More...
Tetrahedron< 3 > * | insertLayeredSolidTorus (unsigned long cuts0, unsigned long cuts1)
| Inserts a new layered solid torus into the triangulation. More...
void | insertLayeredLensSpace (unsigned long p, unsigned long q)
| Inserts a new layered lens space L(p,q) into the triangulation. More...
void | insertLayeredLoop (unsigned long length, bool twisted)
| Inserts a layered loop of the given length into this triangulation. More...
void | insertAugTriSolidTorus (long a1, long b1, long a2, long b2, long a3, long b3)
| Inserts an augmented triangular solid torus with the given parameters into this triangulation. More...
void | insertSFSOverSphere (long a1=1, long b1=0, long a2=1, long b2=0, long a3=1, long b3=0)
| Inserts an orientable Seifert fibred space with at most three exceptional fibres over the 2-sphere into this triangulation. More...
void | connectedSumWith (const Triangulation &other)
| Forms the connected sum of this triangulation with the given triangulation. More...
bool | insertRehydration (const std::string &dehydration)
| Inserts the rehydration of the given string into this triangulation. More...
Exporting Triangulations
std::string | dehydrate () const
| Dehydrates this triangulation into an alphabetical string. More...
std::string | recogniser () const
| Returns a string that expresses this triangulation in Matveev's 3-manifold recogniser format. More...
void | recogniser (std::ostream &out) const
| Writes a string expressing this triangulation in Matveev's 3-manifold recogniser format to the given output stream. More...
std::string | recognizer () const
| A synonym for recogniser(). More...
void | recognizer (std::ostream &out) const
| A synonym for recognizer(std::ostream&). More...
bool | saveRecogniser (const char *filename) const
| Writes this triangulation to the given file in Matveev's 3-manifold recogniser format. More...
bool | saveRecognizer (const char *filename) const
| A synonym for saveRecogniser(). More...
Packet Identification
virtual PacketType | type () const =0
| Returns the unique integer ID representing this type of packet. More...
virtual std::string | typeName () const =0
| Returns an English name for this type of packet. More...
const std::string & | label () const
| Returns the label associated with this individual packet. More...
std::string | humanLabel () const
| Returns the label associated with this individual packet, adjusted if necessary for human-readable output. More...
std::string | adornedLabel (const std::string &adornment) const
| Returns the label of this packet adorned with the given string. More...
void | setLabel (const std::string &label)
| Sets the label associated with this individual packet. More...
std::string | fullName () const
| Returns a descriptive text string for the packet. More...
Tags
bool | hasTag (const std::string &tag) const
| Determines whether this packet has the given associated tag. More...
bool | hasTags () const
| Determines whether this packet has any associated tags at all. More...
bool | addTag (const std::string &tag)
| Associates the given tag with this packet. More...
bool | removeTag (const std::string &tag)
| Removes the association of the given tag with this packet. More...
void | removeAllTags ()
| Removes all associated tags from this packet. More...
const std::set< std::string > & | tags () const
| Returns the set of all tags associated with this packet. More...
Event Handling
bool | listen (PacketListener *listener)
| Registers the given packet listener to listen for events on this packet. More...
bool | isListening (PacketListener *listener)
| Determines whether the given packet listener is currently listening for events on this packet. More...
bool | unlisten (PacketListener *listener)
| Unregisters the given packet listener so that it no longer listens for events on this packet. More...
Tree Queries
Packet * | parent () const
| Determines the parent packet in the tree structure. More...
Packet * | firstChild () const
| Determines the first child of this packet in the tree structure. More...
Packet * | lastChild () const
| Determines the last child of this packet in the tree structure. More...
Packet * | nextSibling () const
| Determines the next sibling of this packet in the tree structure. More...
Packet * | prevSibling () const
| Determines the previous sibling of this packet in the tree structure. More...
Packet * | root () const
| Determines the root of the tree to which this packet belongs. More...
unsigned | levelsDownTo (const Packet *descendant) const
| Counts the number of levels between this packet and its given descendant in the tree structure. More...
unsigned | levelsUpTo (const Packet *ancestor) const
| Counts the number of levels between this packet and its given ancestor in the tree structure. More...
bool | isGrandparentOf (const Packet *descendant) const
| Determines if this packet is equal to or an ancestor of the given packet in the tree structure. More...
size_t | countChildren () const
| Returns the number of immediate children of this packet. More...
size_t | countDescendants () const
| Returns the total number of descendants of this packet. More...
size_t | totalTreeSize () const
| Determines the total number of packets in the tree or subtree for which this packet is matriarch. More...
Tree Manipulation
void | insertChildFirst (Packet *child)
| Inserts the given packet as the first child of this packet. More...
void | insertChildLast (Packet *child)
| Inserts the given packet as the last child of this packet. More...
void | insertChildAfter (Packet *newChild, Packet *prevChild)
| Inserts the given packet as a child of this packet at the given location in this packet's child list. More...
void | makeOrphan ()
| Cuts this packet away from its parent in the tree structure and instead makes it matriarch of its own tree. More...
void | reparent (Packet *newParent, bool first=false)
| Cuts this packet away from its parent in the tree structure, and inserts it as a child of the given packet instead. More...
void | transferChildren (Packet *newParent)
| Cuts all of this packet's children out of the packet tree, and reinserts them as children of the given packet instead. More...
void | swapWithNextSibling ()
| Swaps this packet with its next sibling in the sequence of children beneath their common parent packet. More...
void | moveUp (unsigned steps=1)
| Moves this packet the given number of steps towards the beginning of its sibling list. More...
void | moveDown (unsigned steps=1)
| Moves this packet the given number of steps towards the end of its sibling list. More...
void | moveToFirst ()
| Moves this packet to be the first in its sibling list. More...
void | moveToLast ()
| Moves this packet to be the last in its sibling list. More...
void | sortChildren ()
| Sorts the immediate children of this packet according to their packet labels. More...
Searching and Iterating
Packet * | nextTreePacket ()
| Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs. More...
const Packet * | nextTreePacket () const
| Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs. More...
Packet * | nextTreePacket (const std::string &type)
| Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure. More...
const Packet * | nextTreePacket (const std::string &type) const
| Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure. More...
Packet * | firstTreePacket (const std::string &type)
| Finds the first packet of the requested type in a complete depth-first iteration of the tree structure. More...
const Packet * | firstTreePacket (const std::string &type) const
| Finds the first packet of the requested type in a complete depth-first iteration of the tree structure. More...
Packet * | findPacketLabel (const std::string &label)
| Finds the packet with the requested label in the tree or subtree for which this packet is matriarch. More...
const Packet * | findPacketLabel (const std::string &label) const
| Finds the packet with the requested label in the tree or subtree for which this packet is matriarch. More...
Packet Dependencies
bool | isPacketEditable () const
| Determines whether this packet can be altered without invalidating or otherwise upsetting any of its immediate children. More...
Cloning
Packet * | clone (bool cloneDescendants=false, bool end=true) const
| Clones this packet (and possibly its descendants), assigns to it a suitable unused label and inserts the clone into the tree as a sibling of this packet. More...
Simplices
size_t | size () const
| Returns the number of top-dimensional simplices in the triangulation. More...
const std::vector< Simplex< dim > * > & | simplices () const
| Returns all top-dimensional simplices in the triangulation. More...
Simplex< dim > * | simplex (size_t index)
| Returns the top-dimensional simplex at the given index in the triangulation. More...
const Simplex< dim > * | simplex (size_t index) const
| Returns the top-dimensional simplex at the given index in the triangulation. More...
Simplex< dim > * | newSimplex ()
| Creates a new top-dimensional simplex and adds it to this triangulation. More...
Simplex< dim > * | newSimplex (const std::string &desc)
| Creates a new top-dimensional simplex with the given description and adds it to this triangulation. More...
void | removeSimplex (Simplex< dim > *simplex)
| Removes the given top-dimensional simplex from this triangulation. More...
void | removeSimplexAt (size_t index)
| Removes the top-dimensional simplex at the given index in this triangulation. More...
void | removeAllSimplices ()
| Removes all simplices from the triangulation. More...
void | swapContents (Triangulation< dim > &other)
| Swaps the contents of this and the given triangulation. More...
void | moveContentsTo (Triangulation< dim > &dest)
| Moves the contents of this triangulation into the given destination triangulation, without destroying any pre-existing contents. More...
Skeletal Queries
size_t | countComponents () const
| Returns the number of connected components in this triangulation. More...
size_t | countBoundaryComponents () const
| Returns the number of boundary components in this triangulation. More...
size_t | countFaces () const
| Returns the number of subdim-faces in this triangulation. More...
std::vector< size_t > | fVector () const
| Returns the f-vector of this triangulation, which counts the number of faces of all dimensions. More...
const std::vector< Component< dim > * > & | components () const
| Returns all connected components of this triangulation. More...
const std::vector< BoundaryComponent< dim > * > & | boundaryComponents () const
| Returns all boundary components of this triangulation. More...
const FaceList< dim, subdim > & | faces () const
| Returns an object that allows iteration through and random access to all subdim-faces of this triangulation. More...
Component< dim > * | component (size_t index) const
| Returns the requested connected component of this triangulation. More...
BoundaryComponent< dim > * | boundaryComponent (size_t index) const
| Returns the requested boundary component of this triangulation. More...
Face< dim, subdim > * | face (size_t index) const
| Returns the requested subdim-face of this triangulation. More...
Basic Properties
bool | isEmpty () const
| Determines whether this triangulation is empty. More...
bool | isValid () const
| Determines if this triangulation is valid. More...
bool | hasBoundaryFacets () const
| Determines if this triangulation has any boundary facets. More...
size_t | countBoundaryFacets () const
| Returns the total number of boundary facets in this triangulation. More...
bool | isOrientable () const
| Determines if this triangulation is orientable. More...
bool | isConnected () const
| Determines if this triangulation is connected. More...
bool | isOriented () const
| Determines if this triangulation is oriented; that is, if the vertices of its top-dimensional simplices are labelled in a way that preserves orientation across adjacent facets. More...
long | eulerCharTri () const
| Returns the Euler characteristic of this triangulation. More...
Algebraic Properties
const GroupPresentation & | fundamentalGroup () const
| Returns the fundamental group of this triangulation. More...
void | simplifiedFundamentalGroup (GroupPresentation *newGroup)
| Notifies the triangulation that you have simplified the presentation of its fundamental group. More...
const AbelianGroup & | homology () const
| Returns the first homology group for this triangulation. More...
const AbelianGroup & | homologyH1 () const
| Returns the first homology group for this triangulation. More...
Skeletal Transformations
void | orient ()
| Relabels the vertices of top-dimensional simplices in this triangulation so that all simplices are oriented consistently, if possible. More...
Subdivisions, Extensions and Covers
void | makeDoubleCover ()
| Converts this triangulation into its double cover. More...
void | barycentricSubdivision ()
| Does a barycentric subdivision of the triangulation. More...
bool | finiteToIdeal ()
| Converts each real boundary component into a cusp (i.e., an ideal vertex). More...
Decompositions
size_t | splitIntoComponents (Packet *componentParent=0, bool setLabels=true)
| Splits a disconnected triangulation into many smaller triangulations, one for each component. More...
Isomorphism Testing
bool | isIdenticalTo (const Triangulation< dim > &other) const
| Determines if this triangulation is combinatorially identical to the given triangulation. More...
std::unique_ptr< Isomorphism< dim > > | isIsomorphicTo (const Triangulation< dim > &other) const
| Determines if this triangulation is combinatorially isomorphic to the given triangulation. More...
std::unique_ptr< Isomorphism< dim > > | isContainedIn (const Triangulation< dim > &other) const
| Determines if an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components). More...
size_t | findAllIsomorphisms (const Triangulation< dim > &other, OutputIterator output) const
| Finds all ways in which this triangulation is combinatorially isomorphic to the given triangulation. More...
size_t | findAllSubcomplexesIn (const Triangulation< dim > &other, OutputIterator output) const
| Finds all ways in which an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components). More...
bool | makeCanonical ()
| Relabel the top-dimensional simplices and their vertices so that this triangulation is in canonical form. More...
Building Triangulations
void | insertTriangulation (const Triangulation< dim > &source)
| Inserts a copy of the given triangulation into this triangulation. More...
void | insertConstruction (size_t nSimplices, const int adjacencies[][dim+1], const int gluings[][dim+1][dim+1])
| Inserts a given triangulation into this triangulation, where the given triangulation is described by a pair of integer arrays. More...
Exporting Triangulations
std::string | isoSig (Isomorphism< dim > **relabelling=0) const
| Constructs the isomorphism signature for this triangulation. More...
std::string | dumpConstruction () const
| Returns C++ code that can be used with insertConstruction() to reconstruct this triangulation. More...
Packet Listener Interface
void | unregisterFromAllPackets ()
| Unregisters this listener from any packets to which it is currently listening. More...
virtual void | packetToBeChanged (Packet *packet)
| Called before the contents of the packet are to be changed. More...
virtual void | packetToBeRenamed (Packet *packet)
| Called before the packet label or tags are to be changed. More...
virtual void | packetWasRenamed (Packet *packet)
| Called after the packet label or tags have been changed. More...
virtual void | packetToBeDestroyed (Packet *packet)
| Called before the packet is about to be destroyed. More...
virtual void | childToBeAdded (Packet *packet, Packet *child)
| Called before a child packet is to be inserted directly beneath the packet. More...
virtual void | childWasAdded (Packet *packet, Packet *child)
| Called after a child packet has been inserted directly beneath the packet. More...
virtual void | childToBeRemoved (Packet *packet, Packet *child, bool inParentDestructor)
| Called before a child packet is to be removed from directly beneath the packet. More...
virtual void | childWasRemoved (Packet *packet, Packet *child, bool inParentDestructor)
| Called after a child packet has been removed from directly beneath the packet. More...
virtual void | childrenToBeReordered (Packet *packet)
| Called before the child packets directly beneath the packet are to be reordered. More...
virtual void | childrenWereReordered (Packet *packet)
| Called after the child packets directly beneath the packet have been reordered. More...
virtual void | childToBeRenamed (Packet *packet, Packet *child)
| Called before one of this packet's immediate children has its label or tags changed. More...
virtual void | childWasRenamed (Packet *packet, Packet *child)
| Called after one of this packet's immediate children has its label or tags changed. More...

## Static Public Member Functions

SnapPea kernel messages
static bool | kernelMessagesEnabled ()
| Returns whether or not the SnapPea kernel writes diagnostic messages to standard output. More...
static void | enableKernelMessages (bool enabled=true)
| Configures whether or not the SnapPea kernel should write diagnostic messages to standard output. More...
static void | disableKernelMessages ()
| Specifies that the SnapPea kernel should not write diagnostic messages to standard output. More...
Importing Triangulations
static Triangulation< 3 > * | enterTextTriangulation (std::istream &in, std::ostream &out)
| Allows the user to interactively enter a triangulation in plain text. More...
static Triangulation< 3 > * | rehydrate (const std::string &dehydration)
| Rehydrates the given alphabetical string into a new triangulation. More...
static Triangulation< 3 > * | fromSnapPea (const std::string &snapPeaData)
| Extracts the tetrahedron gluings from a string that contains the full contents of a SnapPea data file. More...

## Static Public Attributes

static constexpr int | dimension
| A compile-time constant that gives the dimension of the triangulation. More...

## Protected Types

typedef std::vector< Face< dim, subdim > * >::const_iterator | Iterator
| An iterator type for iterating through this list of faces. More...

## Protected Member Functions

void | deleteFaces ()
| Deletes all faces of dimension subdim and below. More...
void | swapFaces (FaceListSuite< dim, subdim > &other)
| Swaps all faces of dimension subdim and below with those of the given triangulation. More...
void | fillFVector (std::vector< size_t > &result) const
| Fills the given vector with the first (subdim + 1) elements of the f-vector. More...
bool | sameFVector (const FaceListSuite< dim, subdim > &other) const
| Tests whether this and the given triangulation have the same number of k-faces, for each facial dimension k ≤ subdim. More...
bool | sameDegrees (const FaceListSuite< dim, subdim > &other) const
| Tests whether this and the given triangulation have the same k-face degree sequences, for each facial dimension k ≤ subdim. More...
bool | sameDegrees (const FaceList< dim, subdim > &other) const
| Tests whether this and the given triangulation have the same subdim-face degree sequences. More...
Face< dim, subdim > * | operator[] (size_t index) const
| Returns the requested subdim-face. More...
Iterator | begin () const
| Returns an iterator pointing to the first subdim-face. More...
Iterator | end () const
| Returns an iterator pointing beyond the last subdim-face. More...
void | push_back (Face< dim, subdim > *face)
| Pushes the given face onto the end of this list. More...
void | destroy ()
| Destroys all faces in this list, and clears the list itself. More...
void | swap (FaceList< dim, subdim > &other)
| Swaps all faces in this list with those in the given list. More...

## Protected Attributes

MarkedVector< Simplex< dim > > | simplices_
| The top-dimensional simplices that form the triangulation. More...
MarkedVector< BoundaryComponent< dim > > | boundaryComponents_
| The components that form the boundary of the triangulation. More...
bool | valid_
| Is this triangulation valid? See isValid() for details on what this means. More...

## File I/O

bool | save (const char *filename, bool compressed=true) const
| Saves the subtree rooted at this packet to the given Regina data file, using Regina's native XML file format. More...
bool | save (std::ostream &s, bool compressed=true) const
| Writes the subtree rooted at this packet to the given output stream, in the format of a Regina XML data file. More...
void | writeXMLFile (std::ostream &out) const
| Writes the subtree rooted at this packet to the given output stream in Regina's native XML file format. More...
std::string | internalID () const
| Returns a unique string ID that identifies this packet. More...
bool | hasOwner () const
| Indicates whether some other object in the calculation engine is responsible for ultimately destroying this object. More...
void | writeXMLPacketTree (std::ostream &out) const
| Writes a chunk of XML containing the subtree with this packet as matriarch. More...

## Packet Administration

virtual void | writeTextShort (std::ostream &out) const
| Writes a short text representation of this object to the given output stream. More...
virtual void | writeTextLong (std::ostream &out) const
| Writes a detailed text representation of this object to the given output stream. More...
virtual bool | dependsOnParent () const
| Determines if this packet depends upon its parent. More...
static XMLPacketReader * | xmlReader (Packet *parent, XMLTreeResolver &resolver)

## Packet Listener Interface

class | regina::XMLSnapPeaReader
virtual void | packetWasChanged (Packet *packet)
| Called after the contents of the packet have been changed. More...
virtual Packet * | internalClonePacket (Packet *parent) const
| Makes a newly allocated copy of this packet. More...
virtual void | writeXMLPacketData (std::ostream &out) const
| Writes a chunk of XML containing the data for this packet only. More...

## Importing Triangulations

static Triangulation< dim > * | fromIsoSig (const std::string &sig)
| Recovers a full triangulation from an isomorphism signature. More...
static size_t | isoSigComponentSize (const std::string &sig)
| Deduces the number of top-dimensional simplices in a connected triangulation from its isomorphism signature. More...
void | ensureSkeleton () const
| Ensures that all "on demand" skeletal objects have been calculated. More...
bool | calculatedSkeleton () const
| Determines whether the skeletal objects and properties of this triangulation have been calculated. More...
void | clearBaseProperties ()
| Clears all properties that are managed by this base class. More...
void | swapBaseProperties (TriangulationBase< dim > &other)
| Swaps all properties that are managed by this base class, including skeletal data, with the given triangulation. More...
void | writeXMLBaseProperties (std::ostream &out) const
| Writes a chunk of XML containing properties of this triangulation. More...

## Detailed Description

Offers direct access to the SnapPea kernel from within Regina.

An object of this class represents a 3-manifold triangulation, stored directly in the SnapPea kernel using SnapPea's internal format.

Regarding interaction with the SnapPea kernel:

- This class acts as the sole C/C++ conduit between the Regina calculation engine and Regina's inbuilt version of the SnapPea kernel. Regina should not interact with the SnapPea kernel at the C/C++ level other than through this class.
- Regina can, however, interact with SnapPy at the Python level. Regina's version of the SnapPea kernel lives within a separate namespace (regina::snappea), and so there should be no conflicts between Regina's copy and SnapPy's copy of the SnapPea kernel (which may even be different versions). You can pass triangulations back and forth between Regina and SnapPy using strings that contain the contents of a SnapPea data file (see for instance SnapPeaTriangulation::snapPea()).

Regarding the inherited Triangulation<3> interface:

- You can happily query this object using both SnapPea functions (such as SnapPeaTriangulation::volume(), and others specific to this class) and Regina's native triangulation functions (such as Triangulation<3>::homology(), and others inherited from Triangulation<3>). This is because an object of this class stores two representations of the triangulation (SnapPea's and Regina's), which are always kept in sync.
- However, you may only edit this object using the SnapPea functions specific to this class (such as SnapPeaTriangulation::randomise()). This is essentially because the synchronisation is one-way only (from SnapPea to Regina, but not in the other direction).
- Any attempt to edit this triangulation via the inherited Triangulation<3> interface (for instance, by calling Triangulation<3>::twoThreeMove()) will automatically cause this to become a null triangulation, with no tetrahedra and no SnapPea data at all.

Null triangulations appear more generally when Regina is unable to represent data in SnapPea's native format. You can test for a null triangulation by calling isNull(). Null triangulations can occur for several reasons, such as (but not limited to):

- attempting to build a SnapPea triangulation from a Regina triangulation that is invalid, has boundary faces, or has higher genus vertex links (none of which SnapPea can handle);
- attempting to read a broken SnapPea data file;
- attempting to change a SnapPea triangulation using the inherited Triangulation<3> interface (as discussed above);
- attempting to import a SnapPea triangulation that uses unsupported (e.g., non-integer or non-coprime) filling coefficients, as discussed below).

Regarding fillings: SnapPea can store and manipulate Dehn fillings on cusps, and the SnapPeaTriangulation class respects these where it can (but with restrictions on the possible filling coefficients; see below). However, Regina's own Triangulation<3> class knows nothing about fillings at all. Therefore:

- Routines inherited through the Triangulation<3> interface will ignore fillings completely (so, for instance, homology() will return the first homology of the unfilled manifold, even if SnapPea has designated fillings on the cusps).
- Routines that are defined here in the SnapPeaTriangulation class are generally aware of fillings (so, for instance, homologyFilled() will return the first homology of the filled manifold). See the individual notes for each member function for details on how it handles fillings.

For now, SnapPeaTriangulation only supports the following types of filling coefficients: on orientable cusps the filling coefficients must be coprime integers, and non non-orientable cusps the filling coefficients must be the integers (±1, 0). Any attempt to import a triangulation from a SnapPea file with filling coefficients outside these requirements will result in a null triangulation (as discussed above).

There are many places in the SnapPea kernel where SnapPea throws a fatal error. As of Regina 4.96, these fatal errors are converted into exceptions (subclassed from SnapPeaException), which can be caught and handled politely.

Regina uses the variant of the SnapPea kernel that is shipped with SnapPy (standard precision), as well as some additional code written explicitly for SnapPy. The header regina-config.h includes a macro SNAPPY_VERSION that gives the exact version of SnapPy that is bundled into Regina, and you can query this at runtime by calling Regina's function regina::versionSnapPy().

The SnapPea kernel was originally written by Jeff Weeks. SnapPy, where this kernel is now maintained, is primarily developed by Marc Culler and Nathan Dunfield, with contributions from many people. SnapPy and the corresponding SnapPea kernel are distributed under the terms of the GNU General Public License, version 2 or any later version, as published by the Free Software Foundation.

See http://snappy.computop.org/ for further information on SnapPea and its successor SnapPy.

## Member Typedef Documentation

## BoundaryComponentIterator

typedef std::vector<BoundaryComponent<dim>*>::const_iterator regina::detail::TriangulationBase< dim >::BoundaryComponentIterator

inherited

Used to iterate through boundary components.

## ComponentIterator

typedef std::vector<Component<dim>*>::const_iterator regina::detail::TriangulationBase< dim >::ComponentIterator

inherited

Used to iterate through connected components.

## SafePointeeType

typedef Packet regina::SafePointeeBase< Packet >::SafePointeeType

inherited

The type of object being pointed to.

## SimplexIterator

typedef std::vector<Simplex<dim>*>::const_iterator regina::detail::TriangulationBase< dim >::SimplexIterator

inherited

Used to iterate through top-dimensional simplices.

## Member Function Documentation

## barycentricSubdivision()

void regina::detail::TriangulationBase< dim >::barycentricSubdivision | ( |  | ) |

inherited

Does a barycentric subdivision of the triangulation.

This is done in-place, i.e., the triangulation will be modified directly.

Each top-dimensional simplex s is divided into (dim + 1) factorial sub-simplices by placing an extra vertex at the centroid of every face of every dimension. Each of these sub-simplices t is described by a permutation p of (0, ..., dim). The vertices of such a sub-simplex t are:

- vertex p[0] of s;
- the centre of edge (p[0], p[1]) of s;
- the centroid of triangle (p[0], p[1], p[2]) of s;
- ...
- the centroid of face (p[0], p[1], p[2], p[dim]) of s, which is the entire simplex s itself.

The sub-simplices have their vertices numbered in a way that mirrors the original simplex s:

- vertex p[0] of s will be labelled p[0] in t;
- the centre of edge (p[0], p[1]) of s will be labelled p[1] in t;
- the centroid of triangle (p[0], p[1], p[2]) of s will be labelled p[2] in t;
- ...
- the centroid of s itself will be labelled p[dim] in t.

If simplex s has index i in the original triangulation, then its sub-simplex corresponding to permutation p will have index `((dim + 1)! * i + p.index())` in the resulting triangulation. In other words: sub-simplices are ordered first according to the original simplex that contains them, and then according to the lexicographical ordering of the corresponding permutations p.

Precondition
  dim is one of Regina's standard dimensions. This precondition is a safety net, since in higher dimensions the triangulation would explode too quickly in size (and for the highest dimensions, possibly beyond the limits of `size_t`).

Warning
  In dimensions 3 and 4, both the labelling and ordering of sub-simplices in the subdivided triangulation has changed as of Regina 5.1. (Earlier versions of Regina made no guarantee about the labelling and ordering; these guarantees are also new to Regina 5.1).

## boundaryComponent()

BoundaryComponent< dim > * regina::detail::TriangulationBase< dim >::boundaryComponent | ( | size_t | index | ) | const

inline inherited

Returns the requested boundary component of this triangulation.

Note that each time the triangulation changes, all boundary components will be deleted and replaced with new ones. Therefore this object should be considered temporary only.

Parameters

  index | the index of the desired boundary component; this must be between 0 and countBoundaryComponents()-1 inclusive.

Returns
  the requested boundary component.

## boundaryComponents()

const std::vector< BoundaryComponent< dim > * > & regina::detail::TriangulationBase< dim >::boundaryComponents | ( |  | ) | const

inline inherited

Returns all boundary components of this triangulation.

Note that, in Regina's standard dimensions, each ideal vertex forms its own boundary component, and some invalid vertices do also. See the BoundaryComponent class notes for full details on what constitutes a boundary component in standard and non-standard dimensions.

Bear in mind that each time the triangulation changes, all boundary component objects will be deleted and replaced with new ones. Therefore these boundary component objects should be considered temporary only.

In contrast, this reference to the list of BoundaryComponent objects will remain valid and up-to-date for as long as the triangulation exists.

Python:\n This routine returns a python list.

Returns
  the list of all boundary components.

## calculatedSkeleton()

bool regina::detail::TriangulationBase< dim >::calculatedSkeleton | ( |  | ) | const

inline protected inherited

Determines whether the skeletal objects and properties of this triangulation have been calculated.

These are only calculated "on demand", when a skeletal property is first queried.

Returns
  `true` if and only if the skeleton has been calculated.

## clearBaseProperties()

void regina::detail::TriangulationBase< dim >::clearBaseProperties | ( |  | ) |

protected inherited

Clears all properties that are managed by this base class.

This includes deleting all skeletal objects and emptying the corresponding internal lists, as well as clearing other cached properties and deallocating the corresponding memory where required.

Note that TriangulationBase never calls this routine itself. Typically clearBaseProperties() is only ever called by Triangulation<dim>::clearAllProperties(), which in turn is called by "atomic" routines that change the triangluation (before firing packet change events), as well as the Triangulation<dim> destructor.

## component()

Component< dim > * regina::detail::TriangulationBase< dim >::component | ( | size_t | index | ) | const

inline inherited

Returns the requested connected component of this triangulation.

Note that each time the triangulation changes, all component objects will be deleted and replaced with new ones. Therefore this component object should be considered temporary only.

Parameters

  index | the index of the desired component; this must be between 0 and countComponents()-1 inclusive.

Returns
  the requested component.

## components()

const std::vector< Component< dim > * > & regina::detail::TriangulationBase< dim >::components | ( |  | ) | const

inline inherited

Returns all connected components of this triangulation.

Note that each time the triangulation changes, all component objects will be deleted and replaced with new ones. Therefore these component objects should be considered temporary only.

In contrast, this reference to the list of all components will remain valid and up-to-date for as long as the triangulation exists.

Python:\n This routine returns a python list.

Returns
  the list of all components.

## countBoundaryComponents()

size_t regina::detail::TriangulationBase< dim >::countBoundaryComponents | ( |  | ) | const

inline inherited

Returns the number of boundary components in this triangulation.

Note that, in Regina's standard dimensions, each ideal vertex forms its own boundary component, and some invalid vertices do also. See the BoundaryComponent class notes for full details on what constitutes a boundary component in standard and non-standard dimensions.

Returns
  the number of boundary components.

## countBoundaryFacets()

size_t regina::detail::TriangulationBase< dim >::countBoundaryFacets | ( |  | ) | const

inline inherited

Returns the total number of boundary facets in this triangulation.

This routine counts facets of top-dimensional simplices that are not glued to some adjacent top-dimensional simplex.

Returns
  the total number of boundary facets.

## countComponents()

size_t regina::detail::TriangulationBase< dim >::countComponents | ( |  | ) | const

inline inherited

Returns the number of connected components in this triangulation.

Returns
  the number of connected components.

## countFaces()

size_t regina::detail::TriangulationBase< dim >::countFaces | ( |  | ) | const

inline inherited

Returns the number of subdim-faces in this triangulation.

Precondition
  The template argument subdim is between 0 and dim-1 inclusive.

Python:\n Python does not support templates. Instead,
  Python users should call this function in the form `countFaces(subdim)`; that is, the template parameter subdim becomes the first argument of the function.

Returns
  the number of subdim-faces.

## deleteFaces()

void regina::detail::FaceListSuite< dim >::deleteFaces | ( |  | ) |

inline protected inherited

Deletes all faces of dimension subdim and below.

This routine destroys the corresponding Face objects and clears the lists that contain them.

## detail()

std::string regina::Output< Packet , false >::detail | ( |  | ) | const

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.

Returns
  a detailed text representation of this object.

## dumpConstruction()

std::string regina::detail::TriangulationBase< dim >::dumpConstruction | ( |  | ) | const

inherited

Returns C++ code that can be used with insertConstruction() to reconstruct this triangulation.

The code produced will consist of the following:

- the declaration and initialisation of two integer arrays, describing the gluings between simplices of this trianguation;
- two additional lines that declare a new Triangulation<dim> and call insertConstruction() to rebuild this triangulation.

The main purpose of this routine is to generate the two integer arrays, which can be tedious and error-prone to code up by hand.

Note that the number of lines of code produced grows linearly with the number of simplices. If this triangulation is very large, the returned string will be very large as well.

Returns
  the C++ code that was generated.

## ensureSkeleton()

void regina::detail::TriangulationBase< dim >::ensureSkeleton | ( |  | ) | const

inline protected inherited

Ensures that all "on demand" skeletal objects have been calculated.

## eulerCharTri()

long regina::detail::TriangulationBase< dim >::eulerCharTri | ( |  | ) | const

inline inherited

Returns the Euler characteristic of this triangulation.

This will be evaluated strictly as the alternating sum of the number of i-faces (that is, `countVertices() - countEdges() + countTriangles() - ...`).

Note that this routine handles ideal triangulations in a non-standard way. Since it computes the Euler characteristic of the triangulation (and not the underlying manifold), this routine will treat each ideal boundary component as a single vertex, and not as an entire (dim-1)-dimensional boundary component.

In Regina's standard dimensions, for a routine that handles ideal boundary components properly (by treating them as (dim-1)-dimensional boundary components when computing Euler characteristic), you can use the routine eulerCharManifold() instead.

Returns
  the Euler characteristic of this triangulation.

## face()

Face< dim, subdim > * regina::detail::TriangulationBase< dim >::face | ( | size_t | index | ) | const

inline inherited

Returns the requested subdim-face of this triangulation.

Precondition
  The template argument subdim is between 0 and dim-1 inclusive.

Python:\n Python does not support templates. Instead,
  Python users should call this function in the form `face(subdim, index)`; that is, the template parameter subdim becomes the first argument of the function.

Parameters

  index | the index of the desired face, ranging from 0 to countFaces<subdim>()-1 inclusive.

Returns
  the requested face.

## faces()

const FaceList< dim, subdim > & regina::detail::TriangulationBase< dim >::faces | ( |  | ) | const

inline inherited

Returns an object that allows iteration through and random access to all subdim-faces of this triangulation.

Bear in mind that each time the triangulation changes, all face objects will be deleted and replaced with new ones. Therefore these face objects should be considered temporary only.

In contrast, this reference to the FaceList object itself will remain valid and up-to-date for as long as the triangulation exists.

Python:\n Python users should call this function in the
  form `faces(subdim)`. It will then return a Python list containing all the subdim-faces of the triangulation. Be warned that, unlike in C++, this Python list will be a snapshot of the faces when this function is called, and will not be kept up-to-date as the triangulation changes.

Returns
  access to the list of all subdim-faces.

## fillFVector()

void regina::detail::FaceListSuite< dim >::fillFVector | ( | std::vector< size_t > & | result | ) | const

inline protected inherited

Fills the given vector with the first (subdim + 1) elements of the f-vector.

Specifically, this routine pushes the values f[0], ..., f[subdim] onto the end of the given vector, where f[k] denotes the number of k-faces that this object stores.

Parameters

  result | the vector in which the results will be placed.

## findAllIsomorphisms()

size_t regina::detail::TriangulationBase< dim >::findAllIsomorphisms | ( | const Triangulation< dim > & | other,
|  | OutputIterator | output
| ) |  | const

inline inherited

Finds all ways in which this triangulation is combinatorially isomorphic to the given triangulation.

This routine behaves identically to isIsomorphicTo(), except that instead of returning just one isomorphism, all such isomorphisms are returned.

See the isIsomorphicTo() notes for additional information.

The isomorphisms that are found will be written to the given output iterator. This iterator must accept objects of type Isomorphism<dim>*. As an example, output might be a back_insert_iterator for a std::vector<Isomorphism<dim>*>.

The isomorphisms that are written to the given output iterator will be newly created, and the caller of this routine is responsible for destroying them.

Python:\n The output argument is not present.
  Instead, this routine returns a python list containing all of the isomorphisms that were found.

Warning
  For large dimensions, this routine can become extremely slow: its running time includes a factor of (dim+1)!.

Parameters

  other | the triangulation to compare with this one.
  output | the output iterator to which the isomorphisms will be written.

Returns
  the number of isomorphisms that were found.

## findAllSubcomplexesIn()

size_t regina::detail::TriangulationBase< dim >::findAllSubcomplexesIn | ( | const Triangulation< dim > & | other,
|  | OutputIterator | output
| ) |  | const

inline inherited

Finds all ways in which an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components).

This routine behaves identically to isContainedIn(), except that instead of returning just one isomorphism (which may be boundary incomplete and need not be onto), all such isomorphisms are returned.

See the isContainedIn() notes for additional information.

The isomorphisms that are found will be written to the given output iterator. This iterator must accept objects of type Isomorphism<dim>*. As an example, output might be a back_insert_iterator for a std::vector<Isomorphism<dim>*>.

The isomorphisms that are written to the given output iterator will be newly created, and the caller of this routine is responsible for destroying them.

Warning
  For large dimensions, this routine can become extremely slow: its running time includes a factor of (dim+1)!.

Python:\n Not present.

Parameters

  other | the triangulation in which to search for isomorphic copies of this triangulation.
  output | the output iterator to which the isomorphisms will be written.

Returns
  the number of isomorphisms that were found.

## finiteToIdeal()

bool regina::detail::TriangulationBase< dim >::finiteToIdeal | ( |  | ) |

inherited

Converts each real boundary component into a cusp (i.e., an ideal vertex).

Only boundary components formed from real (dim-1)-faces will be affected; ideal boundary components are already cusps and so will not be changed.

One side-effect of this operation is that all spherical boundary components will be filled in with balls.

This operation is performed by attaching a new dim-simplex to each boundary (dim-1)-face, and then gluing these new simplices together in a way that mirrors the adjacencies of the underlying boundary facets. Each boundary component will thereby be pushed up through the new simplices and converted into a cusp formed using vertices of these new simplices.

In Regina's standard dimensions, where triangulations also support an idealToFinite() operation, this routine is a loose converse of that operation.

In dimension 2, every boundary component is spherical and so this routine simply fills all the punctures in the underlying surface. (In dimension 2, triangulations cannot have cusps).

Warning
  If a real boundary component contains vertices whose links are not discs, this operation may have unexpected results.

Returns
  `true` if changes were made, or `false` if the original triangulation contained no real boundary components.

## fromIsoSig()

static Triangulation<dim>* regina::detail::TriangulationBase< dim >::fromIsoSig | ( | const std::string & | sig | ) |

static inherited

Recovers a full triangulation from an isomorphism signature.

See isoSig() for more information on isomorphism signatures. It will be assumed that the signature describes a triangulation of dimension dim.

The triangulation that is returned will be newly created, and it is the responsibility of the caller of this routine to destroy it.

Calling isoSig() followed by fromIsoSig() is not guaranteed to produce an identical triangulation to the original, but it is guaranteed to produce a combinatorially isomorphic triangulation. In other words, fromIsoSig() may reconstruct the triangulation with its simplices and/or vertices relabelled. The optional argument to isoSig() allows you to determine the precise relabelling that will be used, if you need to know it.

For a full and precise description of the isomorphism signature format for 3-manifold triangulations, see Simplification paths in the Pachner graphs of closed orientable 3-manifold triangulations, Burton, 2011, `arXiv:1110.6080`. The format for other dimensions is essentially the same, but with minor dimension-specific adjustments.

Warning
  Do not mix isomorphism signatures between dimensions! It is possible that the same string could corresponding to both a p-dimensional triangulation and a q-dimensional triangulation for different dimensions p and q.

Parameters

  sig | the isomorphism signature of the triangulation to construct. Note that isomorphism signature are case-sensitive (unlike, for example, dehydration strings for 3-manifolds).

Returns
  a newly allocated triangulation if the reconstruction was successful, or `null` if the given string was not a valid dim-dimensional isomorphism signature.

## fundamentalGroup()

const GroupPresentation & regina::detail::TriangulationBase< dim >::fundamentalGroup | ( |  | ) | const

inherited

Returns the fundamental group of this triangulation.

The fundamental group is computed in the dual 2-skeleton. This means:

- If the triangulation contains any ideal vertices, the fundamental group will be calculated as if each such vertex had been truncated.
- Likewise, if the triangulation contains any invalid faces of dimension 0,1,...,(dim-3), these will effectively be truncated also.
- In contrast, if the triangulation contains any invalid (dim-2)-faces (i.e., codimension-2-faces that are identified with themselves under a non-trivial map), the fundamental group will be computed without truncating the centroid of the face. For instance, if a 3-manifold triangulation has an edge identified with itself in reverse, then the fundamental group will be computed without truncating the resulting projective plane cusp. This means that, if a barycentric subdivision is performed on a such a triangulation, the result of fundamentalGroup() might change.

Bear in mind that each time the triangulation changes, the fundamental group will be deleted. Thus the reference that is returned from this routine should not be kept for later use. Instead, fundamentalGroup() should be called again; this will be instantaneous if the group has already been calculated.

Precondition
  This triangulation has at most one component.

Warning
  In dimension 3, if you are calling this from the subclass SnapPeaTriangulation then any fillings on the cusps will be ignored. (This is the same as for every routine implemented by Regina's Triangulation<3> class.) If you wish to compute the fundamental group with fillings, call SnapPeaTriangulation::fundamentalGroupFilled() instead.

Returns
  the fundamental group.

## fVector()

std::vector< size_t > regina::detail::TriangulationBase< dim >::fVector | ( |  | ) | const

inline inherited

Returns the f-vector of this triangulation, which counts the number of faces of all dimensions.

The vector that is returned will have length dim+1. If this vector is f, then f[k] will be the number of k-faces for each 0 ≤ k ≤ dim.

This routine is significantly more heavyweight than countFaces(). Its advantage is that, unlike the templatised countFaces(), it allows you to count faces whose dimensions are not known until runtime.

Returns
  the f-vector of this triangulation.

## hasBoundaryFacets()

bool regina::detail::TriangulationBase< dim >::hasBoundaryFacets | ( |  | ) | const

inline inherited

Determines if this triangulation has any boundary facets.

This routine returns `true` if and only if the triangulation contains some top-dimension simplex with at least one facet that is not glued to an adjacent simplex.

Returns
  `true` if and only if there are boundary facets.

## homology()

const AbelianGroup & regina::detail::TriangulationBase< dim >::homology | ( |  | ) | const

inherited

Returns the first homology group for this triangulation.

The homology is computed in the dual 2-skeleton. This means:

- If the triangulation contains any ideal vertices, the homology will be calculated as if each such vertex had been truncated.
- Likewise, if the triangulation contains any invalid faces of dimension 0,1,...,(dim-3), these will effectively be truncated also.
- In contrast, if the triangulation contains any invalid (dim-2)-faces (i.e., codimension-2-faces that are identified with themselves under a non-trivial map), the homology will be computed without truncating the centroid of the face. For instance, if a 3-manifold triangulation has an edge identified with itself in reverse, then the homology will be computed without truncating the resulting projective plane cusp. This means that, if a barycentric subdivision is performed on a such a triangulation, the result of homology() might change.

This routine can also be accessed via the alias homologyH1() (a name that is more specific, but a little longer to type).

Bear in mind that each time the triangulation changes, the homology groups will be deleted. Thus the reference that is returned from this routine should not be kept for later use. Instead, homology() should be called again; this will be instantaneous if the group has already been calculated.

Warning
  In dimension 3, if you are calling this from the subclass SnapPeaTriangulation then any fillings on the cusps will be ignored. (This is the same as for every routine implemented by Regina's Triangulation<3> class.) If you wish to compute homology with fillings, call SnapPeaTriangulation::homologyFilled() instead.

Returns
  the first homology group.

## homologyH1()

const AbelianGroup & regina::detail::TriangulationBase< dim >::homologyH1 | ( |  | ) | const

inline inherited

Returns the first homology group for this triangulation.

This is identical to calling homology(). See the homology() documentation for further details.

Returns
  the first homology group.

## insertConstruction()

void regina::detail::TriangulationBase< dim >::insertConstruction | ( | size_t | nSimplices,
|  | const int | adjacencies[][dim+1],
|  | const int | gluings[][dim+1][dim+1]
| ) |  |

inherited

Inserts a given triangulation into this triangulation, where the given triangulation is described by a pair of integer arrays.

The main purpose of this routine is to allow users to hard-code triangulations into C++ source files. In particular, all of the simplex gluings can be hard-coded into a pair of integer arrays at the beginning of the source file, avoiding an otherwise tedious sequence of many calls to Simplex<dim>::join(). If you have a particular triangulation that you would like to hard-code in this way, you can call dumpConstruction() to generate the corresponding integer arrays as C++ source code.

This routine will insert an additional nSimplices top-dimensional simplices into this triangulation. We number these simplices 0,1,...,nSimplices-1. The gluings between these new simplices should be stored in the two arrays as follows.

The adjacencies array describes which simplices are joined to which others. Specifically, `adjacencies[s][f]` indicates which of the new simplices is joined to facet f of simplex s. This should be between 0 and nSimplices-1 inclusive, or -1 if facet f of simplex s is to be left as a boundary facet.

The gluings array describes the particular gluing permutations used to join these simplices together. Specifically, `gluings[s][f][0..dim]` should describe the permutation used to join facet f of simplex s to its adjacent simplex. These dim+1 integers should be 0,1,...,dim in some order, so that `gluings[s][f][i]` contains the image of i under this permutation. If facet f of simplex s is to be left as a boundary facet, then `gluings[s][f][0..dim]` may contain anything (and will be duly ignored).

If this triangulation is empty before this routine is called, then the new simplices will be given indices 0,1,...,nSimplices-1 according to the numbering described above. Otherwise they will be inserted after any pre-existing simplices, and so they will be given larger indices instead. In the latter case, the adjacencies array should still refer to the new simplices as 0,1,...,nSimplices-1, and this routine will handle any renumbering automatically at runtime.

It is the responsibility of the caller of this routine to ensure that the given arrays are correct and consistent. No error checking will be performed by this routine.

Python:\n Not present.

Parameters

  nSimplices | the number of additional simplices to insert.
  adjacencies | describes which simplices are adjace to which others, as described above. This array must have initial dimension at least nSimplices.
  gluings | describes the specific gluing permutations, as described above. This array must also have initial dimension at least nSimplices.

## insertTriangulation()

void regina::detail::TriangulationBase< dim >::insertTriangulation | ( | const Triangulation< dim > & | source | ) |

inherited

Inserts a copy of the given triangulation into this triangulation.

The top-dimensional simplices of source will be copied into this triangulation in the same order in which they appear in source. That is, if the original size of this triangulation was S, then the simplex at index i in source will be copied into this triangulation as a new simplex at index S+i.

The copies will use the same vertex numbering and descriptions as the original simplices from source, and any gluings between the simplices of source will likewise be copied across as gluings between their copies in this triangulation.

This routine behaves correctly when source is this triangulation.

Parameters

  source | the triangulation whose copy will be inserted.

## isConnected()

bool regina::detail::TriangulationBase< dim >::isConnected | ( |  | ) | const

inline inherited

Determines if this triangulation is connected.

Returns
  `true` if and only if this triangulation is connected.

## isContainedIn()

std::unique_ptr< Isomorphism< dim > > regina::detail::TriangulationBase< dim >::isContainedIn | ( | const Triangulation< dim > & | other | ) | const

inline inherited

Determines if an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components).

Specifically, this routine determines if there is a boundary incomplete combinatorial isomorphism from this triangulation to other. Boundary incomplete isomorphisms are described in detail in the Isomorphism class notes.

In particular, note that facets of top-dimensional simplices that lie on the boundary of this triangulation need not correspond to boundary facets of other, and that other may contain more top-dimensional simplices than this triangulation.

If a boundary incomplete isomorphism is found, the details of this isomorphism are returned. The isomorphism is newly constructed, and so to assist with memory management is returned as a std::unique_ptr. Thus, to test whether an isomorphism exists without having to explicitly deal with the isomorphism itself, you can call `if (isContainedIn(other).get())` and the newly created isomorphism (if it exists) will be automatically destroyed.

If more than one such isomorphism exists, only one will be returned. For a routine that returns all such isomorphisms, see findAllSubcomplexesIn().

Warning
  For large dimensions, this routine can become extremely slow: its running time includes a factor of (dim+1)!.

Parameters

  other | the triangulation in which to search for an isomorphic copy of this triangulation.

Returns
  details of the isomorphism if such a copy is found, or a null pointer otherwise.

## isEmpty()

bool regina::detail::TriangulationBase< dim >::isEmpty | ( |  | ) | const

inline inherited

Determines whether this triangulation is empty.

An empty triangulation is one with no simplices at all.

Returns
  `true` if and only if this triangulation is empty.

## isIdenticalTo()

bool regina::detail::TriangulationBase< dim >::isIdenticalTo | ( | const Triangulation< dim > & | other | ) | const

inherited

Determines if this triangulation is combinatorially identical to the given triangulation.

Here "identical" means that the triangulations have the same number of top-dimensional simplices, with gluings between the same pairs of numbered simplices using the same gluing permutations. In other words, "identical" means that the triangulations are isomorphic via the identity isomorphism.

For the less strict notion of isomorphic triangulations, which allows relabelling of the top-dimensional simplices and their vertices, see isIsomorphicTo() instead.

This test does not examine the textual simplex descriptions, as seen in Simplex<dim>::description(); these may still differ. It also does not test whether lower-dimensional faces are numbered identically (vertices, edges and so on); this routine is only concerned with top-dimensional simplices.

(At the time of writing, two identical triangulations will always number their lower-dimensional faces in the same way. However, it is conceivable that in future versions of Regina there may be situations in which identical triangulations can acquire different numberings for vertices, edges, and so on.)

Parameters

  other | the triangulation to compare with this one.

Returns
  `true` if and only if the two triangulations are combinatorially identical.

## isIsomorphicTo()

std::unique_ptr< Isomorphism< dim > > regina::detail::TriangulationBase< dim >::isIsomorphicTo | ( | const Triangulation< dim > & | other | ) | const

inline inherited

Determines if this triangulation is combinatorially isomorphic to the given triangulation.

Two triangulations are isomorphic if and only it is possible to relabel their top-dimensional simplices and the (dim+1) vertices of each simplex in a way that makes the two triangulations combinatorially identical, as returned by isIdenticalTo().

Equivalently, two triangulations are isomorphic if and only if there is a one-to-one and onto boundary complete combinatorial isomorphism from this triangulation to other, as described in the Isomorphism class notes.

In particular, note that this triangulation and other must contain the same number of top-dimensional simplices for such an isomorphism to exist.

If the triangulations are isomorphic, then this routine returns one such boundary complete isomorphism (i.e., one such relabelling). The isomorphism will be newly constructed, and to assist with memory management, it will be returned as a std::unique_ptr. Thus, to test whether an isomorphism exists without having to explicitly manage with the isomorphism itself, you can just call `if (isIsomorphicTo(other).get())`, in which case the newly created isomorphism (if it exists) will be automatically destroyed.

There may be many such isomorphisms between the two triangulations. If you need to find all such isomorphisms, you may call findAllIsomorphisms() instead.

If you need to ensure that top-dimensional simplices are labelled the same in both triangulations (i.e., that the triangulations are related by the identity isomorphism), you should call the stricter test isIdenticalTo() instead.

Warning
  For large dimensions, this routine can become extremely slow: its running time includes a factor of (dim+1)!.

Todo:
  Optimise: Improve the complexity by choosing a simplex mapping from each component and following gluings to determine the others.

Parameters

  other | the triangulation to compare with this one.

Returns
  details of the isomorphism if the two triangulations are combinatorially isomorphic, or a null pointer otherwise.

## isOrientable()

bool regina::detail::TriangulationBase< dim >::isOrientable | ( |  | ) | const

inline inherited

Determines if this triangulation is orientable.

Returns
  `true` if and only if this triangulation is orientable.

## isOriented()

bool regina::detail::TriangulationBase< dim >::isOriented | ( |  | ) | const

inherited

Determines if this triangulation is oriented; that is, if the vertices of its top-dimensional simplices are labelled in a way that preserves orientation across adjacent facets.

Specifically, this routine returns `true` if and only if every gluing permutation has negative sign.

Note that orientable triangulations are not always oriented by default. You can call orient() if you need the top-dimensional simplices to be oriented consistently as described above.

A non-orientable triangulation can never be oriented.

Returns
  `true` if and only if all top-dimensional simplices are oriented consistently.

Author
  Matthias Goerner

## isoSig()

std::string regina::detail::TriangulationBase< dim >::isoSig | ( | Isomorphism< dim > ** | relabelling = `0` | ) | const

inherited

Constructs the isomorphism signature for this triangulation.

An isomorphism signature is a compact text representation of a triangulation that uniquely determines the triangulation up to combinatorial isomorphism. That is, two triangulations of dimension dim are combinatorially isomorphic if and only if their isomorphism signatures are the same.

The isomorphism signature is constructed entirely of printable characters, and has length proportional to `n log n`, where n is the number of top-dimenisonal simplices.

Whilst the format of an isomorphism signature bears some similarity to dehydration strings for 3-manifolds, they are more general: isomorphism signatures can be used with any triangulations, including closed, bounded and/or disconnected triangulations, as well as triangulations with many simplices. Note also that 3-manifold dehydration strings are not unique up to isomorphism (they depend on the particular labelling of tetrahedra).

The time required to construct the isomorphism signature of a triangulation is `O((dim!) n^2 log^2 n)`. Whilst this is fine for large triangulation, it will be extremly slow for large dimensions.

The routine fromIsoSig() can be used to recover a triangulation from an isomorphism signature. The triangulation recovered might not be identical to the original, but it will be combinatorially isomorphic.

If relabelling is non-null (i.e., it points to some Isomorphism pointer p), then it will be modified to point to a new isomorphism that describes the precise relationship between this triangulation and the reconstruction from fromIsoSig(). Specifically, the triangulation that is reconstructed from fromIsoSig() will be combinatorially identical to `relabelling.apply(this)`.

For a full and precise description of the isomorphism signature format for 3-manifold triangulations, see Simplification paths in the Pachner graphs of closed orientable 3-manifold triangulations, Burton, 2011, `arXiv:1110.6080`. The format for other dimensions is essentially the same, but with minor dimension-specific adjustments.

Python:\n The isomorphism argument is not present.
  Instead there are two routines: fromIsoSig(), which returns a string only, and fromIsoSigDetail(), which returns a pair (signature, relabelling).

Precondition
  If relabelling is non-null, then this triangulation must be non-empty and connected. The facility to return a relabelling for disconnected triangulations may be added to Regina in a later release.

Warning
  Do not mix isomorphism signatures between dimensions! It is possible that the same string could corresponding to both a p-dimensional triangulation and a q-dimensional triangulation for different dimensions p and q.

Parameters

  relabelling | if this is non-null, it will be modified to point to a new isomorphism that describes the relationship between this triangulation and the triangulation that will be reconstructed from fromIsoSig(), as described above.

Returns
  the isomorphism signature of this triangulation.

## isoSigComponentSize()

static size_t regina::detail::TriangulationBase< dim >::isoSigComponentSize | ( | const std::string & | sig | ) |

static inherited

Deduces the number of top-dimensional simplices in a connected triangulation from its isomorphism signature.

See isoSig() for more information on isomorphism signatures. It will be assumed that the signature describes a triangulation of dimension dim.

If the signature describes a connected triangulation, this routine will simply return the size of that triangulation (e.g., the number of tetrahedra in the case dim = 3). You can also pass an isomorphism signature that describes a disconnected triangulation; however, this routine will only return the number of top-dimensional simplices in the first connected component. If you need the total size of a disconnected triangulation, you will need to reconstruct the full triangulation by calling fromIsoSig() instead.

This routine is very fast, since it only examines the first few characters of the isomorphism signature (in which the size of the first component is encoded). However, a side-effect of this is that it is possible to pass an invalid isomorphism signature and still receive a positive result. If you need to test whether a signature is valid or not, you must call fromIsoSig() instead, which will examine the entire signature in full.

Warning
  Do not mix isomorphism signatures between dimensions! It is possible that the same string could corresponding to both a p-dimensional triangulation and a q-dimensional triangulation for different dimensions p and q.

Parameters

  sig | the isomorphism signature of a dim-dimensional triangulation. Note that isomorphism signature are case-sensitive (unlike, for example, dehydration strings for 3-manifolds).

Returns
  the number of top-dimensional simplices in the first connected component, or 0 if this could not be determined because the given string was not a valid isomorphism signature.

## isValid()

bool regina::detail::TriangulationBase< dim >::isValid | ( |  | ) | const

inline inherited

Determines if this triangulation is valid.

There are several conditions that might make a dim-dimensional triangulation invalid:

1. if some face is identified with itself under a non-identity permutation (e.g., an edge is identified with itself in reverse, or a triangle is identified with itself under a rotation);
2. if some subdim-face does not have an appropriate link. Here the meaning of "appropriate" depends upon the type of face:
   - for a face that belongs to some boundary facet(s) of this triangulation, its link must be a topological ball;
   - for a vertex that does not belong to any boundary facets, its link must be a closed (dim - 1)-manifold;
   - for a (subdim ≥ 1)-face that does not belong to any boundary facets, its link must be a topological sphere.

Condition (1) is tested for all dimensions 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 a triangulation is invalid then you can call Face<dim, subdim>::isValid() to discover exactly which face(s) are responsible, and you can call Face<dim, subdim>::hasBadIdentification() and/or Face<dim, subdim>::hasBadLink() to discover exactly which conditions fail.

Note that all invalid vertices are considered to be on the boundary; see isBoundary() for details.

Returns
  `true` if and only if this triangulation is valid.

## makeCanonical()

bool regina::detail::TriangulationBase< dim >::makeCanonical | ( |  | ) |

inherited

Relabel the top-dimensional simplices and their vertices so that this triangulation is in canonical form.

This is essentially the lexicographically smallest labelling when the facet gluings are written out in order.

Two triangulations are isomorphic if and only if their canonical forms are identical.

The lexicographic ordering assumes that the facet gluings are written in order of simplex index and then facet number. Each gluing is written as the destination simplex index followed by the gluing permutation (which in turn is written as the images of 0,1,...,dim in order).

Precondition
  This routine currently works only when the triangulation is connected. It may be extended to work with disconnected triangulations in later versions of Regina.

Returns
  `true` if the triangulation was changed, or `false` if the triangulation was in canonical form to begin with.

## makeDoubleCover()

void regina::detail::TriangulationBase< dim >::makeDoubleCover | ( |  | ) |

inherited

Converts this triangulation into its double cover.

Each orientable component will be duplicated, and each non-orientable component will be converted into its orientable double cover.

## moveContentsTo()

void regina::detail::TriangulationBase< dim >::moveContentsTo | ( | Triangulation< dim > & | dest | ) |

inherited

Moves the contents of this triangulation into the given destination triangulation, without destroying any pre-existing contents.

All top-dimensional simplices that currently belong to dest will remain there (and will keep the same indices in dest). All top-dimensional simplices that belong to this triangulation will be moved into dest also (but in general their indices will change).

This triangulation will become empty as a result.

Any pointers or references to Simplex<dim> objects will remain valid.

Precondition
  dest is not this triangulation.

Parameters

  dest | the triangulation into which simplices should be moved.

## newSimplex() [1/2]

Simplex< dim > * regina::detail::TriangulationBase< dim >::newSimplex | ( |  | ) |

inherited

Creates a new top-dimensional simplex and adds it to this triangulation.

The new simplex will have an empty description. All (dim+1) facets of the new simplex will be boundary facets.

The new simplex will become the last simplex in this triangulation; that is, it will have index size()-1.

Returns
  the new simplex.

## newSimplex() [2/2]

Simplex< dim > * regina::detail::TriangulationBase< dim >::newSimplex | ( | const std::string & | desc | ) |

inherited

Creates a new top-dimensional simplex with the given description and adds it to this triangulation.

All (dim+1) facets of the new simplex will be boundary facets.

Descriptions are optional, may have any format, and may be empty. How descriptions are used is entirely up to the user.

The new simplex will become the last simplex in this triangulation; that is, it will have index size()-1.

Parameters

  desc | the description to give to the new simplex.

Returns
  the new simplex.

## orient()

void regina::detail::TriangulationBase< dim >::orient | ( |  | ) |

inherited

Relabels the vertices of top-dimensional simplices in this triangulation so that all simplices are oriented consistently, if possible.

This routine works by flipping vertices (dim - 1) and dim of each top-dimensional simplices that has negative orientation. The result will be a triangulation where the top-dimensional simplices have their vertices labelled in a way that preserves orientation across adjacent facets. In particular, every gluing permutation will have negative sign.

If this triangulation includes both orientable and non-orientable components, the orientable components will be oriented as described above and the non-orientable components will be left untouched.

## removeAllSimplices()

void regina::detail::TriangulationBase< dim >::removeAllSimplices | ( |  | ) |

inline inherited

Removes all simplices from the triangulation.

As a result, this triangulation will become empty.

All of the simplices that belong to this triangulation will be destroyed immediately.

## removeSimplex()

void regina::detail::TriangulationBase< dim >::removeSimplex | ( | Simplex< dim > * | simplex | ) |

inline inherited

Removes the given top-dimensional simplex from this triangulation.

The given simplex will be unglued from any adjacent simplices (if any), and will be destroyed immediately.

Precondition
  The given simplex is a top-dimensional simplex in this triangulation.

Parameters

  simplex | the simplex to remove.

## removeSimplexAt()

void regina::detail::TriangulationBase< dim >::removeSimplexAt | ( | size_t | index | ) |

inline inherited

Removes the top-dimensional simplex at the given index in this triangulation.

This is equivalent to calling `removeSimplex(simplex(index))`.

The given simplex will be unglued from any adjacent simplices (if any), and will be destroyed immediately.

Parameters

  index | specifies which top-dimensionalsimplex to remove; this must be between 0 and size()-1 inclusive.

## sameDegrees()

bool regina::detail::FaceListSuite< dim >::sameDegrees | ( | const FaceListSuite< dim, subdim > & | other | ) | const

inline protected inherited

Tests whether this and the given triangulation have the same k-face degree sequences, for each facial dimension k ≤ subdim.

For the purposes of this routine, degree sequences are considered to be unordered.

Precondition
  This and the given triangulation are known to have the same number of k-faces as each other, for each facial dimension k ≤ subdim.

Parameters

  other | the triangulation to compare against this.

Returns
  `true` if and only if all degree sequences considered are equal.

## sameFVector()

bool regina::detail::FaceListSuite< dim >::sameFVector | ( | const FaceListSuite< dim, subdim > & | other | ) | const

inline protected inherited

Tests whether this and the given triangulation have the same number of k-faces, for each facial dimension k ≤ subdim.

Parameters

  other | the triangulation to compare against this.

Returns
  `true` if and only if the face counts considered are identical for both triangluations.

## simplex() [1/2]

Simplex< dim > * regina::detail::TriangulationBase< dim >::simplex | ( | size_t | index | ) |

inline inherited

Returns the top-dimensional simplex at the given index in the triangulation.

Note that indexing may change when a simplex is added to or removed from the triangulation.

Parameters

  index | specifies which simplex to return; this value should be between 0 and size()-1 inclusive.

Returns
  the indexth top-dimensional simplex.

## simplex() [2/2]

const Simplex< dim > * regina::detail::TriangulationBase< dim >::simplex | ( | size_t | index | ) | const

inline inherited

Returns the top-dimensional simplex at the given index in the triangulation.

Note that indexing may change when a simplex is added to or removed from the triangulation.

Parameters

  index | specifies which simplex to return; this value should be between 0 and size()-1 inclusive.

Returns
  the indexth top-dimensional simplex.

## simplices()

const std::vector< Simplex< dim > * > & regina::detail::TriangulationBase< dim >::simplices | ( |  | ) | const

inline inherited

Returns all top-dimensional simplices in the triangulation.

The reference that is returned will remain valid for as long as the triangulation exists: even as simplices are added and/or removed, it will always reflect the simplices that are currently in the triangulation.

Python:\n This routine returns a python list.

Returns
  the list of all top-dimensional simplices.

## simplifiedFundamentalGroup()

void regina::detail::TriangulationBase< dim >::simplifiedFundamentalGroup | ( | GroupPresentation * | newGroup | ) |

inline inherited

Notifies the triangulation that you have simplified the presentation of its fundamental group.

The old group presentation will be destroyed, and this triangulation will take ownership of the new (hopefully simpler) group that is passed.

This routine is useful for situations in which some external body (such as GAP) has simplified the group presentation better than Regina can.

Regina does not verify that the new group presentation is equivalent to the old, since this is - well, hard.

If the fundamental group has not yet been calculated for this triangulation, this routine will nevertheless take ownership of the new group, under the assumption that you have worked out the group through some other clever means without ever having needed to call fundamentalGroup() at all.

Note that this routine will not fire a packet change event.

Parameters

  newGroup | a new (and hopefully simpler) presentation of the fundamental group of this triangulation.

## size()

size_t regina::detail::TriangulationBase< dim >::size | ( |  | ) | const

inline inherited

Returns the number of top-dimensional simplices in the triangulation.

Returns
  The number of top-dimensional simplices.

## splitIntoComponents()

size_t regina::detail::TriangulationBase< dim >::splitIntoComponents | ( | Packet * | componentParent = `0`,
|  | bool | setLabels = `true`
| ) |  |

inherited

Splits a disconnected triangulation into many smaller triangulations, one for each component.

The new component triangulations will be inserted as children of the given parent packet. The original triangulation (i.e., this triangulation) will be left unchanged.

If the given parent packet is 0, the new component triangulations will be inserted as children of this triangulation.

By default, this routine will assign sensible packet labels to each of the new component triangulations. If these component triangulations are only temporary objects used as part of some larger algorithm, then labels are unnecessary - in this case you can pass setLabels as `false` to avoid the (small) overhead that these packet labels incur.

Parameters

  componentParent | the packet beneath which the new component triangulations will be inserted, or 0 if they should be inserted directly beneath this triangulation.
  setLabels | `true` if the new component triangulations should be assigned sensible packet labels, or `false` if they should be left without labels at all.

Returns
  the number of new component triangulations constructed.

## str()

std::string regina::Output< Packet , false >::str | ( |  | ) | const

inherited

Returns a short text representation of this object.

This text should be human-readable, should fit on a single line, and should not end with a newline. Where possible, it should use plain ASCII characters.

Python:\n In addition to str(), this is also used as the
  Python "stringification" function `__str__()`.

Returns
  a short text representation of this object.

## swapBaseProperties()

void regina::detail::TriangulationBase< dim >::swapBaseProperties | ( | TriangulationBase< dim > & | other | ) |

protected inherited

Swaps all properties that are managed by this base class, including skeletal data, with the given triangulation.

Note that TriangulationBase never calls this routine itself. Typically swapBaseProperties() is only ever called by Triangulation<dim>::swapAllProperties(), which in turn is called by swapContents().

Parameters

  other | the triangulation whose properties should be swapped with this.

## swapContents()

void regina::detail::TriangulationBase< dim >::swapContents | ( | Triangulation< dim > & | other | ) |

inherited

Swaps the contents of this and the given triangulation.

All top-dimensional simplices that belong to this triangulation will be moved to other, and all top-dimensional simplices that belong to other will be moved to this triangulation. Likewise, all skeletal objects (such as lower-dimensional faces, components, and boundary components) and all cached properties (such as homology and fundamental group) will be swapped.

In particular, any pointers or references to Simplex<dim> and/or Face<dim, subdim> objects will remain valid.

This routine will behave correctly if other is in fact this triangulation.

Parameters

  other | the triangulation whose contents should be swapped with this.

## swapFaces()

void regina::detail::FaceListSuite< dim >::swapFaces | ( | FaceListSuite< dim, subdim > & | other | ) |

inline protected inherited

Swaps all faces of dimension subdim and below with those of the given triangulation.

Parameters

  other | the face storage for the triangulation whose faces are to be swapped with this.

## utf8()

std::string regina::Output< Packet , false >::utf8 | ( |  | ) | const

inherited

Returns a short text representation of this object using unicode characters.

Like str(), this text should be human-readable, should fit on a single line, and should not end with a newline. In addition, it may use unicode characters to make the output more pleasant to read. This string will be encoded in UTF-8.

Returns
  a short text representation of this object.

## writeXMLBaseProperties()

void regina::detail::TriangulationBase< dim >::writeXMLBaseProperties | ( | std::ostream & | out | ) | const

protected inherited

Writes a chunk of XML containing properties of this triangulation.

This routine covers those properties that are managed by this base class TriangulationBase and that have already been computed for this triangulation.

This routine is typically called from within Triangulation<dim>::writeXMLPacketData(). The XML elements that it writes are child elements of the `packet` element.

Parameters

  out | the output stream to which the XML should be written.

## Member Data Documentation

## boundaryComponents_

MarkedVector<BoundaryComponent<dim> > regina::detail::TriangulationBase< dim >::boundaryComponents_

protected inherited

The components that form the boundary of the triangulation.

## dimension

constexpr int regina::detail::TriangulationBase< dim >::dimension

static constexpr inherited

A compile-time constant that gives the dimension of the triangulation.

## simplices_

MarkedVector<Simplex<dim> > regina::detail::TriangulationBase< dim >::simplices_

protected inherited

The top-dimensional simplices that form the triangulation.

## valid_

bool regina::detail::TriangulationBase< dim >::valid_

protected inherited

Is this triangulation valid? See isValid() for details on what this means.

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

- snappea/snappeatriangulation.h

Copyright © 1999-2016, 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).