Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

MatSparse(Type) Class Reference

general sparse matrix. More...

#include <MatSparse_Type.h>

Inheritance diagram for MatSparse(Type)::

Matrix_Type HandleId List of all members.

Public Methods

 MatSparse(Type) ()
 MatSparse(Type) (int n, int max_nonzeroes, bool symm_storage=false)
 MatSparse(Type) (int nrows, int ncolumns, int max_nonzeroes, bool symm_storage=false)
 MatSparse(Type) (int n, const VecSimple(int) &offsets, bool symm_storage=false)
 MatSparse(Type) (const SparseDS &addresses, bool symm_storage=false)
 MatSparse(Type) (const MatDense(Type) &M, real drop_tolerance=1.0e-12)
 MatSparse(Type) (const MatSparse(Type) &X)
 MatSparse(Type) (const Matrix(prm_Type) &pm)
virtual ~MatSparse(Type) (;) virtual int getNoRows() const
virtual int getNoColumns () const
virtual int getNoNonzeroes () const
virtual void size (int &m, int &n) const
int size () const
bool ok ()
virtual int getWork (const MatrixWork work_tp=MATVEC_WORK) const
virtual real getStorage () const
SparseDSpattern ()
virtual bool makeItSimilar (Handle(Matrix(Type)) &M) const
virtual bool redim (const Matrix(prm_Type) &pm)
bool redim (int n, int max_nonzeroes, bool symm_storage=false)
bool redim (int nrows, int ncolumns, int max_nonzeroes, bool symm_storage=false)
bool redim (const SparseDS &addresses, bool symm_storage=false)
virtual void optimizeDataStructure ()
void compressPattern (real threshold)
virtual bool redim (const VecSimple(int) &ivec, const VecSimple(int) &jvec, int new_nrows, int new_ncolumns)
virtual void getIndexSet (VecSimple(int) &ivec, VecSimple(int) &jvec) const
virtual bool validIndexSet (const VecSimple(int) &ivec, const VecSimple(int) &jvec, const int new_nrows, const int new_ncolumns)
virtual Type& elm (int i, int j)
MatSparse(Type)& operator= (Type a)
MatSparse(Type)& operator= (const MatSparse(Type) &X)
virtual void fill (const Matrix(Type) &X)
virtual void fill (Type a)
int idx (int i, int j) const
Type& operator() (int i, int j)
const Type& operator() (int i, int j) const
Type& operator() (int ij)
const Type& operator() (int ij) const
virtual void assemble (const Mat(Type) &em, const VecSimple(int) &idx_row_trans, const VecSimple(int) &idx_col_trans, int elm_no)
virtual void add (Matrix(Type) &bb, Matrix(Type) &cb)
virtual void add (Matrix(Type) &bb, char s, Matrix(Type) &cb)
virtual void add (Matrix(Type) &bb, Type b, Matrix(Type) &cb)
virtual void add (Type a, Matrix(Type) &bb, Type b, Matrix(Type) &cb)
void add (MatSparse(Type) &y, int power)
void add (Type value)
virtual void mult (Type value)
virtual void prod (const Vector(Type) &xb, Vector(Type) &yb, TransposeMode tpmode=NOT_TRANSPOSED, bool add_to_yb=false) const
virtual void colManip (LinEqConstraint &constraint_eq, Vec(Type) &vc, VecSimple(bool) &essential_dof)
virtual void rowManip (LinEqConstraint &constraint_eq, Vec(Type) &vc, VecSimple(bool) &essential_dof)
bool factRILU (real omega=0.0, int level=0)
void forwBackRILU (Vec(Type) &b, Vec(Type) &x)
bool factLU ()
void forwBackLU (Vec(Type) &b, Vec(Type) &x)
bool factAMG ()
void forwBackAMG (Vec(Type) &b, Vec(Type) &x)
virtual bool factorize (const FactStrategy &fstrategy)
virtual void forwBack (Vector(Type) &bb, Vector(Type) &xb)
virtual void SSOR1it (Vector(Type) &xnew, const Vector(Type) &xold, const Vector(Type) &b, real omega, TransposeMode tpmode=NOT_TRANSPOSED) const
virtual void SSORsolve (Vector(Type) &y, const Vector(Type) &c, real omega, TransposeMode tpmode=NOT_TRANSPOSED) const
virtual void SOR1it (Vector(Type) &xnew, const Vector(Type) &xold, const Vector(Type) &b, real omega, TransposeMode tpmode=NOT_TRANSPOSED) const
virtual void SORsolve (Vector(Type) &y, const Vector(Type) &c, real omega, TransposeMode tpmode=NOT_TRANSPOSED) const
virtual void Jacobi1it (Vector(Type) &xnew, const Vector(Type) &xold, const Vector(Type) &b, TransposeMode tpmode=NOT_TRANSPOSED) const
virtual void Jacobisolve (Vector(Type) &y, const Vector(Type) &c, TransposeMode tpmode=NOT_TRANSPOSED) const
virtual void print (Os os, const char *header=NULL, int nentries_per_line=3) const
virtual void printAscii (Os os, const char *header=NULL) const
virtual void printIndexed (Os os, const char *header=NULL) const
virtual void scan (Is is)
virtual void save (const char *filename, const char *name="X") const
virtual void load (const char *filename, const char *name="X")
CLASS_INFO VIRTUAL_CAST (MatSparse(Type))

