SourcePro® API Reference Guide

Product Documentation:
   SourcePro
Documentation Home
List of all members | Public Member Functions
RWHessenbergDecomp< TypeT > Class Template Reference

Encapsulates a Hessenberg decomposition as well as an optional balance transformation. More...

#include <rw/lapack/hess.h>

Public Member Functions

 RWHessenbergDecomp ()
 
 RWHessenbergDecomp (const RWGenMat< TypeT > &A, bool permute=true, bool scale=true)
 
 RWHessenbergDecomp (const RWBalanceDecomp< TypeT > &)
 
RWGenMat< TypeT > B () const
 
RWBalanceTransform< TypeT > balanceTransform () const
 
RWMathVec< TypeT > BInvTx (const RWMathVec< TypeT > &x) const
 
RWGenMat< TypeT > BInvTX (const RWGenMat< TypeT > &X) const
 
RWMathVec< TypeT > Bx (const RWMathVec< TypeT > &x) const
 
RWGenMat< TypeT > BX (const RWGenMat< TypeT > &X) const
 
unsigned cols () const
 
void factor (const RWGenMat< TypeT > &A, bool permute=true, bool scale=true)
 
void factor (const RWBalanceDecomp< TypeT > &)
 
RWGenMat< TypeT > Q () const
 
RWMathVec< TypeT > QTx (const RWMathVec< TypeT > &) const
 
RWGenMat< TypeT > QTX (const RWGenMat< TypeT > &X) const
 
RWMathVec< TypeT > Qx (const RWMathVec< TypeT > &x) const
 
RWGenMat< TypeT > QX (const RWGenMat< TypeT > &X) const
 

Detailed Description

template<class TypeT>
class RWHessenbergDecomp< TypeT >

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 encapsulates a Hessenberg decomposition as well as an optional balance transformation. The decomposition of a matrix A is:

\[ A = BQHQ'B^{-1} \]

where Q is orthogonal, H is 0 below the first subdiagonal, and B is a balance transformation. See the entry RWBalanceTransform.

Synopsis
#include <rw/lapack/hess.h>
RWHessenbergDecomp<double> hess(A); // A is a
// RWGenMat<double>
Example
#include <iostream>
#include <rw/lapack/hess.h>
int main()
{
std::cin >> 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;
}

Constructor & Destructor Documentation

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

Default constructor. Builds a decomposition of size 0 x 0.

template<class TypeT>
RWHessenbergDecomp< TypeT >::RWHessenbergDecomp ( const RWGenMat< TypeT > &  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.

template<class TypeT>
RWHessenbergDecomp< TypeT >::RWHessenbergDecomp ( const RWBalanceDecomp< TypeT > &  )

Builds a Hessenberg decomposition of the matrix represented by the balance decomposition.

Member Function Documentation

template<class TypeT>
RWGenMat<TypeT> RWHessenbergDecomp< TypeT >::B ( ) const

Computes an explicit representation of the balance transformation.

template<class TypeT>
RWBalanceTransform<TypeT> RWHessenbergDecomp< TypeT >::balanceTransform ( ) const
inline

Returns an object which represents the balance transformation.

template<class TypeT>
RWMathVec<TypeT> RWHessenbergDecomp< TypeT >::BInvTx ( const RWMathVec< TypeT > &  x) const

Computes the (conjugate) transpose inverse of the balance transformation B and the vector x.

template<class TypeT>
RWGenMat<TypeT> RWHessenbergDecomp< TypeT >::BInvTX ( const RWGenMat< TypeT > &  X) const

Computes the (conjugate) transpose inverse of the balance transformation B and the matrix X.

template<class TypeT>
RWMathVec<TypeT> RWHessenbergDecomp< TypeT >::Bx ( const RWMathVec< TypeT > &  x) const

Computes the inner product of the balance transformation B and the vector x.

template<class TypeT>
RWGenMat<TypeT> RWHessenbergDecomp< TypeT >::BX ( const RWGenMat< TypeT > &  X) const

Computes the inner product of the balance transformation B and the matrix X.

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

Returns the number of columns in the matrix that the decomposition represents.

template<class TypeT>
void RWHessenbergDecomp< TypeT >::factor ( const RWGenMat< TypeT > &  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.

template<class TypeT>
void RWHessenbergDecomp< TypeT >::factor ( const RWBalanceDecomp< TypeT > &  )

Replaces the current decomposition with the Hessenberg decomposition of the matrix represented by the balance decomposition.

template<class TypeT>
RWGenMat<TypeT> RWHessenbergDecomp< TypeT >::Q ( ) const

Computes an explicit representation of the orthogonal matrix Q.

template<class TypeT>
RWMathVec<TypeT> RWHessenbergDecomp< TypeT >::QTx ( const RWMathVec< TypeT > &  ) const

Computes the (conjugate) transpose of the orthogonal matrix Q and the vector x.

template<class TypeT>
RWGenMat<TypeT> RWHessenbergDecomp< TypeT >::QTX ( const RWGenMat< TypeT > &  X) const

Computes the (conjugate) transpose of the orthogonal matrix Q and the matrix X.

template<class TypeT>
RWMathVec<TypeT> RWHessenbergDecomp< TypeT >::Qx ( const RWMathVec< TypeT > &  x) const

Computes the inner product of the orthogonal matrix Q and the vector x.

template<class TypeT>
RWGenMat<TypeT> RWHessenbergDecomp< TypeT >::QX ( const RWGenMat< TypeT > &  X) const

Computes the inner product of the orthogonal matrix Q and the matrix X.

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