regina::NNormalSurfaceVector Class Referenceabstract
Normal Surfaces

Stores the vector of a single normal surface in a 3-manifold. More...

`#include <surfaces/nnormalsurface.h>`

Inheritance diagram for regina::NNormalSurfaceVector:

## Public Member Functions

| NNormalSurfaceVector (size_t length)
| Creates a new vector all of whose entries are initialised to zero. More...
| NNormalSurfaceVector (const NVector< NLargeInteger > &cloneMe)
| Creates a new vector that is a clone of the given vector. More...
virtual | ~NNormalSurfaceVector ()
| A virtual destructor. More...
virtual NNormalSurfaceVector * | clone () 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 const NVertex * | isVertexLink (const NTriangulation *triang) const
| Determines if a rational multiple of the normal surface represented is the link of a single vertex. 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...
virtual NLargeInteger | getTriangleCoord (unsigned long tetIndex, int vertex, const NTriangulation *triang) const =0
| 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 =0
| 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 =0
| 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 =0
| 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 =0
| Returns the number of arcs in which this normal surface intersects the given triangle in the given direction. 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 NLargeInteger & | operator[] (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 NNormalSurfaceVector * | makeZeroVector (const NTriangulation *triangulation)
| Returns a new normal surface vector of the appropriate length for the given triangulation and for the coordinate system corresponding to this subclass of NNormalSurfaceVector. More...
static NMatrixInt * | makeMatchingEquations (const NTriangulation *triangulation)
| Creates a new set of normal surface matching equations for the given triangulation using the coordinate system corresponding to this particular subclass of NNormalSurfaceVector. More...
static NEnumConstraintList * | makeEmbeddedConstraints (const NTriangulation *triangulation)
| Creates a new set of validity constraints representing the condition that normal surfaces 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

NLargeInteger * | elements
| The internal array containing all vector elements. More...
NLargeInteger * | end
| A pointer just beyond the end of the internal array. More...

## Detailed Description

Stores the vector of a single normal surface in a 3-manifold.

The different subclasses of NNormalSurfaceVector 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 surface 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 NNormalSurfaceVectorMirrored), the vector may not change once the first coordinate lookup routine (such as getTriangleCoord() and the like) has been called. See NNormalSurfaceVectorMirrored for further explanation.

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

All subclasses of NNormalSurfaceVector must have the following properties:

- Normal surfaces can be enumerated by intersecting the non-negative orthant of the underlying vector space with some linear subspace;
- Multiplying a normal surface by k corresponds to multiplying the underlying vector by k for any non-negative integer k.

When deriving classes from NNormalSurfaceVector:

- A new value must must be added to the NormalCoords enum in normalcoords.h to represent the new coordinate system.
- The file coordregistry-impl.h must be updated to reflect the new coordinate system (the file itself contains instructions on how to do this).
- A corresponding specialisation of NormalInfo<> must be defined, typically in the same header as the new vector subclass.
- The macro REGINA_NORMAL_SURFACE_FLAVOUR must be added to the beginning of the new vector subclass. This will declare and define various constants, typedefs and virtual functions (see the REGINA_NORMAL_SURFACE_FLAVOUR macro documentation for details).
- Constructors `class(size_t length)` and `class(const NVector<NLargeInteger>& cloneMe)` must be declared and implemented; these will usually just call the corresponding superclass constructors.
- All abstract functions must be implemented, except for those already provided by REGINA_NORMAL_SURFACE_FLAVOUR. Note that coordinate functions such as getTriangleCoord() must return the total number of discs of the requested type; if your new coordinate system adorns discs with extra information (such as orientation) then your implementation must compute the appropriate sum.
- The orientation-specific coordinate functions getOrientedTriangleCoord() and getOrientedQuadCoord() must be implemented if your coordinate system supports transverse orientation. Otherwise you can use the default implementations (which returns zero).
- Static public functions `void makeZeroVector(const NTriangulation*)`, `NMatrixInt* makeMatchingEquations(const NTriangulation*)` and makeEmbeddedConstraints(const NTriangulation*) must be declared and implemented.

Todo:
  Optimise (long-term): Investigate using sparse vectors for storage.

Python:
  Not present.

## Constructor & Destructor Documentation

regina::NNormalSurfaceVector::NNormalSurfaceVector | ( | size_t | length | ) |

inline

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

Parameters

  length | the number of elements in the new vector.

regina::NNormalSurfaceVector::NNormalSurfaceVector | ( | const NVector< NLargeInteger > & | cloneMe | ) |

inline

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

Parameters

  cloneMe | the vector to clone.

regina::NNormalSurfaceVector::~NNormalSurfaceVector | ( |  | ) |

inline virtual

A virtual destructor.

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

## Member Function Documentation

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

inline inherited

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

Precondition
  This and the given vector have the same size.

Parameters

  other | the vector a multiple of which will be added to this vector.
  multiple | the multiple of other to be added to this vector.

virtual bool regina::NNormalSurfaceVector::allowsAlmostNormal | ( |  | ) | const

