Regina Calculation Engine
Public Types | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends
regina::NTriangulation Class Reference

Stores the triangulation of a 3-manifold along with its various cellular structures and other information. More...

#include <triangulation/ntriangulation.h>

Inheritance diagram for regina::NTriangulation:
regina::NPacket regina::NFilePropertyReader regina::ShareableObject regina::boost::noncopyable

List of all members.

Public Types

typedef std::vector
< NTetrahedron * >
::const_iterator 
TetrahedronIterator
 Used to iterate through tetrahedra.
typedef std::vector< NFace * >
::const_iterator 
FaceIterator
 Used to iterate through faces.
typedef std::vector< NEdge * >
::const_iterator 
EdgeIterator
 Used to iterate through edges.
typedef std::vector< NVertex * >
::const_iterator 
VertexIterator
 Used to iterate through vertices.
typedef std::vector
< NComponent * >
::const_iterator 
ComponentIterator
 Used to iterate through components.
typedef std::vector
< NBoundaryComponent * >
::const_iterator 
BoundaryComponentIterator
 Used to iterate through boundary components.
typedef std::map< std::pair
< unsigned long, unsigned long >
, double > 
TuraevViroSet
 A map from (r, whichRoot) pairs to Turaev-Viro invariants.

Public Member Functions

Constructors and Destructors
 NTriangulation ()
 Default constructor.
 NTriangulation (const NTriangulation &cloneMe)
 Copy constructor.
virtual ~NTriangulation ()
 Destroys this triangulation.
Packet Administration

(end: Constructors and Destructors)

virtual int getPacketType () const
 Returns the integer ID representing this type of packet.
virtual std::string getPacketTypeName () const
 Returns an English name for this type of packet.
virtual void writePacket (NFile &out) const
 Writes the packet details to the given old-style binary file.
virtual void writeTextShort (std::ostream &out) const
 Writes this object in short text format to the given output stream.
virtual void writeTextLong (std::ostream &out) const
 Writes this object in long text format to the given output stream.
virtual bool dependsOnParent () const
 Determines if this packet depends upon its parent.
virtual void readIndividualProperty (NFile &infile, unsigned propType)
 Reads an individual property from an old-style binary file.
Tetrahedra

(end: Packet Administration)

unsigned long getNumberOfTetrahedra () const
 Returns the number of tetrahedra in the triangulation.
const std::vector
< NTetrahedron * > & 
getTetrahedra () const
 Returns all tetrahedra in the triangulation.
NTetrahedrongetTetrahedron (unsigned long index)
 Returns the tetrahedron with the given index number in the triangulation.
const NTetrahedrongetTetrahedron (unsigned long index) const
 Returns the tetrahedron with the given index number in the triangulation.
long tetrahedronIndex (const NTetrahedron *tet) const
 Returns the index of the given tetrahedron in the triangulation.
long getTetrahedronIndex (const NTetrahedron *tet) const
 Returns the index of the given tetrahedron in the triangulation.
NTetrahedronnewTetrahedron ()
 Creates a new tetrahedron and adds it to this triangulation.
NTetrahedronnewTetrahedron (const std::string &desc)
 Creates a new tetrahedron with the given description and adds it to this triangulation.
void addTetrahedron (NTetrahedron *tet)
 Inserts the given tetrahedron into the triangulation.
void removeTetrahedron (NTetrahedron *tet)
 Removes the given tetrahedron from the triangulation.
void removeTetrahedronAt (unsigned long index)
 Removes the tetrahedron with the given index number from the triangulation.
void removeAllTetrahedra ()
 Removes all tetrahedra from the triangulation.
void swapContents (NTriangulation &other)
 Swaps the contents of this and the given triangulation.
void moveContentsTo (NTriangulation &dest)
 Moves the contents of this triangulation into the given destination triangulation, without destroying any pre-existing contents.
void gluingsHaveChanged ()
 This routine now does nothing, and should not be used.
Skeletal Queries

(end: Tetrahedra)

unsigned long getNumberOfBoundaryComponents () const
 Returns the number of boundary components in this triangulation.
unsigned long getNumberOfComponents () const
 Returns the number of components in this triangulation.
unsigned long getNumberOfVertices () const
 Returns the number of vertices in this triangulation.
unsigned long getNumberOfEdges () const
 Returns the number of edges in this triangulation.
unsigned long getNumberOfFaces () const
 Returns the number of faces in this triangulation.
const std::vector< NComponent * > & getComponents () const
 Returns all components of this triangulation.
const std::vector
< NBoundaryComponent * > & 
getBoundaryComponents () const
 Returns all boundary components of this triangulation.
const std::vector< NVertex * > & getVertices () const
 Returns all vertices of this triangulation.
const std::vector< NEdge * > & getEdges () const
 Returns all edges of this triangulation.
const std::vector< NFace * > & getFaces () const
 Returns all faces of this triangulation.
NComponentgetComponent (unsigned long index) const
 Returns the requested triangulation component.
NBoundaryComponentgetBoundaryComponent (unsigned long index) const
 Returns the requested triangulation boundary component.
NVertexgetVertex (unsigned long index) const
 Returns the requested triangulation vertex.
NEdgegetEdge (unsigned long index) const
 Returns the requested triangulation edge.
NFacegetFace (unsigned long index) const
 Returns the requested triangulation face.
long componentIndex (const NComponent *component) const
 Returns the index of the given component in the triangulation.
long getComponentIndex (const NComponent *component) const
 Returns the index of the given component in the triangulation.
long boundaryComponentIndex (const NBoundaryComponent *bc) const
 Returns the index of the given boundary component in the triangulation.
long getBoundaryComponentIndex (const NBoundaryComponent *bc) const
 Returns the index of the given boundary component in the triangulation.
long vertexIndex (const NVertex *vertex) const
 Returns the index of the given vertex in the triangulation.
long getVertexIndex (const NVertex *vertex) const
 Returns the index of the given vertex in the triangulation.
long edgeIndex (const NEdge *edge) const
 Returns the index of the given edge in the triangulation.
long getEdgeIndex (const NEdge *edge) const
 Returns the index of the given edge in the triangulation.
long faceIndex (const NFace *face) const
 Returns the index of the given face in the triangulation.
long getFaceIndex (const NFace *face) const
 Returns the index of the given face in the triangulation.
bool hasTwoSphereBoundaryComponents () const
 Determines if this triangulation contains any two-sphere boundary components.
bool hasNegativeIdealBoundaryComponents () const
 Determines if this triangulation contains any ideal boundary components with negative Euler characteristic.
Isomorphism Testing

(end: Skeletal Queries)

std::auto_ptr< NIsomorphismisIsomorphicTo (const NTriangulation &other) const
 Determines if this triangulation is combinatorially isomorphic to the given triangulation.
std::auto_ptr< NIsomorphismisContainedIn (const NTriangulation &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).
unsigned long findAllSubcomplexesIn (const NTriangulation &other, std::list< NIsomorphism * > &results) 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).
Basic Properties

(end: Isomorphism Testing)

long getEulerCharTri () const
 Returns the Euler characteristic of this triangulation.
long getEulerCharManifold () const
 Returns the Euler characteristic of the corresponding compact 3-manifold.
