Regina Calculation Engine
|
A dim-dimensional triangulation, built by gluing together dim-dimensional simplices along their (dim-1)-dimensional facets. More...
#include <generic/triangulation.h>
Public Types | |
typedef NPacket | 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... | |
Public Member Functions | |
bool | hasOwner () const |
Indicates whether some other object in the calculation engine is responsible for ultimately destroying this object. More... | |
std::string | str () const |
Returns a short text representation of this object. More... | |
std::string | utf8 () const |
Returns a short text representation of this object using unicode characters. More... | |
std::string | detail () const |
Returns a detailed text representation of this object. More... | |
REGINA_DEPRECATED std::string | toString () const |
A deprecated alias for str(). More... | |
REGINA_DEPRECATED std::string | toStringLong () const |
A deprecated alias for detail(). More... | |
template<int subdim> | |
size_t | getNumberOfFaces () const |
bool | makeCanonical () |
Relabel the top-dimensional simplices and their vertices so that this triangulation is in canonical form. More... | |
Constructors and Destructors | |
Triangulation () | |
Default constructor. More... | |
Triangulation (const Triangulation ©) | |
Creates a new copy of the given triangulation. More... | |
Packet Administration | |
virtual void | writeTextShort (std::ostream &out) const |
Writes a short text representation of this object to the given output stream. More... | |
virtual void | writeTextLong (std::ostream &out) const |
Writes a detailed text representation of this object to the given output stream. More... | |
virtual bool | dependsOnParent () const |
Determines if this packet depends upon its parent. More... | |
Packet Identification | |
virtual PacketType | type () const =0 |
Returns the unique integer ID representing this type of packet. More... | |
REGINA_DEPRECATED PacketType | getPacketType () const |
Deprecated routine that returns the unique integer ID representing this type of packet. More... | |
virtual std::string | typeName () const =0 |
Returns an English name for this type of packet. More... | |
REGINA_DEPRECATED std::string | getPacketTypeName () const |
Deprecated routine that returns an English name for this type of packet. More... | |
const std::string & | label () const |
Returns the label associated with this individual packet. More... | |
REGINA_DEPRECATED const std::string & | getPacketLabel () const |
Deprecated routine that returns the label associated with this individual packet. More... | |
std::string | humanLabel () const |
Returns the label associated with this individual packet, adjusted if necessary for human-readable output. More... | |
REGINA_DEPRECATED std::string | getHumanLabel () const |
Deprecated routine that returns the label associated with this individual packet, adjusted if necessary for human-readable output. More... | |
std::string | adornedLabel (const std::string &adornment) const |
Returns the label of this packet adorned with the given string. More... | |
void | setLabel (const std::string &label) |
Sets the label associated with this individual packet. More... | |
REGINA_DEPRECATED void | setPacketLabel (const std::string &label) |
Deprecated routine that sets the label associated with this individual packet. More... | |
std::string | fullName () const |
Returns a descriptive text string for the packet. More... | |
REGINA_DEPRECATED std::string | getFullName () const |
Deprecated routine that returns a descriptive text string for the packet. More... | |
REGINA_DEPRECATED std::string | makeUniqueLabel (const std::string &base) const |
Returns a new label that cannot be found anywhere in the entire tree structure. More... | |
REGINA_DEPRECATED bool | makeUniqueLabels (NPacket *reference) |
Ensures that all packet labels in both this and the given packet tree combined are distinct. More... | |
Tags | |
bool | hasTag (const std::string &tag) const |
Determines whether this packet has the given associated tag. More... | |
bool | hasTags () const |
Determines whether this packet has any associated tags at all. More... | |
bool | addTag (const std::string &tag) |
Associates the given tag with this packet. More... | |
bool | removeTag (const std::string &tag) |
Removes the association of the given tag with this packet. More... | |
void | removeAllTags () |
Removes all associated tags from this packet. More... | |
const std::set< std::string > & | tags () const |
Returns the set of all tags associated with this packet. More... | |
REGINA_DEPRECATED const std::set< std::string > & | getTags () const |
Deprecated routine that returns the set of all tags associated with this packet. More... | |
Event Handling | |
bool | listen (NPacketListener *listener) |
Registers the given packet listener to listen for events on this packet. More... | |
bool | isListening (NPacketListener *listener) |
Determines whether the given packet listener is currently listening for events on this packet. More... | |
bool | unlisten (NPacketListener *listener) |
Unregisters the given packet listener so that it no longer listens for events on this packet. More... | |
Tree Queries | |
NPacket * | parent () const |
Determines the parent packet in the tree structure. More... | |
REGINA_DEPRECATED NPacket * | getTreeParent () const |
Deprecated routine that determines the parent packet in the tree structure. More... | |
NPacket * | firstChild () const |
Determines the first child of this packet in the tree structure. More... | |
REGINA_DEPRECATED NPacket * | getFirstTreeChild () const |
Deprecated routine that determines the first child of this packet in the tree structure. More... | |
NPacket * | lastChild () const |
Determines the last child of this packet in the tree structure. More... | |
REGINA_DEPRECATED NPacket * | getLastTreeChild () const |
Deprecated routine that determines the last child of this packet in the tree structure. More... | |
NPacket * | nextSibling () const |
Determines the next sibling of this packet in the tree structure. More... | |
REGINA_DEPRECATED NPacket * | getNextTreeSibling () const |
Deprecated routine that determines the next sibling of this packet in the tree structure. More... | |
NPacket * | prevSibling () const |
Determines the previous sibling of this packet in the tree structure. More... | |
REGINA_DEPRECATED NPacket * | getPrevTreeSibling () const |
Deprecated routine that determines the previous sibling of this packet in the tree structure. More... | |
NPacket * | root () const |
Determines the root of the tree to which this packet belongs. More... | |
REGINA_DEPRECATED NPacket * | getTreeMatriarch () const |
Deprecated routine that determines the root of the tree to which this packet belongs. More... | |
unsigned | levelsDownTo (const NPacket *descendant) const |
Counts the number of levels between this packet and its given descendant in the tree structure. More... | |
unsigned | levelsUpTo (const NPacket *ancestor) const |
Counts the number of levels between this packet and its given ancestor in the tree structure. More... | |
bool | isGrandparentOf (const NPacket *descendant) const |
Determines if this packet is equal to or an ancestor of the given packet in the tree structure. More... | |
size_t | countChildren () const |
Returns the number of immediate children of this packet. More... | |
REGINA_DEPRECATED size_t | getNumberOfChildren () const |
Deprecated routine that returns the number of immediate children of this packet. More... | |
size_t | countDescendants () const |
Returns the total number of descendants of this packet. More... | |
REGINA_DEPRECATED size_t | getNumberOfDescendants () const |
Deprecated routine that returns the total number of descendants of this packet. More... | |
size_t | totalTreeSize () const |
Determines the total number of packets in the tree or subtree for which this packet is matriarch. More... | |
REGINA_DEPRECATED size_t | getTotalTreeSize () const |
Deprecated routine that returns the total number of packets in the tree or subtree for which this packet is matriarch. More... | |
Tree Manipulation | |
void | insertChildFirst (NPacket *child) |
Inserts the given packet as the first child of this packet. More... | |
void | insertChildLast (NPacket *child) |
Inserts the given packet as the last child of this packet. More... | |
void | insertChildAfter (NPacket *newChild, NPacket *prevChild) |
Inserts the given packet as a child of this packet at the given location in this packet's child list. More... | |
void | makeOrphan () |
Cuts this packet away from its parent in the tree structure and instead makes it matriarch of its own tree. More... | |
void | reparent (NPacket *newParent, bool first=false) |
Cuts this packet away from its parent in the tree structure, and inserts it as a child of the given packet instead. More... | |
void | transferChildren (NPacket *newParent) |
Cuts all of this packet's children out of the packet tree, and reinserts them as children of the given packet instead. More... | |
void | swapWithNextSibling () |
Swaps this packet with its next sibling in the sequence of children beneath their common parent packet. More... | |
void | moveUp (unsigned steps=1) |
Moves this packet the given number of steps towards the beginning of its sibling list. More... | |
void | moveDown (unsigned steps=1) |
Moves this packet the given number of steps towards the end of its sibling list. More... | |
void | moveToFirst () |
Moves this packet to be the first in its sibling list. More... | |
void | moveToLast () |
Moves this packet to be the last in its sibling list. More... | |
void | sortChildren () |
Sorts the immediate children of this packet according to their packet labels. More... | |
Searching and Iterating | |
NPacket * | nextTreePacket () |
Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs. More... | |
const NPacket * | nextTreePacket () const |
Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs. More... | |
NPacket * | nextTreePacket (const std::string &type) |
Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure. More... | |
const NPacket * | nextTreePacket (const std::string &type) const |
Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure. More... | |
NPacket * | firstTreePacket (const std::string &type) |
Finds the first packet of the requested type in a complete depth-first iteration of the tree structure. More... | |
const NPacket * | firstTreePacket (const std::string &type) const |
Finds the first packet of the requested type in a complete depth-first iteration of the tree structure. More... | |
NPacket * | findPacketLabel (const std::string &label) |
Finds the packet with the requested label in the tree or subtree for which this packet is matriarch. More... | |
const NPacket * | findPacketLabel (const std::string &label) const |
Finds the packet with the requested label in the tree or subtree for which this packet is matriarch. More... | |
Packet Dependencies | |
bool | isPacketEditable () const |
Determines whether this packet can be altered without invalidating or otherwise upsetting any of its immediate children. More... | |
Cloning | |
NPacket * | clone (bool cloneDescendants=false, bool end=true) const |
Clones this packet (and possibly its descendants), assigns to it a suitable unused label and inserts the clone into the tree as a sibling of this packet. More... | |
File I/O | |
bool | save (const char *filename, bool compressed=true) const |
Saves the subtree rooted at this packet to the given Regina data file, using Regina's native XML file format. More... | |
bool | save (std::ostream &s, bool compressed=true) const |
Writes the subtree rooted at this packet to the given output stream, in the format of a Regina XML data file. More... | |
void | writeXMLFile (std::ostream &out) const |
Writes the subtree rooted at this packet to the given output stream in Regina's native XML file format. More... | |
std::string | internalID () const |
Returns a unique string ID that identifies this packet. More... | |
Simplices | |
size_t | size () const |
Returns the number of top-dimensional simplices in the triangulation. More... | |
REGINA_DEPRECATED size_t | getNumberOfSimplices () const |
Deprecated routine that returns the number of top-dimensional simplices in the triangulation. More... | |
const std::vector< Simplex< dim > * > & | simplices () const |
Returns all top-dimensional simplices in the triangulation. More... | |
REGINA_DEPRECATED const std::vector< Simplex< dim > * > & | getSimplices () const |
Deprecated routine that returns all of the top-dimensional simplices in the triangulation. More... | |
Simplex< dim > * | simplex (size_t index) |
Returns the top-dimensional simplex at the given index in the triangulation. More... | |
const Simplex< dim > * | simplex (size_t index) const |
Returns the top-dimensional simplex at the given index in the triangulation. More... | |
REGINA_DEPRECATED Simplex< dim > * | getSimplex (size_t index) |
Deprecated routine that returns the top-dimensional simplex at the given index in the triangulation. More... | |
REGINA_DEPRECATED const Simplex< dim > * | getSimplex (size_t index) const |
Deprecated routine that returns the top-dimensional simplex at the given index in the triangulation. More... | |
REGINA_DEPRECATED size_t | simplexIndex (const Simplex< dim > *simplex) const |
Deprecated routine that returns the index of the given top-dimensional simplex in the triangulation. More... | |
Simplex< dim > * | newSimplex () |
Creates a new top-dimensional simplex and adds it to this triangulation. More... | |
Simplex< dim > * | newSimplex (const std::string &desc) |
Creates a new top-dimensional simplex with the given description and adds it to this triangulation. More... | |
void | removeSimplex (Simplex< dim > *simplex) |
Removes the given top-dimensional simplex from this triangulation. More... | |
void | removeSimplexAt (size_t index) |
Removes the top-dimensional simplex at the given index in this triangulation. More... | |
void | removeAllSimplices () |
Removes all simplices from the triangulation. More... | |
void | swapContents (Triangulation< dim > &other) |
Swaps the contents of this and the given triangulation. More... | |
void | moveContentsTo (Triangulation< dim > &dest) |
Moves the contents of this triangulation into the given destination triangulation, without destroying any pre-existing contents. More... | |
Skeletal Queries | |
size_t | countComponents () const |
Returns the number of connected components in this triangulation. More... | |
REGINA_DEPRECATED size_t | getNumberOfComponents () const |
Deprecated routine that returns the number of connected components in this triangulation. More... | |
template<int subdim> | |
size_t | countFaces () const |
Returns the number of subdim-faces in this triangulation. More... | |
template<int subdim> | |
REGINA_DEPRECATED size_t | getNumberOfFaces () const |
Deprecated routine that returns the number of subdim-faces in this triangulation. More... | |
std::vector< size_t > | fVector () const |
Returns the f-vector of this triangulation, which counts the number of faces of all dimensions. More... | |
const std::vector< Component< dim > * > & | components () const |
Returns all connected components of this triangulation. More... | |
REGINA_DEPRECATED const std::vector< Component< dim > * > & | getComponents () const |
Deprecated routine that returns all connected components of this triangulation. More... | |
template<int subdim> | |
const FaceList< dim, subdim > & | faces () const |
Returns an object that allows iteration through and random access to all subdim-faces of this triangulation. More... | |
Component< dim > * | component (size_t index) const |
Returns the requested connected component of this triangulation. More... | |
REGINA_DEPRECATED Component< dim > * | getComponent (size_t index) const |
Deprecated routine that returns the requested connected component of this triangulation. More... | |
template<int subdim> | |
Face< dim, subdim > * | face (size_t index) const |
Returns the requested subdim-face of this triangulation. More... | |
REGINA_DEPRECATED size_t | componentIndex (const Component< dim > *component) const |
Deprecated routine that returns the index of the given connected component in this triangulation. More... | |
Basic Properties | |
bool | isEmpty () const |
Determines whether this triangulation is empty. More... | |
bool | isValid () const |
Determines if this triangulation is valid. More... | |
bool | hasBoundaryFacets () const |
Determines if this triangulation has any boundary facets. More... | |
size_t | countBoundaryFacets () const |
Returns the total number of boundary facets in this triangulation. More... | |
bool | isOrientable () const |
Determines if this triangulation is orientable. More... | |
bool | isConnected () const |
Determines if this triangulation is connected. More... | |
bool | isOriented () const |
Determines if this triangulation is oriented; that is, if the vertices of its top-dimensional simplices are labelled in a way that preserves orientation across adjacent facets. More... | |
Skeletal Transformations | |
void | orient () |
Relabels the vertices of top-dimensional simplices in this triangulation so that all simplices are oriented consistently, if possible. More... | |
Subdivisions, Extensions and Covers | |
void | makeDoubleCover () |
Converts this triangulation into its double cover. More... | |
bool | finiteToIdeal () |
Converts each real boundary component into a cusp (i.e., an ideal vertex). More... | |
Decompositions | |
size_t | splitIntoComponents (NPacket *componentParent=0, bool setLabels=true) |
Splits a disconnected triangulation into many smaller triangulations, one for each component. More... | |
Isomorphism Testing | |
bool | isIdenticalTo (const Triangulation< dim > &other) const |
Determines if this triangulation is combinatorially identical to the given triangulation. More... | |
std::unique_ptr< Isomorphism< dim > > | isIsomorphicTo (const Triangulation< dim > &other) const |
Determines if this triangulation is combinatorially isomorphic to the given triangulation. More... | |
std::unique_ptr< Isomorphism< dim > > | isContainedIn (const Triangulation< dim > &other) const |
Determines if an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components). More... | |
template<typename OutputIterator > | |
size_t | findAllIsomorphisms (const Triangulation< dim > &other, OutputIterator output) const |
Finds all ways in which this triangulation is combinatorially isomorphic to the given triangulation. More... | |
template<typename OutputIterator > | |
size_t | findAllSubcomplexesIn (const Triangulation< dim > &other, OutputIterator output) const |
Finds all ways in which an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components). More... | |
Building Triangulations | |
void | insertTriangulation (const Triangulation< dim > &source) |
Inserts a copy of the given triangulation into this triangulation. More... | |
void | insertConstruction (size_t nSimplices, const int adjacencies[][dim+1], const int gluings[][dim+1][dim+1]) |
Inserts a given triangulation into this triangulation, where the given triangulation is described by a pair of integer arrays. More... | |
Exporting Triangulations | |
std::string | isoSig (Isomorphism< dim > **relabelling=0) const |
Constructs the isomorphism signature for this triangulation. More... | |
std::string | dumpConstruction () const |
Returns C++ code that can be used with insertConstruction() to reconstruct this triangulation. More... | |
Static Public Member Functions | |
static NXMLPacketReader * | xmlReader (NPacket *parent, NXMLTreeResolver &resolver) |
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... | |
Public Attributes | |
REGINA_DEPRECATED typedef ChangeEventSpan | ChangeEventBlock |
A deprecated typedef for ChangeEventSpan. More... | |
Protected Types | |
typedef std::vector< Face< dim, subdim > * >::const_iterator | Iterator |
An iterator type for iterating through this list of faces. More... | |
Protected Member Functions | |
virtual NPacket * | internalClonePacket (NPacket *parent) const |
Makes a newly allocated copy of this packet. More... | |
virtual void | writeXMLPacketData (std::ostream &out) const |
Writes a chunk of XML containing the data for this packet only. More... | |
void | writeXMLPacketTree (std::ostream &out) const |
Writes a chunk of XML containing the subtree with this packet as matriarch. More... | |
void | ensureSkeleton () const |
Ensures that all "on demand" skeletal objects have been calculated. More... | |
bool | calculatedSkeleton () const |
Determines whether the skeletal objects and properties of this triangulation have been calculated. More... | |
void | calculateSkeleton () |
Calculates all skeletal objects for this triangulation. More... | |
void | deleteSkeleton () |
Deallocates all skeletal objects that are managed by this triangulation, and empties all corresponding internal lists. More... | |
void | deleteFaces () |
Deletes all faces of dimension subdim and below. More... | |
void | fillFVector (std::vector< size_t > &result) const |
Fills the given vector with the first (subdim + 1) elements of the f-vector. More... | |
bool | sameFVector (const FaceListSuite< dim, subdim > &other) const |
Tests whether this and the given triangulation have the same number of k-faces, for each facial dimension k ≤ subdim. More... | |
bool | sameDegrees (const FaceListSuite< dim, subdim > &other) const |
Tests whether this and the given triangulation have the same k-face degree sequences, for each facial dimension k ≤ subdim. More... | |
bool | sameDegrees (const FaceList< dim, subdim > &other) const |
Tests whether this and the given triangulation have the same subdim-face degree sequences. More... | |
Face< dim, subdim > * | operator[] (size_t index) const |
Returns the requested subdim-face. More... | |
Iterator | begin () const |
Returns an iterator pointing to the first subdim-face. More... | |
Iterator | end () const |
Returns an iterator pointing beyond the last subdim-face. More... | |
void | push_back (Face< dim, subdim > *face) |
Pushes the given face onto the end of this list. More... | |
void | destroy () |
Destroys all faces in this list, and clears the list itself. More... | |
Protected Attributes | |
NMarkedVector< Simplex< dim > > | simplices_ |
The top-dimensional simplices that form the triangulation. More... | |
bool | valid_ |
Is this triangulation valid? See isValid() for details on what this means. More... | |
Friends | |
class | detail::SimplexBase< dim > |
class | detail::TriangulationBase< dim > |
A dim-dimensional triangulation, built by gluing together dim-dimensional simplices along their (dim-1)-dimensional facets.
Typically (but not necessarily) such triangulations are used to represent dim-manifolds.
Such triangulations are not the same as pure simplicial complexes, for two reasons:
Amongst other things, this definition is general enough to capture any reasonable definition of a dim-manifold triangulation. However, there is no requirement that a triangulation must actually represent a manifold (and indeed, testing this condition is undecidable for sufficiently large dim).
You can construct a triangulation from scratch using routines such as newSimplex() and Simplex<dim>::join(). There are also routines for importing and exporting triangulations in bulk, such as isoSig() and fromIsoSig() (which uses isomorphism signatures), or insertConstruction() and dumpConstruction() (which exports C++ code).
In additional to top-dimensional simplices, this class also tracks connected components of the triangulation, as represented by the class Component<dim>. Such objects are temporary: whenever the triangulation changes, they will be deleted and rebuilt, and any pointers to them will become invalid. Likewise, if the triangulation is deleted then all component objects will be deleted alongside it.
For Regina's standard dimensions, this template is specialised and offers much more functionality. In order to use these specialised classes, you will need to include the corresponding headers (e.g., dim2/dim2triangulation.h for dim = 2, or triangulation/ntriangulation.h for dim = 3). For convenience, there are typedefs available for these specialised classes (such as Dim2Triangulation and NTriangulation respectively).
dim | the dimension of the underlying triangulation. This must be between 2 and 15 inclusive. |
|
inherited |
Used to iterate through connected components.
|
inherited |
The type of object being pointed to.
|
inherited |
Used to iterate through top-dimensional simplices.
|
inline |
Default constructor.
Creates an empty triangulation.
|
inline |
Creates a new copy of the given triangulation.
copy | the triangulation to copy. |
|
inherited |
Associates the given tag with this packet.
Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.
Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.
tag | the tag to add. |
true
if the given tag was successfully added, or false
if the given tag was already present beforehand.
|
inherited |
Returns the label of this packet adorned with the given string.
An adornment typically shows how a packet has been created and/or modified. For instance, the adornment argument might be "Filled", or "Summand #1".
The way in which the packet label is adorned depends upon the label itself (in particular, an empty packet label will be handled in a sensible way). The way in which the packet label is adorned is subject to change in future versions of Regina.
Note that, whilst this routine returns a modified version of the packet label, the label itself will not be permamently changed.
adornment | the string that will be used to adorn this packet label. The adornment should just be a piece of English, ideally beginning with an upper-case letter. It should not contain any surrounding punctuation such as brackets or a dash (this will be added automatically by this routine as required). |
|
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 |
Calculates all skeletal objects for this triangulation.
For this parent class, calculateSkeleton() computes properties such as connected components, orientability, and lower-dimensional faces. Some Triangulation<dim> subclasses may track additional skeletal data, in which case they should reimplement this function. Their reimplementations must call this parent implementation.
You should never call this function directly; instead call ensureSkeleton() instead.
|
inherited |
Clones this packet (and possibly its descendants), assigns to it a suitable unused label and inserts the clone into the tree as a sibling of this packet.
Note that any string tags associated with this packet will not be cloned.
If this packet has no parent in the tree structure, no clone will be created and 0 will be returned.
cloneDescendants | true if the descendants of this packet should also be cloned and inserted as descendants of the new packet. If this is passed as false (the default), only this packet will be cloned. |
end | true if the new packet should be inserted at the end of the parent's list of children (the default), or false if the new packet should be inserted as the sibling immediately after this packet. |
|
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 |
Deprecated routine that returns the index of the given connected component in this triangulation.
component | specifies which component to find in the triangulation. |
|
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 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.
|
inherited |
Returns the number of immediate children of this packet.
Grandchildren and so on are not counted.
|
inlineinherited |
Returns the number of connected components in this triangulation.
|
inlineinherited |
Returns the total number of descendants of this packet.
This includes children, grandchildren and so on. This packet is not included in the count.
|
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.
|
inlineprotectedinherited |
Deletes all faces of dimension subdim and below.
This routine destroys the corresponding Face objects and clears the lists that contain them.
|
inlineprotectedinherited |
Deallocates all skeletal objects that are managed by this triangulation, and empties all corresponding internal lists.
The next time a user queries some skeletal property, the skeleton will be recalculated.
Triangulation<dim> subclasses should reimplement this if they track additional skeletal data, but they must call this parent implementation.
Note that TriangulationBase never calls this routine itself. Typically deleteSkeleton() is only ever called by Triangulation<dim>::clearAllProperties, which in turn is called by the Triangulation<dim> destructor.
|
inlinevirtual |
Determines if this packet depends upon its parent.
This is true if the parent cannot be altered without invalidating or otherwise upsetting this packet.
true
if and only if this packet depends on its parent. Implements regina::NPacket.
|
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 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.
|
inlineprotectedinherited |
Fills the given vector with the first (subdim + 1) elements of the f-vector.
Specifically, this routine pushes the values f[0], ..., f[subdim] onto the end of the given vector, where f[k] denotes the number of k-faces that this object stores.
result | the vector in which the results will be placed. |
|
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 |
Finds the packet with the requested label in the tree or subtree for which this packet is matriarch.
Note that label comparisons are case sensitive.
label | the label to search for. |
|
inherited |
Finds the packet with the requested label in the tree or subtree for which this packet is matriarch.
Note that label comparisons are case sensitive.
label | the label to search for. |
|
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.
|
inlineinherited |
Determines the first child of this packet in the tree structure.
This routine takes small constant time.
|
inherited |
Finds the first packet of the requested type in a complete depth-first iteration of the tree structure.
Note that this packet must be the matriarch of the entire tree.
A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.
type | the type of packet to search for, as returned by typeName(). Note that string comparisons are case sensitive. |
|
inherited |
Finds the first packet of the requested type in a complete depth-first iteration of the tree structure.
Note that this packet must be the matriarch of the entire tree.
A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.
type | the type of packet to search for, as returned by typeName(). Note that string comparisons are case sensitive. |
|
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 signature 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 a descriptive text string for the packet.
The string is of the form label (packet-type).
The packet label will be adjusted for human-readable output according to the behaviour of humanLabel().
|
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 |
Deprecated routine that returns the requested connected component of this triangulation.
See component() for further details.
|
inlineinherited |
Deprecated routine that returns all connected components of this triangulation.
See components() for further details.
|
inlineinherited |
Deprecated routine that determines the first child of this packet in the tree structure.
|
inlineinherited |
Deprecated routine that returns a descriptive text string for the packet.
|
inlineinherited |
Deprecated routine that returns the label associated with this individual packet, adjusted if necessary for human-readable output.
|
inlineinherited |
Deprecated routine that determines the last child of this packet in the tree structure.
|
inlineinherited |
Deprecated routine that determines the next sibling of this packet in the tree structure.
|
inlineinherited |
Deprecated routine that returns the number of immediate children of this packet.
|
inlineinherited |
Deprecated routine that returns the number of connected components in this triangulation.
See countComponents() for further details.
|
inlineinherited |
Deprecated routine that returns the total number of descendants of this packet.
|
inherited |
Deprecated routine that returns the number of subdim-faces in this triangulation.
See countFaces() for further details.
|
inlineinherited |
Deprecated routine that returns the number of top-dimensional simplices in the triangulation.
|
inlineinherited |
Deprecated routine that returns the label associated with this individual packet.
|
inlineinherited |
Deprecated routine that returns the unique integer ID representing this type of packet.
|
inlineinherited |
Deprecated routine that returns an English name for this type of packet.
|
inlineinherited |
Deprecated routine that determines the previous sibling of this packet in the tree structure.
|
inlineinherited |
Deprecated routine that returns the top-dimensional simplex at the given index in the triangulation.
See simplex() for further details.
|
inlineinherited |
Deprecated routine that returns the top-dimensional simplex at the given index in the triangulation.
See simplex() for further details.
|
inlineinherited |
Deprecated routine that returns all of the top-dimensional simplices in the triangulation.
See simplices() for further details.
|
inlineinherited |
Deprecated routine that returns the set of all tags associated with this packet.
|
inlineinherited |
Deprecated routine that returns the total number of packets in the tree or subtree for which this packet is matriarch.
|
inlineinherited |
Deprecated routine that determines the root of the tree to which this packet belongs.
|
inlineinherited |
Deprecated routine that determines the parent packet in the tree structure.
|
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 |
Indicates whether some other object in the calculation engine is responsible for ultimately destroying this object.
For packets, this returns true
if and only if this packet has a parent in the packet tree (i.e., is not the root).
true
if and only if some other object owns this object.
|
inlineinherited |
Determines whether this packet has the given associated tag.
Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.
Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.
tag | the tag to search for. |
true
if the given tag is found, false
otherwise.
|
inlineinherited |
Determines whether this packet has any associated tags at all.
Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.
Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.
true
if this packet has any tags, false
otherwise.
|
inlineinherited |
Returns the label associated with this individual packet, adjusted if necessary for human-readable output.
In particular, if the packet has no label assigned then this routine will return "(no label)", not the empty string.
Inserts the given packet as a child of this packet at the given location in this packet's child list.
This routine takes small constant time.
newChild | the child to insert. |
prevChild | the preexisting child of this packet after which newChild will be inserted, or 0 if newChild is to be the first child of this packet. |
|
inherited |
Inserts the given packet as the first child of this packet.
This routine takes small constant time.
child | the child to insert. |
|
inherited |
Inserts the given packet as the last child of this packet.
This routine takes small constant time.
child | the child to insert. |
|
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. |
|
inlineprotectedvirtual |
Makes a newly allocated copy of this packet.
This routine should not insert the new packet into the tree structure, clone the packet's associated tags or give the packet a label. It should also not clone any descendants of this packet.
You may assume that the new packet will eventually be inserted into the tree beneath either the same parent as this packet or a clone of that parent.
parent | the parent beneath which the new packet will eventually be inserted. |
Implements regina::NPacket.
|
inherited |
Returns a unique string ID that identifies this packet.
The user has no control over this ID, and it is not human readable. It is guaranteed to remain fixed throughout the lifetime of the program for a given packet, and it is guaranteed not to clash with the ID of any other packet.
If you change the contents of a packet, its ID will not change.
If you clone a packet, the new clone will receive a different ID. If you save and then load a packet to/from file, the ID will change. These behaviours are necessary to ensure that IDs remain unique (since, for instance, you could load several copies of the same data file into memory simultaneously).
The ID is implemented as an encoding of the underlying C++ pointer. This encoding is subject to change in later versions of Regina.
|
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 packet is equal to or an ancestor of the given packet in the tree structure.
descendant | the other packet whose relationships we are examining. |
true
if and only if this packet is equal to or an ancestor of descendant
.
|
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 whether the given packet listener is currently listening for events on this packet.
See the NPacketListener class notes for details.
listener | the listener to search for. |
true
if the given listener is currently registered with this packet, or false
otherwise.
|
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). |
|
inherited |
Determines whether this packet can be altered without invalidating or otherwise upsetting any of its immediate children.
Descendants further down the packet tree are not (and should not need to be) considered.
true
if and only if this packet may be edited.
|
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.
|
inlineinherited |
Returns the label associated with this individual packet.
An example is MyTriangulation
.
|
inlineinherited |
Determines the last child of this packet in the tree structure.
This routine takes small constant time.
|
inherited |
Counts the number of levels between this packet and its given descendant in the tree structure.
If descendant
is this packet, the number of levels is zero.
descendant
, or can be obtained from descendant
using only child-to-parent steps.descendant | the packet whose relationship with this packet we are examining. |
|
inlineinherited |
Counts the number of levels between this packet and its given ancestor in the tree structure.
If ancestor
is this packet, the number of levels is zero.
ancestor
, or can be obtained from ancestor
using only parent-to-child steps.ancestor | the packet whose relationship with this packet we are examining. |
|
inherited |
Registers the given packet listener to listen for events on this packet.
See the NPacketListener class notes for details.
listener | the listener to register. |
true
if the given listener was successfully registered, or false
if the given listener was already registered beforehand.
|
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 |
Cuts this packet away from its parent in the tree structure and instead makes it matriarch of its own tree.
The tree information for both this packet and its parent will be updated.
This routine takes small constant time.
|
inherited |
Returns a new label that cannot be found anywhere in the entire tree structure.
This packet need not be the tree matriarch; this routine will search the entire tree to which this packet belongs.
The new label will consist of the given base, possibly followed by a space and a number.
base | a string upon which the new label will be based. |
|
inherited |
Ensures that all packet labels in both this and the given packet tree combined are distinct.
If two packets have the same label, one will be renamed by adding a space and a number.
Packets in the given packet tree will be given priority over the labels; that is, if a packet in this tree has the same label as a packet in the given tree, it will be the packet in this tree that is renamed.
The given packet tree may be null
, in which case only this tree will be examined.
reference | the packet tree with which to compare this tree. |
true
if and only if any of the packets were relabelled.
|
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 |
Moves this packet the given number of steps towards the end of its sibling list.
If the number of steps is larger than the greatest possible movement, the packet will be moved to the very end of its sibling list.
This routine takes time proportional to the number of steps.
|
inherited |
Moves this packet to be the first in its sibling list.
This routine takes small constant time.
|
inherited |
Moves this packet to be the last in its sibling list.
This routine takes small constant time.
|
inherited |
Moves this packet the given number of steps towards the beginning of its sibling list.
If the number of steps is larger than the greatest possible movement, the packet will be moved to the very beginning of its sibling list.
This routine takes time proportional to the number of steps.
|
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. |
|
inlineinherited |
Determines the next sibling of this packet in the tree structure.
This is the child of the parent that follows this packet.
This routine takes small constant time.
|
inherited |
Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs.
Note that this packet need not be the tree matriarch.
A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.
|
inherited |
Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs.
Note that this packet need not be the tree matriarch.
A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.
|
inherited |
Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure.
Note that this packet need not be the tree matriarch. The order of tree searching is described in firstTreePacket().
type | the type of packet to search for, as returned by typeName(). Note that string comparisons are case sensitive. |
|
inherited |
Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure.
Note that this packet need not be the tree matriarch. The order of tree searching is described in firstTreePacket().
type | the type of packet to search for, as returned by typeName(). Note that string comparisons are case sensitive. |
|
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 |
Determines the parent packet in the tree structure.
This routine takes small constant time.
|
inlineinherited |
Determines the previous sibling of this packet in the tree structure.
This is the child of the parent that precedes this packet.
This routine takes small constant time.
|
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.
|
inherited |
Removes all associated tags from this packet.
Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.
Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.
|
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. |
|
inherited |
Removes the association of the given tag with this packet.
Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.
Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.
tag | the tag to remove. |
true
if the given tag was removed, or false
if the given tag was not actually associated with this packet.
|
inherited |
Cuts this packet away from its parent in the tree structure, and inserts it as a child of the given packet instead.
This routine is essentially a combination of makeOrphan() followed by either insertChildFirst() or insertChildLast().
This routine takes small constant time. It is safe to use regardless of whether this packet has a parent or not.
If you wish to reparent all of the children of a given packet, see transferChildren() instead.
newParent | the new parent of this packet, i.e., the packet beneath which this packet will be inserted. |
first | true if this packet should be inserted as the first child of the given parent, or false (the default) if it should be inserted as the last child. |
|
inherited |
Determines the root of the tree to which this packet belongs.
|
inlineprotectedinherited |
Tests whether this and the given triangulation have the same k-face degree sequences, for each facial dimension k ≤ subdim.
For the purposes of this routine, degree sequences are considered to be unordered.
other | the triangulation to compare against this. |
true
if and only if all degree sequences considered are equal.
|
inlineprotectedinherited |
Tests whether this and the given triangulation have the same number of k-faces, for each facial dimension k ≤ subdim.
other | the triangulation to compare against this. |
true
if and only if the face counts considered are identical for both triangluations.
|
inherited |
Saves the subtree rooted at this packet to the given Regina data file, using Regina's native XML file format.
The XML file may be optionally compressed (Regina can happily read both compressed and uncompressed XML).
This is the preferred way of saving a Regina data file. Typically this will be called from the root of the packet tree, which will save the entire packet tree to file.
filename | the pathname of the file to write to. |
compressed | true if the XML data should be compressed, or false if it should be written as plain text. |
true
if and only if the file was successfully written.
|
inherited |
Writes the subtree rooted at this packet to the given output stream, in the format of a Regina XML data file.
The data file may be optionally compressed (Regina can happily read both compressed and uncompressed XML).
Typically this will be called from the root of the packet tree, which will write the entire packet tree to the given output stream.
s | the output stream to which to write. |
compressed | true if the XML data should be compressed, or false if it should be written as plain text. |
true
if and only if the data was successfully written.
|
inherited |
Sets the label associated with this individual packet.
label | the new label to give this packet. |
|
inlineinherited |
Deprecated routine that sets the label associated with this individual packet.
|
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 |
Deprecated routine that returns the index of the given top-dimensional simplex in the triangulation.
Note that indexing may change when a simplex is added to or removed from the triangulation.
simplex | specifies which simplex to find in the triangulation. |
|
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 |
Returns the number of top-dimensional simplices in the triangulation.
|
inherited |
Sorts the immediate children of this packet according to their packet labels.
Note that this routine is not recursive (for instance, grandchildren will not be sorted within each child packet).
This routine takes quadratic time in the number of immediate children (and it's slow quadratic at that).
|
inherited |
Splits a disconnected triangulation into many smaller triangulations, one for each component.
The new component triangulations will be inserted as children of the given parent packet. The original triangulation (i.e., this triangulation) will be left unchanged.
If the given parent packet is 0, the new component triangulations will be inserted as children of this triangulation.
By default, this routine will assign sensible packet labels to each of the new component triangulations. If these component triangulations are only temporary objects used as part of some larger algorithm, then labels are unnecessary - in this case you can pass setLabels as false
to avoid the (small) overhead that these packet labels incur.
componentParent | the packet beneath which the new component triangulations will be inserted, or 0 if they should be inserted directly beneath this triangulation. |
setLabels | true if the new component triangulations should be assigned sensible packet labels, or false if they should be left without labels at all. |
|
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__()
.
|
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.
Any pointers or references to Simplex<dim> objects will remain valid.
other | the triangulation whose contents should be swapped with this. |
|
inherited |
Swaps this packet with its next sibling in the sequence of children beneath their common parent packet.
Calling this routine is equivalent to calling moveDown().
This routine takes small constant time.
If this packet has no next sibling then this routine does nothing.
|
inlineinherited |
Returns the set of all tags associated with this packet.
Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.
Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.
|
inherited |
A deprecated alias for str().
|
inherited |
A deprecated alias for detail().
|
inherited |
Determines the total number of packets in the tree or subtree for which this packet is matriarch.
This packet is included in the count.
|
inherited |
Cuts all of this packet's children out of the packet tree, and reinserts them as children of the given packet instead.
The children of this packet will be appended to the end of the new parent's child list, in the same order as they were previously.
This is equivalent to calling reparent() on each child, but should be somewhat faster if there are many children to move.
newParent | the new parent beneath which the children will be inserted. |
|
pure virtualinherited |
Returns the unique integer ID representing this type of packet.
This is the same for all packets of this class.
|
pure virtualinherited |
Returns an English name for this type of packet.
An example is NTriangulation
. This is the same for all packets of this class.
|
inherited |
Unregisters the given packet listener so that it no longer listens for events on this packet.
See the NPacketListener class notes for details.
listener | the listener to unregister. |
true
if the given listener was successfully unregistered, or false
if the given listener was not registered in the first place.
|
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.
|
virtual |
Writes a detailed text representation of this object to the given output stream.
This may be reimplemented by subclasses, but the parent NPacket class offers a reasonable default implementation.
out | the output stream to which to write. |
Reimplemented from regina::NPacket.
|
inlinevirtual |
Writes a short text representation of this object to the given output stream.
This must be reimplemented by subclasses.
out | the output stream to which to write. |
Implements regina::NPacket.
|
inherited |
Writes the subtree rooted at this packet to the given output stream in Regina's native XML file format.
Ths is similar to calling save(), except that (i) the user has a more flexible choice of output stream, and (ii) the XML will always be written in plain text (i.e., it will not be compressed).
If you simply wish to save your data to a file on the filesystem, you should call save() instead.
Typically this will be called from the root of the packet tree, which will write the entire packet tree to the output stream.
The output from this routine cannot be used as a piece of an XML file; it must be the entire XML file. For a piece of an XML file, see routine writeXMLPacketTree() instead.
out | the output stream to which the XML data file should be written. |
|
protectedvirtual |
Writes a chunk of XML containing the data for this packet only.
You may assume that the packet opening tag (including the packet type and label) has already been written, and that all child packets followed by the corresponding packet closing tag will be written immediately after this routine is called. This routine need only write the internal data stored in this specific packet.
out | the output stream to which the XML should be written. |
Implements regina::NPacket.
|
protectedinherited |
Writes a chunk of XML containing the subtree with this packet as matriarch.
This is the preferred way of writing a packet tree to file.
The output from this routine is only a piece of XML; it should not be used as a complete XML file. For a complete XML file, see routine writeXMLFile() instead.
out | the output stream to which the XML should be written. |
|
inherited |
A deprecated typedef for ChangeEventSpan.
|
protectedinherited |
The top-dimensional simplices that form the triangulation.
|
protectedinherited |
Is this triangulation valid? See isValid() for details on what this means.