SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Related Functions
RWBandMat< TypeT > Class Template Reference

Encapsulates a banded matrix. More...

#include <rw/lapack/bandmat.h>

Public Member Functions

 RWBandMat ()
 
 RWBandMat (const RWBandMat< TypeT > &A)
 
 RWBandMat (unsigned n, unsigned nAgain, unsigned lowerWidth, unsigned upperWidth)
 
 RWBandMat (const RWMathVec< TypeT > &data, unsigned n, unsigned nAgain, unsigned lowerWidth, unsigned upperWdth)
 
 RWBandMat (const RWTriDiagMat< TypeT > &A)
 
 RWBandMat (const RWSymBandMat< TypeT > &A)
 
 RWBandMat (const RWHermBandMat< TypeT > &A)
 
 RWBandMat (const RWBandMat< double > &re, const RWBandMat< double > &im)
 
unsigned bandwidth () const
 
RWMathVec< TypeT > bcdiagonal (int j=0) const
 
RWRORef< TypeT > bcref (int i, int j)
 
TypeT bcset (int i, int j, TypeT x)
 
TypeT bcval (int i, int j) const
 
unsigned binaryStoreSize () const
 
unsigned cols () const
 
RWBandMat< TypeT > copy () const
 
TypeT * data ()
 
RWMathVec< TypeT > dataVec ()
 
RWBandMat< TypeT > deepCopy () const
 
void deepenShallowCopy ()
 
RWMathVec< TypeT > diagonal (int i=0) const
 
RWBandMat< TypeT > leadingSubmatrix (int order)
 
unsigned lowerBandwidth () const
 
bool operator!= (const RWBandMat< TypeT > &X)
 
RWRORef< TypeT > operator() (int i, int j)
 
TypeT operator() (int i, int j) const
 
RWBandMat< TypeT > & operator*= (const RWBandMat< TypeT > &m)
 
RWBandMat< TypeT > & operator*= (TypeT)
 
RWBandMat< TypeT > & operator+= (const RWBandMat< TypeT > &m)
 
RWBandMat< TypeT > & operator-= (const RWBandMat< TypeT > &m)
 
RWBandMat< TypeT > & operator/= (const RWBandMat< TypeT > &m)
 
RWBandMat< TypeT > & operator/= (TypeT)
 
RWBandMat< TypeT > & operator= (const RWBandMat< TypeT > &m)
 
bool operator== (const RWBandMat< TypeT > &X)
 
void printOn (std::ostream &) const
 
RWRORef< TypeT > ref (int i, int j)
 
RWBandMat< TypeT > & reference (RWBandMat< TypeT > &m)
 
void resize (unsigned m, unsigned n)
 
void resize (unsigned n, unsigned nAgain, unsigned lowWidth, unsigned upWidth)
 
void restoreFrom (RWvistream &)
 
void restoreFrom (RWFile &)
 
unsigned rows () const
 
void saveOn (RWvostream &) const
 
void saveOn (RWFile &) const
 
void scanFrom (std::istream &)
 
TypeT set (int i, int j, TypeT x)
 
unsigned upperBandwidth () const
 
TypeT val (int i, int j) const
 
void zero ()
 

Related Functions

(Note that these are not member functions.)

template<class TypeT >
RWBandMat< typename rw_numeric_traits< TypeT >::norm_type > abs (const RWBandMat< TypeT > &M)
 
RWBandMat< double > arg (const RWBandMat< DComplex > &A)
 
RWBandMat< DComplexconj (const RWBandMat< DComplex > &A)
 
RWBandMat< DComplexconjTransposeProduct (const RWBandMat< DComplex > &A, const RWBandMat< DComplex > &B)
 
RWBandMat< double > imag (const RWBandMat< DComplex > &A)
 
template<class TypeT >
TypeT maxValue (const RWBandMat< TypeT > &A)
 
template<class TypeT >
TypeT minValue (const RWBandMat< TypeT > &A)
 
