Regina Calculation Engine
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
regina::Triangulation< 3 > Class Template Referenceabstract

Represents a 3-dimensional triangulation, typically of a 3-manifold. More...

#include <triangulation/dim3.h>

Inheritance diagram for regina::Triangulation< 3 >:
regina::Packet regina::detail::TriangulationBase< 3 > regina::alias::FacesOfTriangulation< TriangulationBase< dim >, dim > regina::alias::FaceOfTriangulation< TriangulationBase< dim >, dim > regina::alias::SimplexAt< TriangulationBase< dim >, dim, true > regina::alias::Simplices< TriangulationBase< dim >, dim > regina::detail::FaceListSuite< dim, dim - 1 > regina::SafePointeeBase< Packet > regina::Output< Packet > regina::SnapPeaTriangulation

Public Types

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 >, CyclotomicTuraevViroSet
 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

bool hasOwner () const
 Indicates whether some other object in the calculation engine is responsible for ultimately destroying this object. More...
 
std::string str () const
 Returns a short text representation of this object. More...
 
std::string utf8 () const
 Returns a short text representation of this object using unicode characters. More...
 
std::string detail () const
 Returns a detailed text representation of this object. More...
 
bool makeCanonical ()
 Relabel the top-dimensional simplices and their vertices so that this triangulation is in canonical form. More...
 
Constructors and Destructors
 Triangulation ()
 Default constructor. More...
 
 Triangulation (const Triangulation< 3 > &copy)
 Creates a new copy of the given triangulation. More...
 
 Triangulation (const Triangulation &copy, bool cloneProps)
 Creates a new copy of the given triangulation, with the option of whether or not to clone its computed properties also. More...
 
 Triangulation (const std::string &description)
 "Magic" constructor that tries to find some way to interpret the given string as a triangulation. More...
 
virtual REGINA_INLINE_REQUIRED ~Triangulation ()
 Destroys this triangulation. 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...
 
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 AbelianGrouphomologyRel () const
 Returns the relative first homology group with respect to the boundary for this triangulation. More...
 
const AbelianGrouphomologyBdry () const
 Returns the first homology group of the boundary for this triangulation. More...
 
const AbelianGrouphomologyH2 () 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 TuraevViroSetallCalculatedTuraevViro () 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...
 
NormalSurfacehasNonTrivialSphereOrDisc ()
 Searches for a non-vertex-linking normal sphere or disc within this triangulation. More...
 
NormalSurfacehasOctagonalAlmostNormalSphere ()
 Searches for an octagonal almost normal 2-sphere within this triangulation. More...
 
const AngleStructurefindStrictAngleStructure () 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...
 
PacketmakeZeroEfficient ()
 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 TreeDecompositionniceTreeDecomposition () 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...
 
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...
 
std::string recogniser () const
 Returns a string that expresses this triangulation in Matveev's 3-manifold recogniser format. More...
 
std::string recognizer () const
 A synonym for recogniser(). 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...
 
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
Packetparent () const
 Determines the parent packet in the tree structure. More...
 
PacketfirstChild () const
 Determines the first child of this packet in the tree structure. More...
 
PacketlastChild () const
 Determines the last child of this packet in the tree structure. More...
 
PacketnextSibling () const
 Determines the next sibling of this packet in the tree structure. More...
 
PacketprevSibling () const
 Determines the previous sibling of this packet in the tree structure. More...
 
Packetroot () 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
PacketnextTreePacket ()
 Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs. More...
 
const PacketnextTreePacket () const
 Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs. More...
 
