Diffpack Documentation


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

MatBand(Type) Class Reference

dense banded matrix. More...

#include <MatBand_Type.h>

Inheritance diagram for MatBand(Type)::

MatDense_Type List of all members.

Public Methods

 MatBand(Type) ()
 MatBand(Type) (int n, int bandwidth, bool symm_storage=false, bool pivot_allowed=false)
 MatBand(Type) (int nrows, int ncolumns, int bandwidth, bool symm_storage=false, bool pivot_allowed=false)
 MatBand(Type) (const MatBand(Type) &X)
 MatBand(Type) (const Matrix(prm_Type) &pm)
virtual ~MatBand(Type) ()
virtual int getNoColumns () const
virtual int getNoNonzeroes () const
virtual void size (int &m, int &n) const
void setBandwidth (int bandwidth, bool symm_storage=false, bool pivot_allowed=false)
int getBandwidth () const
int getLowerBandwidth () const
int getUpperBandwidth () const
bool insideBand (const int i, const int j) const
virtual bool makeItSimilar (Handle(Matrix(Type)) &M) const
virtual bool redim (const Matrix(prm_Type) &pm)
bool redim (int n, int bandwidth_, bool symm_storage_, bool pivot_allowed_)
bool redim (int nrows, int ncolumns, int bandwidth, bool symm_storage, bool pivot_allowed)
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)
bool denseIndex2bandIndex (int i, int j, int &ib, int &jb)
virtual void fill (const Matrix(Type) &X)
virtual void fill (Type a)
MatBand(Type)& operator= (const MatBand(Type) &X)
MatBand(Type)& operator= (const Type &a)
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) &bm, Type b, Matrix(Type) &cb)
void add (MatBand(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 transpose ()
virtual void conjTranspose ()
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)
virtual bool factSVD (Vec(Type) &, Mat(Type) &, real=1.0e-6)
virtual void forwBackSVD (const Vec(Type) &, const Mat(Type) &, const Vec(Type) &, Vec(Type) &)
virtual bool factChol (bool=true)
virtual void forwBackChol (Vec(Type) &, Vec(Type) &)
virtual bool factLU ()
virtual void forwBackLU (Vec(Type) &b, Vec(Type) &x)
virtual bool factLU (VecSimple(int) &perm, Vec(Type) &scratch)
virtual bool factLU (VecSimple(int) &perm)
virtual void forwBackLU (Vec(Type) &b, Vec(Type) &x, const VecSimple(int) &perm)
virtual bool factorize (const FactStrategy &fstrategy)
virtual void forwBack (Vector(Type) &bb, Vector(Type) &xb)
virtual void inverse (Mat(Type) &inv)
virtual void inverse (Mat(Type) &inv, Vec(Type) &scratch)
virtual void inverse (Mat(Type) &inv, VecSimple(int) &perm, Vec(Type)&scratch)
virtual Type det ()
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
void printAscii (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 (MatBand(Type)) private
virtual void prod (const Matrix(Type) &, const Matrix(Type) &, TransposeMode=NOT_TRANSPOSED, TransposeMode=NOT_TRANSPOSED)
void prod (const Matrix(Type) &, const Matrix(Type) &, bool, TransposeMode=NOT_TRANSPOSED, TransposeMode=NOT_TRANSPOSED)

Protected Methods

int actual_bandwidth (int bandwidth_, bool symm_storage_, bool pivot_allowed_) const
bool validAttributes (int bandwidth, bool &symm_storage, bool &pivot_allowed) const
bool factLU_symm ()
void forwBackLU_symm (Vec(Type) &b, Vec(Type) &x)
bool factLU_nonsymm ()
void forwBackLU_nonsymm (Vec(Type) &b, Vec(Type) &x)
void prod_symm (const Vec(Type) &x, Vec(Type) &y, transposeFP(Type) transform, bool transposed, bool add_to_yb=false) const
void prod_nonsymm (const Vec(Type) &x, Vec(Type) &y, transposeFP(Type) transform, bool transposed, bool add_to_yb=false) const
virtual void copy_matrix_attributes (const Matrix(Type) &X)
virtual void copy_matrix_attributes (const Mat(Type) &X)
virtual void copy_matrix_attributes (const MatBand(Type) &X)
virtual void reset ()
bool redim (int n)
bool redim (int nrows_, int ncolumns_)

Protected Attributes

int full_ncols
int bandwidth
int& ndiags
Type zero_entry

Friends

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

Detailed Description

dense banded matrix.

NAME: MatBand(Type) - dense banded matrix

DESCRIPTION:

The class is a specialization of class "MatDense(Type)" and implements a standard banded matrix format. The class allows both symmetric and nonsymmetric storage schemes.


Constructor & Destructor Documentation

MatBand(Type)::MatBand_Type ( ) [inline]
 

MatBand(Type)::MatBand_Type ( int n,
int bandwidth,
bool symm_storage = false,
bool pivot_allowed = false )
 

See documentation of one of the overloaded constructor.

MatBand(Type)::MatBand_Type ( int nrows,
int ncolumns,
int bandwidth,
bool symm_storage = false,
bool pivot_allowed = false )
 

See documentation of one of the overloaded constructor.

MatBand(Type)::MatBand_Type ( const MatBand(Type) & X )
 

See documentation of one of the overloaded constructor.

MatBand(Type)::MatBand_Type ( const Matrix(prm_Type) & pm )
 

See documentation of one of the overloaded constructor.

MatBand(Type)::~MatBand(Type) ( ) [virtual]
 


Member Function Documentation

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

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

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

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

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

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

CLASS_INFO MatBand(Type)::VIRTUAL_CAST ( MatBand(Type) ) [inline]
 

int MatBand(Type)::actual_bandwidth ( int bandwidth_,
bool symm_storage_,
bool pivot_allowed_ ) const [inline, protected]
 

void MatBand(Type)::add ( Type value )
 

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

void MatBand(Type)::add ( Type a,
Matrix(Type) & bm,
Type b,
Matrix(Type) & cb ) [virtual]
 

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

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

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

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

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

void MatBand(Type)::conjTranspose ( ) [inline, virtual]
 

void MatBand(Type)::copy_matrix_attributes ( const MatBand(Type) & X ) [protected, virtual]
 

void MatBand(Type)::copy_matrix_attributes ( const Mat(Type) & X ) [protected, virtual]
 

void MatBand(Type)::copy_matrix_attributes ( const Matrix(Type) & X ) [protected, virtual]
 

bool MatBand(Type)::denseIndex2bandIndex ( int i,
int j,
int & ib,
int & jb )
 

given an index "(i,j)" in a dense matrix ("Mat" or "MatDense"), the function computes the corresponding index "(ib,jb)" in the "MatBand" storage. Internal parameters such as the bandwidth and whether the banded matrix is symmetric or not, influence the index computation. The function returns a true value if the given index was inside the band, otherwise it returns a false value, indicating that the "(ib,jb)" is not inside the band (this implies that the matrix entry corresponding to "(i,j") is zero). The "denseIndex2bandIndex" function makes it easy to code the "elm" function, or in other words, index a band matrix is if it were a dense matrix.

Type MatBand(Type)::det ( ) [virtual]
 

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

This function returns entry "(i,j)" of the current matrix as if it was represented as a full "m" by "n" matrix, i.e., the arguments "i" and "j" can run from one to "m" and "n", respectively. This indexing functionality can be used both for assignments and extractions of matrix entries. However, assignments to an entry that is outside the allocated band is neglected since such positions is regarded as zeros by definition.

bool MatBand(Type)::factChol ( bool = true ) [inline, virtual]
 

bool MatBand(Type)::factLU ( VecSimple(int) & perm ) [virtual]
 

See documentation of one of the overloaded functions.

bool MatBand(Type)::factLU ( VecSimple(int) & perm,
Vec(Type) & scratch ) [virtual]
 

See documentation of one of the overloaded functions.

bool MatBand(Type)::factLU ( ) [virtual]
 

As for other matrix formats, this functions finds the LU decomposition of the matrix by Gaussian elimination. However, in case of symmetric storage of the banded matrix, this function actually computes D and L in an "LDL^T" factorization. Since this is compensated for in calls to "forwBackLU", the user does usually not have to worry about this behaviour.

Please note that pivoting is allowed only for the nonsymmetric storage format.

bool MatBand(Type)::factLU_nonsymm ( ) [protected]
 

bool MatBand(Type)::factLU_symm ( ) [protected]
 

bool MatBand(Type)::factSVD ( Vec(Type) &,
Mat(Type) &,
real = 1.0e-6 ) [inline, virtual]
 

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

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

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

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

void MatBand(Type)::forwBackChol ( Vec(Type) &,
Vec(Type) & ) [inline, virtual]
 

void MatBand(Type)::forwBackLU ( Vec(Type) & b,
Vec(Type) & x,
const VecSimple(int) & perm ) [virtual]
 

void MatBand(Type)::forwBackLU ( Vec(Type) & b,
Vec(Type) & x ) [virtual]
 

void MatBand(Type)::forwBackLU_nonsymm ( Vec(Type) & b,
Vec(Type) & x ) [protected]
 

void MatBand(Type)::forwBackLU_symm ( Vec(Type) & b,
Vec(Type) & x ) [protected]
 

void MatBand(Type)::forwBackSVD ( const Vec(Type) &,
const Mat(Type) &,
const Vec(Type) &,
Vec(Type) & ) [inline, virtual]
 

int MatBand(Type)::getBandwidth ( ) const [inline]
 

returns the value of "bandwidth", i.e. the requested band width including the main diagonal. The specialized versions "getLowerBandwidth" and "getUpperBandwidth" return the lower and upper bandwidths excluding the main diagonal. The upper bandwidth takes into account storage space allocated for pivoting. The reported values refers to the matrix in a logical sense, i.e. both functions report a nonzero number even for the symmetric storage format.

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

int MatBand(Type)::getLowerBandwidth ( ) const
 

int MatBand(Type)::getNoColumns ( ) const [inline, virtual]
 

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

int MatBand(Type)::getUpperBandwidth ( ) const
 

bool MatBand(Type)::insideBand ( const int i,
const int j ) const
 

void MatBand(Type)::inverse ( Mat(Type) & inv,
VecSimple(int) & perm,
Vec(Type)& scratch ) [virtual]
 

void MatBand(Type)::inverse ( Mat(Type) & inv,
Vec(Type) & scratch ) [virtual]
 

void MatBand(Type)::inverse ( Mat(Type) & inv ) [virtual]
 

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

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

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

MatBand(Type) & MatBand(Type)::operator= ( const Type & a ) [inline]
 

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

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

The "print" function is very similar to "MatSimple print", but since the storage of a band matrix is different, the index information related to each entry is a bit special. We print the index as

             (16, 3 / 13)=4.25439
which means that this entry is located in row 16, with column number 3 in the band matrix storage structure, but with column number 13 if the matrix were a standard dense matrix. Note that the row numbers in a banded storage and a standard dense matrix coincide, but the column numbers do not. If the special index with an asterix,

             (1, 3 / *)=0.00000
is encountered, it means that the storage location (1,3) in a banded matrix has no associated entry in a standard dense matrix (hence the values of such artificial entries in the banded storage structure are always zero).

void MatBand(Type)::printAscii ( Os os,
const char * header = NULL ) const
 

void MatBand(Type)::prod ( const Matrix(Type) &,
const Matrix(Type) &,
bool,
TransposeMode = NOT_TRANSPOSED,
TransposeMode = NOT_TRANSPOSED ) [inline]
 

void MatBand(Type)::prod ( const Matrix(Type) &,
const Matrix(Type) &,
TransposeMode = NOT_TRANSPOSED,
TransposeMode = NOT_TRANSPOSED ) [inline, virtual]
 

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

void MatBand(Type)::prod_nonsymm ( const Vec(Type) & x,
Vec(Type) & y,
transposeFP(Type) transform,
bool transposed,
bool add_to_yb = false ) const [protected]
 

void MatBand(Type)::prod_symm ( const Vec(Type) & x,
Vec(Type) & y,
transposeFP(Type) transform,
bool transposed,
bool add_to_yb = false ) const [protected]
 

bool MatBand(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.

bool MatBand(Type)::redim ( int nrows,
int ncolumns,
int bandwidth,
bool symm_storage,
bool pivot_allowed )
 

See documentation of one of the overloaded functions.

bool MatBand(Type)::redim ( int n,
int bandwidth_,
bool symm_storage_,
bool pivot_allowed_ ) [inline]
 

See documentation of one of the overloaded functions.

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

See documentation of one of the overloaded functions.

bool MatBand(Type)::redim ( int nrows_,
int ncolumns_ ) [inline, protected]
 

See documentation of one of the overloaded functions.

bool MatBand(Type)::redim ( int n ) [inline, protected]
 

In addition to the "redim" accepting a "Matrix_prm(Type)" type argument, there are versions of this function that accept the argument sequences of the "MatBand" specific constructors. The matrix is then redimensioned according to the given parameter values.

void MatBand(Type)::reset ( ) [protected, virtual]
 

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

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

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

void MatBand(Type)::setBandwidth ( int bandwidth,
bool symm_storage = false,
bool pivot_allowed = false )
 

If the matrix is instanciated by one of the general-purpose constructors, this function may be used for setting a new bandwidth. In addition, it is possible to specify the flags for symmetric storage and/or pivoting. The latter option only refers to allocation of space to hold row permutations caused by pivoting. To actually force pivoting in a matrix decomposition, one has to call the correct member function for this operation. Alternatively, this can be achieved by setting the appropriate flag for a direct solver in the "LinEqSolver" hierarchy.

When calling "setBandwidth", the matrix is implicitly redimensioned according to the supplied argument values.

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

void MatBand(Type)::transpose ( ) [inline, virtual]
 

bool MatBand(Type)::validAttributes ( int bandwidth,
bool & symm_storage,
bool & pivot_allowed ) const [protected]
 

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


Friends And Related Function Documentation

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

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


Member Data Documentation

int MatBand(Type)::bandwidth [protected]
 

int MatBand(Type)::full_ncols [protected]
 

int & MatBand(Type)::ndiags [protected]
 

Type MatBand(Type)::zero_entry [protected]
 


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