Module: Linear Algebra Group: Decomposition classes
Does not inherit
#include <rw/lapack/td.h> RWBandTriDiagDecomp<double>(A); // A is a DoubleSymMat
The class RWBandTriDiagDecomp<T> encapsulates a symmetric tridiagonal decomposition of a symmetric banded matrix A:
where Q is orthogonal and T is real tridiagonal symmetric. This class is used internally by the symmetric eigenvalue classes.
#include <rw/lapack/sbndmat.h> #include <rw/lapack/td.h> #include <iostream> int main() { RWSymBandMat<double> A; std::cin >> A; RWSymBandTriDiagDecomp<double> decomp(A); std::cout << "T's diagonal is" << decomp.diagonal() << std::endl; std::cout << "T's off diagonal is " << decomp.offDiagonal()
<< std::endl; return 0; }
RWBandTriDiagDecomp<double>::RWBandTriDiagDecomp
(const RWSymMat<double>& A, bool keepQ=true); RWBandTriDiagDecomp<float>::RWBandTriDiagDecomp(const
RWSymMat<float>& A, bool keepQ=true); RWBandTriDiagDecomp<DComplex>::RWBandTriDiagDecomp(const
RWHermBandMat<DComplex>& A, bool keepQ=true);
Constructs a tridiagonal decomposition of A. By setting the optional boolean parameter to false, the data necessary to transform via Q is not stored. This can save substantial storage costs, but an exception is thrown if you attempt to use the member function transform.
unsigned cols() const;
Returns the number of columns in the decomposition.
const RWMathVec<T> diagonal() const;
Returns the diagonal of the symmetric tridiagonal matrix T.
const RWMathVec<T>
offDiagonal() const;
Returns the subdiagonal or superdiagonal of the symmetric tridiagonal matrix T.
unsigned rows() const;
Returns the number of rows in the decomposition.
void set(const RWMathVec<T>& diag,const RWMathVec<T>& offdiag);
Sets the tridiagonal matrix directly.
virtual RWMathVec<T> transform(const RWMathVec<T>& x); virtual RWGenMat<T> transform(const RWGenMat<T>& x);
Transforms the vector from tridiagonal decomposition space back to the original matrix space. This amounts to multiplying it by the matrix Q.
© 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.