PacketnextTreePacket (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 PacketnextTreePacket (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...
 
PacketfirstTreePacket (const std::string &type)
 Finds the first packet of the requested type in a complete depth-first iteration of the tree structure. More...
 
const PacketfirstTreePacket (const std::string &type) const
 Finds the first packet of the requested type in a complete depth-first iteration of the tree structure. More...
 
PacketfindPacketLabel (const std::string &label)
 Finds the packet with the requested label in the tree or subtree for which this packet is matriarch. More...
 
const PacketfindPacketLabel (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
Packetclone (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...
 
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...
 
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 GroupPresentationfundamentalGroup () 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 AbelianGrouphomology () const
 Returns the first homology group for this triangulation. More...
 
const AbelianGrouphomologyH1 () 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...
 
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...
 

Static Public Member Functions

static XMLPacketReaderxmlReader (Packet *parent, XMLTreeResolver &resolver)
 
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...
 
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...
 

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

virtual PacketinternalClonePacket (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...
 
void writeXMLPacketTree (std::ostream &out) const
 Writes a chunk of XML containing the subtree with this packet as matriarch. 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...
 
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 ksubdim. 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 ksubdim. 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...
 

Friends

class regina::Face< 3, 3 >
 
class regina::detail::SimplexBase< 3 >
 
class regina::detail::TriangulationBase< 3 >
 
class regina::XMLTriangulationReader< 3 >
 

Detailed Description

template<>
class regina::Triangulation< 3 >

Represents a 3-dimensional triangulation, typically of a 3-manifold.

This is a specialisation of the generic Triangulation class template; see the Triangulation documentation for a general overview of how the triangulation classes work.

This 3-dimensional specialisation offers significant extra functionality, including many functions specific to 3-manifolds.

Todo:

Feature: Is the boundary incompressible?

Feature (long-term): Am I obviously a handlebody? (Simplify and see if there is nothing left). Am I obviously not a handlebody? (Compare homology with boundary homology).

Feature (long-term): Is the triangulation Haken?

Feature (long-term): What is the Heegaard genus?

Feature (long-term): Have a subcomplex as a child packet of a triangulation. Include routines to crush a subcomplex or to expand a subcomplex to a normal surface.

Feature (long-term): Implement writeTextLong() for skeletal objects.

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.

§ EdgeIterator

Used to iterate through edges.

§ SafePointeeType

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.

§ TetrahedronIterator

typedef std::vector<Tetrahedron<3>*>::const_iterator regina::Triangulation< 3 >::TetrahedronIterator

A dimension-specific alias for SimplexIterator, used to iterate through tetrahedra.

§ TriangleIterator

Used to iterate through triangles.

§ TuraevViroSet

typedef std::map<std::pair<unsigned long, bool>, Cyclotomic> regina::Triangulation< 3 >::TuraevViroSet

A map from (r, parity) pairs to Turaev-Viro invariants, as described by turaevViro().

§ VertexIterator

Used to iterate through vertices.

Constructor & Destructor Documentation

§ Triangulation() [1/4]

Default constructor.

Creates an empty triangulation.

§ Triangulation() [2/4]

regina::Triangulation< 3 >::Triangulation ( const Triangulation< 3 > &  copy)
inline

Creates a new copy of the given triangulation.

The packet tree structure and packet label are not copied.

This will clone any computed properties (such as homology, fundamental group, and so on) of the given triangulation also. If you want a "clean" copy that resets all properties to unknown, you can use the two-argument copy constructor instead.

Parameters
copythe triangulation to copy.

§ Triangulation() [3/4]

regina::Triangulation< 3 >::Triangulation ( const Triangulation< 3 > &  copy,
bool  cloneProps 
)

Creates a new copy of the given triangulation, with the option of whether or not to clone its computed properties also.

Parameters
copythe triangulation to copy.
clonePropstrue if this should also clone any computed properties of the given triangulation (such as homology, fundamental group, and so on), or false if the new triangulation should have all properties marked as unknown.

§ Triangulation() [4/4]

regina::Triangulation< 3 >::Triangulation ( const std::string &  description)

"Magic" constructor that tries to find some way to interpret the given string as a triangulation.

At present, Regina understands the following types of strings (and attempts to parse them in the following order):

This list may grow in future versions of Regina.

Regina will also set the packet label accordingly.

If Regina cannot interpret the given string, this will be left as the empty triangulation.

Warning
If you pass the contents of a SnapPea data file, then only the tetrahedron gluings will be read; all other SnapPea-specific information (such as peripheral curves) will be lost. See fromSnapPea() for details, and for other alternatives that preserve SnapPea-specific data.
Parameters
descriptiona string that describes a 3-manifold triangulation.

§ ~Triangulation()

regina::Triangulation< 3 >::~Triangulation ( )
inlinevirtual

Destroys this triangulation.

The constituent tetrahedra, the cellular structure and all other properties will also be destroyed.

Member Function Documentation

§ addTag()

bool regina::Packet::addTag ( const std::string &  tag)
inherited

Associates the given tag with this packet.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Precondition
The given tag is not the empty string.
Parameters
tagthe tag to add.
Returns
true if the given tag was successfully added, or false if the given tag was already present beforehand.

§ adornedLabel()

std::string regina::Packet::adornedLabel ( const std::string &  adornment) const
inherited

Returns the label of this packet adorned with the given string.

An adornment typically shows how a packet has been created and/or modified. For instance, the adornment argument might be "Filled", or "Summand #1".

The way in which the packet label is adorned depends upon the label itself (in particular, an empty packet label will be handled in a sensible way). The way in which the packet label is adorned is subject to change in future versions of Regina.

Note that, whilst this routine returns a modified version of the packet label, the label itself will not be permamently changed.

Parameters
adornmentthe string that will be used to adorn this packet label. The adornment should just be a piece of English, ideally beginning with an upper-case letter. It should not contain any surrounding punctuation such as brackets or a dash (this will be added automatically by this routine as required).
Returns
a copy of the packet label with the given adornment.

§ allCalculatedTuraevViro()

const Triangulation< 3 >::TuraevViroSet & regina::Triangulation< 3 >::allCalculatedTuraevViro ( ) const
inline

Returns the cache of all Turaev-Viro state sum invariants that have been calculated for this 3-manifold.

This cache is updated every time turaevViro() is called, and is emptied whenever the triangulation is modified.

Turaev-Viro invariants are identified by an (r, parity) pair as described in the turaevViro() documentation. The cache is just a set that maps (r, parity) pairs to the corresponding invariant values.

For even values of r, the parity is ignored when calling turaevViro() (since the even and odd versions of the invariant contain essentially the same information). Therefore, in this cache, all even values of r will have the corresponding parities set to false.

Note
All invariants in this cache are now computed using exact arithmetic, as elements of a cyclotomic field. This is a change from Regina 4.96 and earlier, which computed floating-point approximations instead.
Python:
Not present.
Returns
the cache of all Turaev-Viro invariants that have already been calculated.
See also
turaevViro

§ 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
inlineinherited

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
indexthe 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
inlineinherited

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:
This routine returns a python list.
Returns
the list of all boundary components.

§ calculatedSkeleton()

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

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 ( )
protectedinherited

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.

§ clone()

Packet* regina::Packet::clone ( bool  cloneDescendants = false,
bool  end = true 
) const
inherited

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.

Note that any string tags associated with this packet will not be cloned.

If this packet has no parent in the tree structure, no clone will be created and 0 will be returned.

Parameters
cloneDescendantstrue if the descendants of this packet should also be cloned and inserted as descendants of the new packet. If this is passed as false (the default), only this packet will be cloned.
endtrue if the new packet should be inserted at the end of the parent's list of children (the default), or false if the new packet should be inserted as the sibling immediately after this packet.
Returns
the newly inserted packet, or 0 if this packet has no parent.

§ closeBook()

bool regina::Triangulation< 3 >::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.

This involves taking a boundary edge of the triangulation and folding together the two boundary triangles on either side. This move is the inverse of the openBook() move, and is used to simplify the boundary of the triangulation. This move can be done if:

  • the edge e is a boundary edge;
  • the two boundary triangles that it joins are distinct;
  • the two vertices opposite e in each of these boundary triangles are valid and distinct;
  • if edges e1 and e2 of one boundary triangle are to be folded onto edges f1 and f2 of the other boundary triangle respectively, then we do not have both e1 = e2 and f1 = f2.

There are in fact several other "distinctness" conditions on the edges e1, e2, f1 and f2, but they follow automatically from the "distinct vertices" condition above.

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument f) can no longer be used.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given edge is an edge of this triangulation.
Parameters
ethe edge about which to perform the move.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

§ collapseEdge()

bool regina::Triangulation< 3 >::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.

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument e) can no longer be used.

The eligibility requirements for this move are somewhat involved, and are discussed in detail in the collapseEdge() source code for those who are interested.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given edge is an edge of this triangulation.
Parameters
ethe edge to collapse.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the given edge may be collapsed without changing the topology of the manifold. If check is false, the function simply returns true.

§ component()

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

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
indexthe 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
inlineinherited

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:
This routine returns a python list.
Returns
the list of all components.

§ connectedSumDecomposition()

long regina::Triangulation< 3 >::connectedSumDecomposition ( Packet primeParent = 0,
bool  setLabels = true 
)

Splits this triangulation into its connected sum decomposition.

The individual prime 3-manifold triangulations that make up this decomposition will be inserted as children of the given parent packet. The original triangulation will be left unchanged.

For non-orientable triangulations, this routine is only guaranteed to succeed if the original manifold contains no embedded two-sided projective planes. If the manifold does contain embedded two-sided projective planes, then this routine might still succeed but it might fail; however, such a failure will always be detected, and in such a case this routine will return -1 instead (without building any prime summands at all).

Note that this routine is currently only available for closed triangulations; see the list of preconditions for full details.

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

This routine can optionally assign unique (and sensible) packet labels to each of the new prime summand triangulations. Note however that uniqueness testing may be slow, so this assignment of labels should be disabled if the summand triangulations are only temporary objects used as part of a larger routine.

If this is a triangulation of a 3-sphere then no prime summand triangulations will be created at all, and this routine will return 0.

The underlying algorithm appears in "A new approach to crushing 3-manifold triangulations", Discrete and Computational Geometry 52:1 (2014), pp. 116-139. This algorithm is based on the Jaco-Rubinstein 0-efficiency algorithm, and works in both orientable and non-orientable settings.

Warning
Users are strongly advised to check the return value if embedded two-sided projective planes are a possibility, since in such a case this routine might fail (as explained above). Note however that this routine might still succeed, and so success is not a proof that no embedded two-sided projective planes exist.
The algorithms used in this routine rely on normal surface theory and so can be very slow for larger triangulations. For 3-sphere testing, see the routine isThreeSphere() which uses faster methods where possible.
Precondition
This triangulation is valid, closed and connected.
Parameters
primeParentthe packet beneath which the new prime summand triangulations will be inserted, or 0 if they should be inserted directly beneath this triangulation.
setLabelstrue if the new prime summand triangulations should be assigned unique packet labels, or false if they should be left without labels at all.
Returns
the number of prime summands created, 0 if this triangulation is a 3-sphere, or -1 if this routine failed because this is a non-orientable triangulation with embedded two-sided projective planes.

§ connectedSumWith()

void regina::Triangulation< 3 >::connectedSumWith ( const Triangulation< 3 > &  other)

Forms the connected sum of this triangulation with the given triangulation.

This triangulation will be altered directly.

If this and the given triangulation are both oriented, then the result will be oriented also, and the connected sum will respect these orientations.

This and/or the given triangulation may be bounded or ideal, or even invalid; in all cases the connected sum will be formed correctly. Note, however, that the result might possibly contain internal vertices (even if the original triangulations do not).

Precondition
This triangulation is connected and non-empty.
Parameters
otherthe triangulation to sum with this.

§ countBoundaryComponents()

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

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
inlineinherited

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.

§ countChildren()

size_t regina::Packet::countChildren ( ) const
inherited

Returns the number of immediate children of this packet.

Grandchildren and so on are not counted.

Returns
the number of immediate children.

§ countComponents()

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

Returns the number of connected components in this triangulation.

Returns
the number of connected components.

§ countDescendants()

size_t regina::Packet::countDescendants ( ) const
inlineinherited

Returns the total number of descendants of this packet.

This includes children, grandchildren and so on. This packet is not included in the count.

Returns
the total number of descendants.

§ countFaces()

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

Returns the number of subdim-faces in this triangulation.

Precondition
The template argument subdim is between 0 and dim-1 inclusive.
Python:
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.

§ dehydrate()

std::string regina::Triangulation< 3 >::dehydrate ( ) const

Dehydrates this triangulation into an alphabetical string.

A dehydration string is a compact text representation of a triangulation, introduced by Callahan, Hildebrand and Weeks for their cusped hyperbolic census (see below). The dehydration string of an n-tetrahedron triangulation consists of approximately (but not precisely) 5n/2 lower-case letters.

Dehydration strings come with some restrictions:

  • They rely on the triangulation being "canonical" in some combinatorial sense. This is not enforced here; instead a combinatorial isomorphism is applied to make the triangulation canonical, and this isomorphic triangulation is dehydrated instead. Note that the original triangulation is not changed.
  • They require the triangulation to be connected.
  • They require the triangulation to have no boundary triangles (though ideal triangulations are fine).
  • They can only support triangulations with at most 25 tetrahedra.

The routine rehydrate() can be used to recover a triangulation from a dehydration string. Note that the triangulation recovered might not be identical to the original, but it is guaranteed to be an isomorphic copy.

For a full description of the dehydrated triangulation format, see A Census of Cusped Hyperbolic 3-Manifolds, Callahan, Hildebrand and Weeks, Mathematics of Computation 68/225, 1999.

Returns
a dehydrated representation of this triangulation (or an isomorphic variant of this triangulation), or the empty string if dehydration is not possible because the triangulation is disconnected, has boundary triangles or contains too many tetrahedra.
See also
rehydrate
insertRehydration

§ deleteFaces()

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

Deletes all faces of dimension subdim and below.

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

§ dependsOnParent()

bool regina::Triangulation< 3 >::dependsOnParent ( ) const
inlinevirtual

Determines if this packet depends upon its parent.

This is true if the parent cannot be altered without invalidating or otherwise upsetting this packet.

Returns
true if and only if this packet depends on its parent.

Implements regina::Packet.

Reimplemented in regina::SnapPeaTriangulation.

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

§ drillEdge()

void regina::Triangulation< 3 >::drillEdge ( Edge< 3 > *  e)

Drills out a regular neighbourhood of the given edge of the triangulation.

This is done by (i) performing two barycentric subdivisions, (ii) removing all tetrahedra that touch the original edge, and (iii) simplifying the resulting triangulation.

Warning
The second barycentric subdivision will multiply the number of tetrahedra by 576; as a result this routine might be slow, and the number of tetrahedra at the end might be large (even taking the simplification into account).
Parameters
ethe edge to drill out.

§ 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
inlineprotectedinherited

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

§ enterTextTriangulation()

static Triangulation<3>* regina::Triangulation< 3 >::enterTextTriangulation ( std::istream &  in,
std::ostream &  out 
)
static

Allows the user to interactively enter a triangulation in plain text.

Prompts will be sent to the given output stream and information will be read from the given input stream.

Python:
This routine is a member of class Engine. It takes no parameters; in and out are always assumed to be standard input and standard output respectively.
Parameters
inthe input stream from which text will be read.
outthe output stream to which prompts will be written.
Returns
the triangulation entered in by the user.

§ eulerCharManifold()

long regina::Triangulation< 3 >::eulerCharManifold ( ) const

Returns the Euler characteristic of the corresponding compact 3-manifold.

Instead of simply calculating V-E+F-T, this routine also:

  • treats ideal vertices as surface boundary components (i.e., effectively truncates them);
  • truncates invalid boundary vertices (i.e., boundary vertices whose links are not discs);
  • truncates the projective plane cusps at the midpoints of invalid edges (edges identified with themselves in reverse).

For ideal triangulations, this routine therefore computes the proper Euler characteristic of the manifold (unlike eulerCharTri(), which does not).

For triangulations whose vertex links are all spheres or discs, this routine and eulerCharTri() give identical results.

Returns
the Euler characteristic of the corresponding compact manifold.

§ eulerCharTri()

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

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
inlineinherited

Returns the requested subdim-face of this triangulation.

Precondition
The template argument subdim is between 0 and dim-1 inclusive.
Python:
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
indexthe 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
inlineinherited

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:
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
inlineprotectedinherited

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
resultthe vector in which the results will be placed.

§ findAllIsomorphisms()

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

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:
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
otherthe triangulation to compare with this one.
outputthe 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
inlineinherited

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:
Not present.
Parameters
otherthe triangulation in which to search for isomorphic copies of this triangulation.
outputthe output iterator to which the isomorphisms will be written.
Returns
the number of isomorphisms that were found.

§ findPacketLabel() [1/2]

Packet* regina::Packet::findPacketLabel ( const std::string &  label)
inherited

Finds the packet with the requested label in the tree or subtree for which this packet is matriarch.

Note that label comparisons are case sensitive.

Parameters
labelthe label to search for.
Returns
the packet with the requested label, or 0 if there is no such packet.

§ findPacketLabel() [2/2]

const Packet* regina::Packet::findPacketLabel ( const std::string &  label) const
inherited

Finds the packet with the requested label in the tree or subtree for which this packet is matriarch.

Note that label comparisons are case sensitive.

Parameters
labelthe label to search for.
Returns
the packet with the requested label, or 0 if there is no such packet.

§ findStrictAngleStructure()

const AngleStructure* regina::Triangulation< 3 >::findStrictAngleStructure ( ) const

Searches for a strict angle structure on this triangulation.

Recall that a strict angle structure is one in which every angle is strictly between 0 and π. If a strict angle structure does exist, then this routine is guaranteed to find one.

The underlying algorithm runs a single linear program (it does not enumerate all vertex angle structures). This means that it is likely to be fast even for large triangulations.

If you are only interested in whether a strict angle structure exists (i.e., you are not interested in the specific angles themselves), then you may call hasStrictAngleStructure() instead.

The angle structure returned (if any) is cached internally alongside this triangulation. This means that, as long as the triangulation does not change, subsequent calls to findStrictAngleStructure() will return identical pointers and will be essentially instantaneous.

If the triangulation changes however, then the cached angle structure will be deleted. This means that you should not store the returned pointer for later use; instead you should just call findStrictAngleStructure() again.

Returns
a strict angle structure on this triangulation, or 0 if none exists.

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

§ firstChild()

Packet * regina::Packet::firstChild ( ) const
inlineinherited

Determines the first child of this packet in the tree structure.

This routine takes small constant time.

Returns
the first child packet, or 0 if there is none.

§ firstTreePacket() [1/2]

Packet* regina::Packet::firstTreePacket ( const std::string &  type)
inherited

Finds the first packet of the requested type in a complete depth-first iteration of the tree structure.

Note that this packet must be the matriarch of the entire tree.

A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.

Parameters
typethe type of packet to search for, as returned by typeName(). Note that string comparisons are case sensitive.
Returns
the first such packet, or 0 if there are no packets of the requested type.

§ firstTreePacket() [2/2]

const Packet* regina::Packet::firstTreePacket ( const std::string &  type) const
inherited

Finds the first packet of the requested type in a complete depth-first iteration of the tree structure.

Note that this packet must be the matriarch of the entire tree.

A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.

Parameters
typethe type of packet to search for, as returned by typeName(). Note that string comparisons are case sensitive.
Returns
the first such packet, or 0 if there are no packets of the requested type.

§ fourFourMove()

bool regina::Triangulation< 3 >::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.

This involves replacing the four tetrahedra joined at that edge with four tetrahedra joined along a different edge. Consider the octahedron made up of the four original tetrahedra; this has three internal axes. The initial four tetrahedra meet along the given edge which forms one of these axes; the new tetrahedra will meet along a different axis. This move can be done iff (i) the edge is valid and non-boundary, and (ii) the four tetrahedra are distinct.

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument e) can no longer be used.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given edge is an edge of this triangulation.
Parameters
ethe edge about which to perform the move.
newAxisSpecifies which axis of the octahedron the new tetrahedra should meet along; this should be 0 or 1. Consider the four original tetrahedra in the order described by Edge<3>::embedding(0,...,3); call these tetrahedra 0, 1, 2 and
  1. If newAxis is 0, the new axis will separate tetrahedra 0 and 1 from 2 and 3. If newAxis is 1, the new axis will separate tetrahedra 1 and 2 from 3 and 0.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

§ fromIsoSig()

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

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

§ fromSnapPea()

static Triangulation<3>* regina::Triangulation< 3 >::fromSnapPea ( const std::string &  snapPeaData)
static

Extracts the tetrahedron gluings from a string that contains the full contents of a SnapPea data file.

All other SnapPea-specific information (such as peripheral curves) will be ignored, since Regina's Triangulation<3> class does not track such information itself.

If you wish to preserve all SnapPea-specific information from the data file, you should work with the SnapPeaTriangulation class instead (which uses the SnapPea kernel directly, and can therefore store anything that SnapPea can).

If you wish to read a triangulation from a SnapPea file, you should likewise call the SnapPeaTriangulation constructor, giving the filename as argument. This will read all SnapPea-specific information (as described above), and also avoids constructing an enormous intermediate string.

The triangulation that is returned will be newly created. If the SnapPea data is not in the correct format, this routine will return 0 instead.

Warning
This routine is "lossy", in that drops SnapPea-specific information (as described above). Unless you specifically need an Triangulation<3> (not an SnapPeaTriangulation) or you need to avoid calling routines from the SnapPea kernel, it is highly recommended that you create a SnapPeaTriangulation from the given file contents instead. See the string-based SnapPeaTriangulation constructor for how to do this.
Parameters
snapPeaDataa string containing the full contents of a SnapPea data file.
Returns
a new triangulation extracted from the given data, or 0 on error.

§ fullName()

std::string regina::Packet::fullName ( ) const
inherited

Returns a descriptive text string for the packet.

The string is of the form label (packet-type).

The packet label will be adjusted for human-readable output according to the behaviour of humanLabel().

Returns
the descriptive text string.

§ 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
inlineinherited

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 ≤ kdim.

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
inlineinherited

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.

§ hasCompressingDisc()

bool regina::Triangulation< 3 >::hasCompressingDisc ( ) const

Searches for a compressing disc within the underlying 3-manifold.

Let M be the underlying 3-manifold and let B be its boundary. By a compressing disc, we mean a disc D properly embedded in M, where the boundary of D lies in B but does not bound a disc in B.

This routine will first call the heuristic routine hasSimpleCompressingDisc() in the hope of obtaining a fast answer. If this fails, it will do one of two things:

  • If the triangulation is orientable and 1-vertex, it will use the linear programming and crushing machinery outlined in "Computing closed essential surfaces in knot complements", Burton, Coward and Tillmann, SCG '13, p405-414, 2013. This is often extremely fast, even for triangulations with many tetrahedra.
  • If the triangulation is non-orientable or has multiple vertices then it will run a full enumeration of vertex normal surfaces, as described in "Algorithms for the complete decomposition of a closed 3-manifold", Jaco and Tollefson, Illinois J. Math. 39 (1995), 358-406. As the number of tetrahedra grows, this can become extremely slow.

This routine will work on a copy of this triangulation, not the original. In particular, the copy will be simplified, which means that there is no harm in calling this routine on an unsimplified triangulation.

If this triangulation has no boundary components, this routine will simply return false.

Precondition
This triangulation is valid and is not ideal.
The underlying 3-manifold is irreducible.
Warning
This routine can be infeasibly slow for large triangulations (particularly those that are non-orientable or have multiple vertices), since it may need to perform a full enumeration of vertex normal surfaces, and since it might perform "large" operations on these surfaces such as cutting along them. See hasSimpleCompressingDisc() for a "heuristic shortcut" that is faster but might not give a definitive answer.
Returns
true if the underlying 3-manifold contains a compressing disc, or false if it does not.

§ hasNegativeIdealBoundaryComponents()

bool regina::Triangulation< 3 >::hasNegativeIdealBoundaryComponents ( ) const
inline

Determines if this triangulation contains any ideal boundary components with negative Euler characteristic.

Returns
true if and only if there is at least one such boundary component.

§ hasNonTrivialSphereOrDisc()

NormalSurface* regina::Triangulation< 3 >::hasNonTrivialSphereOrDisc ( )

Searches for a non-vertex-linking normal sphere or disc within this triangulation.

If such a surface exists within this triangulation, this routine is guaranteed to find one.

Note that the surface returned (if any) depends upon this triangulation, and so the surface must be destroyed before this triangulation is destroyed.

Warning
This routine may, in some scenarios, temporarily modify the packet tree by creating and then destroying a normal surface list.
Returns
a newly allocated non-vertex-linking normal sphere or disc, or 0 if none exists.

§ hasOctagonalAlmostNormalSphere()

NormalSurface* regina::Triangulation< 3 >::hasOctagonalAlmostNormalSphere ( )

Searches for an octagonal almost normal 2-sphere within this triangulation.

If such a surface exists, this routine is guaranteed to find one.

Note that the surface returned (if any) depends upon this triangulation, and so the surface must be destroyed before this triangulation is destroyed.

Precondition
This triangulation is valid, closed, orientable, connected, and 0-efficient. These preconditions are almost certainly more restrictive than they need to be, but we stay safe for now.
Warning
This routine may, in some scenarios, temporarily modify the packet tree by creating and then destroying a normal surface list.
Returns
a newly allocated non-vertex-linking normal sphere or disc, or 0 if none exists.

§ hasOwner()

bool regina::Packet::hasOwner ( ) const
inlineinherited

Indicates whether some other object in the calculation engine is responsible for ultimately destroying this object.

For packets, this returns true if and only if this packet has a parent in the packet tree (i.e., is not the root).

Returns
true if and only if some other object owns this object.

§ hasSimpleCompressingDisc()

bool regina::Triangulation< 3 >::hasSimpleCompressingDisc ( ) const

Searches for a "simple" compressing disc inside this triangulation.

Let M be the underlying 3-manifold and let B be its boundary. By a compressing disc, we mean a disc D properly embedded in M, where the boundary of D lies in B but does not bound a disc in B.

By a simple compressing disc, we mean a compressing disc that has a very simple combinatorial structure (here "simple" is subject to change; see the warning below). Examples include the compressing disc inside a 1-tetrahedron solid torus, or a compressing disc formed from a single internal triangle surrounded by three boundary edges.

The purpose of this routine is to avoid working with normal surfaces within a large triangulation where possible. This routine is relatively fast, and if it returns true then this 3-manifold definitely contains a compressing disc. If this routine returns false then there might or might not be a compressing disc; the user will need to perform a full normal surface enumeration using hasCompressingDisc() to be sure.

This routine will work on a copy of this triangulation, not the original. In particular, the copy will be simplified, which means that there is no harm in calling this routine on an unsimplified triangulation.

If this triangulation has no boundary components, this routine will simply return false.

For further information on this test, see "The Weber-Seifert dodecahedral space is non-Haken", Benjamin A. Burton, J. Hyam Rubinstein and Stephan Tillmann, Trans. Amer. Math. Soc. 364:2 (2012), pp. 911-932.

Warning
The definition of "simple" is subject to change in future releases of Regina. That is, this routine may be expanded over time to identify more types of compressing discs (thus making it more useful as a "heuristic shortcut").
Precondition
This triangulation is valid and is not ideal.
Returns
true if a simple compressing disc was found, or false if not. Note that even with a return value of false, there might still be a compressing disc (just not one with a simple combinatorial structure).

§ hasSplittingSurface()

bool regina::Triangulation< 3 >::hasSplittingSurface ( )

Determines whether this triangulation has a normal splitting surface.

See NormalSurface::isSplitting() for details regarding normal splitting surfaces.

Precondition
This triangulation is connected. If the triangulation is not connected, this routine will still return a result but that result will be unreliable.
Returns
true if and only if this triangulation has a normal splitting surface.

§ hasStrictAngleStructure()

bool regina::Triangulation< 3 >::hasStrictAngleStructure ( ) const
inline

Determines whether this triangulation supports a strict angle structure.

Recall that a strict angle structure is one in which every angle is strictly between 0 and π.

This routine is equivalent to calling findStrictAngleStructure() and testing whether the return value is non-null.

The underlying algorithm runs a single linear program (it does not enumerate all vertex angle structures). This means that it is likely to be fast even for large triangulations.

Returns
true if a strict angle structure exists on this triangulation, or 0 if not.

§ hasTag()

bool regina::Packet::hasTag ( const std::string &  tag) const
inlineinherited

Determines whether this packet has the given associated tag.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Parameters
tagthe tag to search for.
Returns
true if the given tag is found, false otherwise.

§ hasTags()

bool regina::Packet::hasTags ( ) const
inlineinherited

Determines whether this packet has any associated tags at all.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Returns
true if this packet has any tags, false otherwise.

§ hasTwoSphereBoundaryComponents()

bool regina::Triangulation< 3 >::hasTwoSphereBoundaryComponents ( ) const
inline

Determines if this triangulation contains any two-sphere boundary components.

Returns
true if and only if there is at least one two-sphere boundary component.

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

§ homologyBdry()

const AbelianGroup& regina::Triangulation< 3 >::homologyBdry ( ) const

Returns the first homology group of the boundary for this triangulation.

Note that ideal vertices are considered part of the boundary.

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, homologyBdry() should be called again; this will be instantaneous if the group has already been calculated.

This routine is fairly fast, since it deduces the homology of each boundary component through knowing what kind of surface it is.

Precondition
This triangulation is valid.
Returns
the first homology group of the boundary.

§ homologyH1()

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

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.

§ homologyH2()

const AbelianGroup& regina::Triangulation< 3 >::homologyH2 ( ) const

Returns the second homology group for this triangulation.

If this triangulation contains any ideal vertices, the homology group will be calculated as if each such vertex had been truncated. The algorithm used calculates various first homology groups and uses homology and cohomology theorems to deduce the second homology group.

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, homologyH2() should be called again; this will be instantaneous if the group has already been calculated.

Precondition
This triangulation is valid.
Returns
the second homology group.

§ homologyH2Z2()

unsigned long regina::Triangulation< 3 >::homologyH2Z2 ( ) const
inline

Returns the second homology group with coefficients in Z_2 for this triangulation.

If this triangulation contains any ideal vertices, the homology group will be calculated as if each such vertex had been truncated. The algorithm used calculates the relative first homology group with respect to the boundary and uses homology and cohomology theorems to deduce the second homology group.

This group will simply be the direct sum of several copies of Z_2, so the number of Z_2 terms is returned.

Precondition
This triangulation is valid.
Returns
the number of Z_2 terms in the second homology group with coefficients in Z_2.

§ homologyRel()

const AbelianGroup& regina::Triangulation< 3 >::homologyRel ( ) const

Returns the relative first homology group with respect to the boundary for this triangulation.

Note that ideal vertices are considered part of the boundary.

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, homologyRel() should be called again; this will be instantaneous if the group has already been calculated.

Precondition
This triangulation is valid.
Returns
the relative first homology group with respect to the boundary.

§ humanLabel()

std::string regina::Packet::humanLabel ( ) const
inlineinherited

Returns the label associated with this individual packet, adjusted if necessary for human-readable output.

In particular, if the packet has no label assigned then this routine will return "(no label)", not the empty string.

Warning
The method by which this routine adjusts packet labels is subject to change in future versions of Regina.
Returns
this individual packet's label.

§ idealToFinite()

bool regina::Triangulation< 3 >::idealToFinite ( )

Converts an ideal triangulation into a finite triangulation.

All ideal or invalid vertices are truncated and thus converted into real boundary components made from unglued faces of tetrahedra.

Note that this operation is a loose converse of finiteToIdeal().

Warning
Currently, this routine subdivides all tetrahedra as if all vertices (not just some) were ideal. This may lead to more tetrahedra than are necessary.
Currently, the presence of an invalid edge will force the triangulation to be subdivided regardless of the value of parameter forceDivision. The final triangulation will still have the projective plane cusp caused by the invalid edge.
Todo:
Optimise (long-term): Have this routine only use as many tetrahedra as are necessary, leaving finite vertices alone.
Returns
true if and only if the triangulation was changed.
Author
David Letscher

§ insertAugTriSolidTorus()

void regina::Triangulation< 3 >::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.

Almost all augmented triangular solid tori represent Seifert fibred spaces with three or fewer exceptional fibres. Augmented triangular solid tori are described in more detail in the AugTriSolidTorus class notes.

The resulting Seifert fibred space will be SFS((a1,b1) (a2,b2) (a3,b3) (1,1)), where the parameters a1, ..., b3 are passed as arguments to this routine. The three layered solid tori that are attached to the central triangular solid torus will be LST(|a1|, |b1|, |-a1-b1|), ..., LST(|a3|, |b3|, |-a3-b3|).

The new tetrahedra will be inserted at the end of the list of tetrahedra in the triangulation.

Precondition
gcd(a1, b1) = 1.
gcd(a2, b2) = 1.
gcd(a3, b3) = 1.
Parameters
a1a parameter describing the first layered solid torus in the augmented triangular solid torus; this may be either positive or negative.
b1a parameter describing the first layered solid torus in the augmented triangular solid torus; this may be either positive or negative.
a2a parameter describing the second layered solid torus in the augmented triangular solid torus; this may be either positive or negative.
b2a parameter describing the second layered solid torus in the augmented triangular solid torus; this may be either positive or negative.
a3a parameter describing the third layered solid torus in the augmented triangular solid torus; this may be either positive or negative.
b3a parameter describing the third layered solid torus in the augmented triangular solid torus; this may be either positive or negative.

§ insertChildAfter()

void regina::Packet::insertChildAfter ( Packet newChild,
Packet prevChild 
)
inherited

Inserts the given packet as a child of this packet at the given location in this packet's child list.

This routine takes small constant time.

Precondition
Parameter newChild has no parent packet.
Parameter prevChild is already a child of this packet.
This packet is not a descendant of newChild.
Python:
Since this packet takes ownership of the given child packet, the python object containing the given child packet becomes a null object and should no longer be used. See reparent() for a way of avoiding these problems in some cases.
Parameters
newChildthe child to insert.
prevChildthe preexisting child of this packet after which newChild will be inserted, or 0 if newChild is to be the first child of this packet.

§ insertChildFirst()

void regina::Packet::insertChildFirst ( Packet child)
inherited

Inserts the given packet as the first child of this packet.

This routine takes small constant time.

Precondition
The given child has no parent packet.
This packet is not a descendant of the given child.
Python:
Since this packet takes ownership of the given child packet, the python object containing the given child packet becomes a null object and should no longer be used. See reparent() for a way of avoiding these problems in some cases.
Parameters
childthe child to insert.

§ insertChildLast()

void regina::Packet::insertChildLast ( Packet child)
inherited

Inserts the given packet as the last child of this packet.

This routine takes small constant time.

Precondition
The given child has no parent packet.
This packet is not a descendant of the given child.
Python:
Since this packet takes ownership of the given child packet, the python object containing the given child packet becomes a null object and should no longer be used. See reparent() for a way of avoiding these problems in some cases.
Parameters
childthe child to insert.

§ 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:
Not present.
Parameters
nSimplicesthe number of additional simplices to insert.
adjacenciesdescribes which simplices are adjace to which others, as described above. This array must have initial dimension at least nSimplices.
gluingsdescribes the specific gluing permutations, as described above. This array must also have initial dimension at least nSimplices.

§ insertLayeredLensSpace()

void regina::Triangulation< 3 >::insertLayeredLensSpace ( unsigned long  p,
unsigned long  q 
)

Inserts a new layered lens space L(p,q) into the triangulation.

The lens space will be created by gluing together two layered solid tori in a way that uses the fewest possible tetrahedra.

The new tetrahedra will be inserted at the end of the list of tetrahedra in the triangulation.

Precondition
p > q >= 0 unless (p,q) = (0,1);
gcd(p, q) = 1.
Parameters
pa parameter of the desired lens space.
qa parameter of the desired lens space.
See also
LayeredLensSpace

§ insertLayeredLoop()

void regina::Triangulation< 3 >::insertLayeredLoop ( unsigned long  length,
bool  twisted 
)

Inserts a layered loop of the given length into this triangulation.

Layered loops are described in more detail in the LayeredLoop class notes.

The new tetrahedra will be inserted at the end of the list of tetrahedra in the triangulation.

Parameters
lengththe length of the new layered loop; this must be strictly positive.
twistedtrue if the new layered loop should be twisted, or false if it should be untwisted.
See also
LayeredLoop

§ insertLayeredSolidTorus()

Tetrahedron<3>* regina::Triangulation< 3 >::insertLayeredSolidTorus ( unsigned long  cuts0,
unsigned long  cuts1 
)

Inserts a new layered solid torus into the triangulation.

The meridinal disc of the layered solid torus will intersect the three edges of the boundary torus in cuts0, cuts1 and (cuts0 + cuts1) points respectively.

The boundary torus will always consist of faces 012 and 013 of the tetrahedron containing this boundary torus (this tetrahedron will be returned). In face 012, edges 12, 02 and 01 will meet the meridinal disc cuts0, cuts1 and (cuts0 + cuts1) times respectively. The only exceptions are if these three intersection numbers are (1,1,2) or (0,1,1), in which case edges 12, 02 and 01 will meet the meridinal disc (1, 2 and 1) or (1, 1 and 0) times respectively.

The new tetrahedra will be inserted at the end of the list of tetrahedra in the triangulation.

Precondition
0 <= cuts0 <= cuts1;
cuts1 is non-zero;
gcd(cuts0, cuts1) = 1.
Parameters
cuts0the smallest of the three desired intersection numbers.
cuts1the second smallest of the three desired intersection numbers.
Returns
the tetrahedron containing the boundary torus.
See also
LayeredSolidTorus

§ insertRehydration()

bool regina::Triangulation< 3 >::insertRehydration ( const std::string &  dehydration)

Inserts the rehydration of the given string into this triangulation.

If you simply wish to convert a dehydration string into a new triangulation, use the static routine rehydrate() instead. See dehydrate() for more information on dehydration strings.

This routine will first rehydrate the given string into a proper triangulation. The tetrahedra from the rehydrated triangulation will then be inserted into this triangulation in the same order in which they appear in the rehydrated triangulation, and the numbering of their vertices (0-3) will not change.

The routine dehydrate() can be used to extract a dehydration string from an existing triangulation. Dehydration followed by rehydration might not produce a triangulation identical to the original, but it is guaranteed to produce an isomorphic copy. See dehydrate() for the reasons behind this.

For a full description of the dehydrated triangulation format, see A Census of Cusped Hyperbolic 3-Manifolds, Callahan, Hildebrand and Weeks, Mathematics of Computation 68/225, 1999.

Parameters
dehydrationa dehydrated representation of the triangulation to insert. Case is irrelevant; all letters will be treated as if they were lower case.
Returns
true if the insertion was successful, or false if the given string could not be rehydrated.
See also
dehydrate
rehydrate

§ insertSFSOverSphere()

void regina::Triangulation< 3 >::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.

The inserted Seifert fibred space will be SFS((a1,b1) (a2,b2) (a3,b3) (1,1)), where the parameters a1, ..., b3 are passed as arguments to this routine.

The three pairs of parameters (a,b) do not need to be normalised, i.e., the parameters can be positive or negative and b may lie outside the range [0..a). There is no separate twisting parameter; each additional twist can be incorporated into the existing parameters by replacing some pair (a,b) with the pair (a,a+b). For Seifert fibred spaces with less than three exceptional fibres, some or all of the parameter pairs may be (1,k) or even (1,0).

The new tetrahedra will be inserted at the end of the list of tetrahedra in the triangulation.

Precondition
None of a1, a2 or a3 are 0.
gcd(a1, b1) = 1.
gcd(a2, b2) = 1.
gcd(a3, b3) = 1.
Parameters
a1a parameter describing the first exceptional fibre.
b1a parameter describing the first exceptional fibre.
a2a parameter describing the second exceptional fibre.
b2a parameter describing the second exceptional fibre.
a3a parameter describing the third exceptional fibre.
b3a parameter describing the third exceptional fibre.

§ 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
sourcethe triangulation whose copy will be inserted.

§ intelligentSimplify()

bool regina::Triangulation< 3 >::intelligentSimplify ( )

Attempts to simplify the triangulation using fast and greedy heuristics.

This routine will attempt to reduce both the number of tetrahedra and the number of boundary triangles (with the number of tetrahedra as its priority).

Currently this routine uses simplifyToLocalMinimum() in combination with random 4-4 moves, book opening moves and book closing moves.

Although intelligentSimplify() works very well most of the time, it can occasionally get stuck; in such cases you may wish to try the more powerful but (much) slower simplifyExhaustive() instead.

Warning
The specific behaviour of this routine may well change between releases.
Todo:
Optimise: Include random 2-3 moves to get out of wells.
Returns
true if and only if the triangulation was successfully simplified. Otherwise this triangulation will not be changed.

§ internalClonePacket()

Packet * regina::Triangulation< 3 >::internalClonePacket ( Packet parent) const
inlineprotectedvirtual

Makes a newly allocated copy of this packet.

This routine should not insert the new packet into the tree structure, clone the packet's associated tags or give the packet a label. It should also not clone any descendants of this packet.

You may assume that the new packet will eventually be inserted into the tree beneath either the same parent as this packet or a clone of that parent.

Parameters
parentthe parent beneath which the new packet will eventually be inserted.
Returns
the newly allocated packet.

Implements regina::Packet.

Reimplemented in regina::SnapPeaTriangulation.

§ internalID()

std::string regina::Packet::internalID ( ) const
inherited

Returns a unique string ID that identifies this packet.

The user has no control over this ID, and it is not human readable. It is guaranteed to remain fixed throughout the lifetime of the program for a given packet, and it is guaranteed not to clash with the ID of any other packet.

If you change the contents of a packet, its ID will not change.

If you clone a packet, the new clone will receive a different ID. If you save and then load a packet to/from file, the ID will change. These behaviours are necessary to ensure that IDs remain unique (since, for instance, you could load several copies of the same data file into memory simultaneously).

The ID is implemented as an encoding of the underlying C++ pointer. This encoding is subject to change in later versions of Regina.

Returns
a unique ID that identifies this packet.

§ isBall()

bool regina::Triangulation< 3 >::isBall ( ) const

Determines whether this is a triangulation of a 3-dimensional ball.

This routine is based on isThreeSphere(), which in turn combines Rubinstein's 3-sphere recognition algorithm with Jaco and Rubinstein's 0-efficiency prime decomposition algorithm.

Warning
The algorithms used in this routine rely on normal surface theory and so can be very slow for larger triangulations (although faster tests are used where possible). The routine knowsBall() can be called to see if this property is already known or if it happens to be very fast to calculate for this triangulation.
Returns
true if and only if this is a triangulation of a 3-dimensional ball.

§ isClosed()

bool regina::Triangulation< 3 >::isClosed ( ) const
inline

Determines if this triangulation is closed.

This is the case if and only if it has no boundary. Note that ideal triangulations are not closed.

Returns
true if and only if this triangulation is closed.

§ isConnected()

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

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
inlineinherited

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
otherthe 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
inlineinherited

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.

§ isGrandparentOf()

bool regina::Packet::isGrandparentOf ( const Packet descendant) const
inherited

Determines if this packet is equal to or an ancestor of the given packet in the tree structure.

Parameters
descendantthe other packet whose relationships we are examining.
Returns
true if and only if this packet is equal to or an ancestor of descendant.

§ isHaken()

bool regina::Triangulation< 3 >::isHaken ( ) const

Determines whether the underlying 3-manifold (which must be closed and orientable) is Haken.

In other words, this routine determines whether the underlying 3-manifold contains an embedded closed two-sided incompressible surface.

Currently Hakenness testing is available only for irreducible manifolds. This routine will first test whether the manifold is irreducible and, if it is not, will return false immediately.

Precondition
This triangulation is valid, closed, orientable and connected.
Warning
This routine could be very slow for larger triangulations.
Returns
true if and only if the underlying 3-manifold is irreducible and Haken.

§ isIdeal()

bool regina::Triangulation< 3 >::isIdeal ( ) const
inline

Determines if this triangulation is ideal.

This is the case if and only if one of the vertex links is closed and not a 2-sphere. Note that the triangulation is not required to be valid.

Returns
true if and only if this triangulation is ideal.

§ 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
otherthe triangulation to compare with this one.
Returns
true if and only if the two triangulations are combinatorially identical.

§ isIrreducible()

bool regina::Triangulation< 3 >::isIrreducible ( ) const

Determines whether the underlying 3-manifold (which must be closed) is irreducible.

In other words, this routine determines whether every embedded sphere in the underlying 3-manifold bounds a ball.

If the underlying 3-manifold is orientable, this routine will use fast crushing and branch-and-bound methods. If the underlying 3-manifold is non-orientable, it will use a (much slower) full enumeration of vertex normal surfaces.

Warning
The algorithms used in this routine rely on normal surface theory and might be slow for larger triangulations.
Precondition
This triangulation is valid, closed, orientable and connected.
Returns
true if and only if the underlying 3-manifold is irreducible.

§ isIsomorphicTo()

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

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
otherthe triangulation to compare with this one.
Returns
details of the isomorphism if the two triangulations are combinatorially isomorphic, or a null pointer otherwise.

§ isListening()

bool regina::Packet::isListening ( PacketListener listener)
inlineinherited

Determines whether the given packet listener is currently listening for events on this packet.

See the PacketListener class notes for details.

Python:
Not present.
Parameters
listenerthe listener to search for.
Returns
true if the given listener is currently registered with this packet, or false otherwise.

§ isOrdered()

bool regina::Triangulation< 3 >::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.

Equivalently, this tests whether the edges of the triangulation can all be oriented such that they induce a consistent ordering on the vertices of each tetrahedron.

Triangulations are not ordered by default, and indeed some cannot be ordered at all. The routine order() will attempt to relabel tetrahedron vertices to give an ordered triangulation.

Returns
true if and only if all gluing permutations are order preserving on the tetrahedron faces.
Author
Matthias Goerner

§ isOrientable()

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

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:
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
relabellingif 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)
staticinherited

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

§ isPacketEditable()

bool regina::Packet::isPacketEditable ( ) const
inherited

Determines whether this packet can be altered without invalidating or otherwise upsetting any of its immediate children.

Descendants further down the packet tree are not (and should not need to be) considered.

Returns
true if and only if this packet may be edited.

§ isSolidTorus()

bool regina::Triangulation< 3 >::isSolidTorus ( ) const

Determines whether this is a triangulation of the solid torus; that is, the unknot complement.

This routine can be used on a triangulation with real boundary triangles, or on an ideal triangulation (in which case all ideal vertices will be assumed to be truncated).

Warning
The algorithms used in this routine rely on normal surface theory and so might be very slow for larger triangulations (although faster tests are used where possible). The routine knowsSolidTorus() can be called to see if this property is already known or if it happens to be very fast to calculate for this triangulation.
Returns
true if and only if this is either a real (compact) or ideal (non-compact) triangulation of the solid torus.

§ isStandard()

bool regina::Triangulation< 3 >::isStandard ( ) const
inline

Determines if this triangulation is standard.

This is the case if and only if every vertex is standard. See Vertex<3>::isStandard() for further details.

Returns
true if and only if this triangulation is standard.

§ isThreeSphere()

bool regina::Triangulation< 3 >::isThreeSphere ( ) const

Determines whether this is a triangulation of a 3-sphere.

This routine relies upon a combination of Rubinstein's 3-sphere recognition algorithm and Jaco and Rubinstein's 0-efficiency prime decomposition algorithm.

Warning
The algorithms used in this routine rely on normal surface theory and so can be very slow for larger triangulations (although faster tests are used where possible). The routine knowsThreeSphere() can be called to see if this property is already known or if it happens to be very fast to calculate for this triangulation.
Returns
true if and only if this is a 3-sphere triangulation.

§ isValid()

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

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.

§ isZeroEfficient()

bool regina::Triangulation< 3 >::isZeroEfficient ( )

Determines if this triangulation is 0-efficient.

A triangulation is 0-efficient if its only normal spheres and discs are vertex linking, and if it has no 2-sphere boundary components.

Returns
true if and only if this triangulation is 0-efficient.

§ knowsBall()

bool regina::Triangulation< 3 >::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.

If this property is indeed already known, future calls to isBall() will be very fast (simply returning the precalculated value).

If this property is not already known, this routine will nevertheless run some very fast preliminary tests to see if the answer is obviously no. If so, it will store false as the precalculated value for isBall() and this routine will return true.

Otherwise a call to isBall() may potentially require more significant work, and so this routine will return false.

Warning
This routine does not actually tell you whether this triangulation forms a ball; it merely tells you whether the answer has already been computed (or is very easily computed).
Returns
true if and only if this property is already known or trivial to calculate.

§ knowsCompressingDisc()

bool regina::Triangulation< 3 >::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.

If this property is indeed already known, future calls to hasCompressingDisc() will be very fast (simply returning the precalculated value).

If this property is not already known, this routine will nevertheless run some very fast preliminary tests to see if the answer is obviously no. If so, it will store false as the precalculated value for hasCompressingDisc() and this routine will return true.

Otherwise a call to hasCompressingDisc() may potentially require more significant work, and so this routine will return false.

Warning
This routine does not actually tell you whether the underlying 3-manifold has a compressing disc; it merely tells you whether the answer has already been computed (or is very easily computed).
Precondition
This triangulation is valid and is not ideal.
The underlying 3-manifold is irreducible.
Returns
true if and only if this property is already known or trivial to calculate.

§ knowsHaken()

bool regina::Triangulation< 3 >::knowsHaken ( ) const

Is it already known (or trivial to determine) whether or not the underlying 3-manifold is Haken? See isHaken() for further details.

If this property is indeed already known, future calls to isHaken() will be very fast (simply returning the precalculated value).

Warning
This routine does not actually tell you whether the underlying 3-manifold is Haken; it merely tells you whether the answer has already been computed (or is very easily computed).
Precondition
This triangulation is valid, closed, orientable and connected.
Returns
true if and only if this property is already known or trivial to calculate.

§ knowsIrreducible()

bool regina::Triangulation< 3 >::knowsIrreducible ( ) const

Is it already known (or trivial to determine) whether or not the underlying 3-manifold is irreducible? See isIrreducible() for further details.

If this property is indeed already known, future calls to isIrreducible() will be very fast (simply returning the precalculated value).

Warning
This routine does not actually tell you whether the underlying 3-manifold is irreducible; it merely tells you whether the answer has already been computed (or is very easily computed).
Precondition
This triangulation is valid, closed, orientable and connected.
Returns
true if and only if this property is already known or trivial to calculate.

§ knowsSolidTorus()

bool regina::Triangulation< 3 >::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.

If this property is indeed already known, future calls to isSolidTorus() will be very fast (simply returning the precalculated value).

If this property is not already known, this routine will nevertheless run some very fast preliminary tests to see if the answer is obviously no. If so, it will store false as the precalculated value for isSolidTorus() and this routine will return true.

Otherwise a call to isSolidTorus() may potentially require more significant work, and so this routine will return false.

Warning
This routine does not actually tell you whether this triangulation forms a solid torus; it merely tells you whether the answer has already been computed (or is very easily computed).
Returns
true if and only if this property is already known or trivial to calculate.

§ knowsSplittingSurface()

bool regina::Triangulation< 3 >::knowsSplittingSurface ( ) const
inline

Is it already known whether or not this triangulation has a splitting surface? See hasSplittingSurface() for further details.

If this property is already known, future calls to hasSplittingSurface() will be very fast (simply returning the precalculated value).

Warning
This routine does not actually tell you whether this triangulation has a splitting surface; it merely tells you whether the answer has already been computed.
Returns
true if and only if this property is already known.

§ knowsStrictAngleStructure()

bool regina::Triangulation< 3 >::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.

If this property is indeed already known, future calls to findStrictAngleStructure() and hasStrictAngleStructure() will be very fast (simply returning the precalculated solution).

Warning
This routine does not actually tell you whether the triangulation supports a strict angle structure; it merely tells you whether the answer has already been computed (or is very easily computed).
Returns
true if and only if this property is already known or trivial to calculate.

§ knowsThreeSphere()

bool regina::Triangulation< 3 >::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.

If this property is indeed already known, future calls to isThreeSphere() will be very fast (simply returning the precalculated value).

If this property is not already known, this routine will nevertheless run some very fast preliminary tests to see if the answer is obviously no. If so, it will store false as the precalculated value for isThreeSphere() and this routine will return true.

Otherwise a call to isThreeSphere() may potentially require more significant work, and so this routine will return false.

Warning
This routine does not actually tell you whether this triangulation forms a 3-sphere; it merely tells you whether the answer has already been computed (or is very easily computed).
Returns
true if and only if this property is already known or trivial to calculate.

§ knowsZeroEfficient()

bool regina::Triangulation< 3 >::knowsZeroEfficient ( ) const
inline

Is it already known whether or not this triangulation is 0-efficient? See isZeroEfficient() for further details.

If this property is already known, future calls to isZeroEfficient() will be very fast (simply returning the precalculated value).

Warning
This routine does not actually tell you whether this triangulation is 0-efficient; it merely tells you whether the answer has already been computed.
Returns
true if and only if this property is already known.

§ label()

const std::string & regina::Packet::label ( ) const
inlineinherited

Returns the label associated with this individual packet.

An example is MyTriangulation.

Returns
this individual packet's label.

§ lastChild()

Packet * regina::Packet::lastChild ( ) const
inlineinherited

Determines the last child of this packet in the tree structure.

This routine takes small constant time.

Returns
the last child packet, or 0 if there is none.

§ layerOn()

Tetrahedron<3>* regina::Triangulation< 3 >::layerOn ( Edge< 3 > *  edge)

Performs a layering upon the given boundary edge of the triangulation.

See the Layering class notes for further details on what a layering entails.

Precondition
The given edge is a boundary edge of this triangulation, and the two boundary triangles on either side of it are distinct.
Parameters
edgethe boundary edge upon which to layer.
Returns
the new tetrahedron provided by the layering.

§ levelsDownTo()

unsigned regina::Packet::levelsDownTo ( const Packet descendant) const
inherited

Counts the number of levels between this packet and its given descendant in the tree structure.

If descendant is this packet, the number of levels is zero.

Precondition
This packet is equal to descendant, or can be obtained from descendant using only child-to-parent steps.
Parameters
descendantthe packet whose relationship with this packet we are examining.
Returns
the number of levels difference.

§ levelsUpTo()

unsigned regina::Packet::levelsUpTo ( const Packet ancestor) const
inlineinherited

Counts the number of levels between this packet and its given ancestor in the tree structure.

If ancestor is this packet, the number of levels is zero.

Precondition
This packet is equal to ancestor, or can be obtained from ancestor using only parent-to-child steps.
Parameters
ancestorthe packet whose relationship with this packet we are examining.
Returns
the number of levels difference.

§ listen()

bool regina::Packet::listen ( PacketListener listener)
inherited

Registers the given packet listener to listen for events on this packet.

See the PacketListener class notes for details.

Python:
Not present.
Parameters
listenerthe listener to register.
Returns
true if the given listener was successfully registered, or false if the given listener was already registered beforehand.

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

§ makeOrphan()

void regina::Packet::makeOrphan ( )
inherited

Cuts this packet away from its parent in the tree structure and instead makes it matriarch of its own tree.

The tree information for both this packet and its parent will be updated.

This routine takes small constant time.

Precondition
This packet has a parent.
This packet does not depend on its parent; see dependsOnParent() for details.
Python:
After makeOrphan() is called, this packet will become the root of a new packet tree that is owned by Python. In particular, if you call makeOrphan() and then delete all Python references to this packet, the entire packet subtree will be automatically destroyed.

§ makeZeroEfficient()

Packet* regina::Triangulation< 3 >::makeZeroEfficient ( )

Converts this into a 0-efficient triangulation of the same underlying 3-manifold.

A triangulation is 0-efficient if its only normal spheres and discs are vertex linking, and if it has no 2-sphere boundary components.

Note that this routine is currently only available for closed orientable triangulations; see the list of preconditions for details. The 0-efficiency algorithm of Jaco and Rubinstein is used.

If the underlying 3-manifold is prime, it can always be made 0-efficient (with the exception of the special cases RP3 and S2xS1 as noted below). In this case the original triangulation will be modified directly and 0 will be returned.

If the underyling 3-manifold is RP3 or S2xS1, it cannot be made 0-efficient; in this case the original triangulation will be reduced to a two-tetrahedron minimal triangulation and 0 will again be returned.

If the underlying 3-manifold is not prime, it cannot be made 0-efficient. In this case the original triangulation will remain unchanged and a new connected sum decomposition will be returned. This will be presented as a newly allocated container packet with one child triangulation for each prime summand.

Warning
The algorithms used in this routine rely on normal surface theory and so can be very slow for larger triangulations.
Precondition
This triangulation is valid, closed, orientable and connected.
Returns
0 if the underlying 3-manifold is prime (in which case the original triangulation was modified directly), or a newly allocated connected sum decomposition if the underlying 3-manifold is composite (in which case the original triangulation was not changed).

§ maximalForestInBoundary()

void regina::Triangulation< 3 >::maximalForestInBoundary ( std::set< Edge< 3 > *> &  edgeSet,
std::set< Vertex< 3 > *> &  vertexSet 
) const

Produces a maximal forest in the 1-skeleton of the triangulation boundary.

Both given sets will be emptied and the edges and vertices of the maximal forest will be placed into them. A vertex that forms its own boundary component (such as an ideal vertex) will still be placed in vertexSet.

Note that the edge and vertex pointers returned will become invalid once the triangulation has changed.

Python:
Not present.
Parameters
edgeSetthe set to be emptied and into which the edges of the maximal forest will be placed.
vertexSetthe set to be emptied and into which the vertices of the maximal forest will be placed.

§ maximalForestInSkeleton()

void regina::Triangulation< 3 >::maximalForestInSkeleton ( std::set< Edge< 3 > *> &  edgeSet,
bool  canJoinBoundaries = true 
) const

Produces a maximal forest in the triangulation's 1-skeleton.

The given set will be emptied and will have the edges of the maximal forest placed into it. It can be specified whether or not different boundary components may be joined by the maximal forest.

An edge leading to an ideal vertex is still a candidate for inclusion in the maximal forest. For the purposes of this algorithm, any ideal vertex will be treated as any other vertex (and will still be considered part of its own boundary component).

Note that the edge pointers returned will become invalid once the triangulation has changed.

Python:
Not present.
Parameters
edgeSetthe set to be emptied and into which the edges of the maximal forest will be placed.
canJoinBoundariestrue if and only if different boundary components are allowed to be joined by the maximal forest.

§ 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
destthe triangulation into which simplices should be moved.

§ moveDown()

void regina::Packet::moveDown ( unsigned  steps = 1)
inherited

Moves this packet the given number of steps towards the end of its sibling list.

If the number of steps is larger than the greatest possible movement, the packet will be moved to the very end of its sibling list.

This routine takes time proportional to the number of steps.

Precondition
The given number of steps is strictly positive.

§ moveToFirst()

void regina::Packet::moveToFirst ( )
inherited

Moves this packet to be the first in its sibling list.

This routine takes small constant time.

§ moveToLast()

void regina::Packet::moveToLast ( )
inherited

Moves this packet to be the last in its sibling list.

This routine takes small constant time.

§ moveUp()

void regina::Packet::moveUp ( unsigned  steps = 1)
inherited

Moves this packet the given number of steps towards the beginning of its sibling list.

If the number of steps is larger than the greatest possible movement, the packet will be moved to the very beginning of its sibling list.

This routine takes time proportional to the number of steps.

Precondition
The given number of steps is strictly positive.

§ 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
descthe description to give to the new simplex.
Returns
the new simplex.

§ newTetrahedron() [1/2]

Tetrahedron< 3 > * regina::Triangulation< 3 >::newTetrahedron ( )
inline

A dimension-specific alias for newSimplex().

See newSimplex() for further information.

§ newTetrahedron() [2/2]

Tetrahedron< 3 > * regina::Triangulation< 3 >::newTetrahedron ( const std::string &  desc)
inline

A dimension-specific alias for newSimplex().

See newSimplex() for further information.

§ nextSibling()

Packet * regina::Packet::nextSibling ( ) const
inlineinherited

Determines the next sibling of this packet in the tree structure.

This is the child of the parent that follows this packet.

This routine takes small constant time.

Returns
the next sibling of this packet, or 0 if there is none.

§ nextTreePacket() [1/4]

Packet* regina::Packet::nextTreePacket ( )
inherited

Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs.

Note that this packet need not be the tree matriarch.

A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.

Returns
the next packet, or 0 if this is the last packet in such an iteration.

§ nextTreePacket() [2/4]

const Packet* regina::Packet::nextTreePacket ( ) const
inherited

Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs.

Note that this packet need not be the tree matriarch.

A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.

Returns
the next packet, or 0 if this is the last packet in such an iteration.

§ nextTreePacket() [3/4]

Packet* regina::Packet::nextTreePacket ( const std::string &  type)
inherited

Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure.

Note that this packet need not be the tree matriarch. The order of tree searching is described in firstTreePacket().

Parameters
typethe type of packet to search for, as returned by typeName(). Note that string comparisons are case sensitive.
Returns
the next such packet, or 0 if this is the last packet of the requested type in such an iteration.

§ nextTreePacket() [4/4]

const Packet* regina::Packet::nextTreePacket ( const std::string &  type) const
inherited

Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure.

Note that this packet need not be the tree matriarch. The order of tree searching is described in firstTreePacket().

Parameters
typethe type of packet to search for, as returned by typeName(). Note that string comparisons are case sensitive.
Returns
the next such packet, or 0 if this is the last packet of the requested type in such an iteration.

§ niceTreeDecomposition()

const TreeDecomposition & regina::Triangulation< 3 >::niceTreeDecomposition ( ) const
inline

Returns a nice tree decomposition of the face pairing graph of this triangulation.

This can (for example) be used in implementing algorithms that are fixed-parameter tractable in the treewidth of the face pairing graph.

See TreeDecomposition for further details on tree decompositions, and see TreeDecomposition::makeNice() for details on what it means to be a nice tree decomposition.

This routine is fast: it will use a greedy algorithm to find a tree decomposition with (hopefully) small width, but with no guarantees that the width of this tree decomposition is the smallest possible.

The tree decomposition will be cached, so that if this routine is called a second time (and the underlying triangulation has not been changed) then the same tree decomposition will be returned immediately.

Returns
a nice tree decomposition of the face pairing graph of this triangulation.

§ oneFourMove()

bool regina::Triangulation< 3 >::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.

This involves replacing one tetrahedron with four tetrahedra: each new tetrahedron runs from one face of the original tetrahedron to a new common internal degree four vertex.

This move can always be performed. The check argument is present (as for other moves), but is simply ignored (since the move is always legal). The perform argument is also present for consistency with other moves, but if it is set to false then this routine does nothing and returns no useful information.

Note that after performing this move, all skeletal objects (edges, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument t) can no longer be used.

Precondition
The given tetrahedron is a tetrahedron of this triangulation.
Parameters
tthe tetrahedron about which to perform the move.
checkthis argument is ignored, since this move is always legal (see the notes above).
performtrue if we are to perform the move (defaults to true).
Returns
true always.

§ openBook()

bool regina::Triangulation< 3 >::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.

This involves taking a triangle meeting the boundary along two edges, and ungluing it to create two new boundary triangles (thus exposing the tetrahedra it initially joined). This move is the inverse of the closeBook() move, and is used to open the way for new shellBoundary() moves.

This move can be done if:

  • the triangle meets the boundary in precisely two edges (and thus also joins two tetrahedra);
  • the vertex between these two edges is a standard boundary vertex (its link is a disc);
  • the remaining edge of the triangle (which is internal to the triangulation) is valid.

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument f) can no longer be used.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given triangle is a triangle of this triangulation.
Parameters
tthe triangle about which to perform the move.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

