Diffpack Documentation


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

MatTri(Type) Class Reference

tridiagonal matrix. More...

#include <MatTri_Type.h>

Inheritance diagram for MatTri(Type)::

Matrix_Type HandleId List of all members.

Public Methods

 MatTri(Type) ()
 MatTri(Type) (int n)
 MatTri(Type) (int nrows, int ncolumns)
 MatTri(Type) (const MatTri(Type) &X)
 MatTri(Type) (const Matrix(prm_Type) &pm)
virtual ~MatTri(Type) ()
virtual int getNoRows () const
virtual int getNoColumns () const
virtual int getNoNonzeroes () const
virtual void size (int &m, int &n) const
int size () const
virtual real getStorage () const
virtual bool makeItSimilar (Handle(Matrix(Type)) &M) const
virtual bool redim (const Matrix(prm_Type) &pm)
bool redim (int n)
bool redim (int nrows, int ncolumns)
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)
Type& operator() (int i, int j)
const Type& operator() (int i, int j) const
const Type& a (int i) const
const Type& b (int i) const
const Type& c (int i) const
Type& a (int i)
Type& b (int i)
Type& c (int i)
Vec(Type)* getaPtr ()
Vec(Type)* getbPtr ()
Vec(Type)* getcPtr ()
Vec(Type)& getaRef ()
Vec(Type)& getbRef ()
Vec(Type)& getcRef ()
virtual void fill (const Matrix(Type) &X)
virtual void fill (Type a)
MatTri(Type)& operator= (const MatTri(Type) &X)
MatTri(Type)& operator= (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) &bb, Type b, Matrix(Type) &cb)
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 bool factChol (bool zero_upper_part=true)
virtual void forwBackChol (Vec(Type) &b, Vec(Type) &x)
virtual bool factLU ()
virtual void forwBackLU (Vec(Type) &b, Vec(Type) &x)
virtual bool factRILU (real omega=0.0, int level=0)
virtual void forwBackRILU (Vec(Type) &b, Vec(Type) &x)
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 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
virtual 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")

Friends

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

Detailed Description

tridiagonal matrix.

NAME: MatTri(Type) - tridiagonal matrix

DESCRIPTION:

The class implements a tridiagonal matrix on the form $\[ \left(\begin{array}{ccccccc} a`_{`1`}&` b`_{`1`}&` 0 `&` ... `&` ... `&` ... `&` 0 `\` c`_{`2`}&` a`_{`2`}&` b`_{`2`}&` 0 `&` ... `&` ... `&` 0 `\` `\mbox{}` 0 `&` c`_{`3`}&` a`_{`3`}&` b`_{`3`}&` 0 `&` ... `&` 0 `\` `\mbox{}` ... `&` ... `&` ... `&` ...`&` ... `&` ... `&` ...`\` `\mbox{}` 0 `&` ... `&` 0 `&` c`_{`n-1`}&` a`_{`n-2`}&` b`_{`n-2`}&` 0 `\` `\mbox{}` 0 `&` ... `&` ... `&` 0 `&` c`_{`n-1`}&` a`_{`n-1`}&` b`_{`n-1`}\` `\mbox{}` 0 `&` ... `&` ... `&` ... `&` 0 `&` c`_{`n`}&` a`_{`n`}\` $ \end{array} \right),\] i.e., the vectors "a", "b" and "c" denote the main diagonal, superdiagonal and subdiagonal, respectively.


Constructor & Destructor Documentation

MatTri(Type)::MatTri_Type ( )
 

There are several constructors, see class "Mat(Type)". However, since the tridiagonal matrices are assumed to be square, one specialized constructor accepts a single integer argument "n" giving the matrix dimensions. Some constructors still accept both row and column dimensions in order to provide compatibility with other matrix formats. If these parameters have different values, an error message is given. Please note that there is not yet support for a symmetric storage scheme.

MatTri(Type)::MatTri_Type ( int n )
 

See documentation of one of the overloaded constructor.

MatTri(Type)::MatTri_Type ( int nrows,
int ncolumns )
 

See documentation of one of the overloaded constructor.

MatTri(Type)::MatTri_Type ( const MatTri(Type) & X )
 

See documentation of one of the overloaded constructor.

MatTri(Type)::MatTri_Type ( const Matrix(prm_Type) & pm )
 

See documentation of one of the overloaded constructor.

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


Member Function Documentation

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

Reimplemented from Matrix(Type).

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

Reimplemented from Matrix(Type).

void MatTri(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 MatTri(Type)::SORsolve ( Vector(Type) & y,
const Vector(Type) & c,
real omega,
TransposeMode tpmode = NOT_TRANSPOSED ) const [virtual]
 

Reimplemented from Matrix(Type).

void MatTri(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 MatTri(Type)::SSORsolve ( Vector(Type) & y,
const Vector(Type) & c,
real omega,
TransposeMode tpmode = NOT_TRANSPOSED ) const [virtual]
 

Reimplemented from Matrix(Type).

Type & MatTri(Type)::a ( int i ) [inline]
 

See documentation of one of the overloaded functions.

const Type & MatTri(Type)::a ( int i ) const [inline]
 

gives access to the entries "a(i)" in the main diagonal of the matrix. If the size of the matrix is large, this mechanism for indexing will more efficient than using the operator"()" or the function "elm".

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

Reimplemented from Matrix(Type).

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

Reimplemented from Matrix(Type).

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

Reimplemented from Matrix(Type).

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

Reimplemented from Matrix(Type).

void MatTri(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).

Type & MatTri(Type)::b ( int i ) [inline]
 

See documentation of one of the overloaded functions.

const Type & MatTri(Type)::b ( int i ) const [inline]
 

gives access to the entries "b(i)" in the superdiagonal of the matrix. If the size of the matrix is large, this mechanism for indexing will more efficient than using the operator"()" or the function "elm".

Type & MatTri(Type)::c ( int i ) [inline]
 

See documentation of one of the overloaded functions.

const Type & MatTri(Type)::c ( int i ) const [inline]
 

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

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

As usual, this function permits matrix adressing using the logical index spaces for "(i,j)" ranging from 1 to "nrows" and "ncolumns", respectively. (Note that for "MatTri(Type)" we have "n" = "nrows" = "ncolumns").

Reimplemented from Matrix(Type).

bool MatTri(Type)::factChol ( bool zero_upper_part = true ) [virtual]
 

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

bool MatTri(Type)::factRILU ( real omega = 0.0,
int level = 0 ) [virtual]
 

Since there is no fill-in when factorizing a tridiagonal matrix, the arguments to this function are of no use. However, they are included in order to maintain compatibility with the corresponding functionality implemented for other matrix formats.

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

Reimplemented from Matrix(Type).

void MatTri(Type)::fill ( Type a ) [virtual]
 

Reimplemented from Matrix(Type).

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

Reimplemented from Matrix(Type).

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

Reimplemented from Matrix(Type).

void MatTri(Type)::forwBackChol ( Vec(Type) & b,
Vec(Type) & x ) [virtual]
 

For the Cholesky factorization, the contents of the input vector "rhs" is not touched and can safely be reused afterwards.

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

In contrast to the "forwBackLU" function implemented for other matrix formats, the version for "MatTri" objects will destroy the contents of the right-hand side vector "rhs" deliverd as input. This is necessary to achieve maximum efficiency. If one would like to keep the right-hand side unchanged, the application programmer has to make a local copy that can be sent to "forwBackLU". Exactly the same behavious applied to "forwBackRILU" since a RILU factorization of a tridiagonal matrix is identical to its LU factorization.

void MatTri(Type)::forwBackRILU ( Vec(Type) & b,
Vec(Type) & x ) [virtual]
 

See comments for "forwBackLU".

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

Reimplemented from Matrix(Type).

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

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

Reimplemented from Matrix(Type).

int MatTri(Type)::getNoNonzeroes ( ) const [inline, 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).

int MatTri(Type)::getNoRows ( ) const [inline, virtual]
 

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

Reimplemented from Matrix(Type).

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

Reimplemented from Matrix(Type).

Vec(Type) * MatTri(Type)::getaPtr ( ) [inline]
 

returns the base adresse of the vector "a" used for storing the main diagonal. Use this function at your own risk.

Vec(Type) & MatTri(Type)::getaRef ( ) [inline]
 

Vec(Type) * MatTri(Type)::getbPtr ( ) [inline]
 

returns the base adresse of the vector "b" used for storing the superdiagonal. Use this function at your own risk.

Vec(Type) & MatTri(Type)::getbRef ( ) [inline]
 

Vec(Type) * MatTri(Type)::getcPtr ( ) [inline]
 

returns the base adresse of the vector "c" used for storing the subdiagonal. Use this function at your own risk.

Vec(Type) & MatTri(Type)::getcRef ( ) [inline]
 

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

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

void MatTri(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 MatTri(Type)::makeItSimilar ( Handle(Matrix(Type)) & M ) const [virtual]
 

Reimplemented from Matrix(Type).

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

Reimplemented from Matrix(Type).

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

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

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

Reimplemented from Matrix(Type).

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

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

Reimplemented from Matrix(Type).

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

Reimplemented from Matrix(Type).

void MatTri(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 MatTri(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 MatTri(Type)::redim ( int nrows,
int ncolumns )
 

See documentation of one of the overloaded functions.

bool MatTri(Type)::redim ( int n )
 

See documentation of one of the overloaded functions.

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

There is a local variant of "redim" that accepts a single integer argument "n" indicating the number of rows and columns in the matrix.

Reimplemented from Matrix(Type).

void MatTri(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 MatTri(Type)::scan ( Is is ) [virtual]
 

Reimplemented from Matrix(Type).

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

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

Reimplemented from Matrix(Type).

bool MatTri(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 MatTri(Type) & X ) [friend]
 

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


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