Regina Calculation Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
regina::NNormalSurfaceVectorQuadOct Class Referenceabstract

An almost normal surface vector using quad-oct coordinates. More...

#include <surfaces/nsquadoct.h>

Inheritance diagram for regina::NNormalSurfaceVectorQuadOct:
regina::NNormalSurfaceVectorMirrored regina::NNormalSurfaceVector regina::NRay regina::NVector< NLargeInteger >

Public Member Functions

 NNormalSurfaceVectorQuadOct (size_t length)
 Creates a new vector all of whose entries are initialised to zero. More...
 
 NNormalSurfaceVectorQuadOct (const NVector< NLargeInteger > &cloneMe)
 Creates a new vector that is a clone of the given vector. More...
 
virtual NNormalSurfaceVectormakeMirror (const NTriangulation *triang) const
 Creates a new mirror vector corresponding to this vector. More...
 
virtual const NVertexisVertexLink (const NTriangulation *triang) const
 Determines if a rational multiple of the normal surface represented is the link of a single vertex. More...
 
virtual NLargeInteger getTriangleCoord (unsigned long tetIndex, int vertex, const NTriangulation *triang) const
 Returns the number of triangular discs of the given type in this normal surface. More...
 
virtual NLargeInteger getOrientedTriangleCoord (unsigned long tetIndex, int vertex, const NTriangulation *triang, bool orientation) const
 Returns the number of oriented triangular discs of the given type in this normal surface. More...
 
virtual NLargeInteger getQuadCoord (unsigned long tetIndex, int quadType, const NTriangulation *triang) const
 Returns the number of quadrilateral discs of the given type in this normal surface. More...
 
virtual NLargeInteger getOrientedQuadCoord (unsigned long tetIndex, int quadType, const NTriangulation *triang, bool orientation) const
 Returns the number of oriented quadrilateral discs of the given type in this normal surface. More...
 
virtual NLargeInteger getOctCoord (unsigned long tetIndex, int octType, const NTriangulation *triang) const
 Returns the number of octagonal discs of the given type in this normal surface. More...
 
virtual NLargeInteger getEdgeWeight (unsigned long edgeIndex, const NTriangulation *triang) const
 Returns the number of times this normal surface crosses the given edge. More...
 
virtual NLargeInteger getTriangleArcs (unsigned long triIndex, int triVertex, const NTriangulation *triang) const
 Returns the number of arcs in which this normal surface intersects the given triangle in the given direction. More...
 
virtual NNormalSurfaceVectorclone () const =0
 Creates a newly allocated clone of this vector. More...
 
virtual bool allowsAlmostNormal () const =0
 Determines if the specific underlying coordinate system allows for almost normal surfaces, that is, allows for octagonal discs. More...
 
virtual bool allowsSpun () const =0
 Determines if the specific underlying coordinate system allows for spun-normal surfaces; that is, surfaces with infinitely many triangles. More...
 
virtual bool allowsOriented () const =0
 Determines if the specific underlying coordinate system allows for transversely oriented normal surfaces. More...
 
virtual bool hasMultipleOctDiscs (const NTriangulation *triang) const
 Determines if this normal surface has more than one octagonal disc. More...
 
virtual bool isCompact (const NTriangulation *triang) const
 Determines if the normal surface represented is compact (has finitely many discs). More...
 
virtual bool isVertexLinking (const NTriangulation *triang) const
 Determines if the normal surface represented is vertex linking. More...
 
virtual std::pair< const NEdge
*, const NEdge * > 
isThinEdgeLink (const NTriangulation *triang) const
 Determines if a rational multiple of the normal surface represented is the thin link of a single edge. More...
 
virtual bool isSplitting (const NTriangulation *triang) const
 Determines if the normal surface represented is a splitting surface in the given triangulation. More...
 
virtual NLargeInteger isCentral (const NTriangulation *triang) const
 Determines if the normal surface represented is a central surface in the given triangulation. More...
 
NLargeInteger getFaceArcs (unsigned long triIndex, int triVertex, const NTriangulation *triang) const
 A deprecated alias for getTriangleArcs(). More...
 