§ order()

bool regina::Triangulation< 3 >::order ( bool  forceOriented = false)

Relabels tetrahedron vertices in this triangulation to give an ordered triangulation, if possible.

To be an ordered triangulation, all face gluings (when restricted to the tetrahedron face) must be order preserving. In other words, it must be possible to orient all edges of the triangulation in such a fashion that they are consistent with the ordering of the vertices in each tetrahedron.

If it is possible to order this triangulation, the vertices of each tetrahedron will be relabelled accordingly and this routine will return true. Otherwise, this routine will return false and the triangulation will not be changed.

Warning
This routine may be slow, since it backtracks through all possible edge orientations until a consistent one has been found.
Parameters
forceOrientedtrue if the triangulation must be both ordered and oriented, in which case this routine will return false if the triangulation cannot be oriented and ordered at the same time. See orient() for further details.
Returns
true if the triangulation has been successfully ordered as described above, or false if not.
Author
Matthias Goerner

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

§ parent()

Packet * regina::Packet::parent ( ) const
inlineinherited

Determines the parent packet in the tree structure.

This routine takes small constant time.

Returns
the parent packet, or 0 if there is none.

§ prevSibling()

Packet * regina::Packet::prevSibling ( ) const
inlineinherited

Determines the previous sibling of this packet in the tree structure.