pure virtual

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 virtual

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 virtual

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 virtual

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

inline inherited

Returns the sum of all elements of this vector.

Returns
  the sum of the elements of this vector.

virtual NLargeInteger regina::NNormalSurfaceVector::getEdgeWeight | ( | unsigned long | edgeIndex,
|  | const NTriangulation * | triang
| ) |  | const

pure virtual

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

See NNormalSurface::getEdgeWeight() for further details.

Parameters

  edgeIndex | the index in the triangulation of the edge in which we are interested; this should be between 0 and NTriangulation::getNumberOfEdges()-1 inclusive.
  triang | the triangulation in which this normal surface lives.

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

Implemented in regina::NNormalSurfaceVectorMirrored, regina::NNormalSurfaceVectorOriented, regina::NNormalSurfaceVectorANStandard, and regina::NNormalSurfaceVectorStandard.

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

inline

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

  triIndex | the index in the triangulation of the triangle in which we are interested; this should be between 0 and NTriangulation::getNumberOfTriangles()-1 inclusive.
  triVertex | the 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.
  triang | the triangulation in which this normal surface lives.

Returns
  the number of times this normal surface intersect the given triangle with the given arc type.

virtual NLargeInteger regina::NNormalSurfaceVector::getOctCoord | ( | unsigned long | tetIndex,
|  | int | octType,
|  | const NTriangulation * | triang
| ) |  | const

pure virtual

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

See NNormalSurface::getOctCoord() for further details.

Parameters

  tetIndex | the index in the triangulation of the tetrahedron in which the requested octagons reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
  octType | the number of the vertex splitting that this octagon type represents; this should be between 0 and 2 inclusive.
  triang | the triangulation in which this normal surface lives.

Returns
  the number of octagonal discs of the given type.

Implemented in regina::NNormalSurfaceVectorMirrored, regina::NNormalSurfaceVectorOrientedQuad, regina::NNormalSurfaceVectorOriented, regina::NNormalSurfaceVectorANStandard, regina::NNormalSurfaceVectorQuad, and regina::NNormalSurfaceVectorStandard.

virtual NLargeInteger regina::NNormalSurfaceVector::getOrientedQuadCoord | ( | unsigned long | tetIndex,
|  | int | quadType,
|  | const NTriangulation * | triang,
|  | bool | orientation
| ) |  | const

virtual

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

  tetIndex | the index in the triangulation of the tetrahedron in which the requested quadrilaterals reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
  quadType | the number of the vertex splitting that this quad type represents; this should be between 0 and 2 inclusive.
  triang | the triangulation in which this normal surface lives.
  orientation | the orientation of the normal discs.

Returns
  the number of quadrilateral discs of the given type.

Reimplemented in regina::NNormalSurfaceVectorMirrored, regina::NNormalSurfaceVectorOrientedQuad, and regina::NNormalSurfaceVectorOriented.

virtual NLargeInteger regina::NNormalSurfaceVector::getOrientedTriangleCoord | ( | unsigned long | tetIndex,
|  | int | vertex,
|  | const NTriangulation * | triang,
|  | bool | orientation
| ) |  | const

virtual

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

  tetIndex | the index in the triangulation of the tetrahedron in which the requested triangles reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
  vertex | the vertex of the given tetrahedron around which the requested triangles lie; this should be between 0 and 3 inclusive.
  triang | the triangulation in which this normal surface lives.
  orientation | the orientation of the normal discs.

Returns
  the number of triangular discs of the given type.

Reimplemented in regina::NNormalSurfaceVectorMirrored, and regina::NNormalSurfaceVectorOriented.

virtual NLargeInteger regina::NNormalSurfaceVector::getQuadCoord | ( | unsigned long | tetIndex,
|  | int | quadType,
|  | const NTriangulation * | triang
| ) |  | const

pure virtual

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

See NNormalSurface::getQuadCoord() for further details.

Parameters

  tetIndex | the index in the triangulation of the tetrahedron in which the requested quadrilaterals reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
  quadType | the number of the vertex splitting that this quad type represents; this should be between 0 and 2 inclusive.
  triang | the triangulation in which this normal surface lives.

Returns
  the number of quadrilateral discs of the given type.

Implemented in regina::NNormalSurfaceVectorMirrored, regina::NNormalSurfaceVectorOrientedQuad, regina::NNormalSurfaceVectorANStandard, regina::NNormalSurfaceVectorOriented, and regina::NNormalSurfaceVectorStandard.

virtual NLargeInteger regina::NNormalSurfaceVector::getTriangleArcs | ( | unsigned long | triIndex,
|  | int | triVertex,
|  | const NTriangulation * | triang
| ) |  | const

pure virtual

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

  triIndex | the index in the triangulation of the triangle in which we are interested; this should be between 0 and NTriangulation::getNumberOfTriangles()-1 inclusive.
  triVertex | the 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.
  triang | the triangulation in which this normal surface lives.

Returns
  the number of times this normal surface intersect the given triangle with the given arc type.

