Regina Calculation Engine
|
A gluing permutation search class that offers a specialised search algorithm for when (i) only closed prime minimal P2-irreducible triangulations are required, and (ii) the given face pairing has order at least three. More...
#include <census/ngluingpermsearcher.h>
Public Member Functions | |
NClosedPrimeMinSearcher (const NFacePairing *pairing, const NFacePairingIsoList *autos, bool orientableOnly, UseGluingPerms use, void *useArgs=0) | |
Creates a new search manager for use when (i) only closed prime minimal P2-irreducible triangulations are required, and (ii) the given face pairing has order at least three. More... | |
NClosedPrimeMinSearcher (std::istream &in, UseGluingPerms use, void *useArgs=0) | |
Initialises a new search manager based on data read from the given input stream. More... | |
virtual | ~NClosedPrimeMinSearcher () |
Destroys this search manager and all supporting data structures. More... | |
virtual void | dumpData (std::ostream &out) const |
Dumps all internal data in a plain text format to the given output stream. More... | |
virtual void | runSearch (long maxDepth=-1) |
Generates all possible gluing permutation sets that satisfy the current search criteria. More... | |
![]() | |
NCompactSearcher (const NFacePairing *pairing, const NFacePairingIsoList *autos, bool orientableOnly, int whichPurge, UseGluingPerms use, void *useArgs=0) | |
Creates a new search manager for use when only compact 3-manifold triangulations are required. More... | |
NCompactSearcher (std::istream &in, UseGluingPerms use, void *useArgs=0) | |
Initialises a new search manager based on data read from the given input stream. More... | |
virtual | ~NCompactSearcher () |
Destroys this search manager and all supporting data structures. More... | |
![]() | |
NGluingPermSearcher (const NFacePairing *pairing, const NFacePairingIsoList *autos, bool orientableOnly, bool finiteOnly, int whichPurge, UseGluingPerms use, void *useArgs=0) | |
Initialises a new search for gluing permutation sets. More... | |
NGluingPermSearcher (std::istream &in, UseGluingPerms use, void *useArgs=0) | |
Initialises a new search manager based on data read from the given input stream. More... | |
virtual | ~NGluingPermSearcher () |
Destroys this search manager and all supporting data structures. More... | |
bool | completePermSet () const |
Determines whether this search manager holds a complete gluing permutation set or just a partially completed search state. More... | |
void | dumpTaggedData (std::ostream &out) const |
Dumps all internal data in a plain text format, along with a marker to signify which precise class the data belongs to. More... | |
![]() | |
NGluingPerms (const NGluingPerms &cloneMe) | |
Creates a new set of gluing permutations that is a clone of the given permutation set. More... | |
NGluingPerms (std::istream &in) | |
Reads a new set of gluing permutations from the given input stream. More... | |
virtual | ~NGluingPerms () |
Deallocates any memory used by this structure. More... | |
bool | inputError () const |
Was an error found during construction from an input stream? More... | |
unsigned | getNumberOfTetrahedra () const |
Returns the total number of tetrahedra under consideration. More... | |
const NFacePairing * | getFacePairing () const |
Returns the specific pairing of tetrahedron faces that this set of gluing permutations complements. More... | |
NPerm4 | gluingPerm (const NTetFace &source) const |
Returns the gluing permutation associated with the given tetrahedron face. More... | |
NPerm4 | gluingPerm (unsigned tet, unsigned face) const |
Returns the gluing permutation associated with the given tetrahedron face. More... | |
NTriangulation * | triangulate () const |
Returns a newly created triangulation as modelled by this set of gluing permutations and the associated tetrahedron face pairing. More... | |
Static Public Attributes | |
static const char | dataTag_ |
A character used to identify this class when reading and writing tagged data in text format. More... | |
![]() | |
static const char | dataTag_ |
A character used to identify this class when reading and writing tagged data in text format. More... | |
![]() | |
static const char | dataTag_ |
A character used to identify this class when reading and writing tagged data in text format. More... | |
Protected Member Functions | |
virtual char | dataTag () const |
Returns the character used to identify this class when storing tagged data in text format. More... | |
![]() | |
int | findEdgeClass (int edgeID) const |
Returns the representative of the equivalence class containing the given tetrahedron edge. More... | |
int | findEdgeClass (int edgeID, char &twisted) const |
Returns the representative of the equivalence class containing the given tetrahedron edge. More... | |
int | mergeVertexClasses () |
Merge the classes of tetrahedron vertices as required by the new gluing made at stage orderElt of the search. More... | |
bool | mergeEdgeClasses () |
Merge the classes of tetrahedron edges as required by the new gluing made at stage orderElt of the search. More... | |
void | splitVertexClasses () |
Split the classes of tetrahedron vertices to mirror the undoing of the gluing at stage orderElt of the search. More... | |
void | splitEdgeClasses () |
Split the classes of tetrahedron edges to mirror the undoing of the gluing at stage orderElt of the search. More... | |
void | vtxBdryJoin (int vertexID, char end, int adjVertexID, char twist) |
Signifies that the boundary edges supplied by the vertex linking triangles for the two given tetrahedron vertices should be marked as adjacent. More... | |
void | vtxBdryFixAdj (int vertexID) |
Adjusts the bdryNext and bdryTwist arrays for nearby tetrahedron vertices, to ensure that these arrays are consistent with the bdryNext and bdryTwist arrays stored with the given vertex. More... | |
void | vtxBdryBackup (int vertexID) |
Copies the bdryNext and bdryTwist arrays to the bdryNextOld and bdryTwistOld arrays for the given tetrahedron vertex. More... | |
void | vtxBdryRestore (int vertexID) |
Copies the bdryNextOld and bdryTwistOld arrays to the bdryNext and bdryTwist arrays for the given tetrahedron vertex. More... | |
void | vtxBdryNext (int vertexID, int tet, int vertex, int bdryFace, int next[2], char twist[2]) |
Assuming the given edge of the vertex linking triangle for the given tetrahedron vertex lies on the boundary of the vertex link, this routine identifies the adjacent boundary edges of the vertex link in each direction. More... | |
bool | vtxBdryLength1 (int vertexID) |
Determines whether one of the edges of the vertex linking triangle for the given tetrahedron vertex in fact forms an entire one-edge boundary component of the overall vertex link. More... | |
bool | vtxBdryLength2 (int vertexID1, int vertexID2) |
Determines whether edges of the vertex linking triangles for each of the given tetrahedron vertices combine to form an entire two-edge boundary component of the overall vertex link, with one edge from each triangle. More... | |
void | vtxBdryConsistencyCheck () |
Runs a number of tests on all tetrahedron vertices to locate consistency errors in the bdryEdges, bdryNext and bdryTwist members of the TetVertexState class. More... | |
void | vtxBdryDump (std::ostream &out) |
Dumps a summary of bdryNext, bdryTwist and bdryEdges for every vertex of every tetrahedron to the given output stream. More... | |
![]() | |
bool | isCanonical () const |
Compares the current set of gluing permutations with its preimage under each automorphism of the underlying face pairing, in order to see whether the current set is in canonical form (i.e., is lexicographically smallest). More... | |
bool | badEdgeLink (const NTetFace &face) const |
Determines whether the permutations already constructed model a triangulation with an edge identified with itself in reverse. More... | |
bool | lowDegreeEdge (const NTetFace &face, bool testDegree12, bool testDegree3) const |
Determines whether the permutations already constructed model a triangulation with a low degree edge. More... | |
bool | mayPurge (const NTetFace &face) const |
Determines whether the permutations under construction are doomed to model a triangulation that can be purged from the census. More... | |
![]() | |
NGluingPerms (const NFacePairing *newPairing) | |
Creates a new permutation set. More... | |
int & | permIndex (const NTetFace &source) |
Returns the index into array NPerm4::S3 describing how the the given face is joined to its partner. More... | |
int & | permIndex (unsigned tet, unsigned face) |
Returns the index into array NPerm4::S3 describing how the the given face is joined to its partner. More... | |
const int & | permIndex (const NTetFace &source) const |
Returns the index into array NPerm4::S3 describing how the the given face is joined to its partner. More... | |
const int & | permIndex (unsigned tet, unsigned face) const |
Returns the index into array NPerm4::S3 describing how the the given face is joined to its partner. More... | |
int | gluingToIndex (const NTetFace &source, const NPerm4 &gluing) const |
Returns the index into array NPerm4::S3 corresponding to the given gluing permutation from the given face to its partner. More... | |
int | gluingToIndex (unsigned tet, unsigned face, const NPerm4 &gluing) const |
Returns the index into array NPerm4::S3 corresponding to the given gluing permutation from the given face to its partner. More... | |
NPerm4 | indexToGluing (const NTetFace &source, int index) const |
Returns the gluing permutation from the given face to its partner that corresponds to the given index into array NPerm4::S3. More... | |
NPerm4 | indexToGluing (unsigned tet, unsigned face, int index) const |
Returns the gluing permutation from the given face to its partner that corresponds to the given index into array NPerm4::S3. More... | |
Additional Inherited Members | |
![]() | |
static void | findAllPerms (const NFacePairing *pairing, const NFacePairingIsoList *autos, bool orientableOnly, bool finiteOnly, int whichPurge, UseGluingPerms use, void *useArgs=0) |
The main entry routine for running a search for all gluing permutation sets that complement a given face pairing. More... | |
static NGluingPermSearcher * | bestSearcher (const NFacePairing *pairing, const NFacePairingIsoList *autos, bool orientableOnly, bool finiteOnly, int whichPurge, UseGluingPerms use, void *useArgs=0) |
Constructs a search manager of the best possible class for the given search parameters. More... | |
static NGluingPermSearcher * | readTaggedData (std::istream &in, UseGluingPerms use, void *useArgs=0) |
Creates a new search manager based on tagged data read from the given input stream. More... | |
![]() | |
unsigned | nVertexClasses |
The number of equivalence classes of identified tetrahedron vertices. More... | |
TetVertexState * | vertexState |
Used for tracking equivalence classes of identified tetrahedron vertices. More... | |
int * | vertexStateChanged |
Tracks the way in which the vertexState[] array has been updated over time. More... | |
unsigned | nEdgeClasses |
The number of equivalence classes of identified tetrahedron edges. More... | |
TetEdgeState * | edgeState |
Used for tracking equivalence classes of identified tetrahedron edges. More... | |
int * | edgeStateChanged |
Tracks the way in which the edgeState[] array has been updated over time. More... | |
![]() | |
static const char | VLINK_CLOSED |
Signifies that a vertex link has been closed off (i.e., the link has no remaining boundary edges). More... | |
static const char | VLINK_NON_SPHERE |
Signifies that a vertex link has been made into something other than a 2-sphere with zero or more punctures. More... | |
static const int | vertexLinkNextFace [4][4] |
Maintains an ordering of the three tetrahedron faces surrounding a vertex in a tetrahedron. More... | |
static const int | vertexLinkPrevFace [4][4] |
Provides backwards links for the ordering described by vertexLinkNextFace. More... | |
A gluing permutation search class that offers a specialised search algorithm for when (i) only closed prime minimal P2-irreducible triangulations are required, and (ii) the given face pairing has order at least three.
The search algorithm is significantly different from the default algorithm provided by NGluingPermSearcher. It is heavily optimised and takes advantage of a number of results regarding the underlying face pairing graph.
Note that additional unwanted triangulations (e.g., non-prime or non-minimal triangulations) may still be produced by this search. However, significantly fewer unwanted triangulations will be produced when using this class instead of NGluingPermSearcher.
regina::NClosedPrimeMinSearcher::NClosedPrimeMinSearcher | ( | const NFacePairing * | pairing, |
const NFacePairingIsoList * | autos, | ||
bool | orientableOnly, | ||
UseGluingPerms | use, | ||
void * | useArgs = 0 |
||
) |
Creates a new search manager for use when (i) only closed prime minimal P2-irreducible triangulations are required, and (ii) the given face pairing has order at least three.
Note that other unwanted triangulations may still be produced (e.g., non-prime or non-minimal triangulations), but there will be far fewer of these than when using the NGluingPermSearcher class directly.
For details on how a search manager is used, see the NGluingPermSearcher documentation. Note in particular that this class will be automatically used by NGluingPermSearcher::findAllPerms() if possible, so there is often no need for an end user to instantiate this class directly.
All constructor arguments are the same as for the NGluingPermSearcher constructor, though some arguments (such as finiteOnly and whichPurge) are not needed here since they are already implied by the specialised search context.
regina::NClosedPrimeMinSearcher::NClosedPrimeMinSearcher | ( | std::istream & | in, |
UseGluingPerms | use, | ||
void * | useArgs = 0 |
||
) |
Initialises a new search manager based on data read from the given input stream.
This may be a new search or a partially completed search.
This routine reads data in the format written by dumpData(). If you wish to read data whose precise class is unknown, consider using dumpTaggedData() and readTaggedData() instead.
If the data found in the input stream is invalid or incorrectly formatted, the routine inputError() will return true
but the contents of this object will be otherwise undefined.
The arguments use and useArgs are the same as for the NGluingPermSearcher constructor.
in | the input stream from which to read. |
|
inlinevirtual |
Destroys this search manager and all supporting data structures.
|
inlineprotectedvirtual |
Returns the character used to identify this class when storing tagged data in text format.
Reimplemented from regina::NCompactSearcher.
|
virtual |
Dumps all internal data in a plain text format to the given output stream.
This object can be recreated from this text data by calling the input stream constructor for this class.
This routine may be useful for transferring objects from one processor to another.
Note that subclass data is written after superclass data, so it is safe to dump data from a subclass and then recreate a new superclass object from that data (though subclass-specific information will of course be lost).
out | the output stream to which the data should be written. |
Reimplemented from regina::NCompactSearcher.
|
virtual |
Generates all possible gluing permutation sets that satisfy the current search criteria.
The search criteria are specified in the class constructor, or through the static method findAllPerms().
Each set of gluing permutations will be produced precisely once up to equivalence, where equivalence is defined by the given set of automorphisms of the given face pairing.
For each permutation set that is generated, routine use_ (as passed to the class constructor) will be called with that permutation set as an argument.
Once the generation of permutation sets has finished, routine use_ will be called once more, this time with null
as its first (permutation set) argument.
Subclasses corresponding to more specialised search criteria should override this routine to use a better optimised algorithm where possible.
It is possible to run only a partial search, branching to a given depth but no further. In this case, rather than producing complete gluing permutation sets, the search will produce a series of partially-complete NGluingPermSearcher objects. These partial searches may then be restarted by calling runSearch() once more (usually after being frozen or passed on to a different processor). If necessary, the use_ routine may call completePermSet() to distinguish between a complete set of gluing permutations and a partial search state.
Note that a restarted search will never drop below its initial depth. That is, calling runSearch() with a fixed depth can be used to subdivide the overall search space into many branches, and then calling runSearch() on each resulting partial search will complete each of these branches without overlap.
maxDepth | the depth of the partial search to run, or a negative number if a full search should be run (the default). |
Reimplemented from regina::NCompactSearcher.
|
static |
A character used to identify this class when reading and writing tagged data in text format.