void scaleDown ()
 Scales this vector down by the greatest common divisor of all its elements. More...
 
void negate ()
 Negates every element of this vector. More...
 
size_t size () const
 Returns the number of elements in the vector. More...
 
const NLargeIntegeroperator[] (size_t index) const
 Returns the element at the given index in the vector. More...
 
void setElement (size_t index, const NLargeInteger &value)
 Sets the element at the given index in the vector to the given value. More...
 
bool operator== (const NVector< NLargeInteger > &compare) const
 Determines if this vector is equal to the given vector. More...
 
void operator+= (const NVector< NLargeInteger > &other)
 Adds the given vector to this vector. More...
 
void operator-= (const NVector< NLargeInteger > &other)
 Subtracts the given vector from this vector. More...
 
void operator*= (const NLargeInteger &factor)
 Multiplies this vector by the given scalar. More...
 
NLargeInteger operator* (const NVector< NLargeInteger > &other) const
 Calculates the dot product of this vector and the given vector. More...
 
NLargeInteger norm () const
 Returns the norm of this vector. More...
 
NLargeInteger elementSum () const
 Returns the sum of all elements of this vector. More...
 
void addCopies (const NVector< NLargeInteger > &other, const NLargeInteger &multiple)
 Adds the given multiple of the given vector to this vector. More...
 
void subtractCopies (const NVector< NLargeInteger > &other, const NLargeInteger &multiple)
 Subtracts the given multiple of the given vector to this vector. More...
 

Static Public Member Functions

static NNormalSurfaceVectormakeZeroVector (const NTriangulation *triangulation)
 
static NMatrixIntmakeMatchingEquations (const NTriangulation *triangulation)
 
static NEnumConstraintListmakeEmbeddedConstraints (const NTriangulation *triangulation)
 

Static Public Attributes

static NLargeInteger zero
 Zero in the underlying number system. More...
 
static NLargeInteger one
 One in the underlying number system. More...
 
static NLargeInteger minusOne
 Negative one in the underlying number system. More...
 

Protected Attributes

NLargeIntegerelements
 The internal array containing all vector elements. More...
 
NLargeIntegerend
 A pointer just beyond the end of the internal array. More...
 

Detailed Description

An almost normal surface vector using quad-oct coordinates.

If there are t tetrahedra in the underlying triangulation, there must be precisely 6t coordinates. The first six coordinates will be for the first tetrahedron, the next six for the second tetrahedron and so on. For each tetrahedron, the first three coordinates represent the number of quadrilateral discs of type 0, 1 and 2 (see NNormalSurface::getQuadCoord()), and the final three represent the number of octagonal discs of type 0, 1 and 2 (see NNormalSurface::getOctCoord()).

Python:
Not present.

Constructor & Destructor Documentation

regina::NNormalSurfaceVectorQuadOct::NNormalSurfaceVectorQuadOct ( size_t  length)
inline

Creates a new vector all of whose entries are initialised to zero.

Parameters
lengththe number of elements in the new vector.
regina::NNormalSurfaceVectorQuadOct::NNormalSurfaceVectorQuadOct ( const NVector< NLargeInteger > &  cloneMe)
inline

Creates a new vector that is a clone of the given vector.

Parameters
cloneMethe vector to clone.

Member Function Documentation

void regina::NVector< NLargeInteger >::addCopies ( const NVector< NLargeInteger > &  other,
const NLargeInteger multiple 
)
inlineinherited

Adds the given multiple of the given vector to this vector.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector a multiple of which will be added to this vector.
multiplethe multiple of other to be added to this vector.
virtual bool regina::NNormalSurfaceVector::allowsAlmostNormal ( ) const
pure virtualinherited

Determines if the specific underlying coordinate system allows for almost normal surfaces, that is, allows for octagonal discs.

Note that this has nothing to do with whether or not this specific surface contains octagonal discs.

Returns
true if and only if almost normal surfaces are allowed.
virtual bool regina::NNormalSurfaceVector::allowsOriented ( ) const
pure virtualinherited

Determines if the specific underlying coordinate system allows for transversely oriented normal surfaces.

