Module: Linear Algebra Group: Nonsymmetric Eigenvalue Decomposition classes
Does not inherit
B() balanceTransform() BInvTx() BInvTX() |
BX() Bx() cols() factor() |
Q() QTx() QTX() Qx() |
QX() RWHessenbergDecomp() |
#include <rw/lapack/hess.h> RWHessenbergDecomp<double> hess(A); // A is a
// RWGenMat<double>
A Hessenberg decomposition uses orthogonal transformations to reduce a matrix A to a matrix H that is 0 below the first subdiagonal. Computation of the Hessenberg decomposition is the first step in the QR method for computing eigenvalues of a nonsymmetric matrix.
The class RWHessenbergDecomp<T> encapsulates a Hessenberg decomposition as well as an optional balance transformation. The decomposition of a matrix A is:
where Q is orthogonal, H is 0 below the first subdiagonal, and B is a balance transformation. See the entry RWBalanceTransform<T>.
#include <iostream> #include <rw/lapack/hess.h> int main() { RWGenMat<double> A; std::cin >> A; RWHessenbergDecomp<double> hess(A); std::cout << "Input matrix: " << A << std::endl; std::cout << "B: " << hess.B() << std::endl; std::cout << "Q: " << hess.Q() << std::endl; std::cout << "H: " << hess.H() << std::endl; return 0; }
RWHessenbergDecomp();
Default constructor. Builds a decomposition of size 0 x 0.
RWHessenbergDecomp(const RWGenMat<T>& A, bool permute=true, bool scale=true);
Constructs the Hessenberg decomposition of the matrix A. The boolean parameters determine whether or not the permutation or scaling parts of the balance transformation are applied prior to forming the Hessenberg decomposition.
RWHessenbergDecomp(const RWBalanceDecomp<T>& A);
Builds a Hessenberg decomposition of the matrix represented by the balance decomposition.
RWGenMat<T> B() const;
Computes an explicit representation of the balance transformation.
RWBalanceTransform<T> balanceTransform() const;
Returns an object which represents the balance transformation.
RWMathVec<T> Bx(const RWMathVec<T>& x); RWMathVec<T> BInvTx(const RWMathVec<T>& x); RWGenMat<T> BX(const RWGenMat<T>& X); RWGenMat<T> BInvTX(const RWGenMat<T>& X);
Computes the inner product of the balance transformation B, or its (conjugate) transpose inverse, and the vector x or the matrix X.
unsigned cols();
Returns the number of columns in the matrix that the decomposition represents.
void factor(const RWGenMat<T>& A, bool permute=true, bool scale=true);
Replaces the current decomposition with the Hessenberg decomposition of the matrix A. The boolean parameters determine whether or not the permutation or scaling parts of the balance transformation are applied prior to forming the Hessenberg decomposition.
void factor(const RWBalanceDecomp<T>& A);
Replaces the current decomposition with the Hessenberg decomposition of the matrix represented by the balance decomposition.
RWGenMat<T> Q() const;
Computes an explicit representation of the orthogonal matrix Q.
RWMathVec<T> Qx(const RWMathVec<T>& x); RWMathVec<T> QTx(const RWMathVec<T>& x); RWGenMat<T> QX(const RWGenMat<T>& X); RWGenMat<T> QTX(const RWGenMat<T>& X);
Computes the inner product of the orthogonal matrix Q, or its (conjugate) transpose, and the vector x or the matrix X.
© 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.