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

MatrixBD Class Reference

A class for column oriented storage of a general, banded double Matrix. More...

#include <matrixBD.h>

Inheritance diagram for MatrixBD:

MatrixC Matrix List of all members.

Public Methods

virtual void stream (ostream& s)
 output to stream.

MatrixBD transpose () const
 return transposed Matrix.

void multiply (const MatrixBD& A, const MatrixBD& B, const char TRANSA='N', const char TRANSB='N')
 Multiplication of two symmetric matrices destroys the symmetry.

void multiply (const VectorD& x, VectorD& y, const char TRANS='N', const double ALPHA=1.0, const double BETA=0.0) const
 multiplication y=alpha*op(this)*x+beta*y, BLAS level 2.

void multiply (const double value)
 multiply with a constant value and write to this.

void LUdecompose (int* IPIV)
 LU decomposition of a general banded matrix, see note above.

void LUsubstitute (MatrixC<double>& B, int* IPIV)
 solve triangular system by backsubstitution IPIV is an integer vector of order nc() that contains row column permutations.

void LUsolve (MatrixC<double>& B)
 solve linear equation system.

void LUinvert ()
 inversion of a general banded matrix is not implemented.

void CHdecompose ()
 Cholesky CTC decomposition of a symmetric positive definite band matrix.

void CHsubstitute (MatrixC<double>& B)
 solve triangular Cholesky system by backsubstitution.

void CHsolve (MatrixC<double>& B)
 solve linear equation system with a symmetric positive definite banded matrix.

void CHinvert ()
 inversion of a symmetric positive definite matrix is not implemented.

constructors and destructor
 MatrixBD ()
 default constructor.

 MatrixBD (const int nr, const int nc, const int nu, const double value=0.0)
 standard constructor.

 MatrixBD (const int nr, const int nc=1, const double value=0.0)
 standard constructor for the case of a symmetric band Matrix.

 MatrixBD (const MatrixBD& B)
 copy constructor.

 ~MatrixBD ()
 virtual destructor.

MatrixBD& operator= (const double value)
 assignment with a constant value.

overloaded virtual methods of the Matrix base class
int nr () const
 number of rows, i.e. bandwith.

int nr (const int j) const
 number of rows for column j.

int nc () const
 number of columns.

int nc (const int i) const
 number of columns for row i.

void resize (const int nr, const int nc, const double value=0)
 resize Matrix.

virtual Ref<double> operator() (const int i, const int j=0)
 non constant, write access to elements.

virtual double operator() (const int i, const int j=0) const
 constant, read only access to elements is overloaded.

some special methods of general banded matrices
int row_begin (const int j) const
 first element in column j.

int row_end (const int j) const
 end element in column j.

int col_begin (const int i) const
 first element in row i.

int col_end (const int i) const
 end element in row i.

int ku () const
 number of superdiagonals.

int kl () const
 number of subdiagonals.


Protected Methods

double* ref (const int i, const int j) const
 low level reference to data returns a pointer, use this with care.

double read (const int i, const int j) const
 low level read.

void write (const int i, const int j, const double v)
 low level write.

void add (const int i, const int j, const double v)
 low level add to.

void sub (const int i, const int j, const double v)
 low level sub from.

void mul (const int i, const int j, const double v)
 low level mul with.

void div (const int i, const int j, const double v)
 low level div by.


Detailed Description

A class for column oriented storage of a general, banded double Matrix.

Author(s):
rokrau
Date:
2000/11/09 18:41:31

The Matrix is stored with kl subdiagonals and ku superdiagonals so that nr=ku+kl+1 and elements can be referenced directly. In the case of ku being 0 it is assumed that the Matrix is banded symmetric and that only the lower half is stored. The case of kl=0 is not implemented. Access outside the matrix band will be punished with an error message and program halt. During LU decomposition of a general nonsymmetric banded matrix kl rows are added to the matrix and the matrix contents is shifted appropriately.


Constructor & Destructor Documentation

MatrixBD::MatrixBD ( ) [explicit]
 

default constructor.

MatrixBD::MatrixBD ( const int nr,
const int nc,
const int nu,
const double value = 0.0 ) [explicit]
 

standard constructor.

MatrixBD::MatrixBD ( const int nr,
const int nc = 1,
const double value = 0.0 ) [explicit]
 

standard constructor for the case of a symmetric band Matrix.

MatrixBD::MatrixBD ( const MatrixBD & B )
 