Returns
true if and only if transverse orientations are supported.
virtual bool regina::NNormalSurfaceVector::allowsSpun ( ) const
pure virtualinherited

Determines if the specific underlying coordinate system allows for spun-normal surfaces; that is, surfaces with infinitely many triangles.

Note that this has nothing to do with whether or not this specific surface contains infinitely many triangles.

Returns
true if and only if spun-normal surfaces are allowed.
virtual NNormalSurfaceVector* regina::NNormalSurfaceVector::clone ( ) const
pure virtualinherited

Creates a newly allocated clone of this vector.

The clone will be of the same subclass of NNormalSurfaceVector as this vector.

NLargeInteger regina::NVector< NLargeInteger >::elementSum ( ) const
inlineinherited

Returns the sum of all elements of this vector.

Returns
the sum of the elements of this vector.
NLargeInteger regina::NNormalSurfaceVectorMirrored::getEdgeWeight ( unsigned long  edgeIndex,
const NTriangulation triang 
) const
inlinevirtualinherited

Returns the number of times this normal surface crosses the given edge.

See NNormalSurface::getEdgeWeight() for further details.

Parameters
edgeIndexthe index in the triangulation of the edge in which we are interested; this should be between 0 and NTriangulation::getNumberOfEdges()-1 inclusive.
triangthe triangulation in which this normal surface lives.
Returns
the number of times this normal surface crosses the given edge.

Implements regina::NNormalSurfaceVector.

NLargeInteger regina::NNormalSurfaceVector::getFaceArcs ( unsigned long  triIndex,
int  triVertex,
const NTriangulation triang 
) const
inlineinherited

A deprecated alias for getTriangleArcs().

This routine returns the number of arcs in which this normal surface intersects the given triangle in the given direction. See getTriangleArcs() for further details.

Since this is an alias only, it is non-virtual and cannot be overridden. Its implementation simply calls getTriangleArcs().

Deprecated:
This routine will be removed in a future version of Regina. Please use getTriangleArcs() instead.
Parameters
triIndexthe index in the triangulation of the triangle in which we are interested; this should be between 0 and NTriangulation::getNumberOfTriangles()-1 inclusive.
triVertexthe vertex of the triangle (0, 1 or 2) around which the arcs of intersection that we are interested in lie; only these arcs will be counted.
triangthe triangulation in which this normal surface lives.
Returns
the number of times this normal surface intersect the given triangle with the given arc type.
NLargeInteger regina::NNormalSurfaceVectorMirrored::getOctCoord ( unsigned long  tetIndex,
int  octType,
const NTriangulation triang 
) const
inlinevirtualinherited

Returns the number of octagonal discs of the given type in this normal surface.

See NNormalSurface::getOctCoord() for further details.

Parameters
tetIndexthe index in the triangulation of the tetrahedron in which the requested octagons reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
octTypethe number of the vertex splitting that this octagon type represents; this should be between 0 and 2 inclusive.
triangthe triangulation in which this normal surface lives.
Returns
the number of octagonal discs of the given type.

Implements regina::NNormalSurfaceVector.

Reimplemented in regina::NNormalSurfaceVectorOrientedQuad, and regina::NNormalSurfaceVectorQuad.

NLargeInteger regina::NNormalSurfaceVectorMirrored::getOrientedQuadCoord ( unsigned long  tetIndex,
int  quadType,
const NTriangulation triang,
bool  orientation 
) const
inlinevirtualinherited

Returns the number of oriented quadrilateral discs of the given type in this normal surface.

See NNormalSurface::getOrientedQuadCoord() for further details.

The default implementation of this routine returns zero, which is suitable for coordinate systems that do not support transverse orientation.

Parameters
tetIndexthe index in the triangulation of the tetrahedron in which the requested quadrilaterals reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
quadTypethe number of the vertex splitting that this quad type represents; this should be between 0 and 2 inclusive.
triangthe triangulation in which this normal surface lives.
orientationthe orientation of the normal discs.
Returns
the number of quadrilateral discs of the given type.