RWBandMat< double > norm (const RWBandMat< DComplex > &A)
 
template<class TypeT >
RWBandMat< TypeT > operator* (const RWBandMat< TypeT > &, const RWBandMat< TypeT > &)
 
template<class TypeT >
RWBandMat< TypeT > operator* (const RWBandMat< TypeT > &A, TypeT x)
 
template<class TypeT >
RWBandMat< TypeT > operator* (TypeT x, const RWBandMat< TypeT > &A)
 
template<class TypeT >
RWBandMat< TypeT > operator+ (const RWBandMat< TypeT > &)
 
template<class TypeT >
RWBandMat< TypeT > operator+ (const RWBandMat< TypeT > &, const RWBandMat< TypeT > &)
 
template<class TypeT >
RWBandMat< TypeT > operator- (const RWBandMat< TypeT > &)
 
template<class TypeT >
RWBandMat< TypeT > operator- (const RWBandMat< TypeT > &, const RWBandMat< TypeT > &)
 
template<class TypeT >
RWBandMat< TypeT > operator/ (const RWBandMat< TypeT > &, const RWBandMat< TypeT > &)
 
template<class TypeT >
RWBandMat< TypeT > operator/ (const RWBandMat< TypeT > &A, TypeT x)
 
template<class TypeT >
std::ostream & operator<< (std::ostream &s, const RWBandMat< TypeT > &m)
 
template<class TypeT >
std::istream & operator>> (std::istream &s, RWBandMat< TypeT > &m)
 
template<class TypeT >
RWMathVec< TypeT > product (const RWBandMat< TypeT > &A, const RWMathVec< TypeT > &x)
 
template<class TypeT >
RWMathVec< TypeT > product (const RWMathVec< TypeT > &x, const RWBandMat< TypeT > &A)
 
template<class TypeT >
RWBandMat< TypeT > product (const RWBandMat< TypeT > &A, const RWBandMat< TypeT > &B)
 
RWBandMat< double > real (const RWBandMat< DComplex > &A)
 
template<class TypeT >
RWBandMat< TypeT > toBandMat (const RWGenMat< TypeT > &A, unsigned bandl, unsigned bandu)
 
template<class TypeT >
RWHermBandMat< TypeT > toHermBandMat (const RWBandMat< TypeT > &A)
 
template<class TypeT >
RWTriDiagMat< TypeT > toTriDiagMat (const RWBandMat< TypeT > &A)
 
template<class TypeT >
RWBandMat< TypeT > transpose (const RWBandMat< TypeT > &A)
 
template<class TypeT >
RWBandMat< TypeT > transposeProduct (const RWBandMat< TypeT > &A, const RWBandMat< TypeT > &B)
 

Detailed Description

template<class TypeT>
class RWBandMat< TypeT >

The class RWBandMat 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.

Synopsis
#include <rw/lapack/bandmat.h>
Example
#include <iostream>
#include <rw/lapack/bandmat.h>
int main(){
RWBandMat<double> d(9, 9, 2, 1);
d.diagonal(-2) = 1;
d.diagonal(-1) = 2;
d.diagonal( ) = 3;
d.diagonal( 1) = 4;
std::cout << d;
return 0;
}

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:

\[ \begin{bmatrix} A_{11} & A_{12} & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ A_{21} & A_{22} & A_{23} & 0 & 0 & 0 & 0 & 0 & 0 \\ A_{31} & A_{32} & A_{33} & A_{34} & 0 & 0 & 0 & 0 & 0 \\ 0 & A_{42} & A_{43} & A_{44} & A_{45} & 0 & 0 & 0 & 0 \\ 0 & 0 & A_{53} & A_{54} & A_{55} & A_{56} & 0 & 0 & 0 \\ 0 & 0 & 0 & A_{64} & A_{65} & A_{66} & A_{67} & 0 & 0 \\ 0 & 0 & 0 & 0 & A_{75} & A_{76} & A_{77} & A_{78} & 0 \\ 0 & 0 & 0 & 0 & 0 & A_{86} & A_{87} & A_{88} & A_{89} \\ 0 & 0 & 0 & 0 & 0 & 0 & A_{97} & A_{98} & A_{99} \end{bmatrix} \]

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:

\[ A[i + 1, j + 1] \to vec[i - j + upperBandwidth + j * bandwidth] \]

Constructor & Destructor Documentation

template<class TypeT>
RWBandMat< TypeT >::RWBandMat ( )

Default constructor. Builds a matrix of size 0 by 0. Necessary for declaring a matrix with no explicit constructor, or an array of matrices.

template<class TypeT>
RWBandMat< TypeT >::RWBandMat ( const RWBandMat< TypeT > &  A)

Builds a copy of the argument, A. Note that the new matrix references A's data. To construct a matrix with its own copy of the data, use either the copy() or deepenShallowCopy() member functions.

template<class TypeT>
RWBandMat< TypeT >::RWBandMat ( unsigned  n,
unsigned  nAgain,
unsigned  lowerWidth,
unsigned  upperWidth 
)

Defines an uninitialized matrix of size n x nAgain with lower bandwidth lowerWidth and upper bandwidth upperWidth.

template<class TypeT>
RWBandMat< TypeT >::RWBandMat ( const RWMathVec< TypeT > &  data,
unsigned  n,
unsigned  nAgain,
unsigned  lowerWidth,
unsigned  upperWdth 
)

Constructs a size n x nAgain matrix, with lower bandwidth lowerWidth and upper bandwidth upperWidth, using the data in the passed vector. This data must be stored in the format described in the Storage Scheme section. The resultant matrix references the data in vector data.

template<class TypeT>
RWBandMat< TypeT >::RWBandMat ( const RWTriDiagMat< TypeT > &  A)

Constructs a banded matrix from a symmetric banded, Hermitian banded, or tridiagonal matrix.

template<class TypeT>
RWBandMat< TypeT >::RWBandMat ( const RWSymBandMat< TypeT > &  A)

Constructs a banded matrix from a symmetric banded, Hermitian banded, or tridiagonal matrix.

template<class TypeT>
RWBandMat< TypeT >::RWBandMat ( const RWHermBandMat< TypeT > &  A)

Constructs a banded matrix from a symmetric banded, Hermitian banded, or tridiagonal matrix.

template<class TypeT>
RWBandMat< TypeT >::RWBandMat ( const RWBandMat< double > &  re,
const RWBandMat< double > &  im 
)

Constructs a complex matrix from the real and imaginary parts supplied. If no imaginary part is supplied, it is assumed to be 0.

Member Function Documentation

template<class TypeT>
unsigned RWBandMat< TypeT >::bandwidth ( ) const
inline

Returns the bandwidth of the matrix. The bandwidth is the sum of the upper and lower bandwidths plus 1 for the main diagonal.

template<class TypeT>
RWMathVec<TypeT> RWBandMat< TypeT >::bcdiagonal ( int  j = 0) const

Returns a reference to the j th diagonal of the matrix, after doing bounds checking. The main diagonal is indexed by 0, diagonals in the upper triangle are indexed with positive integers, and diagonals in the lower triangle are indexed with negative integers.

template<class TypeT>
RWRORef<TypeT> RWBandMat< TypeT >::bcref ( int  i,
int  j 
)

Returns a reference to the ij th element of the matrix, after doing bounds checking.

template<class TypeT>
TypeT RWBandMat< TypeT >::bcset ( int  i,
int  j,
TypeT  x 
)

Sets the ij th element of the matrix equal to x, after doing bounds checking.

template<class TypeT>
TypeT RWBandMat< TypeT >::bcval ( int  i,
int  j 
) const

Returns the value of the ij th element of the matrix, after doing bounds checking.

template<class TypeT>
unsigned RWBandMat< TypeT >::binaryStoreSize ( ) const

Returns the number of bytes that it would take to write the matrix to a file using saveOn(RWFile&) const.

