Class HessenbergDecomposition


  • public class HessenbergDecomposition
    extends Object
    Given a square matrix A, we find Q such that Q' * A * Q = H where H is a Hessenberg matrix. This implementation uses Householder reflection to repeatedly zero out the elements below the sub-diagonal. For example, the first step is to left multiply A by a Householder matrix Q1 so that matrix Q1 * A has zeros in the left column (except for the first two rows). That is (Q's are Hermitian.), \[ Q_1 \times A = Q_1' \times A = \begin{bmatrix} a_{11} & * & ... & * \\ a_{21} & & & \\ 0 & & & \\ ... & &A ' & \\ ... & & & \\ 0 & & & \end{bmatrix} \] Then, we right multiply A by Q1. We have \[ Q_1' \times A \times Q_1 = \begin{bmatrix} a_{11} & ? & ... & ? \\ a_{21} & & & \\ 0 & & & \\ ... & & A'' & \\ ... & & & \\ 0 & & & \end{bmatrix} \] At the end, we have a Hessenberg H such that \[ (Q_n' \times ... \times Q_1') \times A \times (Q_1 \times ... \times Q_n) = H \] We have \[ Q = (Q_1 \times ... \times Q_n) \] This transformation always succeeds.
    • Method Detail

      • Q

        public Matrix Q()
        Gets the Q matrix, where \[ Q = (Q_1 \times ... \times Q_n) \] n = dim - 2.

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

        Returns:
        the Q matrix in the QR decomposition
      • H

        public Matrix H()
        Gets the H matrix.
        Returns:
        H