Regina Calculation Engine
|
A vector of integers used to indirectly store the individual angles in an angle structure. More...
#include <angle/nanglestructure.h>
Public Member Functions | |
NAngleStructureVector (size_t length) | |
Creates a new vector all of whose entries are initialised to zero. More... | |
NAngleStructureVector (const NVector< NLargeInteger > &cloneMe) | |
Creates a new vector that is a clone of the given vector. 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 NMatrixInt * | makeAngleEquations (const NTriangulation *tri) |
Creates a new set of angle structure equations for the given triangulation. 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 vector of integers used to indirectly store the individual angles in an angle structure.
This vector will contain one member per angle plus a final scaling member; to obtain the actual angle in the angle structure one should divide the corresonding angle member by the scaling member and then multiply by pi.
The reason for using this obfuscated representation is so we can use the NDoubleDescription vertex enumeration routines to calculate vertex angle structures.
If there are t tetrahedra in the underlying triangulation, there will be precisely 3t+1 elements in this vector. The first three elements will be the angle members for the first tetrahedron, the next three for the second tetrahedron and so on. For each tetraheron, the three individual elements are the angle members for vertex splittings 0, 1 and 2 (see NAngleStructure::getAngle()). The final element of the vector is the scaling member as described above.
|
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. |
|
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. |
|
inlineinherited |
Returns the sum of all elements of this vector.
|
static |
Creates a new set of angle structure equations for the given triangulation.
Each equation will be represented as a row of the matrix, and each column will represent a coordinate in the underlying coordinate system (which is described in the NAngleStructureVector class notes).
The returned matrix will be newly allocated and its destruction will be the responsibility of the caller of this routine.
tri | the triangulation upon which these angle structure equations will be 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 |
Returns the element at the given index in the vector.
A constant reference to the element is returned; the element may not be altered.
index
is between 0 and size()-1 inclusive.index | the vector index to examine. |
|
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. |
|
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!