template<class TypeT>
unsigned RWBandMat< TypeT >::cols ( ) const
inline

Returns the number of columns in the matrix.

template<class TypeT>
RWBandMat<TypeT> RWBandMat< TypeT >::copy ( ) const

Creates a copy of this matrix with distinct data. The stride of the data vector in the new matrix is guaranteed to be 1.

template<class TypeT>
TypeT* RWBandMat< TypeT >::data ( )
inline

Returns a pointer to the first item of data in the vector storing the matrix's data. You can use this (with caution!) to pass the matrix's data to C or FORTRAN subroutines. Be aware that the stride of the data vector may not be 1.

template<class TypeT>
RWMathVec<TypeT> RWBandMat< TypeT >::dataVec ( )
inline

Returns the matrix's data vector, where the explicitly stored entries in the matrix are kept.

template<class TypeT>
RWBandMat<TypeT> RWBandMat< TypeT >::deepCopy ( ) const
inline

Creates a copy of this matrix with distinct data. The stride of the data vector in the new matrix is guaranteed to be 1.

template<class TypeT>
void RWBandMat< TypeT >::deepenShallowCopy ( )
inline

Ensures that the data in the matrix is not shared by any other matrix or vector. Also ensure that the stride in the data vector is equal to 1. If necessary, a new copy of the data vector is made.

template<class TypeT>
RWMathVec<TypeT> RWBandMat< TypeT >::diagonal ( int  i = 0) const
inline

Returns a reference to the i th diagonal of the matrix. The main diagonal is indexed by 0, diagonals in the upper triangle are indexed with positive integers, and diagonals in the lower triangle are indexed with negative integers. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined when the header file is read. The member function bcdiagonal() does the same thing with guaranteed bounds checking.

template<class TypeT>
RWBandMat<TypeT> RWBandMat< TypeT >::leadingSubmatrix ( int  order)

Returns the order x order upper left corner of the matrix. The submatrix and the matrix share the same data.

template<class TypeT>
unsigned RWBandMat< TypeT >::lowerBandwidth ( ) const
inline

Returns the lower bandwidth of the matrix.

template<class TypeT>
bool RWBandMat< TypeT >::operator!= ( const RWBandMat< TypeT > &  X)
inline

Boolean operators. Two matrices are considered equal if they have the same size and their elements are all exactly the same. Be aware that floating point arithmetic is not exact; matrices which are theoretically equal are not always numerically equal.

template<class TypeT>
RWRORef<TypeT> RWBandMat< TypeT >::operator() ( int  i,
int  j 
)
inline

Accesses the ij th element. If the matrix is not a const matrix, a reference type is returned, so this operator can be used for assigning or accessing an element. In these cases, using this operator is equivalent to calling the ref() member function. If the matrix is a const matrix, a value is returned, so this operator can be used only for accessing an element. In this case, using this operator is equivalent to calling the val() member function. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined before including the header file.

template<class TypeT>
TypeT RWBandMat< TypeT >::operator() ( int  i,
int  j 
) const
inline

Accesses the ij th element. If the matrix is not a const matrix, a reference type is returned, so this operator can be used for assigning or accessing an element. In these cases, using this operator is equivalent to calling the ref() member function. If the matrix is a const matrix, a value is returned, so this operator can be used only for accessing an element. In this case, using this operator is equivalent to calling the val() member function. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined before including the header file.

template<class TypeT>
RWBandMat<TypeT>& RWBandMat< TypeT >::operator*= ( const RWBandMat< TypeT > &  m)

Performs element-by-element arithmetic on the data in the matrices.

Note
This operator does element-by-element multiplication, not inner product style matrix multiplication. You can use product() to do matrix-matrix inner product multiplication.
template<class TypeT>
RWBandMat<TypeT>& RWBandMat< TypeT >::operator*= ( TypeT  )

Performs the indicated operation on each element of the matrix.

