Base class of sparse matrices. More...
#include <spm.h>
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) |
Base class of sparse matrices.
gridripper::math::SpM< TD >::SpM | ( | int | nrows, | |
int | ncols | |||
) | [inline, protected] |
Creates a sparse matrix with the specified number of rows.
nrows | the number of rows | |
ncols | the number of columns |
virtual int gridripper::math::SpM< TD >::countNonzerosInRow | ( | int | row | ) | const [pure virtual] |
Gets the number of nonzeros in the specified row.
row | the row index |
Implemented in gridripper::math::DiaSpM< TD, TI >, gridripper::math::EllSpM< TD, TI >, gridripper::math::CooSpM< TD, TI >, and gridripper::math::CsrSpM< TD, TI >.
int gridripper::math::SpM< TD >::getNumColumns | ( | ) | const [inline] |
Gets the number of columns.
int gridripper::math::SpM< TD >::getNumRows | ( | ) | const [inline] |
Gets the number of rows.
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.
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 >.
virtual void gridripper::math::SpM< TD >::toDenseMatrix | ( | TD * | mat | ) | const [pure virtual] |
Converts the sparse matrix to a dense matrix.
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 >.