SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWTriDiagMat< TypeT > Class Template Reference

Encapsulates tridiagonal matrices. More...

#include <rw/lapack/trdgmat.h>

Public Member Functions

 RWTriDiagMat ()
 
 RWTriDiagMat (const RWMathVec< TypeT > &data, unsigned n, unsigned nAgain)
 
 RWTriDiagMat (const RWTriDiagMat< double > &re, const RWTriDiagMat< double > &im)
 
 RWTriDiagMat (const RWTriDiagMat< TypeT > &rhs)
 
 RWTriDiagMat (const typename rw_linear_algebra_traits< TypeT >::generic_tri_diag_mat &re)
 
 RWTriDiagMat (unsigned n, unsigned nAgain)
 
 ~RWTriDiagMat ()
 
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
 
RWTriDiagMat< TypeT > copy () const
 
TypeT * data ()
 
const TypeT * data () const
 
RWMathVec< TypeT > dataVec ()
 
const RWMathVec< TypeT > & dataVec () const
 
RWTriDiagMat< TypeT > deepCopy () const
 
void deepenShallowCopy ()
 
RWMathVec< TypeT > diagonal (int j=0) const
 
unsigned halfBandwidth () const
 
RWTriDiagMat< TypeT > leadingSubmatrix (int k)
 
unsigned lowerBandwidth () const
 
bool operator!= (const RWTriDiagMat< TypeT > &X)
 
RWRORef< TypeT > operator() (int i, int j)
 
TypeT operator() (int i, int j) const
 
RWTriDiagMat< TypeT > & operator*= (const RWTriDiagMat< TypeT > &m)
 
RWTriDiagMat< TypeT > & operator*= (TypeT)
 
RWTriDiagMat< TypeT > & operator+= (const RWTriDiagMat< TypeT > &m)
 
RWTriDiagMat< TypeT > & operator-= (const RWTriDiagMat< TypeT > &m)
 
RWTriDiagMat< TypeT > & operator/= (const RWTriDiagMat< TypeT > &m)
 
RWTriDiagMat< TypeT > & operator/= (TypeT)
 
RWTriDiagMat< TypeT > & operator= (const RWTriDiagMat< TypeT > &A)
 
bool operator== (const RWTriDiagMat< TypeT > &X)
 
void printOn (std::ostream &os) const
 
RWRORef< TypeT > ref (int i, int j)
 
RWTriDiagMat< TypeT > & reference (RWTriDiagMat< TypeT > &m)
 
void resize (unsigned m, unsigned n)
 
void restoreFrom (RWFile &f)
 
void restoreFrom (RWvistream &is)
 
unsigned rows () const
 
void saveOn (RWFile &f) const
 
void saveOn (RWvostream &os) const
 
void scanFrom (std::istream &is)
 
TypeT set (int i, int j, TypeT x)
 
unsigned upperBandwidth () const
 
TypeT val (int i, int j) const
 
void zero ()
 

Related Symbols

(Note that these are not member symbols.)

template<class TypeT >
RWTriDiagMat< typename rw_numeric_traits< TypeT >::norm_type > abs (const RWTriDiagMat< TypeT > &M)
 
RWTriDiagMat< double > arg (const RWTriDiagMat< DComplex > &A)
 
RWTriDiagMat< DComplexconj (const RWTriDiagMat< DComplex > &A)
 
RWTriDiagMat< double > imag (const RWTriDiagMat< DComplex > &A)
 
double maxValue (const RWTriDiagMat< double > &A)
 
float maxValue (const RWTriDiagMat< float > &A)
 
double minValue (const RWTriDiagMat< double > &A)
 
float minValue (const RWTriDiagMat< float > &A)
 
RWTriDiagMat< double > norm (const RWTriDiagMat< DComplex > &A)
 
template<class TypeT >
RWTriDiagMat< TypeT > operator* (const RWTriDiagMat< TypeT > &, const RWTriDiagMat< TypeT > &)
 
template<class TypeT >
RWTriDiagMat< TypeT > operator* (const RWTriDiagMat< TypeT > &A, TypeT x)
 
