Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Linear Algebra Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWBandMat<T>

Module:  Linear Algebra   Group:  Sparse Matrix Classes


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/lapack/bandmat.h>

RWBandMat<double> d;

Description

The class RWBandMat<T> encapsulates a banded matrix. A banded matrix is nonzero only near the diagonal. Specifically, if u is the upper bandwidth and l the lower, the matrix entry Aij is defined as 0 if either j-i>u or i-j>l. The total bandwidth, simply called bandwidth, is the sum of the upper and lower bandwidths plus 1, for the diagonal. See the Storage Scheme section of this entry for an example of a banded matrix.

Example

Storage Scheme

The matrix is stored column-by-column. There are some unused locations in the vector of data so that each column takes up the same number of entries. For example, the following 9x9 matrix has an upper bandwidth of 1, a lower bandwidth of 2, and thus a total bandwidth of 4:

This matrix is stored as follows:

[ XXX A11 A21 A31 A12 A22 A32 A42 A23 A33 A43 A53

A34 A44 A54 A64 A45 A55 A65 A75 A56 A66 A76 A86

A67 A77 A87 A97 A78 A88 A98 XXX A89 A99 XXX XXX ]

where XXX indicates an unused storage location. The mapping between array entry Aij and the storage vector is as follows:

Public Constructors

RWBandMat();
RWBandMat(const RWBandMat<T>& A);
RWBandMat(unsigned n, unsigned n, unsigned lb,unsigned ub);
RWBandMat(const RWMathVec<T>& vd, unsigned n,
unsigned n, unsigned lb, unsigned ub);
RWBandMat<DComplex>(const RWBandMat<double>& re);
RWBandMat<DComplex>(const RWBandMat<double>& re, 
                const RWBandMat<double>& im);
RWBandMat<double>(const RWBandMat<float>&);
RWBandMat<float>(const RWSymBandMat<float>&);
RWBandMat<double>(const RWSymBandMat<float>&);
RWBandMat<DComplex>(const RWSymBandMat<DComplex>&);
RWBandMat<DComplex>(const RWHermBandMat<DComplex>&);
RWBandMat<T>(const RWTriDiagMat<T>&);

Public Member Functions

unsigned
bandwidth();
RWMathVec<T>
bcdiagonal(int j=0);
RWRORef<T>
bcref(int i, int j);
void
bcset(int i, int j, T x);
T
bcval(int i, int j);
unsigned
binaryStoreSize();
unsigned
cols();
RWBandMat<T>
copy();
T*
data();
RWMathVec<T>
dataVec();
RWBandMat<T>
deepCopy();
void
deepenShallowCopy();
RWMathVec<T>
diagonal(int j=0);
RWBandMat<T>
leadingSubmatrix(int k);
unsigned
lowerBandwidth();
void
printOn(ostream&);
RWRORef<T>
ref(int i, int j);
RWBandMat<T>
reference(RWBandMat<T>&);
void
resize(unsigned n, unsigned n);
void
resize(unsigned n, unsigned n, unsigned lb, unsigned ub);
void
restoreFrom(RWFile&);
void
restoreFrom(RWvistream&);
unsigned
rows();
void
saveOn(RWFile&);
void
saveOn(RWvostream&);
scanFrom(istream&);
void
set(int i, int j, T x);
unsigned
upperBandwidth();
T
val(int i, int j);
RWBandMat<T>
zero();

Public Member Operators

RWRORef<T> RWBandMat<T>::operator() (int i, int j);
T RWBandMat<T>::operator() (int i, int j) const;
RWBandMat<T>&    operator=(const RWBandMat<T>& A);
bool    operator==(const RWBandMat<T>& A);
bool    operator!=(const RWBandMat<T>& A);
RWBandMat<T>&    operator*=(T x);
RWBandMat<T>&    operator/=(T x);
RWBandMat<T>&    operator+=(const RWBandMat<T>& A);
RWBandMat<T>&    operator-=(const RWBandMat<T>& A);
RWBandMat<T>&    operator*=(const RWBandMat<T>& A);
RWBandMat<T>&    operator/=(const RWBandMat<T>& A);

Global Operators

RWBandMat<T>    operator+(const RWBandMat<T>&);
RWBandMat<T>    operator-(const RWBandMat<T>&);
RWBandMat<T>    operator+(const RWBandMat<T>&, 
const RWBandMat<T>&); RWBandMat<T> operator-(const RWBandMat<T>&,
const RWBandMat<T>&); RWBandMat<T> operator*(const RWBandMat<T>&,
const RWBandMat<T>&); RWBandMat<T> operator/(const RWBandMat<T>&,
const RWBandMat<T>&);
RWBandMat<T>    operator*(T,const RWBandMat<T>&);
RWBandMat<T>    operator*(const RWBandMat<T>&,T);
RWBandMat<T>    operator/(const RWBandMat<T>&,T);
ostream&    operator<<(ostream& s, const RWBandMat<T>&);
istream&    operator>>(istream& s, const RWBandMat<T>&);

Global Functions

RWBandMat<T>
abs(const RWBandMat<T>&);
RWBandMat<double>
arg(const RWBandMat<DComplex>& A);
RWBandMat<DComplex>
conj(const RWBandMat<DComplex>& A);
RWBandMat<DComplex>
conjTransposeProduct(const RWBandMat<DComplex>& A, 
const RWBandMat<DComplex>& B);
RWBandMat<double>
imag(const RWBandMat<DComplex>& A);
double
maxValue(const RWBandMat<double>&);
float
maxValue(const RWBandMat<float>&);
double
minValue(const RWBandMat<double>&);
float
minValue(const RWBandMat<float>&);
RWBandMat<double>
norm(const RWBandMat<DComplex>& A);
RWBandMat<T>
product(const RWBandMat<T>& A, const RWBandMat<T>&
        B);
RWMathVec<T>
product(const RWBandMat<T>& A, const RWMathVec<T>&
        x);
RWMathVec<T>
product(const RWMathVec<T>& x, const RWBandMat<T>& A);
RWBandMat<double>
real(const RWBandMat<DComplex>& A);
RWBandMat<T>
toBandMat(const RWGenMat<T>&, unsigned bl, unsigned
bu);
RWBandMat<float>
toFloat(const RWBandMat<double>&);
RWBandMat<DComplex>
toHermBandMat(const RWBandMat<DComplex>& A);
RWSymBandMat<T>
toSymBandMat(const RWBandMat<T>& A);
RWTriDiagMat<T>
toTriDiagMat(const RWBandMat<T>& A);
RWBandMat<T>
transpose(const RWBandMat<T>&);
FloatBandMat
RWBandMat<T>
transposeProduct(const RWBandMat<T>& A,
const RWBandMat<T>& B);


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.