Regina 7.4 Calculation Engine
Implementation details

Implementation details that end users should not need to reference directly. More...

Classes

class  regina::detail::BoundaryComponentBase< dim >
 Helper class that provides core functionality for a boundary component of a dim-dimensional triangulation. More...
 
class  regina::detail::ComponentBase< dim >
 Helper class that provides core functionality for a connected component of a dim-manifold triangulation. More...
 
class  regina::detail::ExampleFromLowDim< dim, available >
 Helper class that builds various dim-dimensional triangulations from (dim-1)-dimensional triangulations. More...
 
class  regina::detail::ExampleFromLowDim< dim, false >
 Helper class that builds various dim-dimensional triangulations from (dim-1)-dimensional triangulations. More...
 
class  regina::detail::ExampleBase< dim >
 Provides core functionality for constructing example dim-dimensional triangulations. More...
 
class  regina::detail::FaceEmbeddingBase< dim, subdim >
 Helper class that provides core functionality for describing how a subdim-face of a dim-dimensional triangulation appears within each top-dimensional simplex. More...
 
class  regina::detail::FaceBase< dim, subdim >
 Helper class that provides core functionality for a subdim-face in the skeleton of a dim-dimensional triangulation. More...
 
class  regina::detail::FaceNumberingAPI< dim, subdim >
 Placeholder class that outlines the functions provided by FaceNumbering<dim, subdim>. More...
 
class  regina::detail::FaceNumberingImpl< dim, subdim, codim >
 Implementation details for numbering subdim-faces of a dim-dimensional simplex. More...
 
class  regina::detail::FacetPairingBase< dim >
 Provides core functionality for facet pairings (that is, dual graphs) of dim-dimensional triangulations. More...
 
struct  regina::detail::RetriangulateActionTraits< Object, Action, FirstArg >
 A traits class that analyses callable objects that are passed to retriangulation or link rewriting functions. More...
 
class  regina::detail::SimplexBase< dim >
 Helper class that provides core functionality for a top-dimensional simplex in a dim-manifold triangulation. More...
 
struct  regina::detail::Strings< dim_ >
 Contains a collection of compile-time constant strings that describe features of the dimension dim. More...
 
class  regina::detail::TriangulationBase< dim >
 Provides core functionality for dim-dimensional triangulations. More...
 
struct  regina::CallableArg< Action, pos >
 A traits class that deduces the type of the argument in a given position for a callable object. More...
 

Typedefs

template<class Object , bool withSig>
using regina::detail::RetriangulateActionFunc
 Declares the internal type used to store a callable action that is passed to a retriangulation or link rewriting function.
 

Enumerations

enum  { regina::detail::RetriangulateDefault = 0x0000 , regina::detail::RetriangulateNoLocks = 0x0001 , regina::detail::RetriangulateNotFinished = 0x0002 }
 Represents different options that can be used internally with a retriangulation or link rewriting function. More...
 

Functions

template<class Object , bool withSig, int flags = RetriangulateDefault, typename PropagationOptions = void>
bool regina::detail::retriangulateInternal (const Object &obj, bool rigid, int height, int nThreads, ProgressTrackerOpen *tracker, RetriangulateActionFunc< Object, withSig > &&action)
 The common implementation of all retriangulation and link rewriting functions.
 
template<class Object , typename PropagationOptions = void>
bool regina::detail::simplifyExhaustiveInternal (Object &obj, int height, int threads, ProgressTrackerOpen *tracker)
 The common implementation of all exhaustive simplification functions.
 
template<class Object , typename PropagationOptions = void>
bool regina::detail::improveTreewidthInternal (Object &obj, ssize_t maxAttempts, int height, int threads, ProgressTrackerOpen *tracker)
 The common implementation of all exhaustive treewidth improvement functions, which aim to rewrite/retriangulate the given link diagram or triangulation to become one with a smaller-width greedy tree decomposition.
 
template<int dim>
void regina::swap (Triangulation< dim > &lhs, Triangulation< dim > &rhs)
 Swaps the contents of the two given triangulations.
 