This is the child of the parent that precedes this packet.

This routine takes small constant time.

Returns
the previous sibling of this packet, or 0 if there is none.

§ puncture()

void regina::Triangulation< 3 >::puncture ( Tetrahedron< 3 > *  tet = 0)

Punctures this manifold by removing a 3-ball from the interior of the given tetrahedron.

If no tetrahedron is specified (i.e., the tetrahedron pointer is null), then the puncture will be taken from the interior of tetrahedron 0.

The puncture will not meet the boundary of the tetrahedron, so nothing will go wrong if the tetrahedron has boundary facets and/or ideal vertices. A side-effect of this, however, is that the resulting triangulation will contain additional vertices, and will almost certainly be far from minimal. It is highly recommended that you run intelligentSimplify() if you do not need to preserve the combinatorial structure of the new triangulation.

The puncturing is done by subdividing the original tetrahedron. The new tetrahedra will have orientations consistent with the original tetrahedra, so if the triangulation was originally oriented then it will also be oriented after this routine has been called. See isOriented() for further details on oriented triangulations.

The new sphere boundary will be formed from two triangles; specifically, face 0 of the last and second-last tetrahedra of the triangulation. These two triangles will be joined so that vertex 1 of each tetrahedron coincides, and vertices 2,3 of one map to vertices 3,2 of the other.

