Class HessenbergTransformer
A m × m matrix A can be written as the product of three matrices: A = P × H × PT with P an orthogonal matrix and H a Hessenberg matrix. Both P and H are m × m matrices.
Transformation to Hessenberg form is often not a goal by itself, but it is an
intermediate step in more general decomposition algorithms like
eigen decomposition
. This class is therefore
intended for internal use by the library and is not public. As a consequence
of this explicitly limited scope, many methods directly returns references to
internal arrays, not copies.
This class is based on the method orthes in class EigenvalueDecomposition from the JAMA library.
- Since:
- 3.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RealMatrix
Cached value of H.private RealMatrix
Cached value of P.private RealMatrix
Cached value of Pt.private final double[][]
Householder vectors.private final double[]
Temporary storage vector. -
Constructor Summary
ConstructorsConstructorDescriptionHessenbergTransformer
(RealMatrix matrix) Build the transformation to Hessenberg form of a general matrix. -
Method Summary
Modifier and TypeMethodDescriptiongetH()
Returns the Hessenberg matrix H of the transform.(package private) double[][]
Get the Householder vectors of the transform.getP()
Returns the matrix P of the transform.getPT()
Returns the transpose of the matrix P of the transform.private void
Transform original matrix to Hessenberg form.
-
Field Details
-
householderVectors
private final double[][] householderVectorsHouseholder vectors. -
ort
private final double[] ortTemporary storage vector. -
cachedP
Cached value of P. -
cachedPt
Cached value of Pt. -
cachedH
Cached value of H.
-
-
Constructor Details
-
HessenbergTransformer
HessenbergTransformer(RealMatrix matrix) Build the transformation to Hessenberg form of a general matrix.- Parameters:
matrix
- matrix to transform- Throws:
NonSquareMatrixException
- if the matrix is not square
-
-
Method Details
-
getP
Returns the matrix P of the transform.P is an orthogonal matrix, i.e. its inverse is also its transpose.
- Returns:
- the P matrix
-
getPT
Returns the transpose of the matrix P of the transform.P is an orthogonal matrix, i.e. its inverse is also its transpose.
- Returns:
- the transpose of the P matrix
-
getH
Returns the Hessenberg matrix H of the transform.- Returns:
- the H matrix
-
getHouseholderVectorsRef
double[][] getHouseholderVectorsRef()Get the Householder vectors of the transform.Note that since this class is only intended for internal use, it returns directly a reference to its internal arrays, not a copy.
- Returns:
- the main diagonal elements of the B matrix
-
transform
private void transform()Transform original matrix to Hessenberg form.Transformation is done using Householder transforms.
-