Regina Calculation Engine
Public Types | Public Member Functions | Static Public Member Functions
regina::NSnapPeaTriangulation Class Reference

Offers direct access to the SnapPea kernel from within Regina. More...

#include <snappea/nsnappeatriangulation.h>

Inheritance diagram for regina::NSnapPeaTriangulation:
regina::ShareableObject regina::boost::noncopyable

List of all members.

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.
NMatrixIntslopeEquations () 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.

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.

Detailed Description

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.

Test:
Included in the test suite.

Member Enumeration Documentation

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.

Warning:
This enumeration must always be kept in sync with SnapPea's own SolutionType enumeration.
Enumerator:
not_attempted 

A solution has not been attempted.

geometric_solution 

All tetrahedra are either positively oriented or flat, though the entire solution is not flat and no tetrahedra are degenerate.

nongeometric_solution 

The volume is positive, but some tetrahedra are negatively oriented.

flat_solution 

All tetrahedra are flat, but none have shape 0, 1 or infinity.

degenerate_solution 

At least one tetrahedron has shape 0, 1 or infinity.

other_solution 

The volume is zero or negative, but the solution is neither flat nor degenerate.

no_solution 

The gluing equations could not be solved.


Constructor & Destructor Documentation

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.

Parameters:
trithe 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.

Warning:
Passing allowClosed as true can occasionally cause the program to crash! See the notes above for details.
Parameters:
trithe Regina triangulation to clone.
allowClosedtrue if closed triangulations should be considered, or false if all closed triangulations should give null SnapPea data (the default). See above for details.

Destroys this triangulation.

All internal SnapPea data will also be destroyed.


Member Function Documentation

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.

void regina::NSnapPeaTriangulation::dump ( ) const [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 void regina::NSnapPeaTriangulation::enableKernelMessages ( bool  enabled = true) [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.

Parameters:
enabledtrue if diagnostic messages should be enabled, or false otherwise.
bool regina::NSnapPeaTriangulation::isNull ( ) const [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.

Returns:
true if this is a null triangulation, or false if this triangulation contains valid SnapPea data.

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.

Returns:
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.

Parameters:
filenamethe name of the SnapPea file to write.

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.

Precondition:
All vertex links in this triangulation must be tori.
Author:
William Pettersson and Stephan Tillmann
Returns:
a newly allocated matrix with (2 * number_of_cusps) rows and (3 * number_of_tetrahedron) columns as described above, or 0 if this is a null triangulation.

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.

Returns:
the solution type.

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.

Parameters:
triangulationthe triangulation to compare with this SnapPea triangulation.
Returns:
true if the face gluings match precisely, or false if the face gluings do not match or if this is a null triangulation.

Computes the volume of the underlying 3-manifold.

Returns:
the volume of the underlying 3-manifold, or 0 if this is a null triangulation.
double regina::NSnapPeaTriangulation::volume ( int &  precision) const

Computes the volume of the underlying 3-manifold and estimates the accuracy of the answer.

Parameters:
precisionused to return an estimate of the number of decimal places of accuracy in the calculated volume.
Python:
The precision argument is not present. Instead, two routines are offered. The routine volume() takes no arguments and returns the volume only, whereas the routine volumeWithPrecision() takes no arguments and returns a (volume, precision) tuple.
Returns:
the volume of the underlying 3-manifold, or 0 if this is a null triangulation.
virtual void regina::NSnapPeaTriangulation::writeTextShort ( std::ostream &  out) const [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.

Python:
The parameter out does not exist; standard output will be used.
Parameters:
outthe output stream to which to write.

Implements regina::ShareableObject.


The documentation for this class was generated from the following file:

Copyright © 1999-2011, The Regina development team
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).