#include <nvectormatrix.h>
Inheritance diagram for regina::NVectorMatrix< T >:
Public Member Functions | |
NVectorMatrix (const NMatrix< T > &matrix, unsigned whichRowCol) | |
Creates a new vector that refers to the given row or column of the given matrix. | |
virtual NVector< T > * | clone () const |
Makes a newly allocated clone of this vector. | |
virtual void | setElement (unsigned, const T &) |
Sets the element at the given index in the vector to the given value. | |
virtual void | operator= (const NVector< T > &) |
Sets this vector equal to the given vector. | |
virtual void | operator+= (const NVector< T > &) |
Adds the given vector to this vector. | |
virtual void | operator-= (const NVector< T > &) |
Subtracts the given vector from this vector. | |
virtual void | operator *= (const T &) |
Multiplies this vector by the given scalar. | |
virtual void | negate () |
Negates every element of this vector. | |
virtual void | addCopies (const NVector< T > &, const T &) |
Adds the given multiple of the given vector to this vector. | |
virtual void | subtractCopies (const NVector< T > &, const T &) |
Subtracts the given multiple of the given vector to this vector. | |
Protected Attributes | |
const NMatrix< T > & | source |
The matrix to which this row or column belongs. | |
unsigned | rowCol |
The row or column of the matrix that is this vector. |
Such a vector takes up essentially no storage space, since it merely looks up values in the matrix it references. Because of this, it should never be modified! The modification routines (such as =
, +=
and so on) throw an exception when called. It is recommended to declare any matrix vector as const
for a safeguard.
If the matrix upon which this is vector is based should change, the vector will change accordingly. If it is destroyed, the vector will become invalid and should not be used.
Since a cloned vector might be modified, clone() will return a new NVectorDense instead of a new NVectorMatrix.
|
Creates a new vector that refers to the given row or column of the given matrix. The subclass of NVectorMatrix being used will determine if it is a row or a column that we are referencing.
|
|
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 >. |
|
Negates every element of this vector.
Implements regina::NVector< T >. |
|
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 >. |
|
Sets the element at the given index in the vector to the given value.
Implements regina::NVector< T >. |
|
Subtracts the given multiple of the given vector to this vector.
Implements regina::NVector< T >. |
|
The row or column of the matrix that is this vector.
|
|
The matrix to which this row or column belongs.
|