>
>#include <rw/dhess.h> // DoubleHessenbergDecomp #include <rw/chess.h> // DComplexHessenbergDecomp DoubleHessenbergDecomp 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 classes {TYPE}HessenbergDecomp encapsulate a Hessenberg decomposition as well as an optional balance transformation. The decomposition of a matix A is:
where Q is orthogonal, H is 0 below the first subdiagonal, and B is a balance transformation. See the entry {TYPE}BalanceTransform.
>#include <iostream.h> #include <rw/dhess.h> main() { RWGenMat<double> A; cin >> A; DoubleHessenbergDecomp hess(A); cout << "Input matrix: " << A << endl; cout << "B: " << hess.B() << endl; cout << "Q: " << hess.Q() << endl; cout << "H: " << hess.H() << endl; }>
DoubleHessenbergDecomp(); DComplexHessenbergDecomp();
Default constructor. Builds a decomposition of size 0 x 0.
DoubleHessenbergDecomp(const RWGenMat<double>& A, RWBoolean permute=TRUE, RWBoolean scale=TRUE); DComplexHessenbergDecomp(const RWGenMat<DComplex>& A, RWBoolean permute=TRUE, RWBoolean 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.
DoubleHessenbergDecomp(const DoubleBalanceDecomp& A); DComplexHessenbergDecomp(const DComplexBalanceDecomp& A);
Builds a Hessenberg decomposition of the matrix represented by the balance decomposition.
RWGenMat<double> DoubleHessenbergDecomp::B() const; RWGenMat<DComplex> DComplexHessenbergDecomp::B() const;
Computes an explicit representation of the balance transformation.
DoubleBalanceTransform DoubleHessenbergDecomp::balanceTransform() const; DComplexBalanceTransform DComplexHessenbergDecomp::balanceTransform() const;
Returns an object which represents the balance transformation.
RWMathVec<double> DoubleHessenbergDecomp::Bx(const RWMathVec<double>& x); RWMathVec<double> DoubleHessenbergDecomp::BInvTx(const RWMathVec<double>& x); RWGenMat<double> DoubleHessenbergDecomp::BX(const RWGenMat<double>& X); RWGenMat<double> DoubleHessenbergDecomp::BInvTX(const RWGenMat<double>& X); RWMathVec<DComplex> DComplexHessenbergDecomp::Bx(const RWMathVec<DComplex>& x); RWMathVec<DComplex> DComplexHessenbergDecomp::BInvTx(const RWMathVec<DComplex>& x); RWGenMat<DComplex> DComplexHessenbergDecomp::BX(const RWGenMat<DComplex>& X); RWGenMat<DComplex> DComplexHessenbergDecomp::BInvTX(const RWGenMat<DComplex>& X);
Computes the inner product of the balance transformation B, or its (conjugate) transpose inverse, and the vector x or the matrix X.
unsigned FloatHessenbergDecomp::cols(); unsigned DoubleHessenbergDecomp::cols(); unsigned DComplexHessenbergDecomp::cols();
Returns the number of columns in the matrix that the decomposition represents.
void DoubleHessenbergDecomp::factor(const RWGenMat<double>& A, RWBoolean permute=TRUE, RWBoolean scale=TRUE); void DComplexHessenbergDecomp::factor(const RWGenMat<DComplex>& A, RWBoolean permute=TRUE, RWBoolean 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 DoubleHessenbergDecomp::factor(const DoubleBalanceDecomp& A); void DComplexHessenbergDecomp::factor (const DComplexBalanceDecomp& A);
Replaces the current decomposition with the Hessenberg decomposition of the matrix represented by the balance decomposition.
RWGenMat<double> DoubleHessenbergDecomp::Q() const; RWGenMat<DComplex> DComplexHessenbergDecomp::Q() const;
Computes an explicit representation of the orthogonal matrix Q.
RWMathVec<double> DoubleHessenbergDecomp::Qx(const RWMathVec<double>& x); RWMathVec<double> DoubleHessenbergDecomp::QTx(const RWMathVec<double>& x); RWGenMat<double> DoubleHessenbergDecomp::QX(const RWGenMat<double>& X); RWGenMat<double> DoubleHessenbergDecomp::QTX(const RWGenMat<double>& X); RWMathVec<DComplex> DComplexHessenbergDecomp::Qx(const RWMathVec<DComplex>& x); RWMathVec<DComplex> DComplexHessenbergDecomp::QTx(const RWMathVec<DComplex>& x); RWGenMat<DComplex> DComplexHessenbergDecomp::QX(const RWGenMat<DComplex>& X); RWGenMat<DComplex> DComplexHessenbergDecomp::QTX(const RWGenMat<DComplex>& X);
Computes the inner product of the orthogonal matrix Q, or its (conjugate) transpose, and the vector x or the matrix X.
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.