Sleipnir
|
An asymmetric two-dimensional sparse matrix using maps for each row. More...
#include <sparsematrix.h>
Public Member Functions | |
CSparseMapMatrix (const tType &Default) | |
Create a new sparse matrix with the given default value. | |
void | Reset () |
Empties the matrix and deallocates all associated memory. | |
void | Initialize (size_t iR) |
Create a new matrix of the requested size. | |
size_t | GetRows () const |
Return the number of rows in the matrix. | |
tType | Get (size_t iY, size_t iX) const |
Returns the value at the requested matrix position. | |
void | Set (size_t iY, size_t iX, const tType &Value) |
Set the value at the requested matrix position. | |
const tType & | GetDefault () const |
Return the default value for entries not in the matrix. |
An asymmetric two-dimensional sparse matrix using maps for each row.
tType | Type of element contained by the matrix. |
Implements a two-dimensional matrix assuming few non-default entries in each row. These entries are maintained by a map for each row, allowing fairly rapid lookup at the expense of moderate memory usage.
Definition at line 366 of file sparsematrix.h.
Sleipnir::CSparseMapMatrix< tType >::CSparseMapMatrix | ( | const tType & | Default | ) | [inline] |
Create a new sparse matrix with the given default value.
Default | Default value provided for entries not in the matrix. |
Definition at line 375 of file sparsematrix.h.
tType Sleipnir::CSparseMapMatrix< tType >::Get | ( | size_t | iY, |
size_t | iX | ||
) | const [inline] |
Returns the value at the requested matrix position.
iY | Matrix row. |
iX | Matrix column. |
Definition at line 437 of file sparsematrix.h.
const tType& Sleipnir::CSparseMapMatrix< tType >::GetDefault | ( | ) | const [inline] |
Return the default value for entries not in the matrix.
Reimplemented from Sleipnir::CSparseMatrixImpl< tType >.
Definition at line 473 of file sparsematrix.h.
size_t Sleipnir::CSparseMapMatrix< tType >::GetRows | ( | ) | const [inline] |
Return the number of rows in the matrix.
Reimplemented from Sleipnir::CSparseMatrixImpl< tType >.
Definition at line 413 of file sparsematrix.h.
void Sleipnir::CSparseMapMatrix< tType >::Initialize | ( | size_t | iR | ) | [inline] |
Create a new matrix of the requested size.
iR | Matrix rows. |
Definition at line 401 of file sparsematrix.h.
References Sleipnir::CSparseMapMatrix< tType >::Reset().
void Sleipnir::CSparseMapMatrix< tType >::Set | ( | size_t | iY, |
size_t | iX, | ||
const tType & | Value | ||
) | [inline] |
Set the value at the requested matrix position.
iY | Matrix row. |
iX | Matrix column. |
Value | Value to store. |
Definition at line 462 of file sparsematrix.h.