copy constructor.

MatrixBD::~MatrixBD ( ) [inline]
 

virtual destructor.


Member Function Documentation

MatrixBD & MatrixBD::operator= ( const double value ) [inline]
 

assignment with a constant value.

int MatrixBD::nr ( ) const
 

number of rows, i.e. bandwith.

int MatrixBD::nr ( const int j ) const [virtual]
 

number of rows for column j.

Reimplemented from MatrixC.

int MatrixBD::nc ( ) const
 

number of columns.

int MatrixBD::nc ( const int i ) const [virtual]
 

number of columns for row i.

Reimplemented from MatrixC.

void MatrixBD::resize ( const int nr,
const int nc,
const double value = 0 )
 

resize Matrix.

Ref< double > MatrixBD::operator() ( const int i,
const int j = 0 ) [inline, virtual]
 

non constant, write access to elements.

Reimplemented from MatrixC.

double MatrixBD::operator() ( const int i,
const int j = 0 ) const [inline, virtual]
 

constant, read only access to elements is overloaded.

Reimplemented from MatrixC.

int MatrixBD::row_begin ( const int j ) const [inline]
 

first element in column j.

int MatrixBD::row_end ( const int j ) const [inline]
 

end element in column j.

int MatrixBD::col_begin ( const int i ) const [inline]
 

first element in row i.

int MatrixBD::col_end ( const int i ) const [inline]
 

end element in row i.

int MatrixBD::ku ( ) const [inline]
 

number of superdiagonals.

int MatrixBD::kl ( ) const [inline]
 

number of subdiagonals.

double * MatrixBD::ref ( const int i,
const int j ) const [inline, protected, virtual]
 

low level reference to data returns a pointer, use this with care.

Reimplemented from MatrixC.

double MatrixBD::read ( const int i,
const int j ) const [inline, protected, virtual]
 

low level read.

Reimplemented from MatrixC.

void MatrixBD::write ( const int i,
const int j,
const double v ) [inline, protected]
 

low level write.

void MatrixBD::add ( const int i,
const int j,
const double v ) [inline, protected]
 

low level add to.

void MatrixBD::sub ( const int i,
const int j,
const double v ) [inline, protected]
 

low level sub from.

void MatrixBD::mul ( const int i,
const int j,
const double v ) [inline, protected]
 

low level mul with.

void MatrixBD::div ( const int i,
const int j,
const double v ) [inline, protected]
 

low level div by.

void MatrixBD::stream ( ostream & s ) [virtual]
 

output to stream.

Reimplemented from MatrixC.

MatrixBD MatrixBD::transpose ( ) const
 

return transposed Matrix.

Reimplemented from MatrixC.

void MatrixBD::multiply ( const MatrixBD & A,
const MatrixBD & B,
const char TRANSA = 'N',
const char TRANSB = 'N' ) [inline]
 

Multiplication of two symmetric matrices destroys the symmetry.

void MatrixBD::multiply ( const VectorD & x,
VectorD & y,
const char TRANS = 'N',
const double ALPHA = 1.0,
const double BETA = 0.0 ) const
 

multiplication y=alpha*op(this)*x+beta*y, BLAS level 2.

void MatrixBD::multiply ( const double value )
 

multiply with a constant value and write to this.

void MatrixBD::LUdecompose ( int * IPIV )
 

LU decomposition of a general banded matrix, see note above.

void MatrixBD::LUsubstitute ( MatrixC< double >& B,
int * IPIV )
 

solve triangular system by backsubstitution IPIV is an integer vector of order nc() that contains row column permutations.

void MatrixBD::LUsolve ( MatrixC< double >& B )
 

solve linear equation system.

void MatrixBD::LUinvert ( ) [inline]
 

inversion of a general banded matrix is not implemented.

void MatrixBD::CHdecompose ( )
 

Cholesky CTC decomposition of a symmetric positive definite band matrix.

void MatrixBD::CHsubstitute ( MatrixC< double >& B )
 

solve triangular Cholesky system by backsubstitution.

void MatrixBD::CHsolve ( MatrixC< double >& B )
 

solve linear equation system with a symmetric positive definite banded matrix.

void MatrixBD::CHinvert ( ) [inline]
 

inversion of a symmetric positive definite matrix is not implemented.


The documentation for this class was generated from the following file:
Generated at Wed Nov 22 08:38:29 2000 for LinAl - a simple and efficient Matrix library - by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000