class SparseMatrix : public Matrix

Data type sparse matrix

Inheritance:


Public Methods

SparseMatrix(int nrows, int ncols = 0)
Creates sparse matrix.
virtual double& Elem(int i, int j)
Returns reference to a_{ij}. Index i, j = 0 .. size-1
virtual const double& Elem(int i, int j) const
Returns constant reference to a_{ij}. Index i, j = 0 .. size-1
double& operator) (int i, int j)
Returns reference to A[i][j]. Index i, j = 0 .. size-1
const double& operator) (int i, int j) const
Returns reference to A[i][j]. Index i, j = 0 .. size-1
virtual void Mult(const Vector & x, Vector & y) const
Matrix vector multiplication.
void AddMult(const Vector & x, Vector & y) const
y += A * x
void MultTranspose(const Vector & x, Vector & y) const
Multiply a vector with the transposed matrix. y = At * x
void AddMultTranspose(const Vector & x, Vector & y) const
y += At * x
virtual MatrixInverse* Inverse() const
Returns a pointer to approximation of the matrix inverse.
void EliminateRow(int row, const double sol, Vector &rhs)
Eliminates a column from the transpose matrix.
void EliminateRowCol(int rc, const double sol, Vector &rhs)
Eliminates the column 'rc' to the 'rhs', deletes the row 'rc' and replaces the element (rc,rc) with 1
void Gauss_Seidel_forw(const Vector &x, Vector &y) const
Gauss-Seidel forward and backward iterations over a vector x.
virtual void Finalize()
Finalize the matrix initialization
virtual void AddElementMatrix(const Array<int> & dofs, const Matrix & elemmat)
Add (element) submatrix to the matrix.
virtual void AddElementMatrix(const Array<int> & dofs1, const Array<int> & dofs2, const RectangularMatrix & elemmat)
Add (element) submatrix to the matrix.
void Print(ostream & out = cout, int width = 4)
Prints matrix to stream out.
void PrintCSR(ostream & out)
Prints matrix to stream out in hypre_CSRMatrix format.
virtual ~SparseMatrix()
Destroys sparse matrix.

Inherited from Matrix:

Public Methods

inline int Size() const
CGMatrixInverse* CG(int printiter = 0, int maxnumiter = 1000, double rtol = 10e-12, double atol = 10e-24) const
PCGMatrixInverse* PCG(const MatrixInverse & b, int printiter = 0, int maxnumiter = 1000, double rtol = 10e-12, double atol = 10e-24) const

Documentation

Data type sparse matrix
SparseMatrix(int nrows, int ncols = 0)
Creates sparse matrix.

virtual double& Elem(int i, int j)
Returns reference to a_{ij}. Index i, j = 0 .. size-1

virtual const double& Elem(int i, int j) const
Returns constant reference to a_{ij}. Index i, j = 0 .. size-1

double& operator) (int i, int j)
Returns reference to A[i][j]. Index i, j = 0 .. size-1

const double& operator) (int i, int j) const
Returns reference to A[i][j]. Index i, j = 0 .. size-1

virtual void Mult(const Vector & x, Vector & y) const
Matrix vector multiplication.

void AddMult(const Vector & x, Vector & y) const
y += A * x

void MultTranspose(const Vector & x, Vector & y) const
Multiply a vector with the transposed matrix. y = At * x

void AddMultTranspose(const Vector & x, Vector & y) const
y += At * x

virtual MatrixInverse* Inverse() const
Returns a pointer to approximation of the matrix inverse.

void EliminateRow(int row, const double sol, Vector &rhs)
Eliminates a column from the transpose matrix.

void EliminateRowCol(int rc, const double sol, Vector &rhs)
Eliminates the column 'rc' to the 'rhs', deletes the row 'rc' and replaces the element (rc,rc) with 1.0; assumes that element (i,rc) is assembled if and only if the element (rc,i) is assembled.

void Gauss_Seidel_forw(const Vector &x, Vector &y) const
Gauss-Seidel forward and backward iterations over a vector x.

virtual void Finalize()
Finalize the matrix initialization. The function should be called only once, after the matrix has been initialized. It's densenning the J and A arrays (by getting rid of -1s in array J). *

virtual void AddElementMatrix(const Array<int> & dofs, const Matrix & elemmat)
Add (element) submatrix to the matrix.

virtual void AddElementMatrix(const Array<int> & dofs1, const Array<int> & dofs2, const RectangularMatrix & elemmat)
Add (element) submatrix to the matrix.

void Print(ostream & out = cout, int width = 4)
Prints matrix to stream out.

void PrintCSR(ostream & out)
Prints matrix to stream out in hypre_CSRMatrix format.

virtual ~SparseMatrix()
Destroys sparse matrix.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de