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

Stores the vector of a single normal hypersurface in a 4-manifold triangulation. More...

#include <hypersurface/nnormalhypersurface.h>

Inheritance diagram for regina::NNormalHypersurfaceVector:
regina::NRay regina::NVector< NLargeInteger > regina::NNormalHypersurfaceVectorMirrored regina::NNormalHypersurfaceVectorStandard

Public Member Functions

 NNormalHypersurfaceVector (size_t length)
 Creates a new vector all of whose entries are initialised to zero. More...
 
 NNormalHypersurfaceVector (const NVector< NLargeInteger > &cloneMe)
 Creates a new vector that is a clone of the given vector. More...
 
virtual ~NNormalHypersurfaceVector ()
 A virtual destructor. More...
 
virtual NNormalHypersurfaceVectorclone () const =0
 Creates a newly allocated clone of this vector. More...
 
virtual bool isCompact (const Dim4Triangulation *triang) const
 Determines if the normal hypersurface represented is compact (has finitely many pieces). More...
 
virtual bool isVertexLinking (const Dim4Triangulation *triang) const
 Determines if the normal hypersurface represented is vertex linking. More...
 
virtual const Dim4VertexisVertexLink (const Dim4Triangulation *triang) const
 Determines if a rational multiple of the normal hypersurface represented is the link of a single vertex. More...
 
virtual const Dim4EdgeisThinEdgeLink (const Dim4Triangulation *triang) const
 Determines if a rational multiple of the normal hypersurface represented is the thin link of a single edge. More...
 
virtual NLargeInteger tetrahedra (size_t pentIndex, int vertex, const Dim4Triangulation *triang) const =0
 Returns the number of tetrahedron pieces of the given type in this normal hypersurface. More...
 
virtual NLargeInteger prisms (size_t pentIndex, int prismType, const Dim4Triangulation *triang) const =0
 Returns the number of prism pieces of the given type in this normal hypersurface. More...
 
virtual NLargeInteger edgeWeight (size_t edgeIndex, const Dim4Triangulation *triang) const =0
 Returns the number of times this normal hypersurface crosses the given edge. 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 NNormalHypersurfaceVectormakeZeroVector (const Dim4Triangulation *triangulation)
 Returns a new normal hypersurface vector of the appropriate length for the given triangulation and for the coordinate system corresponding to this subclass of NNormalHypersurfaceVector. More...
 
static NMatrixIntmakeMatchingEquations (const Dim4Triangulation *triangulation)
 Creates a new set of normal hypersurface matching equations for the given triangulation using the coordinate system corresponding to this particular subclass of NNormalHypersurfaceVector. More...
 
static NEnumConstraintListmakeEmbeddedConstraints (const Dim4Triangulation *triangulation)
 Creates a new set of validity constraints representing the condition that normal hypersurfaces be embedded. More...
 

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

Stores the vector of a single normal hypersurface in a 4-manifold triangulation.

The different subclasses of NNormalHypersurfaceVector use different underlying coordinate systems for the normal solution space. However, the various coordinate retrieval routines will return values that are independent of the underlying coordinate system. Thus the coordinates of the normal hypersurface in any coordinate system can be determined without knowledge of the specific underlying coordinate system being used.

Note that if a mirrored vector class is being used (see NNormalHypersurfaceVectorMirrored), the vector may not change once the first coordinate lookup routine (such as tetrahedra() and the like) has been called. See NNormalHypersurfaceVectorMirrored for further explanation.

Note that non-compact hypersurfaces (surfaces with infinitely many pieces) are allowed; in these cases, the corresponding coordinate lookup routines should return NLargeInteger::infinity where appropriate.

All subclasses of NNormalHypersurfaceVector must have the following properties:

When deriving classes from NNormalHypersurfaceVector:

Python:
Not present.

Constructor & Destructor Documentation

§ NNormalHypersurfaceVector() [1/2]

