Public Member Functions | Protected Member Functions

gridripper::math::SpM< TD > Class Template Reference

Base class of sparse matrices. More...

#include <spm.h>

Inheritance diagram for gridripper::math::SpM< TD >:
gridripper::math::CooSpM< TD, TI > gridripper::math::CsrSpM< TD, TI > gridripper::math::DiaSpM< TD, TI > gridripper::math::EllSpM< TD, TI >

List of all members.

Public Member Functions

int getNumRows () const
 Gets the number of rows.
int getNumColumns () const
 Gets the number of columns.
virtual int countNonzerosInRow (int row) const =0
 Gets the number of nonzeros in the specified row.
virtual void gmv (TD *y, TD alpha, const TD *x, TD beta, const TD *b) const =0
 General matrix-vector operation.
virtual void toDenseMatrix (TD *mat) const =0
 Converts the sparse matrix to a dense matrix.

Protected Member Functions

 SpM (int nrows, int ncols)
 Creates a sparse matrix with the specified number of rows.
void resize (int nrows, int ncols)

Detailed Description

template<class TD>
class gridripper::math::SpM< TD >

Base class of sparse matrices.

Version:
07/03/2009
Since:
06/30/2009
Author:
Peter Csizmadia

Constructor & Destructor Documentation

template<class TD >
gridripper::math::SpM< TD >::SpM ( int  nrows,
int  ncols 
) [inline, protected]

Creates a sparse matrix with the specified number of rows.

Parameters:
nrows the number of rows
ncols the number of columns

Member Function Documentation

template<class TD >
virtual int gridripper::math::SpM< TD >::countNonzerosInRow ( int  row  )  const [pure virtual]

Gets the number of nonzeros in the specified row.

Parameters:
row the row index
Returns:
the number of nonzeros

Implemented in gridripper::math::DiaSpM< TD, TI >, gridripper::math::EllSpM< TD, TI >, gridripper::math::CooSpM< TD, TI >, and gridripper::math::CsrSpM< TD, TI >.

template<class TD >
int gridripper::math::SpM< TD >::getNumColumns (  )  const [inline]

Gets the number of columns.

Returns:
the number of columns
template<class TD >
int gridripper::math::SpM< TD >::getNumRows (  )  const [inline]

Gets the number of rows.

Returns:
the number of rows
template<class TD >
virtual void gridripper::math::SpM< TD >::gmv ( TD *  y,
TD  alpha,
const TD *  x,
TD  beta,
const TD *  b 
) const [pure virtual]

General matrix-vector operation.

Computes y = alpha*A*x + beta*b.

Parameters:
y the output vector
alpha scalar multiplier applied to A
x the x vector
beta scalar multiplier applied to b
b the b vector or NULL

Implemented in gridripper::math::DiaSpM< TD, TI >, gridripper::math::EllSpM< TD, TI >, gridripper::math::CooSpM< TD, TI >, and gridripper::math::CsrSpM< TD, TI >.

template<class TD >
virtual void gridripper::math::SpM< TD >::toDenseMatrix ( TD *  mat  )  const [pure virtual]

Converts the sparse matrix to a dense matrix.

Parameters:
mat output array for the dense matrix

Implemented in gridripper::math::DiaSpM< TD, TI >, gridripper::math::EllSpM< TD, TI >, gridripper::math::CooSpM< TD, TI >, and gridripper::math::CsrSpM< TD, TI >.


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