Regina Calculation Engine
|
A normal hypersurface vector that is mirrored in another coordinate system to avoid frequent lengthy calculations. More...
#include <hypersurface/nhsmirrored.h>
Public Member Functions | |
NNormalHypersurfaceVectorMirrored (size_t length) | |
Creates a new vector all of whose entries are initialised to zero. More... | |
NNormalHypersurfaceVectorMirrored (const NVector< NLargeInteger > &cloneMe) | |
Creates a new vector that is a clone of the given vector. More... | |
NNormalHypersurfaceVectorMirrored (const NNormalHypersurfaceVectorMirrored &cloneMe) | |
Creates a new vector that is a clone of the given vector. More... | |
virtual | ~NNormalHypersurfaceVectorMirrored () |
Destroys this vector and its mirror if appropriate. More... | |
virtual NNormalHypersurfaceVector * | makeMirror (const Dim4Triangulation *triang) const =0 |
Creates a new mirror vector corresponding to this vector. More... | |
virtual NLargeInteger | tetrahedra (size_t pentIndex, int vertex, const Dim4Triangulation *triang) const |
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 |
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 |
Returns the number of times this normal hypersurface crosses the given edge. More... | |
virtual NNormalHypersurfaceVector * | clone () 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 Dim4Vertex * | isVertexLink (const Dim4Triangulation *triang) const |
Determines if a rational multiple of the normal hypersurface represented is the link of a single vertex. More... | |
virtual const Dim4Edge * | isThinEdgeLink (const Dim4Triangulation *triang) const |
Determines if a rational multiple of the normal hypersurface represented is the thin link of a single 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 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 NNormalHypersurfaceVector * | makeZeroVector (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 NMatrixInt * | makeMatchingEquations (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 NEnumConstraintList * | makeEmbeddedConstraints (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 | |
NLargeInteger * | elements |
The internal array containing all vector elements. More... | |
NLargeInteger * | end |
A pointer just beyond the end of the internal array. More... | |
A normal hypersurface 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 tetrahedron-prism 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.
Once the first coordinate lookup has taken place (via tetrahedra() or the like), this vector may not change! The mirror will be created at this point and will not change, so if the native coordinates change further then any requests passed to the mirror will return incorrect results.
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 the routine makeMirror() which creates the alternate mirror vector from this vector.
Note that cloning a vector of this class will not clone the mirror. Thus a clone may be safely modified before its first coordinate lookup routine is called.
|
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. |
|
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.
|
inlineinherited |
Adds the given multiple of the given vector to this vector.
other | the vector a multiple of which will be added to this vector. |
multiple | the multiple of other to be added to this vector. |
|
pure virtualinherited |
Creates a newly allocated clone of this vector.
The clone will be of the same subclass of NNormalHypersurfaceVector as this vector.
|
inlinevirtual |
Returns the number of times this normal hypersurface crosses the given edge.
See NNormalHypersurface::edgeWeight() for further details.
edgeIndex | the index in the triangulation of the edge in which we are interested; this should be between 0 and Dim4Triangulation::countEdges()-1 inclusive. |
triang | the triangulation in which this normal hypersurface lives. |
Implements regina::NNormalHypersurfaceVector.
|
inlineinherited |
Returns the sum of all elements of this vector.
|
virtualinherited |
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.
triang | the triangulation in which this normal hypersurface lives. |
true
if and only if the normal hypersurface represented is compact.
|
virtualinherited |
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.
triang | the triangulation in which this normal hypersurface lives. |
|
virtualinherited |
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.
triang | the triangulation in which this normal hypersurface lives. |
|
virtualinherited |
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.
triang | the triangulation in which this normal hypersurface lives. |
true
if and only if the normal hypersurface represented is vertex linking.
|
staticinherited |
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.
triangulation | the triangulation upon which these validity constraints will be based. |
|
staticinherited |
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.
triangulation | the triangulation upon which these matching equations will be based. |
|
pure virtual |
Creates a new mirror vector corresponding to this vector.
The mirror vector should represent the same normal hypersurface as this vector, and should have fast coordinate lookup routines (tetrahedra(), prisms() and so on). It is recommended that the mirror vector be of the class NNormalHypersurfaceVectorStandard.
triang | the triangulation in which this normal hypersurface lives. |
|
staticinherited |
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.
triangulation | the triangulation upon which the underlying coordinate system is based. |
|
inlineinherited |
Negates every element of this vector.
This is an optimised implementation that overrides NVector<NLargeInteger>::negate().
|
inlineinherited |
Returns the norm of this vector.
This is the dot product of the vector with itself.
|
inlineinherited |
Calculates the dot product of this vector and the given vector.
other | the vector with which this will be multiplied. |
|
inlineinherited |
Multiplies this vector by the given scalar.
factor | the scalar with which this will be multiplied. |
|
inlineinherited |
Adds the given vector to this vector.
other | the vector to add to this vector. |
|
inlineinherited |
Subtracts the given vector from this vector.
other | the vector to subtract from this vector. |
|
inlineinherited |
Determines if this vector is equal to the given vector.
compare | the vector with which this will be compared. |
true
if and only if the this and the given vector are equal.
|
inlineinherited |
|
inlinevirtual |
Returns the number of prism pieces of the given type in this normal hypersurface.
See NNormalHypersurface::prisms() for further details.
pentIndex | the index in the triangulation of the pentachoron in which the requested prism pieces reside; this should be between 0 and Dim4Triangulation::size()-1 inclusive. |
prismType | specifies the edge of the given pentachoron that this prism separates from the opposite triangle; this should be between 0 and 9 inclusive. |
triang | the triangulation in which this normal hypersurface lives. |
Implements regina::NNormalHypersurfaceVector.
|
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.
|
inlineinherited |
Sets the element at the given index in the vector to the given value.
index
is between 0 and size()-1 inclusive.index | the vector index to examine. |
value | the new value to assign to the element. |
|
inlineinherited |
Returns the number of elements in the vector.
|
inlineinherited |
Subtracts the given multiple of the given vector to this vector.
other | the vector a multiple of which will be subtracted from this vector. |
multiple | the multiple of other to be subtracted from this vector. |
|
inlinevirtual |
Returns the number of tetrahedron pieces of the given type in this normal hypersurface.
See NNormalHypersurface::tetrahedra() for further details.
pentIndex | the index in the triangulation of the pentachoron in which the requested tetrahedron pieces reside; this should be between 0 and Dim4Triangulation::size()-1 inclusive. |
vertex | the vertex of the given pentachoron around which the requested tetrahedron pieces lie; this should be between 0 and 4 inclusive. |
triang | the triangulation in which this normal hypersurface lives. |
Implements regina::NNormalHypersurfaceVector.
|
protectedinherited |
The internal array containing all vector elements.
|
protectedinherited |
A pointer just beyond the end of the internal array.
The size of the vector can be computed as (end - elements).
|
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!
|
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!
|
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!