regina::NNormalHypersurfaceVector::NNormalHypersurfaceVector ( 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.

§ NNormalHypersurfaceVector() [2/2]

regina::NNormalHypersurfaceVector::NNormalHypersurfaceVector ( const NVector< NLargeInteger > &  cloneMe)
inline

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

Parameters
cloneMethe vector to clone.

§ ~NNormalHypersurfaceVector()

regina::NNormalHypersurfaceVector::~NNormalHypersurfaceVector ( )
inlinevirtual

A virtual destructor.

This is required because here we introduce virtual functions into the NRay hierarchy.

Member Function Documentation

§ addCopies()

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.

§ clone()

virtual NNormalHypersurfaceVector* regina::NNormalHypersurfaceVector::clone ( ) const
pure virtual

Creates a newly allocated clone of this vector.

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

§ edgeWeight()

virtual NLargeInteger regina::NNormalHypersurfaceVector::edgeWeight ( size_t  edgeIndex,
const Dim4Triangulation triang 
) const
pure virtual

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

See NNormalHypersurface::edgeWeight() for further details.

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

Implemented in regina::NNormalHypersurfaceVectorMirrored, and regina::NNormalHypersurfaceVectorStandard.

§ elementSum()

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.

§ isCompact()

virtual bool regina::NNormalHypersurfaceVector::isCompact ( const Dim4Triangulation triang) const
virtual

Determines if the normal hypersurface represented is compact (has finitely many pieces).

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

Parameters
triangthe triangulation in which this normal hypersurface lives.
Returns
true if and only if the normal hypersurface represented is compact.

§ isThinEdgeLink()

virtual const Dim4Edge* regina::NNormalHypersurfaceVector::isThinEdgeLink ( const Dim4Triangulation triang) const
virtual

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

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

Parameters
triangthe triangulation in which this normal hypersurface lives.
Returns
the edge linked by this hypersurface, or 0 if this hypersurface is not a thin edge link.

§ isVertexLink()

virtual const Dim4Vertex* regina::NNormalHypersurfaceVector::isVertexLink ( const Dim4Triangulation triang) const
virtual

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

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

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

§ isVertexLinking()

virtual bool regina::NNormalHypersurfaceVector::isVertexLinking ( const Dim4Triangulation triang) const
virtual

Determines if the normal hypersurface represented is vertex linking.

A vertex linking hypersurface contains only tetrahedra.

The default implementation for this routine simply runs through every non-tetrahedron piece type ensuring that each has no corresponding pieces. Subclasses of NNormalHypersurfaceVector should override this if they can provide a faster implementation.

Parameters
triangthe triangulation in which this normal hypersurface lives.
Returns
true if and only if the normal hypersurface represented is vertex linking.

§ makeEmbeddedConstraints()

static NEnumConstraintList* regina::NNormalHypersurfaceVector::makeEmbeddedConstraints ( const Dim4Triangulation triangulation)
static

Creates a new set of validity constraints representing the condition that normal hypersurfaces be embedded.

The validity constraints will be expressed relative to the coordinate system corresponding to this particular subclass of NNormalHypersurfaceVector.

Parameters
triangulationthe triangulation upon which these validity constraints will be based.
Returns
a newly allocated set of constraints.

§ makeMatchingEquations()

static NMatrixInt* regina::NNormalHypersurfaceVector::makeMatchingEquations ( const Dim4Triangulation triangulation)
static

Creates a new set of normal hypersurface matching equations for the given triangulation using the coordinate system corresponding to this particular subclass of NNormalHypersurfaceVector.

See makeMatchingEquations() for further details.

Parameters
triangulationthe triangulation upon which these matching equations will be based.
Returns
a newly allocated set of matching equations.

§ makeZeroVector()

static NNormalHypersurfaceVector* regina::NNormalHypersurfaceVector::makeZeroVector ( const Dim4Triangulation triangulation)
static

Returns a new normal hypersurface vector of the appropriate length for the given triangulation and for the coordinate system corresponding to this subclass of NNormalHypersurfaceVector.

All elements of the new vector will be initialised to zero.

See makeZeroVector() for further details.

Parameters
triangulationthe triangulation upon which the underlying coordinate system is based.
Returns
a new zero vector of the correct class and length.

§ negate()

void regina::NRay::negate ( )
inlineinherited

Negates every element of this vector.

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

§ norm()

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.

§ operator*()

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.

§ operator*=()

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.

§ operator+=()

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.

§ operator-=()

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.

§ operator==()

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.

§ operator[]()

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.

§ prisms()

virtual NLargeInteger regina::NNormalHypersurfaceVector::prisms ( size_t  pentIndex,
int  prismType,
const Dim4Triangulation triang 
) const
pure virtual

Returns the number of prism pieces of the given type in this normal hypersurface.

See NNormalHypersurface::prisms() for further details.

Parameters
pentIndexthe index in the triangulation of the pentachoron in which the requested prism pieces reside; this should be between 0 and Dim4Triangulation::size()-1 inclusive.
prismTypespecifies the edge of the given pentachoron that this prism separates from the opposite triangle; this should be between 0 and 9 inclusive.
triangthe triangulation in which this normal hypersurface lives.
Returns
the number of prism pieces of the given type.

Implemented in regina::NNormalHypersurfaceVectorMirrored, and regina::NNormalHypersurfaceVectorStandard.

§ scaleDown()

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.

§ setElement()

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

size_t regina::NVector< NLargeInteger >::size ( ) const
inlineinherited

Returns the number of elements in the vector.

Returns
the vector size.

§ subtractCopies()

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.

§ tetrahedra()

virtual NLargeInteger regina::NNormalHypersurfaceVector::tetrahedra ( size_t  pentIndex,
int  vertex,
const Dim4Triangulation triang 
) const
pure virtual

Returns the number of tetrahedron pieces of the given type in this normal hypersurface.

See NNormalHypersurface::tetrahedra() for further details.

Parameters
pentIndexthe index in the triangulation of the pentachoron in which the requested tetrahedron pieces reside; this should be between 0 and Dim4Triangulation::size()-1 inclusive.
vertexthe vertex of the given pentachoron around which the requested tetrahedron pieces lie; this should be between 0 and 4 inclusive.
triangthe triangulation in which this normal hypersurface lives.
Returns
the number of tetrahedron pieces of the given type.

Implemented in regina::NNormalHypersurfaceVectorMirrored, and regina::NNormalHypersurfaceVectorStandard.

Member Data Documentation

§ elements

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

The internal array containing all vector elements.

§ end

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

§ minusOne

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!

§ one

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!

§ zero

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-2016, 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@maths.uq.edu.au).