Main Page | Class List | File List | Class Members

CS_ZZ_ICRS< T > Class Template Reference

The zig-zag incremental compressed row storage sparse matrix data structure. More...

#include <CS_ZZ_ICRS.hpp>

Collaboration diagram for CS_ZZ_ICRS< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CS_ZZ_ICRS (const ULI number_of_nonzeros, const ULI number_of_rows, const ULI number_of_cols, T zero)
 Base constructor which only initialises the internal arrays.
 CS_ZZ_ICRS (CS_ZZ_ICRS< T > &toCopy)
 Copy constructor.
 CS_ZZ_ICRS (std::vector< Triplet< T > > &input, const ULI m, const ULI n, const T zero)
 Constructor which transforms a collection of input triplets to CRS format.
T * zax (T *x_orig)
 Calculates and returns z=Ax.
 ~CS_ZZ_ICRS ()
 Base deconstructor.

Static Protected Member Functions

bool compareTriplets (const Triplet< T > &one, const Triplet< T > &two)
 Comparison function used for sorting input data.

Protected Attributes

CS_ELEMENT< ULI > nnz
 Number of non-zeros.
CS_ELEMENT< ULI > nor
 Number of rows.
CS_ELEMENT< ULI > noc
 Number of cols.
CS_ARRAY< T > * nzs
 Array containing the actual nnz non-zeros.
CS_ARRAY< ULI > * c_ind
 Array containing the column jumps.
CS_ARRAY< ULI > * r_ind
 Array containing the row jumps.
CS_ELEMENT< T > zero_element
 Which element is considered as zero.

Detailed Description

template<typename T>
class CS_ZZ_ICRS< T >

The zig-zag incremental compressed row storage sparse matrix data structure.


Constructor & Destructor Documentation

template<typename T>
CS_ZZ_ICRS< T >::CS_ZZ_ICRS const ULI  number_of_nonzeros,
const ULI  number_of_rows,
const ULI  number_of_cols,
zero
[inline]
 

Base constructor which only initialises the internal arrays.

Note that to gain a valid CRS structure, these arrays have to be filled by some external mechanism (i.e., after calling this constructor, the internal arrays contain garbage, resuling in invalid datastructure).

Parameters:
number_of_nonzeros The number of non-zeros of the matrix to be stored.
number_of_rows The number of rows of the matrix to be stored.
number_of_cols The number of columns of the matrix to be stored.
zero Which element is considered to be the zero element.

template<typename T>
CS_ZZ_ICRS< T >::CS_ZZ_ICRS CS_ZZ_ICRS< T > &  toCopy  )  [inline]
 

Copy constructor.

Parameters:
toCopy reference to the CRS datastructure to copy.

template<typename T>
CS_ZZ_ICRS< T >::CS_ZZ_ICRS std::vector< Triplet< T > > &  input,
const ULI  m,
const ULI  n,
const T  zero
[inline]
 

Constructor which transforms a collection of input triplets to CRS format.

The input collection is considered to have at most one triplet with unique pairs of indeces. Unspecified behaviour occurs when this assumption is not met.

Parameters:
input The input collection.
m Number of matrix rows.
n Number of matrix columns.
zero Which element is considered zero.


Member Function Documentation

template<typename T>
T* CS_ZZ_ICRS< T >::zax T *  x_orig  )  [inline]
 

Calculates and returns z=Ax.

The vector x should have appropiately set length; this is not strictly enforced. Bus errors, segmentation faults, the works; one or more of these will occur if dimensions do not make sense. The return array is allocated to length equal to the number of rows in this function.

Parameters:
x_orig The input (dense) x-vector.
Returns:
The matrix-vector multiplication Ax, where A corresponds to the currently stored matrix.


The documentation for this class was generated from the following file:
Generated on Fri Aug 15 18:12:25 2008 for Run-timeCacheSimulator by  doxygen 1.3.9.1