template<class TypeT>
RWBandMat<TypeT>& RWBandMat< TypeT >::operator+= ( const RWBandMat< TypeT > &  m)

Performs element-by-element arithmetic on the data in the matrices.

template<class TypeT>
RWBandMat<TypeT>& RWBandMat< TypeT >::operator-= ( const RWBandMat< TypeT > &  m)

Performs element-by-element arithmetic on the data in the matrices.

template<class TypeT>
RWBandMat<TypeT>& RWBandMat< TypeT >::operator/= ( const RWBandMat< TypeT > &  m)

Performs element-by-element arithmetic on the data in the matrices.

template<class TypeT>
RWBandMat<TypeT>& RWBandMat< TypeT >::operator/= ( TypeT  )

Performs the indicated operation on each element of the matrix.

template<class TypeT>
RWBandMat<TypeT>& RWBandMat< TypeT >::operator= ( const RWBandMat< TypeT > &  m)

Sets the matrix elements equal to the elements of m. The two matrices must be the same size. To make the matrix reference the same data as m, use the reference() member function.

template<class TypeT>
bool RWBandMat< TypeT >::operator== ( const RWBandMat< TypeT > &  X)

Boolean operators. Two matrices are considered equal if they have the same size and their elements are all exactly the same. Be aware that floating point arithmetic is not exact; matrices which are theoretically equal are not always numerically equal.

template<class TypeT>
void RWBandMat< TypeT >::printOn ( std::ostream &  ) const

Prints the matrix to an output stream in human readable format.

template<class TypeT>
RWRORef<TypeT> RWBandMat< TypeT >::ref ( int  i,
int  j 
)
inline

Returns a reference to the ij th element of the matrix. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined when the header file is read. The member function bcref() does the same thing with guaranteed bounds checking.

template<class TypeT>
RWBandMat<TypeT>& RWBandMat< TypeT >::reference ( RWBandMat< TypeT > &  m)

Makes this matrix a reference to the argument matrix. The two matrices share the same data. The matrices do not have to be the same size before calling reference(). To copy a matrix into another of the same size, use the operator=() member operator.

template<class TypeT>
void RWBandMat< TypeT >::resize ( unsigned  m,
unsigned  n 
)

Resizes the matrix or changes both its size and lower and upper bandwidths. Any new entries in the matrix are set to 0.

template<class TypeT>
void RWBandMat< TypeT >::resize ( unsigned  n,
unsigned  nAgain,
unsigned  lowWidth,
unsigned  upWidth 
)

Resizes the matrix or changes both its size and lower and upper bandwidths. Any new entries in the matrix are set to 0.

template<class TypeT>
void RWBandMat< TypeT >::restoreFrom ( RWvistream )

Reads in a matrix from an RWvistream, the Rogue Wave virtual input stream class. The matrix must have been stored to the stream using the saveOn(RWvostream&) const member function.

template<class TypeT>
void RWBandMat< TypeT >::restoreFrom ( RWFile )

Reads in a matrix from an RWFile. The matrix must have been stored to the file using the saveOn(RWFile&) const member function.

template<class TypeT>
unsigned RWBandMat< TypeT >::rows ( ) const
inline

Returns the number of rows in the matrix.

template<class TypeT>
void RWBandMat< TypeT >::saveOn ( RWvostream ) const

Stores a matrix to an RWvostream, the Rogue Wave virtual output stream class. The matrix can be read using the restoreFrom(RWvistream&) member function.

template<class TypeT>
void RWBandMat< TypeT >::saveOn ( RWFile ) const

Stores a matrix to an RWFile. The matrix can be read using the restoreFrom(RWFile&) member function.

template<class TypeT>
void RWBandMat< TypeT >::scanFrom ( std::istream &  )

Reads a matrix from an input stream. The format of the matrix is the same as the format output by the printOn() member function: first the lower bandwidth, followed by the upper bandwidth, followed by the matrix itself. The sample matrix below shows the format. Note that extra white space and text preceding the bandwidth specification are ignored. Only the relevant band of the matrix is used.