Reimplemented from regina::NNormalSurfaceVector.

Reimplemented in regina::NNormalSurfaceVectorOrientedQuad.

NLargeInteger regina::NNormalSurfaceVectorMirrored::getOrientedTriangleCoord ( unsigned long  tetIndex,
int  vertex,
const NTriangulation triang,
bool  orientation 
) const
inlinevirtualinherited

Returns the number of oriented triangular discs of the given type in this normal surface.

See NNormalSurface::getOrientedTriangleCoord() for further details.

The default implementation of this routine returns zero, which is suitable for coordinate systems that do not support transverse orientation.

Parameters
tetIndexthe index in the triangulation of the tetrahedron in which the requested triangles reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
vertexthe vertex of the given tetrahedron around which the requested triangles lie; this should be between 0 and 3 inclusive.
triangthe triangulation in which this normal surface lives.
orientationthe orientation of the normal discs.
Returns
the number of triangular discs of the given type.

Reimplemented from regina::NNormalSurfaceVector.

NLargeInteger regina::NNormalSurfaceVectorMirrored::getQuadCoord ( unsigned long  tetIndex,
int  quadType,
const NTriangulation triang 
) const
inlinevirtualinherited

Returns the number of quadrilateral discs of the given type in this normal surface.

See NNormalSurface::getQuadCoord() for further details.

Parameters
tetIndexthe index in the triangulation of the tetrahedron in which the requested quadrilaterals reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
quadTypethe number of the vertex splitting that this quad type represents; this should be between 0 and 2 inclusive.
triangthe triangulation in which this normal surface lives.
Returns
the number of quadrilateral discs of the given type.

Implements regina::NNormalSurfaceVector.

Reimplemented in regina::NNormalSurfaceVectorOrientedQuad.

NLargeInteger regina::NNormalSurfaceVectorMirrored::getTriangleArcs ( unsigned long  triIndex,
int  triVertex,
const NTriangulation triang 
) const
inlinevirtualinherited

Returns the number of arcs in which this normal surface intersects the given triangle in the given direction.

See NNormalSurface::getTriangleArcs() for further details.

Parameters
triIndexthe index in the triangulation of the triangle in which we are interested; this should be between 0 and NTriangulation::getNumberOfTriangles()-1 inclusive.
triVertexthe vertex of the triangle (0, 1 or 2) around which the arcs of intersection that we are interested in lie; only these arcs will be counted.
triangthe triangulation in which this normal surface lives.
Returns
the number of times this normal surface intersect the given triangle with the given arc type.

Implements regina::NNormalSurfaceVector.

NLargeInteger regina::NNormalSurfaceVectorMirrored::getTriangleCoord ( unsigned long  tetIndex,
int  vertex,
const NTriangulation triang 
) const
inlinevirtualinherited

Returns the number of triangular discs of the given type in this normal surface.

See NNormalSurface::getTriangleCoord() for further details.

Parameters
tetIndexthe index in the triangulation of the tetrahedron in which the requested triangles reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
vertexthe vertex of the given tetrahedron around which the requested triangles lie; this should be between 0 and 3 inclusive.
triangthe triangulation in which this normal surface lives.
Returns
the number of triangular discs of the given type.

Implements regina::NNormalSurfaceVector.

virtual bool regina::NNormalSurfaceVector::hasMultipleOctDiscs ( const NTriangulation triang) const
virtualinherited

Determines if this normal surface has more than one octagonal disc.

It may be assumed that at most one octagonal disc type exists in this surface. This routine will return true if an octagonal type does exist and its coordinate is greater than one.

The default implementation for this routine simply calculates all the octagonal coordinates and returns as soon as a positive or negative result can be established. Subclasses of NNormalSurfaceVector should override this if they can provide a faster implementation.

If a subclass does not allow for almost normal surfaces, this routine will never be called and thus does not need to be overwritten.

Precondition
At most one octagonal disc type exists in this surface.
This normal surface vector is using a coordinate system that allows for almost normal surfaces.
Parameters
triangthe triangulation in which this normal surface lives.
Returns
true if and only if there is an octagonal disc type present and its coordinate is greater than one.
virtual NLargeInteger regina::NNormalSurfaceVector::isCentral ( const NTriangulation triang) const
virtualinherited

