#include <nvectordense.h>
Inheritance diagram for regina::NVectorDense< T >:
Public Member Functions | |
NVectorDense (unsigned newVectorSize) | |
Creates a new vector. | |
NVectorDense (unsigned newVectorSize, const T &initValue) | |
Creates a new vector and initialises every element to the given value. | |
NVectorDense (const NVector< T > &cloneMe) | |
Creates a new vector that is a clone of the given vector. | |
NVectorDense (const NVectorDense< T > &cloneMe) | |
Creates a new vector that is a clone of the given vector. | |
virtual | ~NVectorDense () |
Destroys this vector. | |
virtual NVector< T > * | clone () const |
Makes a newly allocated clone of this vector. | |
virtual unsigned | size () const |
Returns the number of elements in the vector. | |
virtual const T & | operator[] (unsigned index) const |
Returns the element at the given index in the vector. | |
virtual void | setElement (unsigned index, const T &value) |
Sets the element at the given index in the vector to the given value. | |
virtual void | operator= (const NVector< T > &cloneMe) |
Sets this vector equal to the given vector. | |
virtual void | operator+= (const NVector< T > &other) |
Adds the given vector to this vector. | |
virtual void | operator-= (const NVector< T > &other) |
Subtracts the given vector from this vector. | |
virtual void | operator *= (const T &factor) |
Multiplies this vector by the given scalar. | |
virtual void | negate () |
Negates every element of this vector. | |
virtual void | addCopies (const NVector< T > &other, const T &multiple) |
Adds the given multiple of the given vector to this vector. | |
virtual void | subtractCopies (const NVector< T > &other, const T &multiple) |
Subtracts the given multiple of the given vector to this vector. | |
Protected Attributes | |
T * | elements |
The internal array containing all vector elements. | |
unsigned | vectorSize |
The size of the vector, possibly including zero elements. |
The vector is represented as a simple array on the heap.
|
Creates a new vector. Its elements will not be initialised.
|
|
Creates a new vector and initialises every element to the given value.
|
|
Creates a new vector that is a clone of the given vector.
|
|
Creates a new vector that is a clone of the given vector.
|
|
Destroys this vector.
|
|
Adds the given multiple of the given vector to this vector.
Implements regina::NVector< T >. |
|
Makes a newly allocated clone of this vector. The clone will be of the same subclass of NVector as this vector.
Implements regina::NVector< T >. Reimplemented in regina::NAngleStructureVector, regina::NRay, regina::NNormalSurfaceVectorANStandard, regina::NNormalSurfaceVectorQuad, and regina::NNormalSurfaceVectorStandard. |
|
Negates every element of this vector.
Implements regina::NVector< T >. Reimplemented in regina::NRay. |
|
Multiplies this vector by the given scalar.
Implements regina::NVector< T >. |
|
Adds the given vector to this vector.
Implements regina::NVector< T >. |
|
Subtracts the given vector from this vector.
Implements regina::NVector< T >. |
|
Sets this vector equal to the given vector.
Implements regina::NVector< T >. |
|
Returns the element at the given index in the vector. A constant reference to the element is returned; the element may not be altered.
Implements regina::NVector< T >. |
|
Sets the element at the given index in the vector to the given value.
Implements regina::NVector< T >. |
|
Returns the number of elements in the vector.
Implements regina::NVector< T >. |
|
Subtracts the given multiple of the given vector to this vector.
Implements regina::NVector< T >. |
|
The internal array containing all vector elements.
|
|
The size of the vector, possibly including zero elements.
|