long getEulerCharacteristic () const
 A deprecated alias for getEulerCharTri().
bool isValid () const
 Determines if this triangulation is valid.
bool isIdeal () const
 Determines if this triangulation is ideal.
bool isStandard () const
 Determines if this triangulation is standard.
bool hasBoundaryFaces () const
 Determines if this triangulation has any boundary faces.
bool isClosed () const
 Determines if this triangulation is closed.
bool isOrientable () const
 Determines if this triangulation is orientable.
bool isOriented () const
 Determines if this triangulation is oriented; that is, if tetrahedron vertices are labelled in a way that preserves orientation across adjacent faces.
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 faces.
bool isConnected () const
 Determines if this triangulation is connected.
Algebraic Properties

(end: Basic Properties)

const NGroupPresentationgetFundamentalGroup () const
 Returns the fundamental group of this triangulation.
void simplifiedFundamentalGroup (NGroupPresentation *newGroup)
 Notifies the triangulation that you have simplified the presentation of its fundamental group.
const NAbelianGroupgetHomologyH1 () const
 Returns the first homology group for this triangulation.
const NAbelianGroupgetHomologyH1Rel () const
 Returns the relative first homology group with respect to the boundary for this triangulation.
const NAbelianGroupgetHomologyH1Bdry () const
 Returns the first homology group of the boundary for this triangulation.
const NAbelianGroupgetHomologyH2 () const
 Returns the second homology group for this triangulation.
unsigned long getHomologyH2Z2 () const
 Returns the second homology group with coefficients in Z_2 for this triangulation.
double turaevViro (unsigned long r, unsigned long whichRoot) const
 Computes the Turaev-Viro state sum invariant of this 3-manifold based upon the given initial data.
const TuraevViroSetallCalculatedTuraevViro () const
 Returns the set of all Turaev-Viro state sum invariants that have already been calculated for this 3-manifold.
Normal Surface Properties

(end: Algebraic Properties)

bool isZeroEfficient ()
 Determines if this triangulation is 0-efficient.
bool knowsZeroEfficient () const
 Is it already known whether or not this triangulation is 0-efficient? See isZeroEfficient() for further details.
bool hasSplittingSurface ()
 Determines whether this triangulation has a normal splitting surface.
bool knowsSplittingSurface () const
 Is it already known whether or not this triangulation has a splitting surface? See hasSplittingSurface() for further details.
Skeletal Transformations

(end: Normal Surface Properties)

void maximalForestInBoundary (stdhash::hash_set< NEdge *, HashPointer > &edgeSet, stdhash::hash_set< NVertex *, HashPointer > &vertexSet) const
 Produces a maximal forest in the 1-skeleton of the triangulation boundary.
void maximalForestInSkeleton (stdhash::hash_set< NEdge *, HashPointer > &edgeSet, bool canJoinBoundaries=true) const
 Produces a maximal forest in the triangulation's 1-skeleton.
void maximalForestInDualSkeleton (stdhash::hash_set< NFace *, HashPointer > &faceSet) const
 Produces a maximal forest in the triangulation's dual 1-skeleton.
bool intelligentSimplify ()
 Attempts to simplify the triangulation as intelligently as possible without further input.
bool simplifyToLocalMinimum (bool perform=true)
 Uses all known simplification moves to reduce the triangulation monotonically to some local minimum number of tetrahedra.
bool threeTwoMove (NEdge *e, bool check=true, bool perform=true)
 Checks the eligibility of and/or performs a 3-2 move about the given edge.
bool twoThreeMove (NFace *f, bool check=true, bool perform=true)
 Checks the eligibility of and/or performs a 2-3 move about the given face.
bool fourFourMove (NEdge *e, int newAxis, bool check=true, bool perform=true)
 Checks the eligibility of and/or performs a 4-4 move about the given edge.