Friends

Osoperator<< (Os &os, const MatSparse(Type) &X)
Isoperator>> (Is &is, MatSparse(Type) &X)

Detailed Description

general sparse matrix.

NAME: MatSparse(Type) - general sparse matrix

DESCRIPTION:

This class implements the compressed sparse row storage scheme for representation of sparse matrices with arbitrary sparsity patterns. The class "SparseDS" is used to keep track of the nonzero entries.


Constructor & Destructor Documentation

MatSparse(Type)::MatSparse_Type ( )
 

In addition to the usual constructors, there is a specialized version that accepts a existing "SparseDS" object as argument. Another version specific to sparse matrices, receives a dense matrix of type "MatDense(Type)" (or equivalently, "Mat(Type)"). A sparse matrix is then generated by applying a threshold parameter "drop_tolerance" to each entry of the dense matrix. There is also a constructor which accept a vector containing information on the offset for each stored diagonal. The lower diagonals have negative offset and the upper diagonals positive offset.

Objects of type "MatSparse(Type)" can be used to represent rectangular matrices. However, there is not yet support for a symmetric storage scheme.

MatSparse(Type)::MatSparse_Type ( int n,
int max_nonzeroes,
bool symm_storage = false )
 

See documentation of one of the overloaded constructor.

MatSparse(Type)::MatSparse_Type ( int nrows,
int ncolumns,
int max_nonzeroes,
bool symm_storage = false )
 

See documentation of one of the overloaded constructor.

MatSparse(Type)::MatSparse_Type ( int n,
const VecSimple(int) & offsets,
bool symm_storage = false )
 

See documentation of one of the overloaded constructor.

MatSparse(Type)::MatSparse_Type ( const SparseDS & addresses,
bool symm_storage = false )
 

See documentation of one of the overloaded constructor.

MatSparse(Type)::MatSparse_Type ( const MatDense(Type) & M,
real drop_tolerance = 1.0e-12 )
 

See documentation of one of the overloaded constructor.

MatSparse(Type)::MatSparse_Type ( const MatSparse(Type) & X )
 

See documentation of one of the overloaded constructor.

MatSparse(Type)::MatSparse_Type ( const Matrix(prm_Type) & pm )
 

See documentation of one of the overloaded constructor.

MatSparse(Type)::~MatSparse(Type) ( ; ) const [virtual]
 


Member Function Documentation