Determines if the normal surface represented is a central surface in the given triangulation.

A central surface is a compact surface containing at most one normal or almost normal disc per tetrahedron. If the surface is central, the number of tetrahedra it meets (i.e., the number of discs in the surface) will be returned.

The default implementation for this routine simply runs through and checks the count for each disc type. Subclasses of NNormalSurfaceVector should override this if they can provide a faster implementation.

Parameters
triangthe triangulation in which this normal surface lives.
Returns
the number of tetrahedra that the surface meets if it is a central surface, or 0 if it is not a central surface.
virtual bool regina::NNormalSurfaceVector::isCompact ( const NTriangulation triang) const
virtualinherited

Determines if the normal surface represented is compact (has finitely many discs).

The default implementation for this routine simply runs through every disc type until a disc type with infinite disc count is found or all disc types have been examined. Subclasses of NNormalSurfaceVector should override this if they can provide a faster implementation.

Parameters
triangthe triangulation in which this normal surface lives.
Returns
true if and only if the normal surface represented is compact.
virtual bool regina::NNormalSurfaceVector::isSplitting ( const NTriangulation triang) const
virtualinherited

Determines if the normal surface represented is a splitting surface in the given triangulation.

A splitting surface is a compact surface containing precisely one quad per tetrahedron and no other normal (or almost normal) discs.

The default implementation for this routine simply runs through and checks the count for each disc type. Subclasses of NNormalSurfaceVector should override this if they can provide a faster implementation.

Parameters
triangthe triangulation in which this normal surface lives.
Returns
true if and only if the normal surface represented is a splitting surface.
virtual std::pair<const NEdge*, const NEdge*> regina::NNormalSurfaceVector::isThinEdgeLink ( const NTriangulation triang) const
virtualinherited

Determines if a rational multiple of the normal surface represented is the thin link of a single edge.

If there are two different edges e1 and e2 for which the surface could be expressed as the thin link of either e1 or e2, the pair (e1,e2) will be returned. If the surface is the thin link of only one edge e, the pair (e,0) will be returned. If the surface is not the thin link of any edges, the pair (0,0) will be returned.

The default implementation for this routine involves counting the number of discs of every type. Subclasses of NNormalSurfaceVector should override this if they can provide a faster implementation.

Parameters
triangthe triangulation in which this normal surface lives.
Returns
a pair containing the edge(s) linked by this surface, as described above.
const NVertex * regina::NNormalSurfaceVectorQuadOct::isVertexLink ( const NTriangulation triang) const
inlinevirtual

Determines if a rational multiple of the normal surface represented is the link of a single vertex.

The default implementation for this routine involves counting the number of discs of every type. Subclasses of NNormalSurfaceVector should override this if they can provide a faster implementation.

Parameters
triangthe triangulation in which this normal surface lives.
Returns
the vertex linked by this surface, or 0 if this surface is not the link of a single vertex.

Reimplemented from regina::NNormalSurfaceVector.

virtual bool regina::NNormalSurfaceVector::isVertexLinking ( const NTriangulation triang) const
virtualinherited

Determines if the normal surface represented is vertex linking.

A vertex linking surface contains only triangles.

The default implementation for this routine simply runs through every non-triangular disc type ensuring that each has no corresponding discs. Subclasses of NNormalSurfaceVector should override this if they can provide a faster implementation.

Parameters
triangthe triangulation in which this normal surface lives.
Returns
true if and only if the normal surface represented is vertex linking.
virtual NNormalSurfaceVector* regina::NNormalSurfaceVectorQuadOct::makeMirror ( const NTriangulation triang) const
virtual

Creates a new mirror vector corresponding to this vector.

The mirror vector should represent the same normal surface as this vector, and should have fast coordinate lookup routines (getTriangleCoord(), getQuadCord() and so on). It is recommended that the mirror vector be an NNormalSurfaceVectorStandard or an NNormalSurfaceVectorANStandard.

