SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.factorization.eigen
Class HessenbergDecomposition

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.factorization.eigen.HessenbergDecomposition

public class HessenbergDecomposition
extends java.lang.Object

Given a square matrix A, we find Q such that

Q' %*% A %*% Q = H
where H is a Hessenberg matrix.

This implementation uses the Householder reflection process to repeatedly zero out the elements below the sub-diagonal.

For example, the first step is to left multiply A with the Householder matrix Q1 so that matrix Q1 %*% A has zeros in the left column (except for the first two rows). That is,

                        | a11  * ... * |
                        | a21          |
 Q1 %*% A = Q1' %*% A = | 0            |
                        | .       A'   |
                        | .            |
                        | 0            |
 
(Note that the Q's are Hermitian.)

Then, we right multiply A with Q1. We have

                    | a11  # ... # |
                    | a21          |
 Q1' %*% A %*% Q1 = | 0            |
                    | .       A''  |
                    | .            |
                    | 0            |
 
At the end,
 (Qn' %*% ... %*% Q1') %*% A %*% (Q1 %*% ... %*% Qn) = H
 
where H is Hessenberg. We have
Q = Q1 %*% ... %*% Qn

This transformation always succeeds.


Constructor Summary
HessenbergDecomposition(Matrix A)
          Construct an instance of the Hessenberg decomposition for a square matrix.
 
Method Summary
 Matrix H()
          Get a copy of the H matrix.
 Matrix Q()
          Get a copy of the Q matrix, where Q = Q1 %*% ... %*% Qn where n = dim - 2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HessenbergDecomposition

public HessenbergDecomposition(Matrix A)
Construct an instance of the Hessenberg decomposition for a square matrix.

Note: this decomposition does not require a precision parameter, though checking the result will need an epsilon.

Parameters:
A - a square matrix
Throws:
java.lang.IllegalArgumentException - if A is not square
See Also:
Hessenberg.isHessenberg(com.numericalmethod.suanshu.matrix.doubles.Matrix, double), "Algorithm 7.4.2. Matrix Computations, 3rd edition. Golub G. H., van Loan C. F."
Method Detail

Q

public Matrix Q()
Get a copy of the Q matrix, where
Q = Q1 %*% ... %*% Qn
where n = dim - 2.

To compute Q, instead of explicitly doing this multiplication, we can improve the performance by applying Qi's repeatedly on an identity matrix.

Returns:
a copy of Q matrix in the QR decomposition

H

public Matrix H()
Get a copy of the H matrix.

Returns:
a copy of H

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.