void MatSparse(Type)::Jacobi1it ( Vector(Type) & xnew,
const Vector(Type) & xold,
const Vector(Type) & b,
TransposeMode tpmode = NOT_TRANSPOSED ) const [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::Jacobisolve ( Vector(Type) & y,
const Vector(Type) & c,
TransposeMode tpmode = NOT_TRANSPOSED ) const [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::SOR1it ( Vector(Type) & xnew,
const Vector(Type) & xold,
const Vector(Type) & b,
real omega,
TransposeMode tpmode = NOT_TRANSPOSED ) const [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::SORsolve ( Vector(Type) & y,
const Vector(Type) & c,
real omega,
TransposeMode tpmode = NOT_TRANSPOSED ) const [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::SSOR1it ( Vector(Type) & xnew,
const Vector(Type) & xold,
const Vector(Type) & b,
real omega,
TransposeMode tpmode = NOT_TRANSPOSED ) const [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::SSORsolve ( Vector(Type) & y,
const Vector(Type) & c,
real omega,
TransposeMode tpmode = NOT_TRANSPOSED ) const [virtual]
 

Reimplemented from Matrix(Type).

CLASS_INFO MatSparse(Type)::VIRTUAL_CAST ( MatSparse(Type) )
 

void MatSparse(Type)::add ( Type value )
 

void MatSparse(Type)::add ( MatSparse(Type) & y,
int power )
 

void MatSparse(Type)::add ( Type a,
Matrix(Type) & bb,
Type b,
Matrix(Type) & cb ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::add ( Matrix(Type) & bb,
Type b,
Matrix(Type) & cb ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::add ( Matrix(Type) & bb,
char s,
Matrix(Type) & cb ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::add ( Matrix(Type) & bb,
Matrix(Type) & cb ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::assemble ( const Mat(Type) & em,
const VecSimple(int) & idx_row_trans,
const VecSimple(int) & idx_col_trans,
int elm_no ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::colManip ( LinEqConstraint & constraint_eq,
Vec(Type) & vc,
VecSimple(bool) & essential_dof ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::compressPattern ( real threshold )
 

See documentation of one of the overloaded functions.

Type & MatSparse(Type)::elm ( int i,
int j ) [virtual]
 

as usual, this function permits matrix adressing using the logical index spaces for "(i,j)" from 1 to "nrows" and "ncolumns", respectively.

Reimplemented from Matrix(Type).

bool MatSparse(Type)::factAMG ( )
 

bool MatSparse(Type)::factLU ( )
 

bool MatSparse(Type)::factRILU ( real omega = 0.0,
int level = 0 )
 

performs Relaxed Incomplete LU factorization using the relaxation parameter "omega". Currently, no fill-in is allowed.

bool MatSparse(Type)::factorize ( const FactStrategy & fstrategy ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::fill ( Type a ) [inline, virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::fill ( const Matrix(Type) & X ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::forwBack ( Vector(Type) & bb,
Vector(Type) & xb ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::forwBackAMG ( Vec(Type) & b,
Vec(Type) & x )
 

void MatSparse(Type)::forwBackLU ( Vec(Type) & b,
Vec(Type) & x )
 

void MatSparse(Type)::forwBackRILU ( Vec(Type) & b,
Vec(Type) & x )
 

performs the triangular solves needed in connection to a RILU factrorization, see "factRILU".

void MatSparse(Type)::getIndexSet ( VecSimple(int) & ivec,
VecSimple(int) & jvec ) const [virtual]
 

Reimplemented from Matrix(Type).

int MatSparse(Type)::getNoColumns ( ) const [virtual]
 

returns the number of columns in the current object when viewed (logically) as a full matrix.

Reimplemented from Matrix(Type).

int MatSparse(Type)::getNoNonzeroes ( ) const [virtual]
 

returns the number of nonzero entries represented in the current object. Note that this function does not take symmetric storage formats into account. That is, it also counts entry "a(j,i)" even if this value is not stored due to symmetry properties. This function does not check for stored zero entries, but counts all entries represented by the chosen matrix format.

Reimplemented from Matrix(Type).

real MatSparse(Type)::getStorage ( ) const [virtual]
 

Reimplemented from Matrix(Type).

int MatSparse(Type)::getWork ( const MatrixWork work_tp = MATVEC_WORK ) const [virtual]
 

returns the operation count for the last computation of the type indicated by the "MatrixWork" argument.

Reimplemented from Matrix(Type).

int MatSparse(Type)::idx ( int i,
int j ) const [inline]
 

void MatSparse(Type)::load ( const char * filename,
const char * name = "X" ) [virtual]
 

quite similar to "save", this function permits Matlab data files to be entered into the current vector object. If available, the binary format is used, otherwise it reads plain ASCII files.

The version implemented in this base class is dummy, stating that the described functionality is not available. To overrule this behaviour, the "load" function should be implemented for the specific format(s).

Reimplemented from Matrix(Type).

bool MatSparse(Type)::makeItSimilar ( Handle(Matrix(Type)) & M ) const [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::mult ( Type value ) [virtual]
 

Reimplemented from Matrix(Type).

bool MatSparse(Type)::ok ( ) [inline]
 

const Type & MatSparse(Type)::operator() ( int ij ) const
 

Type & MatSparse(Type)::operator() ( int ij )
 

const Type & MatSparse(Type)::operator() ( int i,
int j ) const
 

Type & MatSparse(Type)::operator() ( int i,
int j )
 

MatSparse(Type) & MatSparse(Type)::operator= ( const MatSparse(Type) & X )
 

MatSparse(Type) & MatSparse(Type)::operator= ( Type a ) [inline]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::optimizeDataStructure ( ) [inline, virtual]
 

calls the "compressPattern" function in order to eliminate the storage of (numerically) zero entries. The compression is done using the threshold value set when the "MatSparse" object is created, typically through a menu choice in the "Matrix_prm" sub menu.

Reimplemented from Matrix(Type).

SparseDS & MatSparse(Type)::pattern ( )
 

void MatSparse(Type)::print ( Os os,
const char * header = NULL,
int nentries_per_line = 3 ) const [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::printAscii ( Os os,
const char * header = NULL ) const [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::printIndexed ( Os os,
const char * header = NULL ) const [virtual]
 

void MatSparse(Type)::prod ( const Vector(Type) & xb,
Vector(Type) & yb,
TransposeMode tpmode = NOT_TRANSPOSED,
bool add_to_yb = false ) const [virtual]
 

Reimplemented from Matrix(Type).

bool MatSparse(Type)::redim ( const VecSimple(int) & ivec,
const VecSimple(int) & jvec,
int new_nrows,
int new_ncolumns ) [virtual]
 

See documentation of one of the overloaded functions.

Reimplemented from Matrix(Type).

bool MatSparse(Type)::redim ( const SparseDS & addresses,
bool symm_storage = false )
 

See documentation of one of the overloaded functions.

bool MatSparse(Type)::redim ( int nrows,
int ncolumns,
int max_nonzeroes,
bool symm_storage = false )
 

See documentation of one of the overloaded functions.

bool MatSparse(Type)::redim ( int n,
int max_nonzeroes,
bool symm_storage = false )
 

See documentation of one of the overloaded functions.

bool MatSparse(Type)::redim ( const Matrix(prm_Type) & pm ) [virtual]
 

the specialized version of this function accepts a "SparseDS" object as input.

Reimplemented from Matrix(Type).

void MatSparse(Type)::rowManip ( LinEqConstraint & constraint_eq,
Vec(Type) & vc,
VecSimple(bool) & essential_dof ) [virtual]
 

Reimplemented from Matrix(Type).

void MatSparse(Type)::save ( const char * filename,
const char * name = "X" ) const [virtual]
 

saves the current vector object in a file that is readable for Matlab. If available, the utilities for Matlab's internal binary data file format is used. Otherwise, the output is given as a plain ASCII file that can be loaded in Matlab.

The version implemented in this base class is dummy, stating that the described functionality is not available. To overrule this behaviour, the "save" function should be implemented for the specific format(s).

Reimplemented from Matrix(Type).

void MatSparse(Type)::scan ( Is is ) [virtual]
 

Reimplemented from Matrix(Type).

int MatSparse(Type)::size ( ) const [inline]
 

void MatSparse(Type)::size ( int & m,
int & n ) const [virtual]
 

Reimplemented from Matrix(Type).

bool MatSparse(Type)::validIndexSet ( const VecSimple(int) & ivec,
const VecSimple(int) & jvec,
const int new_nrows,
const int new_ncolumns ) [virtual]
 

Reimplemented from Matrix(Type).


Friends And Related Function Documentation

Os & operator<< ( Os & os,
const MatSparse(Type) & X ) [friend]
 

Is & operator>> ( Is & is,
MatSparse(Type) & X ) [friend]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.