Regina Calculation Engine
|
The main entry point for the tree traversal algorithm to enumerate all taut angle structures in a 3-manifold triangulation. More...
#include <enumerate/ntreetraversal.h>
Public Member Functions | |
NTautEnumeration (const NTriangulation *tri) | |
Creates a new object for running the tree traversal algorithm. More... | |
unsigned long | nSolns () const |
Returns the total number of taut angle structures found thus far in the tree traversal search. More... | |
void | run (bool(*useSoln)(const NTautEnumeration &, void *), void *arg=0) |
Runs the complete tree traversal algorithm to enumerate all taut angle structures. More... | |
bool | next (NProgressTracker *tracker=0) |
An incremental step in the enumeration algorithm that runs forward until it finds the next solution. More... | |
bool | constraintsBroken () const |
Indicates whether or not the extra constraints from the template parameter LPConstraints were added successfully to the infrastructure for the search tree. More... | |
unsigned long | nVisited () const |
Returns the total number of nodes in the search tree that we have visited thus far in the tree traversal. More... | |
void | dumpTypes (std::ostream &out) const |
Writes the current type vector to the given output stream. More... | |
NNormalSurface * | buildSurface () const |
Reconstructs the full normal surface that is represented by the type vector at the current stage of the search. More... | |
NAngleStructure * | buildStructure () const |
Reconstructs the full taut angle structure that is represented by the type vector at the current stage of the search. More... | |
bool | verify (const NNormalSurface *s, const NMatrixInt *matchingEqns=0) const |
Ensures that the given normal or almost normal surface satisfies the matching equations, as well as any additional constraints from the template parameter LPConstraint. More... | |
bool | verify (const NAngleStructure *s, const NMatrixInt *angleEqns=0) const |
Ensures that the given angle structure satisfies the angle equations, as well as any additional constraints from the template parameter LPConstraint. More... | |
Static Public Member Functions | |
static bool | writeTypes (const NTautEnumeration &tree, void *) |
A callback function that writes to standard output the type vector at the current point in the given tree traversal search. More... | |
static bool | writeStructure (const NTautEnumeration &tree, void *) |
A callback function that writes to standard output the full angle structure coordinates of the taut angle structure at the current point in the given tree traversal search. More... | |
static bool | supported (NormalCoords coords) |
Indicates whether the given coordinate system is supported by this tree traversal infrastructure. More... | |
Protected Member Functions | |
void | setNext (int nextType) |
Rearranges the search tree so that nextType becomes the next type that we process. More... | |
int | nextUnmarkedTriangleType (int startFrom) |
Returns the next unmarked triangle type from a given starting point. More... | |
int | feasibleBranches (int quadType) |
Determines how many different values we could assign to the given quadrilateral or angle type and still obtain a feasible system. More... | |
double | percent () const |
Gives a rough estimate as to what percentage of the way the current type vector is through a full enumeration of the search tree. More... | |
Protected Attributes | |
const LPInitialTableaux < LPConstraint > | origTableaux_ |
The original starting tableaux that holds the adjusted matrix of matching equations, before the tree traversal algorithm begins. More... | |
const NormalCoords | coords_ |
The coordinate system in which we are enumerating or searching for normal surfaces, almost normal surfaces, or taut angle structures. More... | |
const int | nTets_ |
The number of tetrahedra in the underlying triangulation. More... | |
const int | nTypes_ |
The total length of a type vector. More... | |
const int | nTableaux_ |
The maximum number of tableaux that we need to keep in memory at any given time during the backtracking search. More... | |
char * | type_ |
The current working type vector. More... | |
int * | typeOrder_ |
A permutation of 0,...,nTypes_-1 that indicates in which order we select types: the first type we select (at the root of the tree) is type_[typeOrder_[0]], and the last type we select (at the leaves of the tree) is type_[typeOrder_[nTypes_-1]]. More... | |
int | level_ |
The current level in the search tree. More... | |
int | octLevel_ |
The level at which we are enforcing an octagon type (with a strictly positive number of octagons). More... | |
LPData< LPConstraint, Integer > * | lp_ |
Stores tableaux for linear programming at various nodes in the search tree. More... | |
LPData< LPConstraint, Integer > ** | lpSlot_ |
Recall from above that the array lp_ stores tableaux for the current node in the search tree and all of its ancestors. More... | |
LPData< LPConstraint, Integer > ** | nextSlot_ |
Points to the next available tableaux in lp_ that is free to use at each level of the search tree. More... | |
unsigned long | nVisited_ |
Counts the total number of nodes in the search tree that we have visited thus far. More... | |
LPData< LPConstraint, Integer > | tmpLP_ [4] |
Temporary tableaux used by the function feasibleBranches() to determine which quadrilateral types or angle types have good potential for pruning the search tree. More... | |
The main entry point for the tree traversal algorithm to enumerate all taut angle structures in a 3-manifold triangulation.
For the analogous algorithm to enumerate vertex normal or almost normal surfaces, see the class NTreeEnumeration instead.
This class follows a similar structure to the enumeration of vertex normal surfaces, as described in "A tree traversal algorithm for decision problems in knot theory and 3-manifold topology", Burton and Ozlen, Algorithmica 65:4 (2013), pp. 772-801.
To enumerate all taut angle structures on a given 3-manifold triangulation, simply construct an NTautEnumeration object and call run().
Alternatively, you can have more fine-grained control over the search. Instead of calling run(), you can construct an NTautEnumeration object and repeatedly call next() to step through each taut angle structure one at a time. This allows you to pause and resume the search as you please.
By using appropriate template parameters LPConstraint and/or BanConstraint, it is possible to impose additional linear constraints on the angle structure solution space, and/or explicitly force particular angles to be zero. See the LPConstraintBase and BanConstraintBase class notes for details.
The template argument Integer indicates the integer type that will be used throughout the underlying linear programming machinery. Unless you have a good reason to do otherwise, you should use the arbitrary-precision NInteger class (in which integers can grow arbitrarily large, and overflow can never occur).