Sleipnir
|
An asymmetric two-dimensional sparse matrix using linked lists for each row. More...
#include <sparsematrix.h>
Data Structures | |
struct | SNode |
Public Member Functions | |
CSparseListMatrix (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. | |
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. | |
size_t | GetRows () const |
Return the number of rows in the matrix. |
An asymmetric two-dimensional sparse matrix using linked lists 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 linked list for each row, allowing very low memory usage (for sufficiently sparse matrices) at the expense of potentially slow lookup.
Definition at line 496 of file sparsematrix.h.
Sleipnir::CSparseListMatrix< tType >::CSparseListMatrix | ( | 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 514 of file sparsematrix.h.
tType Sleipnir::CSparseListMatrix< 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 573 of file sparsematrix.h.
const tType& Sleipnir::CSparseListMatrix< tType >::GetDefault | ( | ) | const [inline] |
Return the default value for entries not in the matrix.
Reimplemented from Sleipnir::CSparseMatrixImpl< tType >.
Definition at line 626 of file sparsematrix.h.
size_t Sleipnir::CSparseListMatrix< tType >::GetRows | ( | ) | const [inline] |
Return the number of rows in the matrix.
Reimplemented from Sleipnir::CSparseMatrixImpl< tType >.
Definition at line 637 of file sparsematrix.h.
void Sleipnir::CSparseListMatrix< tType >::Initialize | ( | size_t | iR | ) | [inline] |
Create a new matrix of the requested size.
iR | Matrix rows. |
Definition at line 547 of file sparsematrix.h.
References Sleipnir::CSparseListMatrix< tType >::Reset().
void Sleipnir::CSparseListMatrix< 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 601 of file sparsematrix.h.