Regina Calculation Engine
|
Offers direct access to the SnapPea kernel from within Regina. More...
#include <snappea/nsnappeatriangulation.h>
Public Types | |
enum | SolutionType { not_attempted, geometric_solution, nongeometric_solution, flat_solution, degenerate_solution, other_solution, no_solution } |
Describes the different types of solution that can be found when solving for a complete hyperbolic structure. More... |
Public Member Functions | |
NSnapPeaTriangulation (const NSnapPeaTriangulation &tri) | |
Creates a SnapPea clone of the given SnapPea triangulation. | |
NSnapPeaTriangulation (const NTriangulation &tri, bool allowClosed=false) | |
Creates a SnapPea clone of the given Regina triangulation. | |
~NSnapPeaTriangulation () | |
Destroys this triangulation. | |
bool | isNull () const |
Determines whether this triangulation contains valid SnapPea data. | |
SolutionType | solutionType () const |
Returns the type of solution found when solving for a complete hyperbolic structure. | |
double | volume () const |
Computes the volume of the underlying 3-manifold. | |
double | volume (int &precision) const |
Computes the volume of the underlying 3-manifold and estimates the accuracy of the answer. | |
NMatrixInt * | slopeEquations () const |
Returns a matrix for computing boundary slopes of spun-normal surfaces at the cusps of the triangulation. | |
bool | verifyTriangulation (const NTriangulation &triangulation) const |
Verifies that the face gluings from this SnapPea triangulation match the given NTriangulation from Regina. | |
void | dump () const |
Dumps the underlying SnapPea data to standard output. | |
void | saveAsSnapPea (const char *filename) const |
Saves the underlying triangulation as a native SnapPea file. | |
virtual void | writeTextShort (std::ostream &out) const |
Writes this object in short text format to the given output stream. | |
![]() | |
ShareableObject () | |
Default constructor that does nothing. | |
virtual | ~ShareableObject () |
Default destructor that does nothing. | |
virtual void | writeTextLong (std::ostream &out) const |
Writes this object in long text format to the given output stream. | |
std::string | toString () const |
Returns the output from writeTextShort() as a string. | |
std::string | toStringLong () const |
Returns the output from writeTextLong() as a string. |
Static Public Member Functions | |
static bool | kernelMessagesEnabled () |
Returns whether or not the SnapPea kernel writes diagnostic messages to standard output. | |
static void | enableKernelMessages (bool enabled=true) |
Configures whether or not the SnapPea kernel should write diagnostic messages to standard output. | |
static void | disableKernelMessages () |
Specifies that the SnapPea kernel should not write diagnostic messages to standard output. |
Offers direct access to the SnapPea kernel from within Regina.
An object of this class represents a 3-manifold triangulation, stored in SnapPea's internal format. Such an object may be constructed by cloning either a standard Regina triangulation or another SnapPea triangulation.
Note that not all Regina triangulations can be represented in SnapPea format. You should always call isNull() to test whether any Regina-to-SnapPea conversion was successful.
This class is designed to act as the sole conduit between the Regina calculation engine and the SnapPea kernel. Regina code should not interact with the SnapPea kernel other than through this class.
SnapPea was written by Jeff Weeks, and is now maintained by both Jeff Weeks and Nathan Dunfield at http://www.math.uic.edu/t3m/. The SnapPeaKernel is distributed under the terms of the GNU General Public License, version 2 or any later version, as published by the Free Software Foundation.
This class also makes use of additional code from SnapPy that is not included in the SnapPea kernel. SnapPy is by M. Culler, N. M. Dunfield and J. R. Weeks, and is also released under the terms of the GNU General Public License.
See http://snappy.computop.org/ for further information on SnapPea and its successor SnapPy.
Describes the different types of solution that can be found when solving for a complete hyperbolic structure.
Although this enumeration is identical to SnapPea's own SolutionType, it is declared again in this class because Regina code should not in general be interacting directly with the SnapPea kernel. Values may be freely converted between the two enumeration types by simple assignment and/or typecasting.
regina::NSnapPeaTriangulation::NSnapPeaTriangulation | ( | const NSnapPeaTriangulation & | tri | ) |
Creates a SnapPea clone of the given SnapPea triangulation.
This SnapPea triangulation stands independent of tri, so this triangulation will not be affected if tri is later changed or destroyed.
If tri is a null triangulation then this will be a null triangulation also. See isNull() for further details.
Note that the tetrahedron and vertex numbers might be changed in the new SnapPea triangulation.
tri | the SnapPea triangulation to clone. |
regina::NSnapPeaTriangulation::NSnapPeaTriangulation | ( | const NTriangulation & | tri, |
bool | allowClosed = false |
||
) |
Creates a SnapPea clone of the given Regina triangulation.
This SnapPea triangulation stands independent of tri, so this triangulation will not be affected if tri is later changed or destroyed.
Note that, since Regina is written with a different purpose from SnapPea, not all Regina triangulations can be represented in SnapPea format. If the conversion is unsuccessful, this will be marked as a null triangulation. You should always test isNull() to determine whether the conversion was successful.
SnapPea is designed primarily to work with ideal triangulations only. Passing closed triangulations can occasionally cause the SnapPea kernel to raise a fatal error, which in turn will crash the entire program. Thus by default, closed triangulations are never converted (a null SnapPea triangulation will be created instead). See the optional argument allowClosed for how to change this behaviour.
Note also that the tetrahedron and vertex numbers might be changed in the new SnapPea triangulation.
true
can occasionally cause the program to crash! See the notes above for details.tri | the Regina triangulation to clone. |
allowClosed | true if closed triangulations should be considered, or false if all closed triangulations should give null SnapPea data (the default). See above for details. |
regina::NSnapPeaTriangulation::~NSnapPeaTriangulation | ( | ) |
Destroys this triangulation.
All internal SnapPea data will also be destroyed.
|
static |
Specifies that the SnapPea kernel should not write diagnostic messages to standard output.
Calling this routine is equivalent to calling enableKernelMessages(false).
Note that diagnostic messages are already disabled by default.
This routine (which interacts with static data) is thread-safe.
|
inline |
Dumps the underlying SnapPea data to standard output.
This routine should be regarded primarily as a diagnostic tool for investigating how the SnapPea kernel has modified and/or analysed a triangulation.
Note that the SnapPea data is written using C-style output (i.e., using the stdout file pointer), which may or may not cause unexpected behaviour when used in conjunction with std::cout.
If this triangulation does not contain any valid SnapPea data, this routine will do nothing. See isNull() for further details.
|
static |
Configures whether or not the SnapPea kernel should write diagnostic messages to standard output.
By default such diagnostic messages are disabled.
This routine (which interacts with static data) is thread-safe.
enabled | true if diagnostic messages should be enabled, or false otherwise. |
|
inline |
Determines whether this triangulation contains valid SnapPea data.
A null SnapPea triangulation can occur when converting unusual types of Regina triangulation into SnapPea format, since Regina is written to deal with different types of triangulations from SnapPea.
true
if this is a null triangulation, or false
if this triangulation contains valid SnapPea data.
|
static |
Returns whether or not the SnapPea kernel writes diagnostic messages to standard output.
By default such diagnostic messages are disabled. To enable them, call enableKernelMessages().
This routine (which interacts with static data) is thread-safe.
true
if and only if diagonstic messages are enabled. void regina::NSnapPeaTriangulation::saveAsSnapPea | ( | const char * | filename | ) | const |
Saves the underlying triangulation as a native SnapPea file.
Like dump(), this routine is provided primarily as a diagnostic tool.
For a general export-to-SnapPea method, users are referred to regina::writeSnapPea() instead, which avoids the internal SnapPea conversion entirely and simply writes Regina's native triangulation data in SnapPea's text format.
Passing an empty string as the filename will cause the SnapPea data to be written to standard output, just like dump(). See the dump() documentation for caveats when combining the C-style output of this routine with std::cout.
If this triangulation does not contain any valid SnapPea data, this routine will do nothing. See isNull() for further details.
filename | the name of the SnapPea file to write. |
NMatrixInt* regina::NSnapPeaTriangulation::slopeEquations | ( | ) | const |
Returns a matrix for computing boundary slopes of spun-normal surfaces at the cusps of the triangulation.
This matrix includes a pair of rows for each cusp in the triangulation: one row for determining the algebraic intersection number with the meridian, and one row for determining the algebraic intersection number with the longitude. If the triangulation has more than one cusp, these pairs are ordered by vertex number in the triangulation. Within each pair, the meridian row always appears before the longitude row.
This matrix is constructed so that, if M and L are the rows for the meridian and longitude at some cusp, then for any spun-normal surface with quadrilateral coordinates q, the boundary curves have algebraic intersection number M.q with the meridian and L.q with the longitude. Equivalently, the boundary curves pass L.q times around the meridian and -M.q times around the longitude. To compute these slopes directly from a normal surface, see NNormalSurface::boundarySlopes().
This code makes use of the SnapPy kernel, and the choice of meridian and longitude on each cusp follows SnapPy's conventions. In particular, we use the orientations for meridian and longitude from SnapPy. The orientations of the boundary curves of a spun-normal surface are chosen so that if meridian and longitude are a positive basis as vieved from the cusp, then as one travels along an oriented boundary curve, the spun-normal surface spirals into the cusp to one's right and down into the manifold to one's left.
SolutionType regina::NSnapPeaTriangulation::solutionType | ( | ) | const |
Returns the type of solution found when solving for a complete hyperbolic structure.
Note that SnapPea distinguishes between a complete hyperbolic structure and a Dehn filled hyperbolic structure. At the present time Regina does not concern itself with Dehn fillings, so only the complete solution type is offered here.
bool regina::NSnapPeaTriangulation::verifyTriangulation | ( | const NTriangulation & | triangulation | ) | const |
Verifies that the face gluings from this SnapPea triangulation match the given NTriangulation from Regina.
This is useful for developers, if you are not sure whether SnapPea will re-triangulate. For end users, this function should not be required.
triangulation | the triangulation to compare with this SnapPea triangulation. |
true
if the face gluings match precisely, or false
if the face gluings do not match or if this is a null triangulation. double regina::NSnapPeaTriangulation::volume | ( | ) | const |
Computes the volume of the underlying 3-manifold.
double regina::NSnapPeaTriangulation::volume | ( | int & | precision | ) | const |
Computes the volume of the underlying 3-manifold and estimates the accuracy of the answer.
precision | used to return an estimate of the number of decimal places of accuracy in the calculated volume. |
|
virtual |
Writes this object in short text format to the given output stream.
The output should fit on a single line and no newline should be written.
out | the output stream to which to write. |
Implements regina::ShareableObject.