template<class TypeT >
RWTriDiagMat< TypeT > operator* (TypeT x, const RWTriDiagMat< TypeT > &A)
 
template<class TypeT >
RWTriDiagMat< TypeT > operator+ (const RWTriDiagMat< TypeT > &, const RWTriDiagMat< TypeT > &)
 
template<class TypeT >
RWTriDiagMat< TypeT > operator+ (const RWTriDiagMat< TypeT > &m)
 
template<class TypeT >
RWTriDiagMat< TypeT > operator- (const RWTriDiagMat< TypeT > &, const RWTriDiagMat< TypeT > &)
 
template<class TypeT >
RWTriDiagMat< TypeT > operator- (const RWTriDiagMat< TypeT > &m)
 
template<class TypeT >
RWTriDiagMat< TypeT > operator/ (const RWTriDiagMat< TypeT > &, const RWTriDiagMat< TypeT > &)
 
template<class TypeT >
RWTriDiagMat< TypeT > operator/ (const RWTriDiagMat< TypeT > &A, TypeT x)
 
template<class TypeT >
std::ostream & operator<< (std::ostream &s, const RWTriDiagMat< TypeT > &m)
 
template<class TypeT >
std::istream & operator>> (std::istream &s, RWTriDiagMat< TypeT > &m)
 
template<class TypeT >
RWMathVec< TypeT > product (const RWMathVec< TypeT > &x, const RWTriDiagMat< TypeT > &A)
 
template<class TypeT >
RWMathVec< TypeT > product (const RWTriDiagMat< TypeT > &A, const RWMathVec< TypeT > &x)
 
RWTriDiagMat< double > real (const RWTriDiagMat< DComplex > &A)
 
template<class TypeT >
RWTriDiagMat< TypeT > toTriDiagMat (const RWGenMat< TypeT > &A)
 
template<class TypeT >
RWTriDiagMat< TypeT > transpose (const RWTriDiagMat< TypeT > &)
 

Detailed Description

template<class TypeT>
class RWTriDiagMat< TypeT >

The class RWTriDiagMat encapsulates 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.

Synopsis
#include <rw/lapack/trdgmat.h>
Encapsulates tridiagonal matrices.
Definition trdgmat.h:93
Example
#include <rw/lapack/trdgmat.h>
int main() {
m.diagonal() = 1;
m.leadingSubmatrix(3).zero();
return 0;
}

Storage Scheme

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

\[ \begin{bmatrix} A_{11} & A_{12} & 0 & 0 & ... & & & \\ A_{21} & A_{22} & A_{23} & 0 & 0 & ... & & \\ 0 & A_{32} & A_{33} & A_{34} & 0 & 0 & ... & \\ 0 & 0 & A_{43} & A_{44} & A_{45} & 0 & 0 & ... \\ 0 & 0 & 0 & A_{54} & A_{55} & A_{56} & 0 & 0 \\ . & & & & & & & \\ . & & & & & & & \\ . & & & & & & & \\ \end{bmatrix} \]

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
  A12 A22 A32
  A23 A33 A43
  A34 A44 A54
  ...
  Ann XXX ]

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

\[ A(i+1,j+1) \rightarrow vec [ i + 1 + j*2 ] \]

Constructor & Destructor Documentation

◆ RWTriDiagMat() [1/6]

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

Default constructor. Builds a matrix of size 0 x 0. This constructor is necessary to declare a matrix with no explicit constructor or to declare an array of matrices.

◆ RWTriDiagMat() [2/6]

template<class TypeT >
RWTriDiagMat< TypeT >::RWTriDiagMat ( unsigned n,
unsigned nAgain )

Defines an uninitialized matrix of size n x n.

Note
This constructor is used, rather than a constructor that takes only a single argument, to avoid type conversion problems. Both arguments must be equal or a runtime error occurs.

◆ RWTriDiagMat() [3/6]

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

Constructs a size n x n matrix 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.

