#include <matpackII.h>
Public Member Functions | |
Sparse () | |
Default constructor. | |
Sparse (Index r, Index c) | |
Constructor setting size. | |
Sparse (const Sparse &m) | |
Copy constructor from another Sparse. | |
~Sparse () | |
Destructor for Sparse. |
This is a SparseView that also allocates storage automatically, and deallocates it when it is destroyed. We take all the functionality from SparseView. Just the constructors and the destructor have to be defined separately here, since these are not inherited.
Definition at line 80 of file matpackII.h.
Sparse::Sparse | ( | ) | [inline] |
Constructor setting size.
Elements *mdata and *mrowind have to grow later on, when we add data element. But *mcolptr always has the dimenson of the number of columns of the matrix plus one, so it is allocated directly.
Why is there an extra element in *mcolptr? We store also the index behind* the last element of the last column. Or in other words the starting index that the next column *would* have. This just safes a litle time when computing indices. Also, this corresponds to the number of nonzero elements.
Definition at line 260 of file matpackII.h.
Sparse::Sparse | ( | const Sparse & | m | ) | [inline] |
Copy constructor from another Sparse.
This automatically sets the size and copies the data.
Definition at line 272 of file matpackII.h.
Sparse::~Sparse | ( | ) | [inline] |
Destructor for Sparse.
This is important, since Sparse uses new to allocate storage.
Definition at line 285 of file matpackII.h.