Regina Calculation Engine
|
A normal surface vector that is mirrored in another coordinate system to avoid frequent lengthy calculations. More...
#include <surfaces/nsvectormirrored.h>
Public Member Functions | |
NSVectorMirrored (size_t length) | |
Creates a new vector all of whose entries are initialised to zero. More... | |
NSVectorMirrored (const Vector< LargeInteger > &cloneMe) | |
Creates a new vector that is a clone of the given vector. More... | |
virtual | ~NSVectorMirrored () |
Destroys this vector and its mirror if appropriate. More... | |
virtual NormalSurfaceVector * | makeMirror (const Triangulation< 3 > *triang) const =0 |
Creates a new mirror vector corresponding to this vector. More... | |
virtual void | setElement (size_t index, const LargeInteger &value) override |
Sets the given normal coordinate to the given value. More... | |
virtual void | operator+= (const NormalSurfaceVector &other) override |
Adds the given vector to this vector. More... | |
virtual void | scaleDown () override |
Scales this vector down by the greatest common divisor of all its elements. More... | |
virtual LargeInteger | triangles (size_t tetIndex, int vertex, const Triangulation< 3 > *triang) const override |
Returns the number of triangular discs of the given type in this normal surface. More... | |
virtual LargeInteger | orientedTriangles (size_t tetIndex, int vertex, const Triangulation< 3 > *triang, bool orientation) const override |
Returns the number of oriented triangular discs of the given type in this normal surface. More... | |
virtual LargeInteger | quads (size_t tetIndex, int quadType, const Triangulation< 3 > *triang) const override |
Returns the number of quadrilateral discs of the given type in this normal surface. More... | |
virtual LargeInteger | orientedQuads (size_t tetIndex, int quadType, const Triangulation< 3 > *triang, bool orientation) const override |
Returns the number of oriented quadrilateral discs of the given type in this normal surface. More... | |
virtual LargeInteger | octs (size_t tetIndex, int octType, const Triangulation< 3 > *triang) const override |
Returns the number of octagonal discs of the given type in this normal surface. More... | |
virtual LargeInteger | edgeWeight (size_t edgeIndex, const Triangulation< 3 > *triang) const override |
Returns the number of times this normal surface crosses the given edge. More... | |
virtual LargeInteger | arcs (size_t triIndex, int triVertex, const Triangulation< 3 > *triang) const override |
Returns the number of arcs in which this normal surface intersects the given triangle in the given direction. More... | |
const Ray & | coords () const |
Gives read-only access to the underlying vector of coordinates. More... | |
virtual NormalSurfaceVector * | clone () const =0 |
Creates a newly allocated clone of this vector. More... | |
size_t | size () const |
Returns the number of coordinates in the underlying vector. More... | |
const NLargeInteger & | operator[] (size_t index) const |
Returns the given coordinate from the underlying 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 Triangulation< 3 > *triang) const |
Determines if this normal surface has more than one octagonal disc. More... | |
virtual bool | isCompact (const Triangulation< 3 > *triang) const |
Determines if the normal surface represented is compact (has finitely many discs). More... | |
virtual bool | isVertexLinking (const Triangulation< 3 > *triang) const |
Determines if the normal surface represented is vertex linking. More... | |
virtual const Vertex< 3 > * | isVertexLink (const Triangulation< 3 > *triang) const |
Determines if a rational multiple of the normal surface represented is the link of a single vertex. More... | |
virtual std::pair< const Edge< 3 > *, const Edge< 3 > * > | isThinEdgeLink (const Triangulation< 3 > *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 Triangulation< 3 > *triang) const |
Determines if the normal surface represented is a splitting surface in the given triangulation. More... | |
virtual LargeInteger | isCentral (const Triangulation< 3 > *triang) const |
Determines if the normal surface represented is a central surface in the given triangulation. More... | |
Static Public Member Functions | |
static NormalSurfaceVector * | makeMirror (const Ray &original, const Triangulation< 3 > *triang) |
Creates a new mirror vector corresponding to the given vector. More... | |
static NormalSurfaceVector * | makeZeroVector (const Triangulation< 3 > *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 NormalSurfaceVector. More... | |
static MatrixInt * | makeMatchingEquations (const Triangulation< 3 > *triangulation) |
Creates a new set of normal surface matching equations for the given triangulation using the coordinate system corresponding to this particular subclass of NormalSurfaceVector. More... | |
static EnumConstraints * | makeEmbeddedConstraints (const Triangulation< 3 > *triangulation) |
Creates a new set of validity constraints representing the condition that normal surfaces be embedded. More... | |
Protected Attributes | |
Ray | coords_ |
The raw vector of normal coordinates. More... | |
A normal surface vector that is mirrored in another coordinate system to avoid frequent lengthy calculations.
When it is difficult to convert from the native coordinate system to standard tri-quad-oct coordinates, use this as a base class. The conversion of the entire vector will be done once only, and future coordinate lookups will be performed through the pre-converted mirror vector.
Subclasses need not implement any of the coordinate lookup routines. The default implementation will be to pass the lookup to the mirror. If any particular lookup can be done more efficiently in the native coordinate system, the corresponding routine should be overridden.
Subclasses must however implement two variants of makeMirror():
|
inline |
Creates a new vector all of whose entries are initialised to zero.
length | the number of elements in the new vector. |
|
inline |
Creates a new vector that is a clone of the given vector.
cloneMe | the vector to clone. |
|
inlinevirtual |
Destroys this vector and its mirror if appropriate.
|
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.
true
if and only if almost normal surfaces are allowed.
|
pure virtualinherited |
Determines if the specific underlying coordinate system allows for transversely oriented normal surfaces.
true
if and only if transverse orientations are supported.
|
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.
true
if and only if spun-normal surfaces are allowed.
|
inlineoverridevirtual |
Returns the number of arcs in which this normal surface intersects the given triangle in the given direction.
See NormalSurface::arcs() for further details.
triIndex | the index in the triangulation of the triangle in which we are interested; this should be between 0 and Triangulation<3>::countTriangles()-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. |
Implements regina::NormalSurfaceVector.
|
pure virtualinherited |
Creates a newly allocated clone of this vector.
The clone will be of the same subclass of NormalSurfaceVector as this vector.
|
inlineinherited |
Gives read-only access to the underlying vector of coordinates.
|
inlineoverridevirtual |
Returns the number of times this normal surface crosses the given edge.
See NormalSurface::edgeWeight() for further details.
edgeIndex | the index in the triangulation of the edge in which we are interested; this should be between 0 and Triangulation<3>::countEdges()-1 inclusive. |
triang | the triangulation in which this normal surface lives. |
Implements regina::NormalSurfaceVector.
|
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 NormalSurfaceVector 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.
triang | the triangulation in which this normal surface lives. |
true
if and only if there is an octagonal disc type present and its coordinate is greater than one.
|
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 NormalSurfaceVector should override this if they can provide a faster implementation.
triang | the triangulation in which this normal surface lives. |
|
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 NormalSurfaceVector should override this if they can provide a faster implementation.
triang | the triangulation in which this normal surface lives. |
true
if and only if the normal surface represented is compact.
|
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 NormalSurfaceVector should override this if they can provide a faster implementation.
triang | the triangulation in which this normal surface lives. |
true
if and only if the normal surface represented is a splitting surface.
|
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 NormalSurfaceVector should override this if they can provide a faster implementation.
triang | the triangulation in which this normal surface lives. |
|
virtualinherited |
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 NormalSurfaceVector should override this if they can provide a faster implementation.
triang | the triangulation in which this normal surface lives. |
Reimplemented in regina::NSVectorOrientedQuad, regina::NSVectorQuadOct, and regina::NSVectorQuad.
|
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 NormalSurfaceVector should override this if they can provide a faster implementation.
triang | the triangulation in which this normal surface lives. |
true
if and only if the normal surface represented is vertex linking.
|
staticinherited |
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 NormalSurfaceVector.
triangulation | the triangulation upon which these validity constraints will be based. |
|
staticinherited |
Creates a new set of normal surface matching equations for the given triangulation using the coordinate system corresponding to this particular subclass of NormalSurfaceVector.
See regina::makeMatchingEquations() for further details.
triangulation | the triangulation upon which these matching equations will be based. |
|
pure virtual |
Creates a new mirror vector corresponding to this vector.
This function must return a newly created vector that describes this normal surface in the corresponding "standard" coordinate system (i.e., NSVectorStandard if this subclass is NSVectorQuad, or NSVectorANStandard if this subclass is NSVectorQuadOct, and so on.)
Typically subclasses should implement this function by calling the corresponding static makeMirror() function, which does the real work.
triang | the triangulation in which this normal surface lives. |
Implemented in regina::NSVectorOrientedQuad, regina::NSVectorQuadOct, and regina::NSVectorQuad.
|
static |
Creates a new mirror vector corresponding to the given vector.
This function should be implemented by each subclass of NSVectorMirrored.
This function must return a newly created vector that describes the given normal surface in a different coordinate system:
original | a vector in the coordinate system corresponding to the subclass in which this function is implemented. |
triang | the triangulation in which the corresponding normal surface lives. |
|
staticinherited |
Returns a new normal surface vector of the appropriate length for the given triangulation and for the coordinate system corresponding to this subclass of NormalSurfaceVector.
All elements of the new vector will be initialised to zero.
See regina::makeZeroVector() for further details.
triangulation | the triangulation upon which the underlying coordinate system is based. |
|
inlineoverridevirtual |
Returns the number of octagonal discs of the given type in this normal surface.
See NormalSurface::octs() for further details.
tetIndex | the index in the triangulation of the tetrahedron in which the requested octagons reside; this should be between 0 and Triangulation<3>::size()-1 inclusive. |
octType | the type of this octagon in the given tetrahedron; this should be 0, 1 or 2. |
triang | the triangulation in which this normal surface lives. |
Implements regina::NormalSurfaceVector.
Reimplemented in regina::NSVectorOrientedQuad, and regina::NSVectorQuad.
|
inlineoverridevirtual |
Adds the given vector to this vector.
This behaves correctly in the case where other is this.
The default implementation simply adds the coordinates of the underlying vectors. Subclasses should reimplement this if they carry any additional information that also needs adjusting.
other | the vector to add to this vector. |
Reimplemented from regina::NormalSurfaceVector.
|
inlineinherited |
|
inlineoverridevirtual |
Returns the number of oriented quadrilateral discs of the given type in this normal surface.
See NormalSurface::orientedQuads() for further details.
The default implementation of this routine returns zero, which is suitable for coordinate systems that do not support transverse orientation.
tetIndex | the index in the triangulation of the tetrahedron in which the requested quadrilaterals reside; this should be between 0 and Triangulation<3>::size()-1 inclusive. |
quadType | the type of this quadrilateral in the given tetrahedron; this should be 0, 1 or 2. |
triang | the triangulation in which this normal surface lives. |
orientation | the orientation of the normal discs. |
Reimplemented from regina::NormalSurfaceVector.
Reimplemented in regina::NSVectorOrientedQuad.
|
inlineoverridevirtual |
Returns the number of oriented triangular discs of the given type in this normal surface.
See NormalSurface::orientedTriangles() for further details.
The default implementation of this routine returns zero, which is suitable for coordinate systems that do not support transverse orientation.
tetIndex | the index in the triangulation of the tetrahedron in which the requested triangles reside; this should be between 0 and Triangulation<3>::size()-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. |
Reimplemented from regina::NormalSurfaceVector.
|
inlineoverridevirtual |
Returns the number of quadrilateral discs of the given type in this normal surface.
See NormalSurface::quads() for further details.
tetIndex | the index in the triangulation of the tetrahedron in which the requested quadrilaterals reside; this should be between 0 and Triangulation<3>::size()-1 inclusive. |
quadType | the type of this quadrilateral in the given tetrahedron; this should be 0, 1 or 2. |
triang | the triangulation in which this normal surface lives. |
Implements regina::NormalSurfaceVector.
Reimplemented in regina::NSVectorOrientedQuad.
|
inlineoverridevirtual |
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 poses no problem for vectors containing infinite elements; such elements are simply ignored and left at infinity.
The default implementation simply scales down the underlying vector. Subclasses should reimplement this if they carry any additional information that also needs adjusting.
Reimplemented from regina::NormalSurfaceVector.
|
inlineoverridevirtual |
Sets the given normal coordinate to the given value.
The default implementation simply sets the coordinate in the underlying vector. Subclasses should reimplement this if they carry any additional information that also need adjusting.
index | the index of the coordinate to set; this must be between 0 and size()-1 inclusive. |
value | the new value to assign to the given coordinate. |
Reimplemented from regina::NormalSurfaceVector.
|
inlineinherited |
Returns the number of coordinates in the underlying vector.
|
inlineoverridevirtual |
Returns the number of triangular discs of the given type in this normal surface.
See NormalSurface::triangles() for further details.
tetIndex | the index in the triangulation of the tetrahedron in which the requested triangles reside; this should be between 0 and Triangulation<3>::size()-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. |
Implements regina::NormalSurfaceVector.
|
protectedinherited |
The raw vector of normal coordinates.