Parameters
triangthe triangulation in which this normal surface lives.
Returns
a newly created mirror vector.

Implements regina::NNormalSurfaceVectorMirrored.

void regina::NRay::negate ( )
inlineinherited

Negates every element of this vector.

This is an optimised implementation that overrides NVector<NLargeInteger>::negate().

NLargeInteger regina::NVector< NLargeInteger >::norm ( ) const
inlineinherited

Returns the norm of this vector.

This is the dot product of the vector with itself.

Returns
the norm of this vector.
NLargeInteger regina::NVector< NLargeInteger >::operator* ( const NVector< NLargeInteger > &  other) const
inlineinherited

Calculates the dot product of this vector and the given vector.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector with which this will be multiplied.
Returns
the dot product of this and the given vector.
void regina::NVector< NLargeInteger >::operator*= ( const NLargeInteger factor)
inlineinherited

Multiplies this vector by the given scalar.

Parameters
factorthe scalar with which this will be multiplied.
void regina::NVector< NLargeInteger >::operator+= ( const NVector< NLargeInteger > &  other)
inlineinherited

Adds the given vector to this vector.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector to add to this vector.
void regina::NVector< NLargeInteger >::operator-= ( const NVector< NLargeInteger > &  other)
inlineinherited

Subtracts the given vector from this vector.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector to subtract from this vector.
bool regina::NVector< NLargeInteger >::operator== ( const NVector< NLargeInteger > &  compare) const
inlineinherited

Determines if this vector is equal to the given vector.

Precondition
This and the given vector have the same size.
Parameters
comparethe vector with which this will be compared.
Returns
true if and only if the this and the given vector are equal.
const NLargeInteger & regina::NVector< NLargeInteger >::operator[] ( size_t  index) const
inlineinherited

Returns the element at the given index in the vector.

A constant reference to the element is returned; the element may not be altered.

Precondition
index is between 0 and size()-1 inclusive.
Parameters
indexthe vector index to examine.
Returns
the vector element at the given index.
void regina::NRay::scaleDown ( )
inherited

Scales this vector down by the greatest common divisor of all its elements.

The resulting vector will be the smallest multiple of the original that maintains integral entries, and these entries will have the same signs as the originals.

This routine thus reduces a ray to its smallest possible representation.

This routine poses no problem for vectors containing infinite elements; such elements are simply ignored and left at infinity.

void regina::NVector< NLargeInteger >::setElement ( size_t  index,
const NLargeInteger value 
)
inlineinherited

Sets the element at the given index in the vector to the given value.

Precondition
index is between 0 and size()-1 inclusive.
Parameters
indexthe vector index to examine.
valuethe new value to assign to the element.
Returns
the vector element at the given index.
size_t regina::NVector< NLargeInteger >::size ( ) const
inlineinherited

Returns the number of elements in the vector.

Returns
the vector size.
void regina::NVector< NLargeInteger >::subtractCopies ( const NVector< NLargeInteger > &  other,
const NLargeInteger multiple 
)
inlineinherited

Subtracts the given multiple of the given vector to this vector.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector a multiple of which will be subtracted from this vector.
multiplethe multiple of other to be subtracted from this vector.

Member Data Documentation

NLargeInteger * regina::NVector< NLargeInteger >::elements
protectedinherited

The internal array containing all vector elements.

NLargeInteger * regina::NVector< NLargeInteger >::end
protectedinherited

A pointer just beyond the end of the internal array.

The size of the vector can be computed as (end - elements).

NLargeInteger regina::NVector< NLargeInteger >::minusOne
staticinherited

Negative one in the underlying number system.

This would be const if it weren't for the fact that some compilers don't like this. It should never be modified!

NLargeInteger regina::NVector< NLargeInteger >::one
staticinherited

One in the underlying number system.

This would be const if it weren't for the fact that some compilers don't like this. It should never be modified!

NLargeInteger regina::NVector< NLargeInteger >::zero
staticinherited

Zero in the underlying number system.

This would be const if it weren't for the fact that some compilers don't like this. It should never be modified!


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

Copyright © 1999-2014, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).