2 1 5x5
[ 1 1 0 0 0
7 4 3 0 0
5 5 4 5 0
0 1 3 1 1
0 0 8 1 4 ]
template<class TypeT>
TypeT RWBandMat< TypeT >::set ( int  i,
int  j,
TypeT  x 
)
inline

Sets the ij th element of the matrix equal to x. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined when the header file is read. The member function bcset() does the same thing with guaranteed bounds checking.

template<class TypeT>
unsigned RWBandMat< TypeT >::upperBandwidth ( ) const
inline

Returns the upper bandwidth of the matrix.

template<class TypeT>
TypeT RWBandMat< TypeT >::val ( int  i,
int  j 
) const
inline

Returns the value of the ij th element of the matrix. Bounds checking is done if the preprocessor symbol RWBOUNDS_CHECK is defined when the header file is read. The member function bcval() does the same thing with guaranteed bounds checking.

template<class TypeT>
void RWBandMat< TypeT >::zero ( )
inline

Sets every element of the matrix to 0.

Friends And Related Function Documentation

template<class TypeT >
RWBandMat< typename rw_numeric_traits< TypeT >::norm_type > abs ( const RWBandMat< TypeT > &  M)
related

Returns a matrix whose entries are the absolute value of the argument. The absolute value of a complex number is considered to be the sum of the absolute values of its real and imaginary parts. To get the norm of a complex matrix, you can use the norm() function.

template<class TypeT>
RWBandMat< double > arg ( const RWBandMat< DComplex > &  A)
related

Returns a matrix where each element is the argument of the corresponding element in the matrix A.

template<class TypeT>
RWBandMat< DComplex > conj ( const RWBandMat< DComplex > &  A)
related

Returns a matrix where each element is the complex conjugate of the corresponding element in the matrix A.

template<class TypeT>
RWBandMat< DComplex > conjTransposeProduct ( const RWBandMat< DComplex > &  A,
const RWBandMat< DComplex > &  B 
)
related

Returns the inner product (matrix product) of the complex conjugate transpose of A and the matrix B. This product is a banded matrix whose lower bandwidth is the sum of the upper bandwidth of A and the lower bandwidth of B, and whose upper bandwidth is the sum of the lower bandwidth of A and the upper bandwidth of B.

template<class TypeT>
RWBandMat< double > imag ( const RWBandMat< DComplex > &  A)
related

Returns a matrix where each element is the imaginary part of the corresponding element in the matrix A.

template<class TypeT >
TypeT maxValue ( const RWBandMat< TypeT > &  A)
related

Returns the maximum entry in the matrix.

template<class TypeT >
TypeT minValue ( const RWBandMat< TypeT > &  A)
related

Returns the minimum entry in the matrix.

template<class TypeT>
RWBandMat< double > norm ( const RWBandMat< DComplex > &  A)
related

Returns a matrix where each element is the norm (magnitude) of the corresponding element in the matrix A.

template<class TypeT >
RWBandMat< TypeT > operator* ( const RWBandMat< TypeT > &  ,
const RWBandMat< TypeT > &   
)
related

Performs element-by-element operations on the arguments. To do inner product matrix multiplication, use the product global function.

template<class TypeT >
RWBandMat< TypeT > operator* ( const RWBandMat< TypeT > &  A,
TypeT  x 
)
related

Performs element-by-element operations on the arguments.

template<class TypeT >
RWBandMat< TypeT > operator* ( TypeT  x,
const RWBandMat< TypeT > &  A 
)
related

Performs element-by-element operations on the arguments.

template<class TypeT >
RWBandMat< TypeT > operator+ ( const RWBandMat< TypeT > &  )
related

Unary plus and minus operators. Each operator returns a copy of the matrix or its negation.

template<class TypeT >
RWBandMat< TypeT > operator+ ( const RWBandMat< TypeT > &  ,
const RWBandMat< TypeT > &   
)
related