Precondition
This triangulation is non-empty, and if tet is non-null then it is in fact a tetrahedron of this triangulation.
Parameters
tetthe tetrahedron inside which the puncture will be taken. This may be null (the default), in which case the first tetrahedron will be used.

§ recogniser() [1/2]

std::string regina::Triangulation< 3 >::recogniser ( ) const

Returns a string that expresses this triangulation in Matveev's 3-manifold recogniser format.

Precondition
This triangulation is not invalid, and does not contain any boundary triangles.
Returns
a string containing the 3-manifold recogniser data.

§ recogniser() [2/2]

void regina::Triangulation< 3 >::recogniser ( std::ostream &  out) const

Writes a string expressing this triangulation in Matveev's 3-manifold recogniser format to the given output stream.

Precondition
This triangulation is not invalid, and does not contain any boundary triangles.
Python:
Not present.
Parameters
outthe output stream to which the recogniser data file will be written.

§ recognizer() [1/2]

std::string regina::Triangulation< 3 >::recognizer ( ) const

A synonym for recogniser().

This returns a string that expresses this triangulation in Matveev's 3-manifold recogniser format.

Precondition
This triangulation is not invalid, and does not contain any boundary triangles.
Returns
a string containing the 3-manifold recogniser data.

§ recognizer() [2/2]

