#include <nmatrix.h>
Inheritance diagram for regina::NMatrix< T >:
Public Member Functions | |
NMatrix (unsigned long rows, unsigned long cols) | |
Creates a new matrix of the given size. | |
NMatrix (const NMatrix &cloneMe) | |
Creates a new matrix that is a clone of the given matrix. | |
virtual | ~NMatrix () |
Destroys this matrix. | |
void | initialise (const T &value) |
Sets every entry in the matrix to the given value. | |
unsigned long | rows () const |
Returns the number of rows in this matrix. | |
unsigned long | columns () const |
Returns the number of columns in this matrix. | |
T & | entry (unsigned long row, unsigned long column) |
Returns the entry at the given row and column. | |
const T & | entry (unsigned long row, unsigned long column) const |
Returns the entry at the given row and column. | |
virtual void | writeMatrix (std::ostream &out) const |
Writes a complete representation of the matrix to the given output stream. | |
void | swapRows (unsigned long first, unsigned long second) |
Swaps the elements of the two given rows in the matrix. | |
void | swapColumns (unsigned long first, unsigned long second) |
Swaps the elements of the two given columns in the matrix. | |
Protected Attributes | |
unsigned long | nRows |
The number of rows in the matrix. | |
unsigned long | nCols |
The number of columns in the matrix. | |
T ** | data |
The actual entries in the matrix. |
=
) operator.
An element t of type T can be written to an output stream out using the standard expression out << t
.
|
Creates a new matrix of the given size. All entries will be initialised using their default constructors.
|
|
Creates a new matrix that is a clone of the given matrix.
|
|
Destroys this matrix.
|
|
Returns the number of columns in this matrix.
|
|
Returns the entry at the given row and column. Rows and columns are numbered beginning at zero.
|
|
Returns the entry at the given row and column. Rows and columns are numbered beginning at zero.
|
|
Sets every entry in the matrix to the given value.
|
|
Returns the number of rows in this matrix.
|
|
Swaps the elements of the two given columns in the matrix.
|
|
Swaps the elements of the two given rows in the matrix.
|
|
Writes a complete representation of the matrix to the given output stream. Each row will be written on a separate line with elements in each row separated by single spaces.
|
|
The actual entries in the matrix.
|
|
The number of columns in the matrix.
|
|
The number of rows in the matrix.
|