Implemented in regina::NNormalSurfaceVectorMirrored, regina::NNormalSurfaceVectorOriented, regina::NNormalSurfaceVectorANStandard, and regina::NNormalSurfaceVectorStandard.

virtual NLargeInteger regina::NNormalSurfaceVector::getTriangleCoord | ( | unsigned long | tetIndex,
|  | int | vertex,
|  | const NTriangulation * | triang
| ) |  | const

pure virtual

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

See NNormalSurface::getTriangleCoord() for further details.

Parameters

  tetIndex | the index in the triangulation of the tetrahedron in which the requested triangles reside; this should be between 0 and NTriangulation::getNumberOfTetrahedra()-1 inclusive.
  vertex | the vertex of the given tetrahedron around which the requested triangles lie; this should be between 0 and 3 inclusive.
  triang | the triangulation in which this normal surface lives.

Returns
  the number of triangular discs of the given type.

Implemented in regina::NNormalSurfaceVectorMirrored, regina::NNormalSurfaceVectorANStandard, regina::NNormalSurfaceVectorOriented, and regina::NNormalSurfaceVectorStandard.

virtual bool regina::NNormalSurfaceVector::hasMultipleOctDiscs | ( | const NTriangulation * | triang | ) | const

virtual

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

  triang | the 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

virtual

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

  triang | the 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

virtual

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

  triang | the 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

virtual

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

  triang | the 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

virtual

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

  triang | the triangulation in which this normal surface lives.

Returns
  a pair containing the edge(s) linked by this surface, as described above.

virtual const NVertex* regina::NNormalSurfaceVector::isVertexLink | ( | const NTriangulation * | triang | ) | const

virtual

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

  triang | the 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 in regina::NNormalSurfaceVectorOrientedQuad, regina::NNormalSurfaceVectorQuadOct, and regina::NNormalSurfaceVectorQuad.

virtual bool regina::NNormalSurfaceVector::isVertexLinking | ( | const NTriangulation * | triang | ) | const

virtual

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

  triang | the triangulation in which this normal surface lives.

Returns
  `true` if and only if the normal surface represented is vertex linking.

static NEnumConstraintList* regina::NNormalSurfaceVector::makeEmbeddedConstraints | ( | const NTriangulation * | triangulation | ) |

static

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

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

Parameters

  triangulation | the triangulation upon which these validity constraints will be based.

Returns
  a newly allocated set of constraints.

static NMatrixInt* regina::NNormalSurfaceVector::makeMatchingEquations | ( | const NTriangulation * | triangulation | ) |

static

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

See regina::makeMatchingEquations() for further details.

Parameters

  triangulation | the triangulation upon which these matching equations will be based.

Returns
  a newly allocated set of matching equations.

static NNormalSurfaceVector* regina::NNormalSurfaceVector::makeZeroVector | ( | const NTriangulation * | triangulation | ) |

static

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

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

See regina::makeZeroVector() for further details.

Parameters

  triangulation | the triangulation upon which the underlying coordinate system is based.

Returns
  a new zero vector of the correct class and length.

void regina::NRay::negate | ( |  | ) |

inline inherited

Negates every element of this vector.

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

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

inline inherited

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

inline inherited

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

Precondition
  This and the given vector have the same size.

Parameters

  other | the 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 | ) |

inline inherited

Multiplies this vector by the given scalar.

Parameters

  factor | the scalar with which this will be multiplied.

void regina::NVector< NLargeInteger >::operator+= | ( | const NVector< NLargeInteger > & | other | ) |

inline inherited

Adds the given vector to this vector.

Precondition
  This and the given vector have the same size.

Parameters

  other | the vector to add to this vector.

void regina::NVector< NLargeInteger >::operator-= | ( | const NVector< NLargeInteger > & | other | ) |

inline inherited

Subtracts the given vector from this vector.

Precondition
  This and the given vector have the same size.

Parameters

  other | the vector to subtract from this vector.

bool regina::NVector< NLargeInteger >::operator== | ( | const NVector< NLargeInteger > & | compare | ) | const

inline inherited

Determines if this vector is equal to the given vector.

Precondition
  This and the given vector have the same size.

Parameters

  compare | the 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

inline inherited

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

  index | the 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
| ) |  |

inline inherited

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

Precondition
  `index` is between 0 and size()-1 inclusive.

Parameters

  index | the vector index to examine.
  value | the new value to assign to the element.

Returns
  the vector element at the given index.

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

inline inherited

Returns the number of elements in the vector.

Returns
  the vector size.

void regina::NVector< NLargeInteger >::subtractCopies | ( | const NVector< NLargeInteger > & | other,
|  | const NLargeInteger & | multiple
| ) |  |

inline inherited

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

Precondition
  This and the given vector have the same size.

Parameters

  other | the vector a multiple of which will be subtracted from this vector.
  multiple | the multiple of other to be subtracted from this vector.

## Member Data Documentation

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

protected inherited

The internal array containing all vector elements.

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

protected inherited

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

static inherited

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

static inherited

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

static inherited

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:

- surfaces/nnormalsurface.h

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