void regina::Triangulation< 3 >::recognizer ( std::ostream &  out) const
inline

A synonym for recognizer(std::ostream&).

This writes a string expressing this triangulation in Matveev's 3-manifold recogniser format to the given output stream.

Precondition
This triangulation is not invalid, and does not contain any boundary triangles.
Python:
Not present.
Parameters
outthe output stream to which the recogniser data file will be written.

§ rehydrate()

static Triangulation<3>* regina::Triangulation< 3 >::rehydrate ( const std::string &  dehydration)
static

Rehydrates the given alphabetical string into a new triangulation.

See dehydrate() for more information on dehydration strings.

This routine will rehydrate the given string into a new triangulation, and return this new triangulation.

The converse routine dehydrate() can be used to extract a dehydration string from an existing triangulation. Dehydration followed by rehydration might not produce a triangulation identical to the original, but it is guaranteed to produce an isomorphic copy. See dehydrate() for the reasons behind this.

For a full description of the dehydrated triangulation format, see A Census of Cusped Hyperbolic 3-Manifolds, Callahan, Hildebrand and Weeks, Mathematics of Computation 68/225, 1999.

Parameters
dehydrationa dehydrated representation of the triangulation to construct. Case is irrelevant; all letters will be treated as if they were lower case.
Returns
a newly allocated triangulation if the rehydration was successful, or null if the given string could not be rehydrated.
See also
dehydrate
insertRehydration

§ removeAllSimplices()

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

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.

§ removeAllTags()

void regina::Packet::removeAllTags ( )
inherited

Removes all associated tags from this packet.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

§ removeAllTetrahedra()

void regina::Triangulation< 3 >::removeAllTetrahedra ( )
inline

A dimension-specific alias for removeAllSimplices().

See removeAllSimplices() for further information.

§ removeSimplex()

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

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
simplexthe simplex to remove.

§ removeSimplexAt()

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

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
indexspecifies which top-dimensionalsimplex to remove; this must be between 0 and size()-1 inclusive.

§ removeTag()

bool regina::Packet::removeTag ( const std::string &  tag)
inherited

Removes the association of the given tag with this packet.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Parameters
tagthe tag to remove.
Returns
true if the given tag was removed, or false if the given tag was not actually associated with this packet.

§ removeTetrahedron()

void regina::Triangulation< 3 >::removeTetrahedron ( Tetrahedron< 3 > *  tet)
inline

A dimension-specific alias for removeSimplex().

See removeSimplex() for further information.

§ removeTetrahedronAt()

void regina::Triangulation< 3 >::removeTetrahedronAt ( size_t  index)
inline

A dimension-specific alias for removeSimplexAt().

See removeSimplexAt() for further information.

§ reorderTetrahedraBFS()

void regina::Triangulation< 3 >::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.

Specifically, the reordering will operate as follows. Tetrahedron 0 will remain tetrahedron 0. Its immediate neighbours will be numbered 1, 2, 3 and 4 (though if these neighbours are not distinct then of course fewer labels will be required). Their immediate neighbours will in turn be numbered 5, 6, and so on, ultimately following a breadth-first search throughout the entire triangulation.

If the optional argument reverse is true, then tetrahedron numbers will be assigned in reverse order. That is, tetrahedron 0 will become tetrahedron n-1, its neighbours will become tetrahedra n-2 down to n-5, and so on.

Parameters
reversetrue if the new tetrahedron numbers should be assigned in reverse order, as described above.

§ reparent()

void regina::Packet::reparent ( Packet newParent,
bool  first = false 
)
inherited

Cuts this packet away from its parent in the tree structure, and inserts it as a child of the given packet instead.

This routine is essentially a combination of makeOrphan() followed by either insertChildFirst() or insertChildLast().

This routine takes small constant time. It is safe to use regardless of whether this packet has a parent or not.

If you wish to reparent all of the children of a given packet, see transferChildren() instead.

Precondition
This packet does not depend on its parent; see dependsOnParent() for details.
The given parent is not a descendant of this packet.
Python:
This routine is much simpler than combinations of makeOrphan() and insertChildFirst() / insertChildLast(), since there are no unpleasant ownership issues to deal with. However, if this packet currently has no parent then the ownership issues are unavoidable; in this case reparent() will do nothing, and one of the insertChild...() routines must be used instead.
Parameters
newParentthe new parent of this packet, i.e., the packet beneath which this packet will be inserted.
firsttrue if this packet should be inserted as the first child of the given parent, or false (the default) if it should be inserted as the last child.

§ retriangulate()

template<typename Action , typename... Args>
bool regina::Triangulation< 3 >::retriangulate ( int  height,
unsigned  nThreads,
ProgressTrackerOpen tracker,
Action &&  action,
Args &&...  args 
) const
inline

Explores all triangulations that can be reached from this via Pachner moves, without exceeding a given number of additional tetrahedra.

Specifically, this routine will iterate through all triangulations that can be reached from this triangulation via 2-3 and 3-2 Pachner moves, without ever exceeding height additional tetrahedra beyond the original number.

For every such triangulation (including this starting triangulation), this routine will call action (which must be a function or some other callable object).

  • action must take at least one argument. The first argument will be of type Triangulation<3>&, and will reference the triangulation that has been found. If there are any additional arguments supplied in the list args, then these will be passed as subsequent arguments to action.
  • action must return a boolean. If action ever returns true, then this indicates that processing should stop immediately (i.e., no more triangulations will be processed).
  • action may, if it chooses, make changes to this triangulation (i.e., the original triangulation upon which retriangulate() was called). This will not affect the search: all triangulations that this routine visits will be obtained via Pachner moves from the original form of this triangulation, before any subsequent changes (if any) were made.
  • action may, if it chooses, make changes to the triangulation that is passed in its argument (though it must not delete it). This will likewise not affect the search, since the triangulation that is passed to action will be destroyed immediately after action is called.
  • action will only be called once for each triangulation (including this starting triangulation). In other words, no triangulation will be revisited a second time in a single call to retriangulate().

This routine can be very slow and very memory-intensive, since the number of triangulations it visits may be superexponential in the number of tetrahedra, and it records every triangulation that it visits (so as to avoid revisiting the same triangulation again). It is highly recommended that you begin with height = 1, and if necessary try increasing height one at a time until this routine becomes too expensive to run.

If a progress tracker is passed, then the exploration of triangulations will take place in a new thread and this routine will return immediately.