Performs element-by-element operations on the arguments. To do inner product matrix multiplication, use the product global function.

template<class TypeT >
RWBandMat< TypeT > operator- ( const RWBandMat< TypeT > &  )
related

Unary plus and minus operators. Each operator returns a copy of the matrix or its negation.

template<class TypeT >
RWBandMat< TypeT > operator- ( const RWBandMat< TypeT > &  ,
const RWBandMat< TypeT > &   
)
related

Performs element-by-element operations on the arguments. To do inner product matrix multiplication, use the product global function.

template<class TypeT >
RWBandMat< TypeT > operator/ ( const RWBandMat< TypeT > &  ,
const RWBandMat< TypeT > &   
)
related

Performs element-by-element operations on the arguments. To do inner product matrix multiplication, use the product global function.

template<class TypeT >
RWBandMat< TypeT > operator/ ( const RWBandMat< TypeT > &  A,
TypeT  x 
)
related

Performs element-by-element operations on the arguments.

template<class TypeT >
std::ostream & operator<< ( std::ostream &  s,
const RWBandMat< TypeT > &  m 
)
related

Writes the matrix to the stream. This is equivalent to calling the printOn() member function.

template<class TypeT >
std::istream & operator>> ( std::istream &  s,
RWBandMat< TypeT > &  m 
)
related

Reads the matrix from the stream. This is equivalent to calling the scanFrom() member function.

template<class TypeT >
RWMathVec< TypeT > product ( const RWBandMat< TypeT > &  A,
const RWMathVec< TypeT > &  x 
)
related

Returns the inner product (matrix-vector product) of A and x.

template<class TypeT >
RWMathVec< TypeT > product ( const RWMathVec< TypeT > &  x,
const RWBandMat< TypeT > &  A 
)
related

Returns the inner product (matrix-vector product) of x and A. This is equal to the product of A transpose and x.

template<class TypeT >
RWBandMat< TypeT > product ( const RWBandMat< TypeT > &  A,
const RWBandMat< TypeT > &  B 
)
related

Returns the inner product (matrix product) of A and B. This product is a banded matrix whose lower bandwidth is the sum of the lower bandwidths of A and B, and whose upper bandwidth is the sum of the upper bandwidths of A and B.

template<class TypeT>
RWBandMat< double > real ( const RWBandMat< DComplex > &  A)
related

Returns a matrix where each element is the real part of the corresponding element in the matrix A.

template<class TypeT >
RWBandMat< TypeT > toBandMat ( const RWGenMat< TypeT > &  A,
unsigned  bandl,
unsigned  bandu 
)
related

Extracts a band of entries from a square matrix. The main diagonal is extracted, along with bandl diagonals from the upper triangle of the matrix, and bandu diagonals from the lower triangle of the matrix.

template<class TypeT >
RWHermBandMat< TypeT > toHermBandMat ( const RWBandMat< TypeT > &  A)
related

Extracts the Hermitian part of a banded matrix. The Hermitian part of the banded matrix A is \( (A + conj( A^{T}))/2 \).

template<class TypeT >
RWTriDiagMat< TypeT > toTriDiagMat ( const RWBandMat< TypeT > &  A)
related

Extracts the tridiagonal part of a general banded matrix. The tridiagonal part of matrix A consists of the main diagonal, the subdiagonal, and the superdiagonal.

template<class TypeT >
RWBandMat< TypeT > transpose ( const RWBandMat< TypeT > &  A)
related

Returns the transpose of the argument matrix.

template<class TypeT >
RWBandMat< TypeT > transposeProduct ( const RWBandMat< TypeT > &  A,
const RWBandMat< TypeT > &  B 
)
related

Returns the inner product (matrix product) of the transpose of A and the matrix B. This product is a banded matrix whose lower bandwidth is the sum of the upper bandwidth of A and the lower bandwidth of B, and whose upper bandwidth is the sum of the lower bandwidth of A and the upper bandwidth of B.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.