Note
This constructor is used, rather than a constructor that takes only a single argument, to avoid type conversion problems. The last two arguments must be equal or a runtime error occurs.

◆ RWTriDiagMat() [4/6]

template<class TypeT >
RWTriDiagMat< TypeT >::RWTriDiagMat ( const RWTriDiagMat< TypeT > & rhs)

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

◆ RWTriDiagMat() [5/6]

template<class TypeT >
RWTriDiagMat< TypeT >::RWTriDiagMat ( const typename rw_linear_algebra_traits< TypeT >::generic_tri_diag_mat & re)

Constructs a complex matrix from the real part supplied. The imaginary part is assumed to be 0.

◆ RWTriDiagMat() [6/6]

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

Constructs a complex matrix from the real and imaginary parts supplied.

◆ ~RWTriDiagMat()

template<class TypeT >
RWTriDiagMat< TypeT >::~RWTriDiagMat ( )

Destructor.

Member Function Documentation

◆ bandwidth()

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

Returns the bandwidth of the matrix. The bandwidth of a tridiagonal matrix is always 3.

◆ bcdiagonal()

template<class TypeT >
RWMathVec< TypeT > RWTriDiagMat< 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, the super diagonal by 1, and the subdiagonal by -1.

◆ bcref()

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

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

◆ bcset()

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

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

◆ bcval()

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

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

◆ binaryStoreSize()

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

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

◆ cols()

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

Returns the number of columns in the matrix.

◆ copy()

template<class TypeT >
RWTriDiagMat< TypeT > RWTriDiagMat< 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.

◆ data() [1/2]

template<class TypeT >
TypeT * RWTriDiagMat< 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.

◆ data() [2/2]

template<class TypeT >
const TypeT * RWTriDiagMat< TypeT >::data ( ) const
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.

◆ dataVec() [1/2]

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

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

◆ dataVec() [2/2]

template<class TypeT >
const RWMathVec< TypeT > & RWTriDiagMat< TypeT >::dataVec ( ) const
inline

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

◆ deepCopy()

template<class TypeT >
RWTriDiagMat< TypeT > RWTriDiagMat< 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.

◆ deepenShallowCopy()

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

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

◆ diagonal()

template<class TypeT >
RWMathVec< TypeT > RWTriDiagMat< TypeT >::diagonal ( int j = 0) const
inline

Returns a reference to the j th diagonal of the matrix. The main diagonal is indexed by 0, the super diagonal by 1, and the subdiagonal by -1. 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.

◆ halfBandwidth()

template<class TypeT >
unsigned RWTriDiagMat< TypeT >::halfBandwidth ( ) const
inline

Returns the half bandwidth of the matrix. The half bandwidth of a tridiagonal matrix is always 1.

◆ leadingSubmatrix()

template<class TypeT >
RWTriDiagMat< TypeT > RWTriDiagMat< TypeT >::leadingSubmatrix ( int k)

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

◆ lowerBandwidth()

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

Returns the lower bandwidth of the matrix. The lower bandwidth of a tridiagonal matrix is always 1.

◆ operator!=()

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

Inequality operator. Returns false if two matrices have the same size and their elements are all exactly the same. Otherwise this function returns true. Be aware that floating point arithmetic is not exact; matrices that are theoretically equal are not always numerically equal.

◆ operator()() [1/2]

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

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

◆ operator()() [2/2]

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

Accesses the ij th element. A value is returned, so this operator can be used only for accessing an element. 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.

◆ operator*=() [1/2]

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

Performs element-by-element arithmetic on the data in the matrices. This function does element-by-element multiplication, not inner product style matrix multiplication. You can use the product() global function to do matrix-matrix inner product multiplication.

◆ operator*=() [2/2]

template<class TypeT >
RWTriDiagMat< TypeT > & RWTriDiagMat< TypeT >::operator*= ( TypeT )

Performs the indicated operation on each element of the matrix.

◆ operator+=()

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

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

◆ operator-=()

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

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

◆ operator/=() [1/2]

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

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

◆ operator/=() [2/2]

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

Performs the indicated operation on each element of the matrix.