To assist with performance, this routine can run in parallel (multithreaded) mode; simply pass the number of parallel threads in the argument nThreads. Even in multithreaded mode, if no progress tracker is passed then this routine will not return until processing has finished (i.e., either action returned true, or the search was exhausted). All calls to action will be protected by a mutex (i.e., different threads will never be calling action at the same time).

If height is negative, then this routine will do nothing and immediately return false, and any progress tracker that was passed will immediately be marked as finished.

Warning
By default, the arguments args will be copied (or moved) when they are passed to action. If you need to pass some argument(s) by reference, you must wrap them in std::ref or std::cref.
Precondition
This triangulation is connected.
Warning
The API for this class has not yet been finalised. This means that the class interface may change in new versions of Regina, without maintaining backward compatibility. If you use this class directly in your own code, please watch the detailed changelogs upon new releases to see if you need to make changes to your code.
Python:
Not present.
Parameters
heightthe maximum number of additional tetrahedra to allow, beyond the number of tetrahedra originally present in the triangulation.
nThreadsthe number of threads to use. If this is 1 or smaller then the routine will run single-threaded.
trackera progress tracker through which progress will be reported, or 0 if no progress reporting is required.
actiona function (or other callable object) to call upon each triangulation that is found.
argsany additional arguments that should be passed to action, following the initial triangulation argument.
Returns
If a progress tracker is passed, then this routine will return true or false immediately according to whether a new thread could or could not be started. If no progress tracker is passed, then this routine will return true if some call to action returned true (thereby terminating the search early), or false if the search ran to completion.

§ root()

Packet* regina::Packet::root ( ) const
inherited

Determines the root of the tree to which this packet belongs.

Returns
the matriarch of the packet tree.

§ sameDegrees()

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

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

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 ksubdim.
Parameters
otherthe 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
inlineprotectedinherited

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

Parameters
otherthe triangulation to compare against this.
Returns
true if and only if the face counts considered are identical for both triangluations.

§ save() [1/2]

bool regina::Packet::save ( const char *  filename,
bool  compressed = true 
) const
inherited

Saves the subtree rooted at this packet to the given Regina data file, using Regina's native XML file format.

The XML file may be optionally compressed (Regina can happily read both compressed and uncompressed XML).

This is the preferred way of saving a Regina data file. Typically this will be called from the root of the packet tree, which will save the entire packet tree to file.

Precondition
The given packet does not depend on its parent.
Internationalisation:
This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines. The contents of the file will be written using UTF-8.
Parameters
filenamethe pathname of the file to write to.
compressedtrue if the XML data should be compressed, or false if it should be written as plain text.
Returns
true if and only if the file was successfully written.

§ save() [2/2]

bool regina::Packet::save ( std::ostream &  s,
bool  compressed = true 
) const
inherited

Writes the subtree rooted at this packet to the given output stream, in the format of a Regina XML data file.

The data file may be optionally compressed (Regina can happily read both compressed and uncompressed XML).

Typically this will be called from the root of the packet tree, which will write the entire packet tree to the given output stream.

Precondition
The given stream is open for writing.
The given packet does not depend on its parent.
Python:
Not present.
Parameters
sthe output stream to which to write.
compressedtrue if the XML data should be compressed, or false if it should be written as plain text.
Returns
true if and only if the data was successfully written.

§ saveRecogniser()

bool regina::Triangulation< 3 >::saveRecogniser ( const char *  filename) const

Writes this triangulation to the given file in Matveev's 3-manifold recogniser format.

Precondition
This triangulation is not invalid, and does not contain any boundary triangles.
Internationalisation:
This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines. The contents of the file will be written using UTF-8.
Parameters
filenamethe name of the Recogniser file to which to write.
Returns
true if and only if the file was successfully written.

§ saveRecognizer()

bool regina::Triangulation< 3 >::saveRecognizer ( const char *  filename) const
inline

A synonym for saveRecogniser().

This writes this triangulation to the given file in Matveev's 3-manifold recogniser format.

Precondition
This triangulation is not invalid, and does not contain any boundary triangles.
Internationalisation:
This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines. The contents of the file will be written using UTF-8.
Parameters
filenamethe name of the Recogniser file to which to write.
Returns
true if and only if the file was successfully written.

§ saveSnapPea()

virtual bool regina::Triangulation< 3 >::saveSnapPea ( const char *  filename) const
virtual

Writes this triangulation to the given file using SnapPea's native file format.

Regarding what gets stored in the SnapPea data file:

  • If you are calling this from one of Regina's own Triangulation<3> objects, then only the tetrahedron gluings and the manifold name will be stored (the name will be derived from the packet label). All other SnapPea-specific information (such as peripheral curves) will be marked as unknown (since Regina does not track such information itself), and of course other Regina-specific information (such as the Turaev-Viro invariants) will not be written to the SnapPea file at all.
  • If you are calling this from the subclass SnapPeaTriangulation, then all additional SnapPea-specific information will be written to the file (indeed, the SnapPea kernel itself will be used to produce the file contents).

If this triangulation is empty, invalid, or contains boundary triangles (which SnapPea cannot represent), then the file will not be written and this routine will return false.

Internationalisation:
This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines. The contents of the file will be written using UTF-8.
Parameters
filenamethe name of the SnapPea file to which to write.
Returns
true if and only if the file was successfully written.

Reimplemented in regina::SnapPeaTriangulation.

§ setLabel()

void regina::Packet::setLabel ( const std::string &  label)
inherited

Sets the label associated with this individual packet.

Parameters
labelthe new label to give this packet.

§ shellBoundary()

bool regina::Triangulation< 3 >::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.

This involves simply popping off a tetrahedron that touches the boundary. This can be done if:

  • all edges of the tetrahedron are valid;
  • precisely one, two or three faces of the tetrahedron lie in the boundary;
  • if one face lies in the boundary, then the opposite vertex does not lie in the boundary, and no two of the remaining three edges are identified;
  • if two faces lie in the boundary, then the remaining edge does not lie in the boundary, and the remaining two faces of the tetrahedron are not identified.

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects can no longer be used.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given tetrahedron is a tetrahedron of this triangulation.
Parameters
tthe tetrahedron upon which to perform the move.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

§ simplex() [1/2]

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

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
indexspecifies 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
inlineinherited

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
indexspecifies 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
inlineinherited

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:
This routine returns a python list.
Returns
the list of all top-dimensional simplices.

§ simplifiedFundamentalGroup()

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

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
newGroupa new (and hopefully simpler) presentation of the fundamental group of this triangulation.

§ simplifyExhaustive()

bool regina::Triangulation< 3 >::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.

This routine is more powerful but much slower than intelligentSimplify().

Specifically, this routine will iterate through all triangulations that can be reached from this triangulation via 2-3 and 3-2 Pachner moves, without ever exceeding height additional tetrahedra beyond the original number.

If at any stage it finds a triangulation with fewer tetrahedra than the original, then this routine will call intelligentSimplify() to shrink the triangulation further if possible and will then return true. If it cannot find a triangulation with fewer tetrahedra then it will leave this triangulation unchanged and return false.

This routine can be very slow and very memory-intensive: the number of triangulations it visits may be superexponential in the number of tetrahedra, and it records every triangulation that it visits (so as to avoid revisiting the same triangulation again). It is highly recommended that you begin with height = 1, and if this fails then try increasing height one at a time until either you find a simplification or the routine becomes too expensive to run.

If you want a fast simplification routine, you should call intelligentSimplify() instead. The benefit of simplifyExhaustive() is that, for very stubborn triangulations where intelligentSimplify() finds itself stuck at a local minimum, simplifyExhaustive() is able to "climb out" of such wells.

If a progress tracker is passed, then the exhaustive simplification will take place in a new thread and this routine will return immediately. In this case, you will need to use some other means to determine whether the triangulation was eventually simplified (e.g., by examining size() after the tracker indicates that the operation has finished).

To assist with performance, this routine can run in parallel (multithreaded) mode; simply pass the number of parallel threads in the argument nThreads. Even in multithreaded mode, if no progress tracker is passed then this routine will not return until processing has finished (i.e., either the triangulation was simplified or the search was exhausted).

If this routine is unable to simplify the triangulation, then the triangulation will not be changed.

Precondition
This triangulation is connected.
Parameters
heightthe maximum number of additional tetrahedra to allow, beyond the number of tetrahedra originally present in the triangulation.
nThreadsthe number of threads to use. If this is 1 or smaller then the routine will run single-threaded.
trackera progress tracker through which progress will be reported, or 0 if no progress reporting is required.
Returns
If a progress tracker is passed, then this routine will return true or false immediately according to whether a new thread could or could not be started. If no progress tracker is passed, then this routine will return true if and only if the triangulation was successfully simplified to fewer tetrahedra.

§ simplifyToLocalMinimum()

bool regina::Triangulation< 3 >::simplifyToLocalMinimum ( bool  perform = true)

Uses all known simplification moves to reduce the triangulation monotonically to some local minimum number of tetrahedra.

End users will probably not want to call this routine. You should call intelligentSimplify() if you want a fast (and usually effective) means of simplifying a triangulation, or you should call simplifyExhaustive() if you are still stuck and you want to try a slower but more powerful method instead.

The moves used by this routine include 3-2, 2-0 (edge and vertex), 2-1 and boundary shelling moves.

Moves that do not reduce the number of tetrahedra (such as 4-4 moves or book opening moves) are not used in this routine. Such moves do however feature in intelligentSimplify().

Warning
The specific behaviour of this routine is very likely to change between releases.
Parameters
performtrue if we are to perform the simplifications, or false if we are only to investigate whether simplifications are possible (defaults to true).
Returns
if perform is true, this routine returns true if and only if the triangulation was changed to reduce the number of tetrahedra; if perform is false, this routine returns true if and only if it determines that it is capable of performing such a change.

§ size()

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

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

Returns
The number of top-dimensional simplices.

§ snapPea() [1/2]

virtual std::string regina::Triangulation< 3 >::snapPea ( ) const
virtual

Returns a string containing the full contents of a SnapPea data file that describes this triangulation.

In particular, this string can be used in a Python session to pass the triangulation directly to SnapPy (without writing to the filesystem).

Regarding what gets stored in the SnapPea data file:

  • If you are calling this from one of Regina's own Triangulation<3> objects, then only the tetrahedron gluings and the manifold name will be stored (the name will be derived from the packet label). All other SnapPea-specific information (such as peripheral curves) will be marked as unknown (since Regina does not track such information itself), and of course other Regina-specific information (such as the Turaev-Viro invariants) will not be written to the SnapPea file at all.
  • If you are calling this from the subclass SnapPeaTriangulation, then all additional SnapPea-specific information will be written to the file (indeed, the SnapPea kernel itself will be used to produce the file contents).

If you wish to export a triangulation to a SnapPea file, you should call saveSnapPea() instead (which has better performance, and does not require you to construct an enormous intermediate string).

If this triangulation is empty, invalid, or contains boundary triangles (which SnapPea cannot represent), then the resulting string will be empty.

Returns
a string containing the contents of the corresponding SnapPea data file.

Reimplemented in regina::SnapPeaTriangulation.

§ snapPea() [2/2]

virtual void regina::Triangulation< 3 >::snapPea ( std::ostream &  out) const
virtual

Writes the full contents of a SnapPea data file describing this triangulation to the given output stream.

Regarding what gets stored in the SnapPea data file:

  • If you are calling this from one of Regina's own Triangulation<3> objects, then only the tetrahedron gluings and the manifold name will be stored (the name will be derived from the packet label). All other SnapPea-specific information (such as peripheral curves) will be marked as unknown (since Regina does not track such information itself), and of course other Regina-specific information (such as the Turaev-Viro invariants) will not be written to the SnapPea file at all.
  • If you are calling this from the subclass SnapPeaTriangulation, then all additional SnapPea-specific information will be written to the file (indeed, the SnapPea kernel itself will be used to produce the file contents).

If you wish to extract the SnapPea data file as a string, you should call the zero-argument routine snapPea() instead. If you wish to write to a real SnapPea data file on the filesystem, you should call saveSnapPea() (which is also available in Python).

If this triangulation is empty, invalid, or contains boundary triangles (which SnapPea cannot represent), then nothing will be written to the output stream.

Python:
Not present.
Parameters
outthe output stream to which the SnapPea data file will be written.

Reimplemented in regina::SnapPeaTriangulation.

§ sortChildren()

void regina::Packet::sortChildren ( )
inherited

Sorts the immediate children of this packet according to their packet labels.

Note that this routine is not recursive (for instance, grandchildren will not be sorted within each child packet).

This routine takes quadratic time in the number of immediate children (and it's slow quadratic at that).

§ 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
componentParentthe packet beneath which the new component triangulations will be inserted, or 0 if they should be inserted directly beneath this triangulation.
setLabelstrue 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:
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)
protectedinherited

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
otherthe 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
otherthe triangulation whose contents should be swapped with this.

§ swapFaces()

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

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

Parameters
otherthe face storage for the triangulation whose faces are to be swapped with this.

§ swapWithNextSibling()

void regina::Packet::swapWithNextSibling ( )
inherited

