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

RWTriDiagMat<T>

Module:  Linear Algebra   Group:  Sparse Matrix classes


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/lapack/trdgmat.h>

RWTriDiagMat<double> A;

Description

The class RWTriDiagMat<T> encapsulate tridiagonal matrices. A tridiagonal matrix is nonzero only on the diagonal, the subdiagonal, and the superdiagonal. It is a banded matrix with upper and lower bandwidth
equal to 1.

Example

#include <rw/lapack/trdgmat.h>

int main()
{
    RWTriDiagMat<float> T(5,5);
    T.diagonal() = 1;
    T.leadingSubmatrix(3).zero();
    return 0;
}

Storage Scheme

A tridiagonal matrix is nonzero only along the main diagonal, the subdiagonal, and the superdiagonal:

The matrix is stored in an analogous way to the banded matrix. For convenience, there are some unused locations left in the vector of data. These are indicated as XXX in the following illustration of the storage vector:

[ XXX A11 A21 A21 A22 A32 A23 A33 A43 A34 A44 A54 ... Ann XXX ]

The mapping between the array and storage vector is as follows:

Public Constructors

RWTriDiagMat();
RWTriDiagMat(const RWTriDiagMat<T>& A);
RWTriDiagMat(unsigned n, unsigned n);
RWTriDiagMat(const RWMathVec<T>& data, unsigned n,
unsigned n);
RWTriDiagMat<DComplex>(const RWTriDiagMat<double>&
re); RWTriDiagMat<DComplex>(const RWTriDiagMat<double>&
re, const RWTriDiagMat<double>& im);
RWTriDiagMat<double>(const RWTriDiagMat<float>&);

Public Member Functions

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

Public Member Operators

RWRORef<T>   
RWTriDiagMat<T>::operator()(int i, int j); double
RWTriDiagMat<float>::operator()(int i, int j) const; ROFloatRef RWTriDiagMat<double>::operator()(int i, int j); float RWTriDiagMat<double>::operator()(int i, int j) const; RODComplexRef RWTriDiagMat<DComplex>::operator()(int i, int j); DComplex RWTriDiagMat<DComplex>::operator()(int i, int j)
const;
RWTriDiagMat<T>&    operator=(const RWTriDiagMat<T>&
A);
RWTriDiagMat<T>&    operator==(const RWTriDiagMat<T>&
A); RWTriDiagMat<T>& operator!=(const RWTriDiagMat<T>&
A);
RWTriDiagMat<T>&    operator*=(T x);
RWTriDiagMat<T>&    operator/=(T x);
RWTriDiagMat<T>&    operator+=(const RWTriDiagMat<T>&
A); RWTriDiagMat<T>& operator-=(const RWTriDiagMat<T>&
A); RWTriDiagMat<T>& operator*=(const RWTriDiagMat<T>&
A); RWTriDiagMat<T>& operator/=(const RWTriDiagMat<T>&
A);

Global Operators

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

Global Functions

RWTriDiagMat<double>
abs(const RWTriDiagMat<double>&);
RWTriDiagMat<float>
abs(const RWTriDiagMat<float>&);
RWTriDiagMat<double>
abs(const RWTriDiagMat<DComplex>&);
RWTriDiagMat<double>
arg(const RWTriDiagMat<DComplex>& A);
RWTriDiagMat<DComplex>
conj(const RWTriDiagMat<DComplex>& A);
RWTriDiagMat<double>
imag(const RWTriDiagMat<DComplex>& A);
double
maxValue(const RWTriDiagMat<double>&);
float
maxValue(const RWTriDiagMat<float>&);
double
minValue(const RWTriDiagMat<double>&);
float
minValue(const RWTriDiagMat<float>&);
RWTriDiagMat<double>
norm(const RWTriDiagMat<DComplex>& A);
RWMathVec<T>
product(const RWTriDiagMat<T>& A, 
const RWMathVec<T>& x);
RWMathVec<T>
product(const RWMathVec<T>& x, 
const RWTriDiagMat<T>& A);
RWTriDiagMat<double>
real(const RWTriDiagMat<DComplex>& A);
RWTriDiagMat<float>
toFloat(const RWTriDiagMat<double>&);
RWTriDiagMat<T>
toTriDiagMat(const RWGenMat<T>&);
RWTriDiagMat<T>
transpose(const RWTriDiagMat<T>&);


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.