Class RealHess
java.lang.Object
org.flag4j.linalg.decompositions.unitary.UnitaryDecomposition<Matrix,double[]>
org.flag4j.linalg.decompositions.unitary.RealUnitaryDecomposition
org.flag4j.linalg.decompositions.hess.RealHess
- 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=QHQ
T 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 unitary decomposer which will reduce the matrix to an upper quasi-triangular matrix which is has zeros below the specified sub-diagonal.RealHess
(boolean computeQ) Creates a real unitary decomposer which will reduce the matrix to an upper quasi-triangular matrix which is has zeros below the specified 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
decomposeBase, setUp
-
Constructor Details
-
RealHess
public RealHess()Creates a real unitary decomposer which will reduce the matrix to an upper quasi-triangular matrix which is has zeros below the specified sub-diagonal. -
RealHess
public RealHess(boolean computeQ) Creates a real unitary decomposer which will reduce the matrix to an upper quasi-triangular matrix which is has zeros below the specified sub-diagonal.
-
-
Method Details
-
decompose
Applies decomposition to the source matrix. Note, the computation of the unitary 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.
-