Module: Linear Algebra Group: Decomposition classes
Does not inherit
#include <rw/lapack/td.h> RWDenseTriDiagDecomp<double> QTQ(A); // A is a
// RWSymMat<double>
The class RWDenseTriDiagDecomp<T> encapsulates the symmetric tri-
diagonal decomposition of a dense symmetric matrix A, where:
and Q is orthogonal and T is real tridiagonal symmetric. These classes are used internally by the symmetric eigenvalue classes.
#include <rw/lapack/symmat.h> #include <rw/lapack/td.h> #include <iostream> int main() { RWSymMat<double> A; std::cin >> A; RWDenseTriDiagDecomp<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; }
RWDenseTriDiagDecomp(const RWSymMat<T>& A);
Constructs a tridiagonal decomposition of A.
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.