◆ operator=()

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

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

◆ operator==()

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

Equality operator. Returns true if two matrices have the same size and their elements are all exactly the same. Otherwise this function returns false. Be aware that floating point arithmetic is not exact; matrices that are theoretically equal are not always numerically equal.

◆ printOn()

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

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

◆ ref()

template<class TypeT >
RWRORef< TypeT > RWTriDiagMat< 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.

◆ reference()

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

Makes this matrix a reference to the matrix m. 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 operator=().

◆ resize()

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

Resizes the matrix. Any new entries in the matrix are set to 0. Both arguments must be the same.

◆ restoreFrom() [1/2]

template<class TypeT >
void RWTriDiagMat< TypeT >::restoreFrom ( RWFile & f)

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

◆ restoreFrom() [2/2]

template<class TypeT >
void RWTriDiagMat< TypeT >::restoreFrom ( RWvistream & is)

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() member function.

◆ rows()

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

Returns the number of rows in the matrix.

◆ saveOn() [1/2]

template<class TypeT >
void RWTriDiagMat< TypeT >::saveOn ( RWFile & f) const

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

◆ saveOn() [2/2]

template<class TypeT >
void RWTriDiagMat< TypeT >::saveOn ( RWvostream & os) const

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

◆ scanFrom()

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

Reads a matrix from an input stream. The format of the matrix is the same as the format output by printOn(). Below is a sample matrix that could be input. Note that extra white space and any text preceding the dimension specification are ignored. Only the upper triangle of the matrix is used.

4x4
[
4 1 0 0
-5 9 2 0
0 -5 3 9
0 0 4 3
]

◆ set()

template<class TypeT >
TypeT RWTriDiagMat< TypeT >::set ( int i,
int j,
TypeT x )
inline

Sets the ij thelement 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.

◆ upperBandwidth()

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

Returns the upper bandwidth of the matrix. The upper bandwidth of a tridiagonal matrix is always 1.

◆ val()

template<class TypeT >
TypeT RWTriDiagMat< 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.

◆ zero()

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

Sets every element of the matrix to 0.

Friends And Related Symbol Documentation

◆ abs()

template<class TypeT >
RWTriDiagMat< typename rw_numeric_traits< TypeT >::norm_type > abs ( const RWTriDiagMat< 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.

◆ arg()

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

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

◆ conj()

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

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

◆ imag()

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

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

◆ maxValue() [1/2]

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

Returns the maximum entry in the matrix.

◆ maxValue() [2/2]

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

Returns the maximum entry in the matrix.

◆ minValue() [1/2]

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

Returns the minimum entry in the matrix.

◆ minValue() [2/2]

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

Returns the minimum entry in the matrix.

◆ norm()

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

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

◆ operator*() [1/3]

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

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

◆ operator*() [2/3]

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

Performs element-by-element multiplication on the arguments.

◆ operator*() [3/3]

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

Performs element-by-element multiplication on the arguments.

◆ operator+() [1/2]

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

Performs element-by-element addition on the arguments.

◆ operator+() [2/2]

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

Unary plus operator. Returns a copy of the matrix m.

◆ operator-() [1/2]

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

Performs element-by-element subtraction on the arguments.

◆ operator-() [2/2]

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

Unary minus operator. Returns the negation of the matrix m.

◆ operator/() [1/2]

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

Performs element-by-element division on the arguments.

◆ operator/() [2/2]

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

Performs element-by-element division on the arguments.

◆ operator<<()

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

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

◆ operator>>()

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

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

◆ product() [1/2]

template<class TypeT >
RWMathVec< TypeT > product ( const RWMathVec< TypeT > & x,
const RWTriDiagMat< 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.

◆ product() [2/2]

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

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

◆ real()

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

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

◆ toTriDiagMat()

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

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

◆ transpose()

template<class TypeT >
RWTriDiagMat< TypeT > transpose ( const RWTriDiagMat< TypeT > & )
related

Returns the transpose of the argument matrix. The transpose is made to reference the same data as the argument matrix.

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