Top Description Fields Constructors Methods
org.apache.commons.math3.linear

pack-priv Class HessenbergTransformer

extends Object
Class Inheritance
Imports
org.apache.commons.math3.util.FastMath, .Precision

Class transforming a general real matrix to Hessenberg form.

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
MathWorld, Householder Transformations

Field Summary

Modifier and TypeField and Description
private RealMatrix
cachedH

Cached value of H.

private RealMatrix
cachedP

Cached value of P.

private RealMatrix
cachedPt

Cached value of Pt.

private final double[][]
householderVectors

Householder vectors.

private final double[]
ort

Temporary storage vector.

Constructor Summary

AccessConstructor and Description
pack-priv
HessenbergTransformer(final RealMatrix
matrix to transform
matrix
)

Build the transformation to Hessenberg form of a general matrix.

Method Summary

Modifier and TypeMethod and Description
public RealMatrix

Returns:

the H matrix
getH
()

Returns the Hessenberg matrix H of the transform.

pack-priv double[][]

Returns:

the main diagonal elements of the B matrix
getHouseholderVectorsRef
()

Get the Householder vectors of the transform.

public RealMatrix

Returns:

the P matrix
getP
()

Returns the matrix P of the transform.

public RealMatrix

Returns:

the transpose of the P matrix
getPT
()

Returns the transpose of the matrix P of the transform.

private void
transform()

Transform original matrix to Hessenberg form.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachedHback to summary
private RealMatrix cachedH

Cached value of H.

cachedPback to summary
private RealMatrix cachedP

Cached value of P.

cachedPtback to summary
private RealMatrix cachedPt

Cached value of Pt.

householderVectorsback to summary
private final double[][] householderVectors

Householder vectors.

ortback to summary
private final double[] ort

Temporary storage vector.

Constructor Detail

HessenbergTransformerback to summary
pack-priv HessenbergTransformer(final RealMatrix matrix)

Build the transformation to Hessenberg form of a general matrix.

Parameters
matrix:RealMatrix

matrix to transform

Exceptions
NonSquareMatrixException:
if the matrix is not square

Method Detail

getHback to summary
public RealMatrix getH()

Returns the Hessenberg matrix H of the transform.

Returns:RealMatrix

the H matrix

getHouseholderVectorsRefback to summary
pack-priv 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:double[][]

the main diagonal elements of the B matrix

getPback to summary
public RealMatrix getP()

Returns the matrix P of the transform.

P is an orthogonal matrix, i.e. its inverse is also its transpose.

Returns:RealMatrix

the P matrix

getPTback to summary
public RealMatrix 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:RealMatrix

the transpose of the P matrix

transformback to summary
private void transform()

Transform original matrix to Hessenberg form.

Transformation is done using Householder transforms.