ARTS
1.0.222
|
The implementation of a sparse matrix. More...
#include <matpackII.h>
Public Member Functions | |
Index | nrows () const |
Returns the number of rows. More... | |
Index | ncols () const |
Returns the number of columns. More... | |
Index | nnz () const |
Returns the number of nonzero elements. More... | |
Numeric & | rw (Index r, Index c) |
Plain index operator. More... | |
Numeric | ro (Index r, Index c) const |
Plain const index operator. More... | |
Protected Member Functions | |
SparseView () | |
Default constructor. More... | |
SparseView (std::vector< Numeric > *data, std::vector< Index > *rowind, std::vector< Index > *colptr, const Range &rr, const Range &cr) | |
Explicit constructor. More... | |
Protected Attributes | |
std::vector< Numeric > * | mdata |
The actual data values. More... | |
std::vector< Index > * | mrowind |
Row indices. More... | |
std::vector< Index > * | mcolptr |
Pointers to first data element for each column. More... | |
Index | mnr |
Number of rows. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const SparseView &v) |
The implementation of a sparse matrix.
Class Sparse is derived from this one. It also allocates storage.
The chosen storage format is the ‘compressed column’ format. This is the same format used by Matlab. See Matlab User Guide for a description.
Definition at line 41 of file matpackII.h.
|
inlineprotected |
Default constructor.
This is necessary, so that we can have a default constructor for the derived class Sparse.
Definition at line 209 of file matpackII.h.
|
inlineprotected |
Explicit constructor.
This one is used by Matrix to initialize its own SubMatrix part. The row range rr must have a stride to account for the length of one row.
Definition at line 222 of file matpackII.h.
|
inline |
Returns the number of columns.
Definition at line 102 of file matpackII.h.
|
inline |
Returns the number of nonzero elements.
Definition at line 108 of file matpackII.h.
|
inline |
Returns the number of rows.
Definition at line 96 of file matpackII.h.
Plain const index operator.
Definition at line 173 of file matpackII.h.
Plain index operator.
This has to correctly handle two cases:
Definition at line 120 of file matpackII.h.
|
friend |
Definition at line 294 of file matpackII.h.
|
protected |
Pointers to first data element for each column.
Definition at line 70 of file matpackII.h.
|
protected |
The actual data values.
Definition at line 66 of file matpackII.h.
|
protected |
Number of rows.
Definition at line 72 of file matpackII.h.
|
protected |
Row indices.
Definition at line 68 of file matpackII.h.