Class RealHess

All Implemented Interfaces:
Decomposition<Matrix>
Direct Known Subclasses:
SymmHess

public class RealHess extends RealUnitaryDecomposition

Computes the Hessenburg decomposition of a real dense square matrix. That is, for a square matrix A, computes the decomposition A=QHQT where Q is an orthogonal matrix and H is a matrix in upper Hessenburg form which is similar to A (i.e. has the same eigenvalues).

A matrix H is in upper Hessenburg form if it is nearly upper triangular. Specifically, if H has all zeros below the first sub-diagonal.

For example, the following matrix is in upper Hessenburg form where each 'x' may hold a different value:

     [[ x x x x x ]
      [ x x x x x ]
      [ 0 x x x x ]
      [ 0 0 x x x ]
      [ 0 0 0 x x ]]
  • Constructor Details

    • RealHess

      public RealHess()

      Creates a real Hessenburg decomposer which will reduce the matrix to an upper quasi-triangular matrix which is has zeros below the first sub-diagonal. That is, reduce to an upper Hessenburg matrix.

      By default, the orthogonal matrix will be computed. To specify if the orthogonal matrix should be computed, use RealHess(boolean).

      See Also:
    • RealHess

      public RealHess(boolean computeQ)

      Creates a real Hessenburg decomposer which will reduce the matrix to an upper quasi-triangular matrix which is has zeros below the first sub-diagonal. That is, reduce to an upper Hessenburg matrix.

      Parameters:
      computeQ - Flag indicating if the orthogonal matrix in the Hessenburg decomposition should be computed. If it is not needed, setting this to false may yield a slight increase in efficiency.
      See Also:
  • Method Details

    • decompose

      public RealHess decompose(Matrix src)
      Applies decomposition to the source matrix. Note, the computation of the orthogonal matrix Q in the decomposition is deferred until RealUnitaryDecomposition.getQ() is explicitly called. This allows for efficient decompositions when Q is not needed.
      Parameters:
      src - The source matrix to decompose.
      Returns:
      A reference to this decomposer.
      Throws:
      LinearAlgebraException - If src is not a square matrix.
    • initQ

      protected Matrix initQ()
      Creates and initializes Q to the appropriately sized identity matrix.
      Specified by:
      initQ in class UnitaryDecomposition<Matrix,double[]>
      Returns:
      An identity matrix with the appropriate size.
    • getUpper

      public Matrix getUpper()
      Gets the upper Hessenburg matrix from the last decomposition. Same as getH()
      Specified by:
      getUpper in class UnitaryDecomposition<Matrix,double[]>
      Returns:
      The upper Hessenburg matrix from the last decomposition.
    • getH

      public Matrix getH()
      Gets the upper Hessenburg matrix H from the Hessenburg decomposition.
      Returns:
      The upper Hessenburg matrix H from the Hessenburg decomposition.