Detailed Description

Implementation details that end users should not need to reference directly.

Typedef Documentation

◆ RetriangulateActionFunc

template<class Object , bool withSig>
using regina::detail::RetriangulateActionFunc
Initial value:
std::conditional_t<withSig,
std::function<bool(const std::string&, Object&&)>,
std::function<bool(Object&&)>>

Declares the internal type used to store a callable action that is passed to a retriangulation or link rewriting function.

A retriangulation or link rewriting function can work with arbitrary callable objects. However, the implementations of such functions are long and should not be dragged into the main headers. The core purpose of this class is therefore to coalesce the arbitrary action types down to just two fixed types (depending on whether the action includes a text signature (e.g., an isomorphism signature) in its initial argument(s)). This means that the retriangulation or rewriting code can be templated on a single boolean parameter, and so we can instatiate it completely in Regina's library and keep the implementation details out of the main headers.

The current implementation packages the action up as a std::function object with either a single argument (a triangulation/link) or a pair of arguments (a text signature and a triangulation/link). Any additional arguments to the retriangulation/rewriting action will be bound in the std::function object). This implementation is subject to change in future versions of Regina.

Template Parameters
Objectthe class providing the retriangulation/rewriting function, such as regina::Triangulation<dim> or regina::Link.
withSigtrue if we are storing an action that includes both a text signature and a triangulation in its initial argument(s), or false if we are storing an action whose argument list begins with just a triangulation/link.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Represents different options that can be used internally with a retriangulation or link rewriting function.

These options are intended to be used as template arguments. As such, they are not wrapped into the safer Flags type (since C++20 does not allow non-type template arguments with private members). Instead this is an unscoped enumeration, and these integer constants should be combined directly using the bitwise OR operator.

Enumerator
RetriangulateDefault 

An empty flag, indicating that we should use default behaviour.

RetriangulateNoLocks 

Indicates that the retriangulation/rewrite action should not be protected by a mutex.

Instead the user is responsible for managing locks to prevent race conditions when running in multithreaded mode.

RetriangulateNotFinished 

Indicates that, if a progress tracker is used, it should not be marked as finished once the retriangulation process is completed.

Instead the caller is responsible for calling ProgressTracker::setFinished() themselves at an appropriate time.

Function Documentation

◆ improveTreewidthInternal()

template<class Object , typename PropagationOptions = void>
bool regina::detail::improveTreewidthInternal ( Object & obj,
ssize_t maxAttempts,
int height,
int threads,
ProgressTrackerOpen * tracker )

The common implementation of all exhaustive treewidth improvement functions, which aim to rewrite/retriangulate the given link diagram or triangulation to become one with a smaller-width greedy tree decomposition.

This routine performs exactly the task described by Link::improveTreewidth() or Triangluation<dim>::improveTreewidth() (for those dimensions where it is defined), with the following differences:

  • This routine assumes any preconditions have already been checked, and exceptions thrown if they failed.

See Triangulation<dim>::improveTreewidth() or Link::improveTreewidth() for full details on what this routine actually does.

Template Parameters
Objectthe class providing the exhaustive treewidth improvement function, such as regina::Triangulation<dim> or regina::Link.
PropagationOptionsAny options needed to specify how objects should be propagated to produce "nearby" objects. This will be passed through to retriangulateInternal(), and is ultimately used by the domain-specific function RetriangulationParams<Object>::propagateFrom<Retriangulator>.
Parameters
objthe object whose greedy tree decomposition we hope to improve.
maxAttemptsthe maximum number of combinatorially distinct objects to examine before we give up and return false, or a negative number if this should not be bounded.
heightthe maximum number of additional top-dimensional simplices or crossings to allow, or a negative number if this should not be bounded.
threadsthe number of threads to use. If this is 1 or smaller then the routine will run single-threaded.
trackera progress tracker through which progress will be reported, or null if no progress reporting is required.
Returns
true if and only if an object with a smaller-width greedy tree decomposition was found.

◆ retriangulateInternal()

