Regina Calculation Engine
|
Represents a 3-dimensional triangulation, typically of a 3-manifold. More...
#include <triangulation/dim3.h>
Public Types | |
typedef std::vector< Tetrahedron< 3 > * >::const_iterator | TetrahedronIterator |
A dimension-specific alias for SimplexIterator, used to iterate through tetrahedra. More... | |
typedef FaceList< 3, 2 >::Iterator | TriangleIterator |
Used to iterate through triangles. More... | |
typedef FaceList< 3, 1 >::Iterator | EdgeIterator |
Used to iterate through edges. More... | |
typedef FaceList< 3, 0 >::Iterator | VertexIterator |
Used to iterate through vertices. More... | |
typedef std::map< std::pair< unsigned long, bool >, Cyclotomic > | TuraevViroSet |
A map from (r, parity) pairs to Turaev-Viro invariants, as described by turaevViro(). More... | |
typedef Packet | SafePointeeType |
The type of object being pointed to. More... | |
typedef std::vector< Simplex< dim > * >::const_iterator | SimplexIterator |
Used to iterate through top-dimensional simplices. More... | |
typedef std::vector< Component< dim > * >::const_iterator | ComponentIterator |
Used to iterate through connected components. More... | |
typedef std::vector< BoundaryComponent< dim > * >::const_iterator | BoundaryComponentIterator |
Used to iterate through boundary components. More... | |
Public Member Functions | |
std::string | str () const |
Returns a short text representation of this object. More... | |
std::string | utf8 () const |
Returns a short text representation of this object using unicode characters. More... | |
std::string | detail () const |
Returns a detailed text representation of this object. More... | |
bool | hasSafePtr () const |
Is there one or more SafePtr currently pointing to this object? More... | |
Constructors and Destructors | |
Triangulation () | |
Default constructor. More... | |
Triangulation (const Triangulation< 3 > ©) | |
Creates a new copy of the given triangulation. More... | |
Triangulation (const Triangulation ©, bool cloneProps) | |
Creates a new copy of the given triangulation, with the option of whether or not to clone its computed properties also. More... | |
Triangulation (const std::string &description) | |
"Magic" constructor that tries to find some way to interpret the given string as a triangulation. More... | |
Triangulation (snappy.Manifold m) | |
Python-only constructor that copies the given SnapPy manifold. More... | |
Triangulation (snappy.Triangulation t) | |
Python-only constructor that copies the given SnapPy triangulation. More... | |
virtual REGINA_INLINE_REQUIRED | ~Triangulation () |
Destroys this triangulation. More... | |
Packet Administration | |
virtual void | writeTextShort (std::ostream &out) const override |
Writes a short text representation of this object to the given output stream. More... | |
virtual void | writeTextLong (std::ostream &out) const override |
Writes a detailed text representation of this object to the given output stream. More... | |
virtual bool | dependsOnParent () const override |
Determines if this packet depends upon its parent. More... | |
Static Public Attributes | |
static constexpr int | dimension |
A compile-time constant that gives the dimension of the triangulation. More... | |
Protected Attributes | |
MarkedVector< Simplex< dim > > | simplices_ |
The top-dimensional simplices that form the triangulation. More... | |
MarkedVector< BoundaryComponent< dim > > | boundaryComponents_ |
The components that form the boundary of the triangulation. More... | |
bool | valid_ |
Is this triangulation valid? See isValid() for details on what this means. More... | |
int | topologyLock_ |
If non-zero, this will cause Triangulation<dim>::clearAllProperties() to preserve any computed properties that related to the manifold (as opposed to the specific triangulation). More... | |
File I/O | |
bool | save (const char *filename, bool compressed=true) const |
Saves the subtree rooted at this packet to the given Regina data file, using Regina's native XML file format. More... | |
bool | save (std::ostream &s, bool compressed=true) const |
Writes the subtree rooted at this packet to the given output stream, in the format of a Regina XML data file. More... | |
void | writeXMLFile (std::ostream &out) const |
Writes the subtree rooted at this packet to the given output stream in Regina's native XML file format. More... | |
std::string | internalID () const |
Returns a unique string ID that identifies this packet. More... | |
bool | hasOwner () const |
Indicates whether some other object in the calculation engine is responsible for ultimately destroying this object. More... | |
void | writeXMLPacketTree (std::ostream &out) const |
Writes a chunk of XML containing the subtree with this packet as matriarch. More... | |
Importing Triangulations | |
static Triangulation< dim > * | fromIsoSig (const std::string &sig) |
Recovers a full triangulation from an isomorphism signature. More... | |
static size_t | isoSigComponentSize (const std::string &sig) |
Deduces the number of top-dimensional simplices in a connected triangulation from its isomorphism signature. More... | |
void | ensureSkeleton () const |
Ensures that all "on demand" skeletal objects have been calculated. More... | |
bool | calculatedSkeleton () const |
Determines whether the skeletal objects and properties of this triangulation have been calculated. More... | |
void | clearBaseProperties () |
Clears all properties that are managed by this base class. More... | |
void | swapBaseProperties (TriangulationBase< dim > &other) |
Swaps all properties that are managed by this base class, including skeletal data, with the given triangulation. More... | |
void | writeXMLBaseProperties (std::ostream &out) const |
Writes a chunk of XML containing properties of this triangulation. More... | |
Exporting Triangulations | |
std::string | dehydrate () const |
Dehydrates this triangulation into an alphabetical string. More... | |
virtual std::string | snapPea () const |
Returns a string containing the full contents of a SnapPea data file that describes this triangulation. More... | |
virtual void | snapPea (std::ostream &out) const |
Writes the full contents of a SnapPea data file describing this triangulation to the given output stream. More... | |
virtual bool | saveSnapPea (const char *filename) const |
Writes this triangulation to the given file using SnapPea's native file format. More... | |
std::string | recogniser () const |
Returns a string that expresses this triangulation in Matveev's 3-manifold recogniser format. More... | |
std::string | recognizer () const |
A synonym for recogniser(). More... | |
void | recogniser (std::ostream &out) const |
Writes a string expressing this triangulation in Matveev's 3-manifold recogniser format to the given output stream. More... | |
void | recognizer (std::ostream &out) const |
A synonym for recognizer(std::ostream&). More... | |
bool | saveRecogniser (const char *filename) const |
Writes this triangulation to the given file in Matveev's 3-manifold recogniser format. More... | |
bool | saveRecognizer (const char *filename) const |
A synonym for saveRecogniser(). More... | |
Importing Triangulations | |
class | regina::Face< 3, 3 > |
class | regina::detail::SimplexBase< 3 > |
class | regina::detail::TriangulationBase< 3 > |
class | regina::XMLTriangulationReader< 3 > |
static Triangulation< 3 > * | enterTextTriangulation (std::istream &in, std::ostream &out) |
Allows the user to interactively enter a triangulation in plain text. More... | |
static Triangulation< 3 > * | rehydrate (const std::string &dehydration) |
Rehydrates the given alphabetical string into a new triangulation. More... | |
static Triangulation< 3 > * | fromSnapPea (const std::string &snapPeaData) |
Extracts the tetrahedron gluings from a string that contains the full contents of a SnapPea data file. More... | |
static XMLPacketReader * | xmlReader (Packet *parent, XMLTreeResolver &resolver) |
virtual Packet * | internalClonePacket (Packet *parent) const override |
Makes a newly allocated copy of this packet. More... | |
virtual void | writeXMLPacketData (std::ostream &out) const override |
Writes a chunk of XML containing the data for this packet only. More... | |
Represents a 3-dimensional triangulation, typically of a 3-manifold.
This is a specialisation of the generic Triangulation class template; see the Triangulation documentation for a general overview of how the triangulation classes work.
This 3-dimensional specialisation offers significant extra functionality, including many functions specific to 3-manifolds.
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.
|
inherited |
Used to iterate through boundary components.
|
inherited |
Used to iterate through connected components.
|
inherited |
The type of object being pointed to.
|
inherited |
Used to iterate through top-dimensional simplices.
|
inherited |
Does a barycentric subdivision of the triangulation.
This is done in-place, i.e., the triangulation will be modified directly.
Each top-dimensional simplex s is divided into (dim + 1) factorial sub-simplices by placing an extra vertex at the centroid of every face of every dimension. Each of these sub-simplices t is described by a permutation p of (0, ..., dim). The vertices of such a sub-simplex t are:
The sub-simplices have their vertices numbered in a way that mirrors the original simplex s:
If simplex s has index i in the original triangulation, then its sub-simplex corresponding to permutation p will have index ((dim + 1)! * i + p.index())
in the resulting triangulation. In other words: sub-simplices are ordered first according to the original simplex that contains them, and then according to the lexicographical ordering of the corresponding permutations p.
size_t
).
|
inlineinherited |
Returns the requested boundary component of this triangulation.
Note that each time the triangulation changes, all boundary components will be deleted and replaced with new ones. Therefore this object should be considered temporary only.
index | the index of the desired boundary component; this must be between 0 and countBoundaryComponents()-1 inclusive. |
|
inlineinherited |
Returns all boundary components of this triangulation.
Note that, in Regina's standard dimensions, each ideal vertex forms its own boundary component, and some invalid vertices do also. See the BoundaryComponent class notes for full details on what constitutes a boundary component in standard and non-standard dimensions.
Bear in mind that each time the triangulation changes, all boundary component objects will be deleted and replaced with new ones. Therefore these boundary component objects should be considered temporary only.
In contrast, this reference to the list of BoundaryComponent objects will remain valid and up-to-date for as long as the triangulation exists.
|
inlineprotectedinherited |
Determines whether the skeletal objects and properties of this triangulation have been calculated.
These are only calculated "on demand", when a skeletal property is first queried.
true
if and only if the skeleton has been calculated.
|
protectedinherited |
Clears all properties that are managed by this base class.
This includes deleting all skeletal objects and emptying the corresponding internal lists, as well as clearing other cached properties and deallocating the corresponding memory where required.
Note that TriangulationBase never calls this routine itself. Typically clearBaseProperties() is only ever called by Triangulation<dim>::clearAllProperties(), which in turn is called by "atomic" routines that change the triangluation (before firing packet change events), as well as the Triangulation<dim> destructor.
|
inlineinherited |
Returns the requested connected component of this triangulation.
Note that each time the triangulation changes, all component objects will be deleted and replaced with new ones. Therefore this component object should be considered temporary only.
index | the index of the desired component; this must be between 0 and countComponents()-1 inclusive. |
|
inlineinherited |
Returns all connected components of this triangulation.
Note that each time the triangulation changes, all component objects will be deleted and replaced with new ones. Therefore these component objects should be considered temporary only.
In contrast, this reference to the list of all components will remain valid and up-to-date for as long as the triangulation exists.
|
inlineinherited |
Returns the number of boundary components in this triangulation.
Note that, in Regina's standard dimensions, each ideal vertex forms its own boundary component, and some invalid vertices do also. See the BoundaryComponent class notes for full details on what constitutes a boundary component in standard and non-standard dimensions.
|
inlineinherited |
Returns the total number of boundary facets in this triangulation.
This routine counts facets of top-dimensional simplices that are not glued to some adjacent top-dimensional simplex.
|
inlineinherited |
Returns the number of connected components in this triangulation.
|
inlineinherited |
Returns the number of subdim-faces in this triangulation.
countFaces(subdim)
; that is, the template parameter subdim becomes the first argument of the function.
|
inherited |
Returns a detailed text representation of this object.
This text may span many lines, and should provide the user with all the information they could want. It should be human-readable, should not contain extremely long lines (which cause problems for users reading the output in a terminal), and should end with a final newline. There are no restrictions on the underlying character set.
|
inherited |
Returns C++ code that can be used with insertConstruction() to reconstruct this triangulation.
The code produced will consist of the following:
The main purpose of this routine is to generate the two integer arrays, which can be tedious and error-prone to code up by hand.
Note that the number of lines of code produced grows linearly with the number of simplices. If this triangulation is very large, the returned string will be very large as well.
|
inlineprotectedinherited |
Ensures that all "on demand" skeletal objects have been calculated.
|
inlineinherited |
Returns the Euler characteristic of this triangulation.
This will be evaluated strictly as the alternating sum of the number of i-faces (that is, countVertices() - countEdges() + countTriangles() - ...
).
Note that this routine handles ideal triangulations in a non-standard way. Since it computes the Euler characteristic of the triangulation (and not the underlying manifold), this routine will treat each ideal boundary component as a single vertex, and not as an entire (dim-1)-dimensional boundary component.
In Regina's standard dimensions, for a routine that handles ideal boundary components properly (by treating them as (dim-1)-dimensional boundary components when computing Euler characteristic), you can use the routine eulerCharManifold() instead.
|
inlineinherited |
Returns the requested subdim-face of this triangulation.
face(subdim, index)
; that is, the template parameter subdim becomes the first argument of the function.index | the index of the desired face, ranging from 0 to countFaces<subdim>()-1 inclusive. |
|
inlineinherited |
Returns an object that allows iteration through and random access to all subdim-faces of this triangulation.
Bear in mind that each time the triangulation changes, all face objects will be deleted and replaced with new ones. Therefore these face objects should be considered temporary only.
In contrast, this reference to the FaceList object itself will remain valid and up-to-date for as long as the triangulation exists.
faces(subdim)
. It will then return a Python list containing all the subdim-faces of the triangulation. Be warned that, unlike in C++, this Python list will be a snapshot of the faces when this function is called, and will not be kept up-to-date as the triangulation changes.
|
inlineinherited |
Finds all ways in which this triangulation is combinatorially isomorphic to the given triangulation.
This routine behaves identically to isIsomorphicTo(), except that instead of returning just one isomorphism, all such isomorphisms are returned.
See the isIsomorphicTo() notes for additional information.
The isomorphisms that are found will be written to the given output iterator. This iterator must accept objects of type Isomorphism<dim>*. As an example, output might be a back_insert_iterator for a std::vector<Isomorphism<dim>*>.
The isomorphisms that are written to the given output iterator will be newly created, and the caller of this routine is responsible for destroying them.
other | the triangulation to compare with this one. |
output | the output iterator to which the isomorphisms will be written. |
|
inlineinherited |
Finds all ways in which an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components).
This routine behaves identically to isContainedIn(), except that instead of returning just one isomorphism (which may be boundary incomplete and need not be onto), all such isomorphisms are returned.
See the isContainedIn() notes for additional information.
The isomorphisms that are found will be written to the given output iterator. This iterator must accept objects of type Isomorphism<dim>*. As an example, output might be a back_insert_iterator for a std::vector<Isomorphism<dim>*>.
The isomorphisms that are written to the given output iterator will be newly created, and the caller of this routine is responsible for destroying them.
other | the triangulation in which to search for isomorphic copies of this triangulation. |
output | the output iterator to which the isomorphisms will be written. |
|
inherited |
Converts each real boundary component into a cusp (i.e., an ideal vertex).
Only boundary components formed from real (dim-1)-faces will be affected; ideal boundary components are already cusps and so will not be changed.
One side-effect of this operation is that all spherical boundary components will be filled in with balls.
This operation is performed by attaching a new dim-simplex to each boundary (dim-1)-face, and then gluing these new simplices together in a way that mirrors the adjacencies of the underlying boundary facets. Each boundary component will thereby be pushed up through the new simplices and converted into a cusp formed using vertices of these new simplices.
In Regina's standard dimensions, where triangulations also support an idealToFinite() operation, this routine is a loose converse of that operation.
In dimension 2, every boundary component is spherical and so this routine simply fills all the punctures in the underlying surface. (In dimension 2, triangulations cannot have cusps).
true
if changes were made, or false
if the original triangulation contained no real boundary components.
|
staticinherited |
Recovers a full triangulation from an isomorphism signature.
See isoSig() for more information on isomorphism signatures. It will be assumed that the signature describes a triangulation of dimension dim.
The triangulation that is returned will be newly created, and it is the responsibility of the caller of this routine to destroy it.
Calling isoSig() followed by fromIsoSig() is not guaranteed to produce an identical triangulation to the original, but it is guaranteed to produce a combinatorially isomorphic triangulation. In other words, fromIsoSig() may reconstruct the triangulation with its simplices and/or vertices relabelled. The optional argument to isoSig() allows you to determine the precise relabelling that will be used, if you need to know it.
For a full and precise description of the isomorphism signature format for 3-manifold triangulations, see Simplification paths in the Pachner graphs of closed orientable 3-manifold triangulations, Burton, 2011, arXiv:1110.6080
. The format for other dimensions is essentially the same, but with minor dimension-specific adjustments.
sig | the isomorphism signature of the triangulation to construct. Note that isomorphism signatures are case-sensitive (unlike, for example, dehydration strings for 3-manifolds). |
null
if the given string was not a valid dim-dimensional isomorphism signature.
|
inherited |
Returns the fundamental group of this triangulation.
The fundamental group is computed in the dual 2-skeleton. This means:
Bear in mind that each time the triangulation changes, the fundamental group will be deleted. Thus the reference that is returned from this routine should not be kept for later use. Instead, fundamentalGroup() should be called again; this will be instantaneous if the group has already been calculated.
|
inlineinherited |
Returns the f-vector of this triangulation, which counts the number of faces of all dimensions.
The vector that is returned will have length dim+1. If this vector is f, then f[k] will be the number of k-faces for each 0 ≤ k ≤ dim.
This routine is significantly more heavyweight than countFaces(). Its advantage is that, unlike the templatised countFaces(), it allows you to count faces whose dimensions are not known until runtime.
|
inlineinherited |
Determines if this triangulation has any boundary facets.
This routine returns true
if and only if the triangulation contains some top-dimension simplex with at least one facet that is not glued to an adjacent simplex.
true
if and only if there are boundary facets.
|
inlineinherited |
Is there one or more SafePtr currently pointing to this object?
|
inherited |
Returns the first homology group for this triangulation.
The homology is computed in the dual 2-skeleton. This means:
This routine can also be accessed via the alias homologyH1() (a name that is more specific, but a little longer to type).
Bear in mind that each time the triangulation changes, the homology groups will be deleted. Thus the reference that is returned from this routine should not be kept for later use. Instead, homology() should be called again; this will be instantaneous if the group has already been calculated.
|
inlineinherited |
Returns the first homology group for this triangulation.
This is identical to calling homology(). See the homology() documentation for further details.
|
inherited |
Inserts a given triangulation into this triangulation, where the given triangulation is described by a pair of integer arrays.
The main purpose of this routine is to allow users to hard-code triangulations into C++ source files. In particular, all of the simplex gluings can be hard-coded into a pair of integer arrays at the beginning of the source file, avoiding an otherwise tedious sequence of many calls to Simplex<dim>::join(). If you have a particular triangulation that you would like to hard-code in this way, you can call dumpConstruction() to generate the corresponding integer arrays as C++ source code.
This routine will insert an additional nSimplices top-dimensional simplices into this triangulation. We number these simplices 0,1,...,nSimplices-1. The gluings between these new simplices should be stored in the two arrays as follows.
The adjacencies array describes which simplices are joined to which others. Specifically, adjacencies[s][f]
indicates which of the new simplices is joined to facet f of simplex s. This should be between 0 and nSimplices-1 inclusive, or -1 if facet f of simplex s is to be left as a boundary facet.
The gluings array describes the particular gluing permutations used to join these simplices together. Specifically, gluings[s][f][0..dim]
should describe the permutation used to join facet f of simplex s to its adjacent simplex. These dim+1 integers should be 0,1,...,dim in some order, so that gluings[s][f][i]
contains the image of i under this permutation. If facet f of simplex s is to be left as a boundary facet, then gluings[s][f][0..dim]
may contain anything (and will be duly ignored).
If this triangulation is empty before this routine is called, then the new simplices will be given indices 0,1,...,nSimplices-1 according to the numbering described above. Otherwise they will be inserted after any pre-existing simplices, and so they will be given larger indices instead. In the latter case, the adjacencies array should still refer to the new simplices as 0,1,...,nSimplices-1, and this routine will handle any renumbering automatically at runtime.
It is the responsibility of the caller of this routine to ensure that the given arrays are correct and consistent. No error checking will be performed by this routine.
nSimplices | the number of additional simplices to insert. |
adjacencies | describes which simplices are adjace to which others, as described above. This array must have initial dimension at least nSimplices. |
gluings | describes the specific gluing permutations, as described above. This array must also have initial dimension at least nSimplices. |
|
inherited |
Inserts a copy of the given triangulation into this triangulation.
The top-dimensional simplices of source will be copied into this triangulation in the same order in which they appear in source. That is, if the original size of this triangulation was S, then the simplex at index i in source will be copied into this triangulation as a new simplex at index S+i.
The copies will use the same vertex numbering and descriptions as the original simplices from source, and any gluings between the simplices of source will likewise be copied across as gluings between their copies in this triangulation.
This routine behaves correctly when source is this triangulation.
source | the triangulation whose copy will be inserted. |
|
inlineinherited |
Determines if this triangulation is connected.
true
if and only if this triangulation is connected.
|
inlineinherited |
Determines if an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components).
Specifically, this routine determines if there is a boundary incomplete combinatorial isomorphism from this triangulation to other. Boundary incomplete isomorphisms are described in detail in the Isomorphism class notes.
In particular, note that facets of top-dimensional simplices that lie on the boundary of this triangulation need not correspond to boundary facets of other, and that other may contain more top-dimensional simplices than this triangulation.
If a boundary incomplete isomorphism is found, the details of this isomorphism are returned. The isomorphism is newly constructed, and so to assist with memory management is returned as a std::unique_ptr. Thus, to test whether an isomorphism exists without having to explicitly deal with the isomorphism itself, you can call if (isContainedIn(other).get())
and the newly created isomorphism (if it exists) will be automatically destroyed.
If more than one such isomorphism exists, only one will be returned. For a routine that returns all such isomorphisms, see findAllSubcomplexesIn().
other | the triangulation in which to search for an isomorphic copy of this triangulation. |
|
inlineinherited |
Determines whether this triangulation is empty.
An empty triangulation is one with no simplices at all.
true
if and only if this triangulation is empty.
|
inherited |
Determines if this triangulation is combinatorially identical to the given triangulation.
Here "identical" means that the triangulations have the same number of top-dimensional simplices, with gluings between the same pairs of numbered simplices using the same gluing permutations. In other words, "identical" means that the triangulations are isomorphic via the identity isomorphism.
For the less strict notion of isomorphic triangulations, which allows relabelling of the top-dimensional simplices and their vertices, see isIsomorphicTo() instead.
This test does not examine the textual simplex descriptions, as seen in Simplex<dim>::description(); these may still differ. It also does not test whether lower-dimensional faces are numbered identically (vertices, edges and so on); this routine is only concerned with top-dimensional simplices.
(At the time of writing, two identical triangulations will always number their lower-dimensional faces in the same way. However, it is conceivable that in future versions of Regina there may be situations in which identical triangulations can acquire different numberings for vertices, edges, and so on.)
other | the triangulation to compare with this one. |
true
if and only if the two triangulations are combinatorially identical.
|
inlineinherited |
Determines if this triangulation is combinatorially isomorphic to the given triangulation.
Two triangulations are isomorphic if and only it is possible to relabel their top-dimensional simplices and the (dim+1) vertices of each simplex in a way that makes the two triangulations combinatorially identical, as returned by isIdenticalTo().
Equivalently, two triangulations are isomorphic if and only if there is a one-to-one and onto boundary complete combinatorial isomorphism from this triangulation to other, as described in the Isomorphism class notes.
In particular, note that this triangulation and other must contain the same number of top-dimensional simplices for such an isomorphism to exist.
If the triangulations are isomorphic, then this routine returns one such boundary complete isomorphism (i.e., one such relabelling). The isomorphism will be newly constructed, and to assist with memory management, it will be returned as a std::unique_ptr. Thus, to test whether an isomorphism exists without having to explicitly manage with the isomorphism itself, you can just call if (isIsomorphicTo(other).get())
, in which case the newly created isomorphism (if it exists) will be automatically destroyed.
There may be many such isomorphisms between the two triangulations. If you need to find all such isomorphisms, you may call findAllIsomorphisms() instead.
If you need to ensure that top-dimensional simplices are labelled the same in both triangulations (i.e., that the triangulations are related by the identity isomorphism), you should call the stricter test isIdenticalTo() instead.
other | the triangulation to compare with this one. |
|
inlineinherited |
Determines if this triangulation is orientable.
true
if and only if this triangulation is orientable.
|
inherited |
Determines if this triangulation is oriented; that is, if the vertices of its top-dimensional simplices are labelled in a way that preserves orientation across adjacent facets.
Specifically, this routine returns true
if and only if every gluing permutation has negative sign.
Note that orientable triangulations are not always oriented by default. You can call orient() if you need the top-dimensional simplices to be oriented consistently as described above.
A non-orientable triangulation can never be oriented.
true
if and only if all top-dimensional simplices are oriented consistently.
|
inherited |
Constructs the isomorphism signature for this triangulation.
An isomorphism signature is a compact text representation of a triangulation that uniquely determines the triangulation up to combinatorial isomorphism. That is, two triangulations of dimension dim are combinatorially isomorphic if and only if their isomorphism signatures are the same.
The isomorphism signature is constructed entirely of printable characters, and has length proportional to n log n
, where n is the number of top-dimenisonal simplices.
Whilst the format of an isomorphism signature bears some similarity to dehydration strings for 3-manifolds, they are more general: isomorphism signatures can be used with any triangulations, including closed, bounded and/or disconnected triangulations, as well as triangulations with many simplices. Note also that 3-manifold dehydration strings are not unique up to isomorphism (they depend on the particular labelling of tetrahedra).
The time required to construct the isomorphism signature of a triangulation is O((dim!) n^2 log^2 n)
. Whilst this is fine for large triangulation, it will be extremly slow for large dimensions.
The routine fromIsoSig() can be used to recover a triangulation from an isomorphism signature. The triangulation recovered might not be identical to the original, but it will be combinatorially isomorphic.
If relabelling is non-null (i.e., it points to some Isomorphism pointer p), then it will be modified to point to a new isomorphism that describes the precise relationship between this triangulation and the reconstruction from fromIsoSig(). Specifically, the triangulation that is reconstructed from fromIsoSig() will be combinatorially identical to relabelling.apply(this)
.
For a full and precise description of the isomorphism signature format for 3-manifold triangulations, see Simplification paths in the Pachner graphs of closed orientable 3-manifold triangulations, Burton, 2011, arXiv:1110.6080
. The format for other dimensions is essentially the same, but with minor dimension-specific adjustments.
relabelling | if this is non-null, it will be modified to point to a new isomorphism that describes the relationship between this triangulation and the triangulation that will be reconstructed from fromIsoSig(), as described above. |
|
staticinherited |
Deduces the number of top-dimensional simplices in a connected triangulation from its isomorphism signature.
See isoSig() for more information on isomorphism signatures. It will be assumed that the signature describes a triangulation of dimension dim.
If the signature describes a connected triangulation, this routine will simply return the size of that triangulation (e.g., the number of tetrahedra in the case dim = 3). You can also pass an isomorphism signature that describes a disconnected triangulation; however, this routine will only return the number of top-dimensional simplices in the first connected component. If you need the total size of a disconnected triangulation, you will need to reconstruct the full triangulation by calling fromIsoSig() instead.
This routine is very fast, since it only examines the first few characters of the isomorphism signature (in which the size of the first component is encoded). However, a side-effect of this is that it is possible to pass an invalid isomorphism signature and still receive a positive result. If you need to test whether a signature is valid or not, you must call fromIsoSig() instead, which will examine the entire signature in full.
sig | the isomorphism signature of a dim-dimensional triangulation. Note that isomorphism signature are case-sensitive (unlike, for example, dehydration strings for 3-manifolds). |
|
inlineinherited |
Determines if this triangulation is valid.
There are several conditions that might make a dim-dimensional triangulation invalid:
Condition (1) is tested for all dimensions dim. Condition (2) is more difficult, since it relies on undecidable problems. As a result, (2) is only tested when dim is one of Regina's standard dimensions.
If a triangulation is invalid then you can call Face<dim, subdim>::isValid() to discover exactly which face(s) are responsible, and you can call Face<dim, subdim>::hasBadIdentification() and/or Face<dim, subdim>::hasBadLink() to discover exactly which conditions fail.
Note that all invalid vertices are considered to be on the boundary; see isBoundary() for details.
true
if and only if this triangulation is valid.
|
inherited |
Relabel the top-dimensional simplices and their vertices so that this triangulation is in canonical form.
This is essentially the lexicographically smallest labelling when the facet gluings are written out in order.
Two triangulations are isomorphic if and only if their canonical forms are identical.
The lexicographic ordering assumes that the facet gluings are written in order of simplex index and then facet number. Each gluing is written as the destination simplex index followed by the gluing permutation (which in turn is written as the images of 0,1,...,dim in order).
true
if the triangulation was changed, or false
if the triangulation was in canonical form to begin with.
|
inherited |
Converts this triangulation into its double cover.
Each orientable component will be duplicated, and each non-orientable component will be converted into its orientable double cover.
|
inherited |
Moves the contents of this triangulation into the given destination triangulation, without destroying any pre-existing contents.
All top-dimensional simplices that currently belong to dest will remain there (and will keep the same indices in dest). All top-dimensional simplices that belong to this triangulation will be moved into dest also (but in general their indices will change).
This triangulation will become empty as a result.
Any pointers or references to Simplex<dim> objects will remain valid.
dest | the triangulation into which simplices should be moved. |
|
inherited |
Creates a new top-dimensional simplex and adds it to this triangulation.
The new simplex will have an empty description. All (dim+1) facets of the new simplex will be boundary facets.
The new simplex will become the last simplex in this triangulation; that is, it will have index size()-1.
|
inherited |
Creates a new top-dimensional simplex with the given description and adds it to this triangulation.
All (dim+1) facets of the new simplex will be boundary facets.
Descriptions are optional, may have any format, and may be empty. How descriptions are used is entirely up to the user.
The new simplex will become the last simplex in this triangulation; that is, it will have index size()-1.
desc | the description to give to the new simplex. |
|
inherited |
Relabels the vertices of top-dimensional simplices in this triangulation so that all simplices are oriented consistently, if possible.
This routine works by flipping vertices (dim - 1) and dim of each top-dimensional simplices that has negative orientation. The result will be a triangulation where the top-dimensional simplices have their vertices labelled in a way that preserves orientation across adjacent facets. In particular, every gluing permutation will have negative sign.
If this triangulation includes both orientable and non-orientable components, the orientable components will be oriented as described above and the non-orientable components will be left untouched.
|
inlineinherited |
Checks the eligibility of and/or performs a (dim + 1 - k)-(k + 1) Pachner move about the given k-face.
This involves replacing the (dim + 1 - k) top-dimensional simplices meeting that k-face with (k + 1) new top-dimensional simplices joined along a new internal (dim - k)-face. This can be done iff (i) the given k-face is valid and non-boundary; (ii) the (dim + 1 - k) top-dimensional simplices that contain it are distinct; and (iii) these simplices are joined in such a way that the link of the given k-face is the standard triangulation of the (dim - 1 - k)-sphere as the boundary of a (dim - \k)-simplex.
If the routine is asked to both check and perform, the move will only be performed if the check shows it is legal. In In the special case k = dim, the move is always legal and so the check argument will simply be ignored.
Note that after performing this move, all skeletal objects (facets, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument v) can no longer be used.
If this triangulation is currently oriented, then this Pachner move will label the new top-dimensional simplices in a way that preserves the orientation.
See the page on Pachner moves on triangulations for definitions and terminology relating to Pachner moves. After the move, the new belt face will be formed from vertices 0,1,...,(dim - k) of simplices().back()
.
simplices().back()->vertex(dim)
, and as of version 5.2 it is now simplices().back()->vertex(0)
. The deprecated routines Triangulation<2>::oneThreeMove(), Triangulation<3>::oneFourMove() and Triangulation<4>::oneFiveMove() maintain the old behaviour if you need it.f | the k-face about which to perform the move. |
check | true if we are to check whether the move is allowed (defaults to true ). |
perform | true if we are to perform the move (defaults to true ). |
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
.k | the dimension of the given face. This must be between 0 and (dim) inclusive. You can still perform a Pachner move about a 0-face dim-face, but these moves use specialised implementations (as opposed to this generic template implementation). |
|
inherited |
Relabels the vertices of top-dimensional simplices in this triangulation so that all simplices reflect their orientation.
In particular, if this triangulation is oriented, then it will be converted into an isomorphic triangulation with the opposite orientation.
This routine works by flipping vertices (dim - 1) and dim of every top-dimensional simplex.
|
inlineinherited |
Removes all simplices from the triangulation.
As a result, this triangulation will become empty.
All of the simplices that belong to this triangulation will be destroyed immediately.
|
inlineinherited |
Removes the given top-dimensional simplex from this triangulation.
The given simplex will be unglued from any adjacent simplices (if any), and will be destroyed immediately.
simplex | the simplex to remove. |
|
inlineinherited |
Removes the top-dimensional simplex at the given index in this triangulation.
This is equivalent to calling removeSimplex(simplex(index))
.
The given simplex will be unglued from any adjacent simplices (if any), and will be destroyed immediately.
index | specifies which top-dimensionalsimplex to remove; this must be between 0 and size()-1 inclusive. |
|
inlineinherited |
Returns the top-dimensional simplex at the given index in the triangulation.
Note that indexing may change when a simplex is added to or removed from the triangulation.
index | specifies which simplex to return; this value should be between 0 and size()-1 inclusive. |
|
inlineinherited |
Returns the top-dimensional simplex at the given index in the triangulation.
Note that indexing may change when a simplex is added to or removed from the triangulation.
index | specifies which simplex to return; this value should be between 0 and size()-1 inclusive. |
|
inlineinherited |
Returns all top-dimensional simplices in the triangulation.
The reference that is returned will remain valid for as long as the triangulation exists: even as simplices are added and/or removed, it will always reflect the simplices that are currently in the triangulation.
|
inlineinherited |
Notifies the triangulation that you have simplified the presentation of its fundamental group.
The old group presentation will be destroyed, and this triangulation will take ownership of the new (hopefully simpler) group that is passed.
This routine is useful for situations in which some external body (such as GAP) has simplified the group presentation better than Regina can.
Regina does not verify that the new group presentation is equivalent to the old, since this is - well, hard.
If the fundamental group has not yet been calculated for this triangulation, this routine will nevertheless take ownership of the new group, under the assumption that you have worked out the group through some other clever means without ever having needed to call fundamentalGroup() at all.
Note that this routine will not fire a packet change event.
newGroup | a new (and hopefully simpler) presentation of the fundamental group of this triangulation. |
|
inlineinherited |
Returns the number of top-dimensional simplices in the triangulation.
|
inherited |
Splits a disconnected triangulation into many smaller triangulations, one for each component.
The new component triangulations will be inserted as children of the given parent packet. The original triangulation (i.e., this triangulation) will be left unchanged.
If the given parent packet is null
, the new component triangulations will be inserted as children of this triangulation.
By default, this routine will assign sensible packet labels to each of the new component triangulations. If these component triangulations are only temporary objects used as part of some larger algorithm, then labels are unnecessary - in this case you can pass setLabels as false
to avoid the (small) overhead that these packet labels incur.
componentParent | the packet beneath which the new component triangulations will be inserted, or null if they should be inserted directly beneath this triangulation. |
setLabels | true if the new component triangulations should be assigned sensible packet labels, or false if they should be left without labels at all. |
|
inherited |
Returns a short text representation of this object.
This text should be human-readable, should fit on a single line, and should not end with a newline. Where possible, it should use plain ASCII characters.
__str__()
.
|
protectedinherited |
Swaps all properties that are managed by this base class, including skeletal data, with the given triangulation.
Note that TriangulationBase never calls this routine itself. Typically swapBaseProperties() is only ever called by Triangulation<dim>::swapAllProperties(), which in turn is called by swapContents().
other | the triangulation whose properties should be swapped with this. |
|
inherited |
Swaps the contents of this and the given triangulation.
All top-dimensional simplices that belong to this triangulation will be moved to other, and all top-dimensional simplices that belong to other will be moved to this triangulation. Likewise, all skeletal objects (such as lower-dimensional faces, components, and boundary components) and all cached properties (such as homology and fundamental group) will be swapped.
In particular, any pointers or references to Simplex<dim> and/or Face<dim, subdim> objects will remain valid.
This routine will behave correctly if other is in fact this triangulation.
other | the triangulation whose contents should be swapped with this. |
|
inherited |
Returns a short text representation of this object using unicode characters.
Like str(), this text should be human-readable, should fit on a single line, and should not end with a newline. In addition, it may use unicode characters to make the output more pleasant to read. This string will be encoded in UTF-8.
|
protectedinherited |
Writes a chunk of XML containing properties of this triangulation.
This routine covers those properties that are managed by this base class TriangulationBase and that have already been computed for this triangulation.
This routine is typically called from within Triangulation<dim>::writeXMLPacketData(). The XML elements that it writes are child elements of the packet
element.
out | the output stream to which the XML should be written. |
|
protectedinherited |
The components that form the boundary of the triangulation.
|
staticconstexprinherited |
A compile-time constant that gives the dimension of the triangulation.
|
protectedinherited |
The top-dimensional simplices that form the triangulation.
|
protectedinherited |
If non-zero, this will cause Triangulation<dim>::clearAllProperties() to preserve any computed properties that related to the manifold (as opposed to the specific triangulation).
This allows you to avoid recomputing expensive invariants when the underlying manifold is retriangulated.
This property should be managed by creating and destroying TopologyLock objects. The precise value of topologyLock_ indicates the number of TopologyLock objects that currently exist for this triangulation.
|
protectedinherited |
Is this triangulation valid? See isValid() for details on what this means.