- All Implemented Interfaces:
Decomposition<Matrix>
- Direct Known Subclasses:
SymmHess
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 ]]
-
Field Summary
Fields inherited from class org.flag4j.linalg.decompositions.unitary.RealUnitaryDecomposition
currentFactor, norm, shift
Fields inherited from class org.flag4j.linalg.decompositions.unitary.UnitaryDecomposition
applyUpdate, householderVector, minAxisSize, numCols, numRows, qFactors, storeReflectors, subDiagonal, transformData, transformMatrix, workArray
-
Constructor Summary
ConstructorDescriptionRealHess()
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.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. -
Method Summary
Modifier and TypeMethodDescriptionApplies decomposition to the source matrix.getH()
Gets the upper Hessenburg matrixH
from the Hessenburg decomposition.getUpper()
Gets the upper Hessenburg matrix from the last decomposition.protected Matrix
initQ()
Creates and initializes Q to the appropriately sized identity matrix.Methods inherited from class org.flag4j.linalg.decompositions.unitary.RealUnitaryDecomposition
computeHouseholder, computePhasedNorm, findMaxAndInit, getQ, getUpper, initWorkArrays, updateData
Methods inherited from class org.flag4j.linalg.decompositions.unitary.UnitaryDecomposition
decomposeUnitary, setUp
-
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 tofalse
may yield a slight increase in efficiency.- See Also:
-
-
Method Details
-
decompose
Applies decomposition to the source matrix. Note, the computation of the orthogonal matrixQ
in the decomposition is deferred untilRealUnitaryDecomposition.getQ()
is explicitly called. This allows for efficient decompositions whenQ
is not needed.- Parameters:
src
- The source matrix to decompose.- Returns:
- A reference to this decomposer.
- Throws:
LinearAlgebraException
- Ifsrc
is not a square matrix.
-
initQ
Creates and initializes Q to the appropriately sized identity matrix.- Specified by:
initQ
in classUnitaryDecomposition<Matrix,
double[]> - Returns:
- An identity matrix with the appropriate size.
-
getUpper
Gets the upper Hessenburg matrix from the last decomposition. Same asgetH()
- Specified by:
getUpper
in classUnitaryDecomposition<Matrix,
double[]> - Returns:
- The upper Hessenburg matrix from the last decomposition.
-
getH
Gets the upper Hessenburg matrixH
from the Hessenburg decomposition.- Returns:
- The upper Hessenburg matrix
H
from the Hessenburg decomposition.
-