template<class Object , bool withSig, int flags = RetriangulateDefault, typename PropagationOptions = void>
bool regina::detail::retriangulateInternal ( const Object & obj,
bool rigid,
int height,
int nThreads,
ProgressTrackerOpen * tracker,
RetriangulateActionFunc< Object, withSig > && action )

The common implementation of all retriangulation and link rewriting functions.

This routine performs exactly the task described by Link::rewrite() or Triangluation<dim>::retriangulate() (for those dimensions where it is defined), with the following differences:

  • This routine assumes any preconditions have already been checked, and exceptions thrown if they failed;
  • The action passed to this routine uses a much less templated type, which means the implementation can be kept out of the public API headers.

See Triangulation<dim>::retriangulate() or Link::rewrite() for full details on what this routine actually does.

Template Parameters
Objectthe class providing the retriangulation/rewriting function, such as regina::Triangulation<dim> or regina::Link.
withSigtrue if we are storing an action that includes both a text signature and a triangulation in its initial argument(s), or false if we are storing an action whose argument list begins with just a triangulation/link.
flagscontrols how the retriangulation/rewriting process is managed; see the RetriangulationOptions enum for what can be included here.
PropagationOptionsAny options needed to specify how objects should be propagated to produce "nearby" objects. The domain-specific propagation function RetriangulationParams<Object>::propagateFrom<Retriangulator> can access this parameter via the type Retriangulator::PropagationOptions.
Parameters
objthe object being retriangulated or rewritten.
rigidtrue if link diagrams should never be reflected, rotated and/or reversed. This argument is currently ignored when working with triangulations.
heightthe maximum number of top-dimensional simplices or crossings to allow beyond the initial number in obj, or a negative number if this should not be bounded.
nThreadsthe number of threads to use. If this is 1 or smaller then the routine will run single-threaded.
trackera progress tracker through which progress will be reported, or null if no progress reporting is required.
actiona function to call for each triangulation that is found.
Returns
true if some call to action returned true (thereby terminating the search early), or false if the search ran to completion.

◆ simplifyExhaustiveInternal()

template<class Object , typename PropagationOptions = void>
bool regina::detail::simplifyExhaustiveInternal ( Object & obj,
int height,
int threads,
ProgressTrackerOpen * tracker )

The common implementation of all exhaustive simplification functions.

This routine performs exactly the task described by Link::simplifyExhaustive() or Triangluation<dim>::simplifyExhaustive() (for those dimensions where it is defined), with the following differences:

  • This routine assumes any preconditions have already been checked, and exceptions thrown if they failed.

See Triangulation<dim>::simplifyExhaustive() or Link::simplifyExhaustive() for full details on what this routine actually does.

Template Parameters
Objectthe class providing the exhaustive simplification function, such as regina::Triangulation<dim> or regina::Link.
PropagationOptionsAny options needed to specify how objects should be propagated to produce "nearby" objects. This will be passed through to retriangulateInternal(), and is ultimately used by the domain-specific function RetriangulationParams<Object>::propagateFrom<Retriangulator>.
Parameters
objthe object being simplified.
heightthe maximum number of top-dimensional simplices or crossings to allow beyond the initial number in obj, or a negative number if this should not be bounded.
threadsthe number of threads to use. If this is 1 or smaller then the routine will run single-threaded.
trackera progress tracker through which progress will be reported, or null if no progress reporting is required.
Returns
true if and only if the given object was simplified.

◆ swap()

template<int dim>
void regina::swap ( Triangulation< dim > & lhs,
Triangulation< dim > & rhs )

Swaps the contents of the two given triangulations.

This global routine simply calls Triangulation<dim>::swap(); it is provided so that Triangulation<dim> meets the C++ Swappable requirements.

See Triangulation<dim>::swap() for more details.

Note
This swap function is not marked noexcept, since it fires packet change events which may in turn call arbitrary code via any registered packet listeners.
Parameters
lhsthe triangulation whose contents should be swapped with rhs.
rhsthe triangulation whose contents should be swapped with lhs.