Sparse Class Reference

The Sparse class. More...

#include <matpackII.h>

Inheritance diagram for Sparse:

SparseView

List of all members.

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.


Detailed Description

The Sparse class.

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.


Constructor & Destructor Documentation

Sparse::Sparse (  )  [inline]

Default constructor.

Definition at line 242 of file matpackII.h.

Sparse::Sparse ( Index  r,
Index  c 
) [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.


The documentation for this class was generated from the following file:

Generated on Wed Feb 4 08:17:37 2009 for ARTS by  doxygen 1.5.6