bool twoZeroMove (NEdge *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.
bool twoZeroMove (NVertex *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.
bool twoOneMove (NEdge *e, int edgeEnd, bool check=true, bool perform=true)
 Checks the eligibility of and/or performs a 2-1 move about the given edge.
bool openBook (NFace *f, bool check=true, bool perform=true)
 Checks the eligibility of and/or performs a book opening move about the given face.
bool closeBook (NEdge *e, bool check=true, bool perform=true)
 Checks the eligibility of and/or performs a book closing move about the given boundary edge.
bool shellBoundary (NTetrahedron *t, bool check=true, bool perform=true)
 Checks the eligibility of and/or performs a boundary shelling move on the given tetrahedron.
bool collapseEdge (NEdge *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.
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.
void orient ()
 Relabels tetrahedron vertices in this triangulation so that all tetrahedra are oriented consistently, if possible.
bool order (bool forceOriented=false)
 Relabels tetrahedron vertices in this triangulation to give an ordered triangulation, if possible.
Decompositions

(end: Skeletal Transformations)

unsigned long splitIntoComponents (NPacket *componentParent=0, bool setLabels=true)
 Splits a disconnected triangulation into many smaller triangulations, one for each component.
unsigned long connectedSumDecomposition (NPacket *primeParent=0, bool setLabels=true)
 Splits this triangulation into its connected sum decomposition.
bool isThreeSphere () const
 Determines whether this is a triangulation of a 3-sphere.
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.
bool isBall () const
 Determines whether this is a triangulation of a 3-dimensional ball.
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.
NPacketmakeZeroEfficient ()
 Converts this into a 0-efficient triangulation of the same underlying 3-manifold.
bool isSolidTorus () const
 Determines whether this is a triangulation of the solid torus; that is, the unknot complement.
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.
bool hasCompressingDisc () const
 Searches for a compressing disc within the underlying 3-manifold.
bool hasSimpleCompressingDisc () const
 Searches for a "simple" compressing disc inside this triangulation.
Subdivisions, Extensions and Covers

(end: Decompositions)

void makeDoubleCover ()
 Converts this triangulation into its double cover.
bool idealToFinite (bool forceDivision=false)
 Converts an ideal triangulation into a finite triangulation.
bool finiteToIdeal ()
 Converts each real boundary component into a cusp (i.e., an ideal vertex).
void barycentricSubdivision ()
 Does a barycentric subdivision of the triangulation.

Static Public Member Functions

static NTriangulationenterTextTriangulation (std::istream &in, std::ostream &out)
 (end: Building Triangulations)
static NXMLPacketReadergetXMLReader (NPacket *parent)
 (end: File I/O)
static NTriangulationreadPacket (NFile &in, NPacket *parent)
 Reads a single packet from the specified file and returns a newly created object containing that information.

Static Public Attributes

static const int packetType
 Contains the integer ID for this packet.

Protected Member Functions

virtual NPacketinternalClonePacket (NPacket *parent) const
 Makes a newly allocated copy of this packet.
virtual void writeXMLPacketData (std::ostream &out) const
 Writes a chunk of XML containing the data for this packet only.
void cloneFrom (const NTriangulation &from)
 Turns this triangulation into a clone of the given triangulation.

Friends

class regina::NTetrahedron
class regina::NXMLTriangulationReader

Building Triangulations

(end: Subdivisions and Covers)

NTetrahedronlayerOn (NEdge *edge)
 Performs a layering upon the given boundary edge of the triangulation.
NTetrahedroninsertLayeredSolidTorus (unsigned long cuts0, unsigned long cuts1)
 Inserts a new layered solid torus into the triangulation.
void insertLayeredLensSpace (unsigned long p, unsigned long q)
 Inserts a new layered lens space L(p,q) into the triangulation.
void insertLayeredLoop (unsigned long length, bool twisted)
 Inserts a layered loop of the given length into this triangulation.
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.
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.
void insertTriangulation (const NTriangulation &source)
 Inserts a copy of the given triangulation into this triangulation.
bool insertRehydration (const std::string &dehydration)
 Inserts the rehydration of the given string into this triangulation.
std::string dehydrate () const
 Dehydrates this triangulation into an alphabetical string.
std::string isoSig () const
 Constructs the isomorphism signature for this triangulation.
void insertConstruction (unsigned long nTetrahedra, const int adjacencies[][4], const int gluings[][4][4])
 Inserts into this triangulation a set of tetrahedra and their gluings as described by the given integer arrays.
std::string dumpConstruction () const
 Returns C++ code that can be used with insertConstruction() to reconstruct this triangulation.
static NTriangulationrehydrate (const std::string &dehydration)
 Rehydrates the given alphabetical string into a new triangulation.
static NTriangulationfromIsoSig (const std::string &signature)
 Recovers a full triangulation from an isomorphism signature.

Detailed Description

Stores the triangulation of a 3-manifold along with its various cellular structures and other information.

When the triangulation is deleted, the corresponding tetrahedra, the cellular structure and all other properties will be deallocated.

Faces, edges, vertices and components are always temporary; whenever a change occurs with the triangulation, these will be deleted and a new skeletal structure will be calculated. The same is true of various other triangulation properties.

The management of tetrahedra within a triangulation has become simpler and safer as of Regina 4.90. In older versions (Regina 4.6 and earlier), users were required to create tetrahedra, individually add them to triangulations, and manually notify a triangulation whenever its tetrahedron gluings changed. As of Regina 4.90, new tetrahedra are created using NTriangulation::newTetrahedron() which automatically places them within a triangulation, and all gluing changes are likewise communicated to the triangulation automatically. These are part of a larger suite of changes (all designed to help the user avoid inconsistent states and accidental crashes); see the NTetrahedron class notes for further details.

Test:
Included in the test suite.
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

Used to iterate through boundary components.

typedef std::vector<NComponent*>::const_iterator regina::NTriangulation::ComponentIterator

Used to iterate through components.

typedef std::vector<NEdge*>::const_iterator regina::NTriangulation::EdgeIterator

Used to iterate through edges.

typedef std::vector<NFace*>::const_iterator regina::NTriangulation::FaceIterator

Used to iterate through faces.

typedef std::vector<NTetrahedron*>::const_iterator regina::NTriangulation::TetrahedronIterator

Used to iterate through tetrahedra.

typedef std::map<std::pair<unsigned long, unsigned long>, double> regina::NTriangulation::TuraevViroSet

A map from (r, whichRoot) pairs to Turaev-Viro invariants.

typedef std::vector<NVertex*>::const_iterator regina::NTriangulation::VertexIterator

Used to iterate through vertices.


Constructor & Destructor Documentation

Default constructor.

Creates an empty triangulation.

Copy constructor.

Creates a new triangulation identical to the given triangulation. The packet tree structure and packet label are not copied.

Parameters:
cloneMethe triangulation to clone.

Destroys this triangulation.

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


Member Function Documentation

Inserts the given tetrahedron into the triangulation.

No face gluings anywhere will be examined or altered.

The new tetrahedron will be assigned a higher index in the triangulation than all tetrahedra already present.

Precondition:
The given tetrahedron does not already belong to a different triangulation (though already belonging to this triangulation is perfectly fine).
Deprecated:
Users should create tetrahedra by calling newTetrahedron() or newTetrahedron(const std::string&), which will add the tetrahedron to the triangulation automatically.
Warning:
As of Regina 4.90, this routine will also add any neighbouring tetrahedra that do not yet belong to a triangulation; moreover, this addition is recursive. This is done to ensure that, whenever one tetrahedron belongs to a triangulation, everything that it is joined to (directly or indirectly) also belongs to that same triangulation. See the NTetrahedron class notes for further details on how tetrahedron management has changed in Regina 4.90 and above.
Python:
Since this triangulation takes ownership of the given tetrahedron, the python object containing the given tetrahedron becomes a null object and should no longer be used.
Parameters:
tetthe tetrahedron to insert.

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

Turaev-Viro invariants are described by an (r, whichRoot) pair as described in the turaevViro() notes. The set returned by this routine maps (r, whichRoot) pairs to the corresponding invariant values.

Each time turaevViro() is called, the result will be stored in this set (as well as being returned to the user). This set will be emptied whenever the triangulation is modified.

Python:
Not present.
Returns:
the set of all Turaev-Viro invariants that have already been calculated.
See also:
turaevViro

Does a barycentric subdivision of the triangulation.

Each tetrahedron is divided into 24 tetrahedra by placing an extra vertex at the centroid of each tetrahedron, the centroid of each face and the midpoint of each edge.

Author:
David Letscher

Returns the index of the given boundary component in the triangulation.

This routine was introduced in Regina 4.5, and replaces the old getBoundaryComponentIndex(). The name has been changed because, unlike the old routine, it requires that the given boundary component belongs to the triangulation (a consequence of some significant memory optimisations).

Precondition:
The given boundary component belongs to this triangulation.
Warning:
Passing a null pointer to this routine will probably crash your program.
Parameters:
bcspecifies which boundary component to find in the triangulation.
Returns:
the index of the specified boundary component, where 0 is the first boundary component, 1 is the second and so on.
void regina::NTriangulation::cloneFrom ( const NTriangulation from) [protected]

Turns this triangulation into a clone of the given triangulation.

The tree structure and label of this triangulation are not touched.

Parameters:
fromthe triangulation from which this triangulation will be cloned.
bool regina::NTriangulation::closeBook ( NEdge 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 faces 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 faces that it joins are distinct;
  • the two vertices opposite e in each of these boundary faces are valid and distinct;
  • if edges e1 and e2 of one boundary face are to be folded onto edges f1 and f2 of the other boundary face 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 (faces, 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.
bool regina::NTriangulation::collapseEdge ( NEdge 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 (faces, 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.
long regina::NTriangulation::componentIndex ( const NComponent component) const [inline]

Returns the index of the given component in the triangulation.

This routine was introduced in Regina 4.5, and replaces the old getComponentIndex(). The name has been changed because, unlike the old routine, it requires that the given component belongs to the triangulation (a consequence of some significant memory optimisations).

Precondition:
The given component belongs to this triangulation.
Warning:
Passing a null pointer to this routine will probably crash your program.
Parameters:
componentspecifies which component to find in the triangulation.
Returns:
the index of the specified component, where 0 is the first component, 1 is the second and so on.
unsigned long regina::NTriangulation::connectedSumDecomposition ( NPacket 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.

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

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, no prime summand triangulations will be created at all.

Warning:
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, orientable 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 0 if this triangulation does not meet the preconditions described above.
std::string regina::NTriangulation::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 faces (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 faces or contains too many tetrahedra.
See also:
rehydrate
insertRehydration
bool regina::NTriangulation::dependsOnParent ( ) const [inline, virtual]

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::NPacket.

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 tetrahedron gluings in this trianguation;
  • two additional lines that declare a new NTriangulation 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 tetrahedra. If this triangulation is very large, the returned string will be very large as well.

Returns:
the C++ code that was generated.
long regina::NTriangulation::edgeIndex ( const NEdge edge) const [inline]

Returns the index of the given edge in the triangulation.

This routine was introduced in Regina 4.5, and replaces the old getEdgeIndex(). The name has been changed because, unlike the old routine, it requires that the given edge belongs to the triangulation (a consequence of some significant memory optimisations).

Precondition:
The given edge belongs to this triangulation.
Warning:
Passing a null pointer to this routine will probably crash your program.
Parameters:
edgespecifies which edge to find in the triangulation.
Returns:
the index of the specified edge, where 0 is the first edge, 1 is the second and so on.
static NTriangulation* regina::NTriangulation::enterTextTriangulation ( std::istream &  in,
std::ostream &  out 
) [static]

(end: Building Triangulations)

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.
long regina::NTriangulation::faceIndex ( const NFace face) const [inline]

Returns the index of the given face in the triangulation.

This routine was introduced in Regina 4.5, and replaces the old getFaceIndex(). The name has been changed because, unlike the old routine, it requires that the given face belongs to the triangulation (a consequence of some significant memory optimisations).

Precondition:
The given face belongs to this triangulation.
Warning:
Passing a null pointer to this routine will probably crash your program.
Parameters:
facespecifies which face to find in the triangulation.
Returns:
the index of the specified face, where 0 is the first face, 1 is the second and so on.
unsigned long regina::NTriangulation::findAllSubcomplexesIn ( const NTriangulation other,
std::list< NIsomorphism * > &  results 
) 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).

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 inserted into the given list. These isomorphisms will be newly created, and the caller of this routine is responsible for destroying them. The given list will not be emptied before the new isomorphisms are inserted.

Python:
Not present.
Parameters:
otherthe triangulation in which to search for isomorphic copies of this triangulation.
resultsthe list in which any isomorphisms found will be stored.
Returns:
the number of isomorphisms that were found.

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

Only boundary components formed from real tetrahedron 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 tetrahedron to each boundary face and then gluing these new tetrahedra together in a way that mirrors the adjacencies of the underlying boundary faces. Each boundary component will thereby be pushed up through the new tetrahedra and converted into a cusp formed using vertices of these new tetrahedra.

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

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.
bool regina::NTriangulation::fourFourMove ( NEdge 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 (faces, 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 NEdge::getEmbeddings(); call these tetrahedra 0, 1, 2 and 3. 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.
static NTriangulation* regina::NTriangulation::fromIsoSig ( const std::string &  signature) [static]

Recovers a full triangulation from an isomorphism signature.

See isoSig() for more information on isomorphism signatures.

The triangulation that is returned will be newly created.

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.

For a full and precise description of the isomorphism signature format, see Simplification paths in the Pachner graphs of closed orientable 3-manifold triangulations, Burton, 2011, arXiv:1110.6080.

Parameters:
signaturethe isomorphism signature of the triangulation to construct. Note that, unlike dehydration strings, case is important for isomorphism signatures.
Returns:
a newly allocated triangulation if the reconstruction was successful, or null if the given string was not a valid isomorphism signature.
NBoundaryComponent * regina::NTriangulation::getBoundaryComponent ( unsigned long  index) const [inline]

Returns the requested triangulation boundary component.

Bear in mind that each time the triangulation changes, the boundary components will be deleted and replaced with new ones. Thus this object should be considered temporary only.

Parameters:
indexthe index of the desired boundary component, ranging from 0 to getNumberOfBoundaryComponents()-1 inclusive.
Returns:
the requested boundary component.

Returns the index of the given boundary component in the triangulation.

Deprecated:
As of Regina 4.5, this is now a slow linear time routine (a consequence of some significant memory optimisations). The alternative boundaryComponentIndex() is fast, but insists that bc belongs to the triangulation. This slower routine will be removed at some point in the future.
Parameters:
bcspecifies which boundary component to find in the triangulation.
Returns:
the index of the specified boundary component, where 0 is the first boundary component, 1 is the second and so on. If the given boundary component is not part of this triangulation, a negative number is returned.
const std::vector< NBoundaryComponent * > & regina::NTriangulation::getBoundaryComponents ( ) const [inline]

Returns all boundary components of this triangulation.

Note that each ideal vertex forms its own boundary component.

Bear in mind that each time the triangulation changes, the boundary components will be deleted and replaced with new ones. Thus the objects contained in this list should be considered temporary only.

This reference to the list however 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.
NComponent * regina::NTriangulation::getComponent ( unsigned long  index) const [inline]

Returns the requested triangulation component.

Bear in mind that each time the triangulation changes, the components will be deleted and replaced with new ones. Thus this object should be considered temporary only.

Parameters:
indexthe index of the desired component, ranging from 0 to getNumberOfComponents()-1 inclusive.
Returns:
the requested component.
long regina::NTriangulation::getComponentIndex ( const NComponent component) const [inline]

Returns the index of the given component in the triangulation.

Deprecated:
As of Regina 4.5, this is now a slow linear time routine (a consequence of some significant memory optimisations). The alternative componentIndex() is fast, but insists that component belongs to the triangulation. This slower routine will be removed at some point in the future.
Parameters:
componentspecifies which component to find in the triangulation.
Returns:
the index of the specified component, where 0 is the first component, 1 is the second and so on. If the given component is not part of this triangulation, a negative number is returned.
const std::vector< NComponent * > & regina::NTriangulation::getComponents ( ) const [inline]

Returns all components of this triangulation.

Bear in mind that each time the triangulation changes, the components will be deleted and replaced with new ones. Thus the objects contained in this list should be considered temporary only.

This reference to the list however 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.
NEdge * regina::NTriangulation::getEdge ( unsigned long  index) const [inline]

Returns the requested triangulation edge.

Bear in mind that each time the triangulation changes, the edges will be deleted and replaced with new ones. Thus this object should be considered temporary only.

Parameters:
indexthe index of the desired edge, ranging from 0 to getNumberOfEdges()-1 inclusive.
Returns:
the requested edge.
long regina::NTriangulation::getEdgeIndex ( const NEdge edge) const [inline]

Returns the index of the given edge in the triangulation.

Deprecated:
As of Regina 4.5, this is now a slow linear time routine (a consequence of some significant memory optimisations). The alternative edgeIndex() is fast, but insists that edge belongs to the triangulation. This slower routine will be removed at some point in the future.
Parameters:
edgespecifies which edge to find in the triangulation.
Returns:
the index of the specified edge, where 0 is the first edge, 1 is the second and so on. If the given edge is not part of this triangulation, a negative number is returned.
const std::vector< NEdge * > & regina::NTriangulation::getEdges ( ) const [inline]

Returns all edges of this triangulation.

Bear in mind that each time the triangulation changes, the edges will be deleted and replaced with new ones. Thus the objects contained in this list should be considered temporary only.

This reference to the list however 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 edges.

A deprecated alias for getEulerCharTri().

This routine calculates the Euler characteristic of this triangulation. Since it treats cusps in a non-standard way, it was renamed to getEulerCharTri() in Regina 4.4 to clarify that this might differ from the Euler characteristic of the corresponding compact manifold.

See getEulerCharTri() for further details.

Deprecated:
This routine will be removed in a future version of Regina. Please use getEulerCharTri() instead.
Returns:
the Euler characteristic of this triangulation.

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 getEulerCharTri(), which does not).

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

Returns:
the Euler characteristic of the corresponding compact manifold.
long regina::NTriangulation::getEulerCharTri ( ) const [inline]

Returns the Euler characteristic of this triangulation.

This will be evaluated strictly as V-E+F-T.

Note that this routine handles cusps in a non-standard way. Since it computes the Euler characteristic of the triangulation (and not the underlying manifold), this routine will treat each cusp as a single vertex, and not as a surface boundary component.

For a routine that handles cusps properly (i.e., treats them as surface boundary components when computing the Euler characteristic), see getEulerCharManifold() instead.

This routine was previously called getEulerCharacteristic() in Regina 4.3.1 and earlier. It was renamed in Regina 4.4 to clarify the non-standard handling of cusps.

Returns:
the Euler characteristic of this triangulation.
NFace * regina::NTriangulation::getFace ( unsigned long  index) const [inline]

Returns the requested triangulation face.

Bear in mind that each time the triangulation changes, the faces will be deleted and replaced with new ones. Thus this object should be considered temporary only.

Parameters:
indexthe index of the desired face, ranging from 0 to getNumberOfFaces()-1 inclusive.
Returns:
the requested face.
long regina::NTriangulation::getFaceIndex ( const NFace face) const [inline]

Returns the index of the given face in the triangulation.

Deprecated:
As of Regina 4.5, this is now a slow linear time routine (a consequence of some significant memory optimisations). The alternative faceIndex() is fast, but insists that face belongs to the triangulation. This slower routine will be removed at some point in the future.
Parameters:
facespecifies which face to find in the triangulation.
Returns:
the index of the specified face, where 0 is the first face, 1 is the second and so on. If the given face is not part of this triangulation, a negative number is returned.
const std::vector< NFace * > & regina::NTriangulation::getFaces ( ) const [inline]

Returns all faces of this triangulation.

Bear in mind that each time the triangulation changes, the faces will be deleted and replaced with new ones. Thus the objects contained in this list should be considered temporary only.

This reference to the list however 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 faces.

Returns the fundamental group of this triangulation.

If this triangulation contains any ideal or non-standard vertices, the fundamental group will be calculated as if each such vertex had been truncated.

If this triangulation contains any invalid edges, the calculations will be performed without any truncation of the corresponding projective plane cusp. Thus if a barycentric subdivision is performed on the triangulation, the result of getFundamentalGroup() will 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, getFundamentalGroup() should be called again; this will be instantaneous if the group has already been calculated.

Note that this triangulation is not required to be valid (see isValid()).

Precondition:
This triangulation has at most one component.
Returns:
the fundamental group.

Returns the first homology group for this triangulation.

If this triangulation contains any ideal or non-standard vertices, the homology group will be calculated as if each such vertex had been truncated.

If this triangulation contains any invalid edges, the calculations will be performed without any truncation of the corresponding projective plane cusp. Thus if a barycentric subdivision is performed on the triangulation, the result of getHomologyH1() will change.

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

Note that this triangulation is not required to be valid (see isValid()).

Returns:
the first homology group.

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, getHomologyH1Bdry() 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.

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, getHomologyH1Rel() 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.

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, getHomologyH2() 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.
unsigned long regina::NTriangulation::getHomologyH2Z2 ( ) 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.

Returns the number of boundary components in this triangulation.

Note that each ideal vertex forms its own boundary component.

Returns:
the number of boundary components.
unsigned long regina::NTriangulation::getNumberOfComponents ( ) const [inline]

Returns the number of components in this triangulation.

Returns:
the number of components.
unsigned long regina::NTriangulation::getNumberOfEdges ( ) const [inline]

Returns the number of edges in this triangulation.

Returns:
the number of edges.
unsigned long regina::NTriangulation::getNumberOfFaces ( ) const [inline]

Returns the number of faces in this triangulation.

Returns:
the number of faces.
unsigned long regina::NTriangulation::getNumberOfTetrahedra ( ) const [inline]

Returns the number of tetrahedra in the triangulation.

Returns:
the number of tetrahedra.
unsigned long regina::NTriangulation::getNumberOfVertices ( ) const [inline]

Returns the number of vertices in this triangulation.

Returns:
the number of vertices.
virtual int regina::NTriangulation::getPacketType ( ) const [virtual]

Returns the integer ID representing this type of packet.

This is the same for all packets of this class.

Returns:
the packet type ID.

Implements regina::NPacket.

virtual std::string regina::NTriangulation::getPacketTypeName ( ) const [virtual]

Returns an English name for this type of packet.

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

Returns:
the packet type name.

Implements regina::NPacket.

const std::vector< NTetrahedron * > & regina::NTriangulation::getTetrahedra ( ) const [inline]

Returns all tetrahedra in the triangulation.

The reference returned will remain valid for as long as the triangulation exists, always reflecting the tetrahedra currently in the triangulation.

Python:
This routine returns a python list.
Returns:
the list of all tetrahedra.
NTetrahedron * regina::NTriangulation::getTetrahedron ( unsigned long  index) [inline]

Returns the tetrahedron with the given index number in the triangulation.

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

Parameters:
indexspecifies which tetrahedron to return; this value should be between 0 and getNumberOfTetrahedra()-1 inclusive.
Returns:
the indexth tetrahedron in the triangulation.
const NTetrahedron * regina::NTriangulation::getTetrahedron ( unsigned long  index) const [inline]

Returns the tetrahedron with the given index number in the triangulation.

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

Parameters:
indexspecifies which tetrahedron to return; this value should be between 0 and getNumberOfTetrahedra()-1 inclusive.
Returns:
the indexth tetrahedron in the triangulation.
long regina::NTriangulation::getTetrahedronIndex ( const NTetrahedron tet) const [inline]

Returns the index of the given tetrahedron in the triangulation.

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

Deprecated:
As of Regina 4.5, this is now a slow linear time routine (a consequence of some significant memory optimisations). The alternative tetrahedronIndex() is fast, but insists that tet belongs to the triangulation. This slower routine will be removed at some point in the future.
Parameters:
tetspecifies which tetrahedron to find in the triangulation.
Returns:
the index of the specified tetrahedron, where 0 is the first tetrahedron, 1 is the second and so on. If the tetrahedron is not contained in the triangulation, a negative number is returned.
NVertex * regina::NTriangulation::getVertex ( unsigned long  index) const [inline]

Returns the requested triangulation vertex.

Bear in mind that each time the triangulation changes, the vertices will be deleted and replaced with new ones. Thus this object should be considered temporary only.

Parameters:
indexthe index of the desired vertex, ranging from 0 to getNumberOfVertices()-1 inclusive.
Returns:
the requested vertex.
long regina::NTriangulation::getVertexIndex ( const NVertex vertex) const [inline]

Returns the index of the given vertex in the triangulation.

Deprecated:
As of Regina 4.5, this is now a slow linear time routine (a consequence of some significant memory optimisations). The alternative vertexIndex() is fast, but insists that vertex belongs to the triangulation. This slower routine will be removed at some point in the future.
Parameters:
vertexspecifies which vertex to find in the triangulation.
Returns:
the index of the specified vertex, where 0 is the first vertex, 1 is the second and so on. If the given vertex is not part of this triangulation, a negative number is returned.
const std::vector< NVertex * > & regina::NTriangulation::getVertices ( ) const [inline]

Returns all vertices of this triangulation.

Bear in mind that each time the triangulation changes, the vertices will be deleted and replaced with new ones. Thus the objects contained in this list should be considered temporary only.

This reference to the list however 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 vertices.

(end: File I/O)

Returns a newly created XML element reader that will read the contents of a single XML packet element. You may assume that the packet to be read is of the same type as the class in which you are implementing this routine.

The XML element reader should read exactly what writeXMLPacketData() writes, and vice versa.

parent represents the packet which will become the new packet's parent in the tree structure, and may be assumed to have already been read from the file. This information is for reference only, and does not need to be used. The XML element reader can either insert or not insert the new packet beneath parent in the tree structure as it pleases. Note however that parent will be 0 if the new packet is to become a tree matriarch.

This routine is not actually provided for NPacket itself, but must be declared and implemented for every packet subclass that will be instantiated.

Python:
Not present.
Parameters:
parentthe packet which will become the new packet's parent in the tree structure, or 0 if the new packet is to be tree matriarch.
Returns:
the newly created XML element reader.

Reimplemented from regina::NPacket.

This routine now does nothing, and should not be used.

Deprecated:
In Regina versions 4.6 and earlier, this routine was used to manually notify the triangulation that the gluings of tetrahedra had changed. In Regina 4.90 and later this notification is automatic. This routine now does nothing at all, and can safely be removed from any existing code.

Determines if this triangulation has any boundary faces.

Returns:
true if and only if there are boundary faces.

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 run a full enumeration of vertex normal surfaces, which could be extremely slow. For further details on the underlying algorithms, 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; and "Algorithms for the complete decomposition of a closed 3-manifold", William Jaco and Jeffrey L. Tollefson, Illinois J. Math. 39 (1995), 358-406.

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

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.

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 face surrounded by three boundary edges.

The purpose of this routine is to avoid enumerating 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).

Determines whether this triangulation has a normal splitting surface.

See NNormalSurface::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.

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.
bool regina::NTriangulation::idealToFinite ( bool  forceDivision = false)

Converts an ideal triangulation into a finite triangulation.

All ideal or non-standard 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.
Parameters:
forceDivisionspecifies what to do if the triangulation has no ideal or non-standard vertices. If true, the triangulation will be subdivided anyway, as if all vertices were ideal. If false (the default), the triangulation will be left alone.
Returns:
true if and only if the triangulation was changed.
Author:
David Letscher
void regina::NTriangulation::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 NAugTriSolidTorus 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.
void regina::NTriangulation::insertConstruction ( unsigned long  nTetrahedra,
const int  adjacencies[][4],
const int  gluings[][4][4] 
)

Inserts into this triangulation a set of tetrahedra and their gluings as described by the given integer arrays.

This routine is provided to make it easy to hard-code a medium-sized triangulation in a C++ source file. All of the pertinent data can be hard-coded into a pair of integer arrays at the beginning of the source file, avoiding an otherwise tedious sequence of many joinTo() calls.

An additional nTetrahedra tetrahedra will be inserted into this triangulation. The relationships between these tetrahedra should be stored in the two arrays as follows. Note that the new tetrahedra are numbered from 0 to (nTetrahedra - 1), and individual tetrahedron faces are numbered from 0 to 3.

The adjacencies array describes which tetrahedron faces are joined to which others. Specifically, adjacencies[t][f] should contain the number of the tetrahedron joined to face f of tetrahedron t. If this face is to be left as a boundary face, adjacencies[t][f] should be -1.

The gluings array describes the particular gluing permutations used when joining these tetrahedron faces together. Specifically, gluings[t][f][0..3] should describe the permutation used to join face f of tetrahedron t to its adjacent tetrahedron. These four integers should be 0, 1, 2 and 3 in some order, so that gluings[t][f][i] contains the image of i under this permutation. If face f of tetrahedron t is to be left as a boundary face, gluings[t][f][0..3] may contain anything (and will be duly ignored).

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.

Note that, for an existing triangulation, dumpConstruction() will output a pair of C++ arrays that can be copied into a source file and used to reconstruct the triangulation via this routine.

Python:
Not present.
Parameters:
nTetrahedrathe number of additional tetrahedra to insert.
adjacenciesdescribes which of the new tetrahedron faces are to be identified. This array must have initial dimension at least nTetrahedra.
gluingsdescribes the specific gluing permutations by which these new tetrahedron faces should be identified. This array must also have initial dimension at least nTetrahedra.
void regina::NTriangulation::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:
NLayeredLensSpace
void regina::NTriangulation::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 NLayeredLoop 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:
NLayeredLoop
NTetrahedron* regina::NTriangulation::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:
NLayeredSolidTorus
bool regina::NTriangulation::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
void regina::NTriangulation::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.

Inserts a copy of the given triangulation into this triangulation.

The new tetrahedra will be inserted into this triangulation in the order in which they appear in the given triangulation, and the numbering of their vertices (0-3) will not change. They will be given the same descriptions as appear in the given triangulation.

Parameters:
sourcethe triangulation whose copy will be inserted.

Attempts to simplify the triangulation as intelligently as possible without further input.

This routine will attempt to reduce both the number of tetrahedra and the number of boundary faces (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.

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 changed.
NPacket * regina::NTriangulation::internalClonePacket ( NPacket parent) const [inline, protected, virtual]

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::NPacket.

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.
bool regina::NTriangulation::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.
bool regina::NTriangulation::isConnected ( ) const [inline]

Determines if this triangulation is connected.

Returns:
true if and only if this triangulation is connected.
std::auto_ptr<NIsomorphism> regina::NTriangulation::isContainedIn ( const NTriangulation 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).

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 NIsomorphism class notes.

In particular, note that boundary faces of this triangulation need not correspond to boundary faces of other, and that other can contain more tetrahedra 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::auto_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().

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.
bool regina::NTriangulation::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.
std::auto_ptr<NIsomorphism> regina::NTriangulation::isIsomorphicTo ( const NTriangulation other) const

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

Specifically, this routine determines if there is a one-to-one and onto boundary complete combinatorial isomorphism from this triangulation to other. Boundary complete isomorphisms are described in detail in the NIsomorphism class notes.

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

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

If a boundary complete 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::auto_ptr. Thus, to test whether an isomorphism exists without having to explicitly deal with the isomorphism itself, you can call if (isIsomorphicTo(other).get()) and the newly created isomorphism (if it exists) will be automatically destroyed.

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.

Determines if this triangulation is ordered; that is, if tetrahedron vertices are labelled so that all gluing permutations are order-preserving on the 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 faces.
Author:
Matthias Goerner
bool regina::NTriangulation::isOrientable ( ) const [inline]

Determines if this triangulation is orientable.

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

Determines if this triangulation is oriented; that is, if tetrahedron vertices are labelled in a way that preserves orientation across adjacent faces.

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 tetrahedra to be oriented consistently as described above.

A non-orientable triangulation can never be oriented.

Returns:
true if and only if all tetrahedra are oriented consistently.
Author:
Matthias Goerner
std::string regina::NTriangulation::isoSig ( ) const

Constructs the isomorphism signature for this triangulation.

An isomorphism signature is a compact text representation of a triangulation. Unlike dehydrations, an isomorphism signature uniquely determines a triangulation up to combinatorial isomorphism. That is, two triangulations 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 tetrahedra.

Isomorphism signatures are more general than dehydrations: they can be used with any triangulation (including closed, ideal, bounded, invalid and/or disconnected triangulations, as well as triangulations with large numbers of tetrahedra).

The time required to construct the isomorphism signature of a triangulation is O(n^2 log^2 n).

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.

For a full and precise description of the isomorphism signature format, see Simplification paths in the Pachner graphs of closed orientable 3-manifold triangulations, Burton, 2011, arXiv:1110.6080.

Returns:
the isomorphism signature of this triangulation.

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 faces, 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.
bool regina::NTriangulation::isStandard ( ) const [inline]

Determines if this triangulation is standard.

This is the case if and only if every vertex is standard. See NVertex::isStandard() for further details.

Returns:
true if and only if this triangulation is standard.

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.
bool regina::NTriangulation::isValid ( ) const [inline]

Determines if this triangulation is valid.

A triangulation is valid unless there is some vertex whose link has boundary but is not a disc (i.e., a vertex for which NVertex::getLink() returns NVertex::NON_STANDARD_BDRY), or unless there is some edge glued to itself in reverse (i.e., an edge for which NEdge::isValid() returns false).

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

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.

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.

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.

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.

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.

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.

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

See the NLayering 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 faces on either side of it are distinct.
Parameters:
edgethe boundary edge upon which to layer.
Returns:
the new tetrahedron provided by the layering.

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.

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).
void regina::NTriangulation::maximalForestInBoundary ( stdhash::hash_set< NEdge *, HashPointer > &  edgeSet,
stdhash::hash_set< NVertex *, HashPointer > &  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.

Deprecated:
In Regina 5.0, this routine will be changed to use std::set instead of stdhash::hash_set. This is part of the broader plan to remove any need for the non-standard hash_set and hash_map.
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.
void regina::NTriangulation::maximalForestInDualSkeleton ( stdhash::hash_set< NFace *, HashPointer > &  faceSet) const

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

The given set will be emptied and will have the faces corresponding to the edges of the maximal forest in the dual 1-skeleton placed into it.

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

Deprecated:
In Regina 5.0, this routine will be changed to use std::set instead of stdhash::hash_set. This is part of the broader plan to remove any need for the non-standard hash_set and hash_map.
Python:
Not present.
Parameters:
faceSetthe set to be emptied and into which the faces representing the maximal forest will be placed.
void regina::NTriangulation::maximalForestInSkeleton ( stdhash::hash_set< NEdge *, HashPointer > &  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.

Deprecated:
In Regina 5.0, this routine will be changed to use std::set instead of stdhash::hash_set. This is part of the broader plan to remove any need for the non-standard hash_set and hash_map.
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.

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

That is, all tetrahedra that currently belong to dest will remain there, and all tetrahedra that belong to this triangulation will be moved across as additional tetrahedra in dest.

All NTetrahedron pointers or references will remain valid. After this operation, this triangulation will be empty.

Parameters:
destthe triangulation to which tetrahedra should be moved.

Creates a new tetrahedron and adds it to this triangulation.

The new tetrahedron will have an empty description. All four faces of the new tetrahedron will be boundary faces.

Returns:
the new tetrahedron.
NTetrahedron * regina::NTriangulation::newTetrahedron ( const std::string &  desc) [inline]

Creates a new tetrahedron with the given description and adds it to this triangulation.

All four faces of the new tetrahedron will be boundary faces.

Parameters:
descthe description to assign to the new tetrahedron.
Returns:
the new tetrahedron.
bool regina::NTriangulation::openBook ( NFace f,
bool  check = true,
bool  perform = true 
)

Checks the eligibility of and/or performs a book opening move about the given face.

This involves taking a face meeting the boundary along two edges, and ungluing it to create two new boundary faces (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 face 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 face (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 (faces, 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 face is a face of this triangulation.
Parameters:
fthe face 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.
bool regina::NTriangulation::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 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

Relabels tetrahedron vertices in this triangulation so that all tetrahedra are oriented consistently, if possible.

This routine works by flipping vertices 2 and 3 of each tetrahedron with negative orientation. The result will be a triangulation where the tetrahedron vertices are labelled in a way that preserves orientation across adjacent faces. 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.

Author:
Matthias Goerner
virtual void regina::NTriangulation::readIndividualProperty ( NFile infile,
unsigned  propType 
) [virtual]

Reads an individual property from an old-style binary file.

The property type and bookmarking details should not read; merely the contents of the property that are written to file between NFile::writePropertyHeader() and NFile::writePropertyFooter(). See the NFile::writePropertyHeader() notes for details.

The property type of the property to be read will be passed in propType. If the property type is unrecognised, this routine should simply do nothing and return. If the property type is recognised, this routine should read the property and process it accordingly (e.g., store it in whatever data object is currently being read).

Parameters:
infilethe file from which to read the property. This should be open for reading and at the position immediately after writePropertyHeader() would have been called during the corresponding write operation.
propTypethe property type of the property about to be read.

Implements regina::NFilePropertyReader.

static NTriangulation* regina::NTriangulation::readPacket ( NFile in,
NPacket parent 
) [static]

Reads a single packet from the specified file and returns a newly created object containing that information.

You may assume that the packet to be read is of the same type as the class in which you are implementing this routine. The newly created object must also be of this type.

For instance, NTriangulation::readPacket() may assume that the packet is of type NTriangulation, and must return a pointer to a newly created NTriangulation. Deallocation of the newly created packet is the responsibility of whoever calls this routine.

The packet type and label may be assumed to have already been read from the file, and should not be reread. The readPacket() routine should read exactly what writePacket() writes, and vice versa.

parent represents the packet which will become the new packet's parent in the tree structure, and may be assumed to have already been read from the file. This information is for reference only, and does not need to be used. This routine can either insert or not insert the new packet beneath parent in the tree structure as it pleases. Note however that parent will be 0 if the new packet is to become a tree matriarch.

This routine is not actually provided for NPacket itself, but must be declared and implemented for every packet subclass that will be instantiated. Within each such subclass the function must be declared to return a pointer to an object of that subclass. For instance, NTriangulation::readPacket() must be declared to return an NTriangulation*, not simply an NPacket*.

New packet types should make this routine simply return 0 since this file format is now obsolete, and older calculation engines will not understand newer packet types anyway.

Deprecated:
For the preferred way to read packets from file, see getXMLReader() and class NXMLPacketReader instead.
Precondition:
The given file is open for reading and all above conditions have been satisfied.
Python:
Not present.
Parameters:
inthe file from which to read the packet.
parentthe packet which will become the new packet's parent in the tree structure, or 0 if the new packet is to be tree matriarch.
Returns:
the packet read from file, or 0 if an error occurred.

Reimplemented from regina::NPacket.

static NTriangulation* regina::NTriangulation::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

Removes all tetrahedra from the triangulation.

All tetrahedra will be deallocated.

Removes the given tetrahedron from the triangulation.

All faces glued to this tetrahedron will be unglued. The tetrahedron will be deallocated.

Precondition:
The given tetrahedron exists in the triangulation.
Warning:
This routine has changed behaviour as of Regina 4.90. In older versions of Regina, the tetrahedron was returned to the user. As of Regina 4.90, the tetrahedron is now destroyed immediately.
Parameters:
tetthe tetrahedron to remove.
void regina::NTriangulation::removeTetrahedronAt ( unsigned long  index) [inline]

Removes the tetrahedron with the given index number from the triangulation.

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

All faces glued to this tetrahedron will be unglued. The tetrahedron will be deallocated.

Warning:
This routine has changed behaviour as of Regina 4.90. In older versions of Regina, the tetrahedron was returned to the user. As of Regina 4.90, the tetrahedron is now destroyed immediately.
Parameters:
indexspecifies which tetrahedron to remove; this should be between 0 and getNumberOfTetrahedra()-1 inclusive.
void regina::NTriangulation::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.
bool regina::NTriangulation::shellBoundary ( NTetrahedron 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 (faces, 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.

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 getFundamentalGroup() 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.
bool regina::NTriangulation::simplifyToLocalMinimum ( bool  perform = true)

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

Note that this will probably not give a globally minimal triangulation; see intelligentSimplify() for further assistance in achieving this goal.

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

Note that 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.
unsigned long regina::NTriangulation::splitIntoComponents ( NPacket componentParent = 0,
bool  setLabels = true 
)

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 will be left unchanged.

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

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

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 unique packet labels, or false if they should be left without labels at all.
Returns:
the number of new component triangulations constructed.

Swaps the contents of this and the given triangulation.

That is, all tetrahedra that belong to this triangulation will be moved to other, and all tetrahedra that belong to other will be moved to this triangulation.

All NTetrahedron pointers or references will remain valid.

Parameters:
otherthe triangulation whose contents should be swapped with this.
long regina::NTriangulation::tetrahedronIndex ( const NTetrahedron tet) const [inline]

Returns the index of the given tetrahedron in the triangulation.

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

This routine was introduced in Regina 4.5, and replaces the old getTetrahedronIndex(). The name has been changed because, unlike the old routine, it requires that the given tetrahedron belongs to the triangulation (a consequence of some significant memory optimisations).

Precondition:
The given tetrahedron is contained in this triangulation.
Warning:
Passing a null pointer to this routine will probably crash your program. If you are passing the result of some other routine that might return null (such as NTetrahedron::adjacentTetrahedron), it might be worth explicitly testing for null beforehand.
Parameters:
tetspecifies which tetrahedron to find in the triangulation.
Returns:
the index of the specified tetrahedron, where 0 is the first tetrahedron, 1 is the second and so on.
bool regina::NTriangulation::threeTwoMove ( NEdge 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 face. 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 (faces, 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.
double regina::NTriangulation::turaevViro ( unsigned long  r,
unsigned long  whichRoot 
) const

Computes the Turaev-Viro state sum invariant of this 3-manifold based upon the given initial data.

The initial data 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.

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.
Parameters:
rthe integer r as described above; this must be at least 3.
whichRootdetermines q0 to be the root of unity e^(2i * Pi * whichRoot / 2r); this argument must be strictly between 0 and 2r and must have no common factors with r.
Returns:
the requested Turaev-Viro invariant.
See also:
allCalculatedTuraevViro
bool regina::NTriangulation::twoOneMove ( NEdge 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 (faces, 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 NEdgeEmbedding::getVertices().
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.
bool regina::NTriangulation::twoThreeMove ( NFace f,
bool  check = true,
bool  perform = true 
)

Checks the eligibility of and/or performs a 2-3 move about the given face.

This involves replacing the two tetrahedra joined at that face 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 (faces, 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 face is a face of this triangulation.
Parameters:
fthe face 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.
bool regina::NTriangulation::twoZeroMove ( NEdge 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 faces f1 and f2 of one tetrahedron are to be flattened onto faces 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 faces 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 (faces, 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.
bool regina::NTriangulation::twoZeroMove ( NVertex 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 faces 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 (faces, 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.
long regina::NTriangulation::vertexIndex ( const NVertex vertex) const [inline]

Returns the index of the given vertex in the triangulation.

This routine was introduced in Regina 4.5, and replaces the old getVertexIndex(). The name has been changed because, unlike the old routine, it requires that the given vertex belongs to the triangulation (a consequence of some significant memory optimisations).

Precondition:
The given vertex belongs to this triangulation.
Warning:
Passing a null pointer to this routine will probably crash your program.
Parameters:
vertexspecifies which vertex to find in the triangulation.
Returns:
the index of the specified vertex, where 0 is the first vertex, 1 is the second and so on.
virtual void regina::NTriangulation::writePacket ( NFile out) const [virtual]

Writes the packet details to the given old-style binary file.

You may assume that the packet type and label have already been written. Only the actual data stored in the packet need be written.

The default implementation for this routine does nothing; new packet types should not implement this routine since this file format is now obsolete, and older calculation engines will simply skip unknown packet types when reading from binary files.

Deprecated:
For the preferred way to write packets to file, see writeXMLFile() and writeXMLPacketData() instead.
Precondition:
The given file is open for writing and satisfies the assumptions listed above.
Python:
Not present.
Parameters:
outthe file to be written to.

Reimplemented from regina::NPacket.

virtual void regina::NTriangulation::writeTextLong ( std::ostream &  out) const [virtual]

Writes this object in long text format to the given output stream.

The output should provided the user with all the information they could want. The output should end with a newline.

The default implementation of this routine merely calls writeTextShort() and adds a newline.

Python:
The parameter out does not exist; standard output will be used.
Parameters:
outthe output stream to which to write.

Reimplemented from regina::ShareableObject.

void regina::NTriangulation::writeTextShort ( std::ostream &  out) const [inline, virtual]

Writes this object in short text format to the given output stream.

The output should fit on a single line and no newline should be written.

Python:
The parameter out does not exist; standard output will be used.
Parameters:
outthe output stream to which to write.

Implements regina::ShareableObject.

virtual void regina::NTriangulation::writeXMLPacketData ( std::ostream &  out) const [protected, virtual]

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::NPacket.


Member Data Documentation

Contains the integer ID for this packet.

Each distinct packet type must have a unique ID, and this should be a positive integer. See packetregistry.h for further requirements regarding ID selection.

This member is not actually provided for NPacket itself, but must be declared for every packet subclass that will be instantiated. A value need not be assigned; packetregistry.h will take care of this task when you register the packet.

Reimplemented from regina::NPacket.


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

Copyright © 1999-2012, The Regina development team
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).