Swaps this packet with its next sibling in the sequence of children beneath their common parent packet.

Calling this routine is equivalent to calling moveDown().

This routine takes small constant time.

If this packet has no next sibling then this routine does nothing.

§ tags()

const std::set< std::string > & regina::Packet::tags ( ) const
inlineinherited

Returns the set of all tags associated with this packet.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Python:
This routine returns a python list of strings.
Returns
the set of all tags associated with this packet.

§ threeTwoMove()

bool regina::Triangulation< 3 >::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.

This involves replacing the three tetrahedra joined at that edge with two tetrahedra joined by a triangle. This can be done iff (i) the edge is valid and non-boundary, and (ii) the three tetrahedra are distinct.

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument e) can no longer be used.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given edge is an edge of this triangulation.
Parameters
ethe edge about which to perform the move.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

§ totalTreeSize()

size_t regina::Packet::totalTreeSize ( ) const
inherited

Determines the total number of packets in the tree or subtree for which this packet is matriarch.

This packet is included in the count.

Returns
the total tree or subtree size.

§ transferChildren()

void regina::Packet::transferChildren ( Packet newParent)
inherited

Cuts all of this packet's children out of the packet tree, and reinserts them as children of the given packet instead.

The children of this packet will be appended to the end of the new parent's child list, in the same order as they were previously.

This is equivalent to calling reparent() on each child, but should be somewhat faster if there are many children to move.

Precondition
None of the children of this packet depend on their current parent; see dependsOnParent() for details.
The given parent is not a descendant of this packet.
Parameters
newParentthe new parent beneath which the children will be inserted.

§ turaevViro()

Cyclotomic regina::Triangulation< 3 >::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.

The initial data for the Turaev-Viro invariant is as described in the paper of Turaev and Viro, "State sum invariants of 3-manifolds and quantum 6j-symbols", Topology, vol. 31, no. 4, 1992, pp 865-902. In particular, Section 7 of this paper describes the initial data as determined by an integer r >= 3, and a root of unity q0 of degree 2r for which q0^2 is a primitive root of unity of degree r. There are several cases to consider:

  • r may be even. In this case q0 must be a primitive (2r)th root of unity, and the invariant is computed as an element of the cyclotomic field of order 2r. There is no need to specify which root of unity is used, since switching between different roots of unity corresponds to an automorphism of the underlying cyclotomic field (i.e., it does not yield any new information). Therefore, if r is even, the additional argument parity is ignored.
  • r may be odd, and q0 may be a primitive (2r)th root of unity. This case corresponds to passing the argument parity as true. Here the invariant is again computed as an element of the cyclotomic field of order 2r. As before, there is no need to give further information as to which root of unity is used, since switching between roots of unity does not yield new information.
  • r may be odd, and q0 may be a primitive (r)th root of unity. This case corresponds to passing the argument parity as false. In this case the invariant is computed as an element of the cyclotomic field of order r. Again, there is no need to give further information as to which root of unity is used.

This routine works entirely within the relevant cyclotomic field, which yields exact results but adds a significant overhead to the running time. If you want a fast floating-point approximation, you can call turaevViroApprox() instead.

Unlike this routine, turaevViroApprox() requires a precise specification of which root of unity is used (since it returns a numerical real value). The numerical value obtained by calling turaevViroApprox(r, whichRoot) should be the same as turaevViro(r, parity).evaluate(whichRoot), where parity is true or false according to whether whichRoot is odd or even respectively. Of course in practice the numerical values might be very different, since turaevViroApprox() performs significantly more floating point operations, and so is subject to a much larger potential numerical error.

If the requested Turaev-Viro invariant has already been computed, then the result will be cached and so this routine will be very fast (since it just returns the previously computed result). Otherwise the computation could be quite slow, particularly for larger triangulations and/or larger values of r. This (potentially) long computation can be managed by passing a progress tracker:

  • If a progress tracker is passed and the requested invariant has not yet been computed, then the calculation will take place in a new thread and this routine will return immediately. Once the progress tracker indicates that the calculation has finished, you can call turaevViro() again with the same arguments for r and parity to retrieve the value of the invariant.
  • If no progress tracker is passed and the requested invariant has not yet been computed, the calculation will run in the current thread and this routine will not return until it is complete.
  • If the requested invariant has already been computed, then this routine will return immediately with the pre-computed value. If a progress tracker is passed then it will be marked as finished.
Precondition
This triangulation is valid, closed and non-empty.
Parameters
rthe integer r as described above; this must be at least 3.
paritydetermines for odd r whether q0 is a primitive 2rth or rth root of unity, as described above.
algthe algorithm with which to compute the invariant. If you are not sure, the default value (TV_DEFAULT) is a safe choice.
trackera progress tracker through will progress will be reported, or 0 if no progress reporting is required.
Returns
the requested Turaev-Viro invariant. As an exception, if tracker is non-null and the value of this invariant has not been computed before, then (since the calculation will still be running in a new thread) the return value is undefined.
See also
allCalculatedTuraevViro

§ turaevViroApprox()

double regina::Triangulation< 3 >::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.

The initial data for the Turaev-Viro invariant is as described in the paper of Turaev and Viro, "State sum invariants of 3-manifolds and quantum 6j-symbols", Topology, vol. 31, no. 4, 1992, pp 865-902. In particular, Section 7 describes the initial data as determined by an integer r >= 3 and a root of unity q0 of degree 2r for which q0^2 is a primitive root of unity of degree r.

The argument whichRoot specifies which root of unity is used for q0. Specifically, q0 will be the root of unity e^(2i * Pi * whichRoot / 2r). There are additional preconditions on whichRoot to ensure that q0^2 is a primitive root of unity of degree r; see below for details.

This same invariant can be computed by calling turaevViro(r, parity).evaluate(whichRoot), where parity is true or false according to whether whichRoot is odd or even respectively. Calling turaevViroApprox() is significantly faster (since it avoids the overhead of working in cyclotomic fields), but may also lead to a much larger numerical error (since this routine might perform an exponential number of floating point operations, whereas the alternative only uses floating point for the final call to Cyclotomic::evaluate()).

These invariants, although computed in the complex field, should all be reals. Thus the return type is an ordinary double.

Precondition
This triangulation is valid, closed and non-empty.
The argument whichRoot is strictly between 0 and 2r, and has no common factors with r.
Parameters
rthe integer r as described above; this must be at least 3.
whichRootspecifies which root of unity is used for q0, as described above.
algthe algorithm with which to compute the invariant. If you are not sure, the default value (TV_DEFAULT) is a safe choice.
Returns
the requested Turaev-Viro invariant.
See also
allCalculatedTuraevViro

§ twoOneMove()

bool regina::Triangulation< 3 >::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.

This involves taking an edge meeting only one tetrahedron just once and merging that tetrahedron with one of the tetrahedra joining it.

This can be done assuming the following conditions:

  • The edge must be valid and non-boundary.
  • The two remaining faces of the tetrahedron are not joined, and the tetrahedron face opposite the given endpoint of the edge is not boundary.
  • Consider the second tetrahedron to be merged (the one joined along the face opposite the given endpoint of the edge). Moreover, consider the two edges of this second tetrahedron that run from the (identical) vertices of the original tetrahedron not touching e to the vertex of the second tetrahedron not touching the original tetrahedron. These edges must be distinct and may not both be in the boundary.

There are additional "distinct and not both boundary" conditions on faces of the second tetrahedron, but those follow automatically from the final condition above.

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument e) can no longer be used.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given edge is an edge of this triangulation.
Parameters
ethe edge about which to perform the move.
edgeEndthe end of the edge opposite that at which the second tetrahedron (to be merged) is joined. The end is 0 or 1, corresponding to the labelling (0,1) of the vertices of the edge as described in EdgeEmbedding<3>::vertices().
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

§ twoThreeMove()

bool regina::Triangulation< 3 >::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.

This involves replacing the two tetrahedra joined at that triangle with three tetrahedra joined by an edge. This can be done iff the two tetrahedra are distinct.

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument f) can no longer be used.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given triangle is a triangle of this triangulation.
Parameters
tthe triangle about which to perform the move.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

§ twoZeroMove() [1/2]

bool regina::Triangulation< 3 >::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.

This involves taking the two tetrahedra joined at that edge and squashing them flat. This can be done if:

  • the edge is valid and non-boundary;
  • the two tetrahedra are distinct;
  • the edges opposite e in each tetrahedron are distinct and not both boundary;
  • if triangles f1 and f2 from one tetrahedron are to be flattened onto triangles g1 and g2 of the other respectively, then (a) f1 and g1 are distinct, (b) f2 and g2 are distinct, (c) we do not have both f1 = g2 and g1 = f2, (d) we do not have both f1 = f2 and g1 = g2, and (e) we do not have two of the triangles boundary and the other two identified.

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument e) can no longer be used.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given edge is an edge of this triangulation.
Parameters
ethe edge about which to perform the move.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

§ twoZeroMove() [2/2]

bool regina::Triangulation< 3 >::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.

This involves taking the two tetrahedra joined at that vertex and squashing them flat. This can be done if:

  • the vertex is non-boundary and has a 2-sphere vertex link;
  • the two tetrahedra are distinct;
  • the triangles opposite v in each tetrahedron are distinct and not both boundary;
  • the two tetrahedra meet each other on all three faces touching the vertex (as opposed to meeting each other on one face and being glued to themselves along the other two).

If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal.

Note that after performing this move, all skeletal objects (triangles, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument v) can no longer be used.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given vertex is a vertex of this triangulation.
Parameters
vthe vertex about which to perform the move.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

§ type()

virtual PacketType regina::Packet::type ( ) const
pure virtualinherited

Returns the unique integer ID representing this type of packet.

This is the same for all packets of this class.

Returns
the packet type ID.

§ typeName()

virtual std::string regina::Packet::typeName ( ) const
pure virtualinherited

Returns an English name for this type of packet.

An example is Triangulation3. This is the same for all packets of this class.

Returns
the packet type name.

§ unlisten()

bool regina::Packet::unlisten ( PacketListener listener)
inherited

Unregisters the given packet listener so that it no longer listens for events on this packet.

See the PacketListener class notes for details.

Python:
Not present.
Parameters
listenerthe listener to unregister.
Returns
true if the given listener was successfully unregistered, or false if the given listener was not registered in the first place.

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

§ writeTextLong()

virtual void regina::Triangulation< 3 >::writeTextLong ( std::ostream &  out) const
virtual

Writes a detailed text representation of this object to the given output stream.

This may be reimplemented by subclasses, but the parent Packet class offers a reasonable default implementation.

Python:
Not present.
Parameters
outthe output stream to which to write.

Reimplemented from regina::Packet.

Reimplemented in regina::SnapPeaTriangulation.

§ writeTextShort()

void regina::Triangulation< 3 >::writeTextShort ( std::ostream &  out) const
inlinevirtual

Writes a short text representation of this object to the given output stream.

This must be reimplemented by subclasses.

Python:
Not present.
Parameters
outthe output stream to which to write.

Implements regina::Packet.

Reimplemented in regina::SnapPeaTriangulation.

§ writeXMLBaseProperties()

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

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
outthe output stream to which the XML should be written.

§ writeXMLFile()

void regina::Packet::writeXMLFile ( std::ostream &  out) const
inherited

Writes the subtree rooted at this packet to the given output stream in Regina's native XML file format.

Ths is similar to calling save(), except that (i) the user has a more flexible choice of output stream, and (ii) the XML will always be written in plain text (i.e., it will not be compressed).

If you simply wish to save your data to a file on the filesystem, you should call save() instead.

Typically this will be called from the root of the packet tree, which will write the entire packet tree to the output stream.

The output from this routine cannot be used as a piece of an XML file; it must be the entire XML file. For a piece of an XML file, see routine writeXMLPacketTree() instead.

Precondition
This packet does not depend upon its parent.
Python:
The argument out is not present; instead the XML data is written to standard output.
Parameters
outthe output stream to which the XML data file should be written.

§ writeXMLPacketData()

virtual void regina::Triangulation< 3 >::writeXMLPacketData ( std::ostream &  out) const
protectedvirtual

Writes a chunk of XML containing the data for this packet only.

You may assume that the packet opening tag (including the packet type and label) has already been written, and that all child packets followed by the corresponding packet closing tag will be written immediately after this routine is called. This routine need only write the internal data stored in this specific packet.

Parameters
outthe output stream to which the XML should be written.

Implements regina::Packet.

Reimplemented in regina::SnapPeaTriangulation.

§ writeXMLPacketTree()

void regina::Packet::writeXMLPacketTree ( std::ostream &  out) const
protectedinherited

Writes a chunk of XML containing the subtree with this packet as matriarch.

This is the preferred way of writing a packet tree to file.

The output from this routine is only a piece of XML; it should not be used as a complete XML file. For a complete XML file, see routine writeXMLFile() instead.

Parameters
outthe output stream to which the XML should be written.

Member Data Documentation

§ boundaryComponents_

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

The components that form the boundary of the triangulation.

§ dimension

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

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

§ simplices_

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

The top-dimensional simplices that form the triangulation.

§ valid_

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

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


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

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