|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.linear.TriDiagonalTransformer
class TriDiagonalTransformer
Class transforming a symmetrical matrix to tridiagonal shape.
A symmetrical m × m matrix A can be written as the product of three matrices: A = Q × T × QT with Q an orthogonal matrix and T a symmetrical tridiagonal matrix. Both Q and T are m × m matrices.
This implementation only uses the upper part of the matrix, the part below the diagonal is not accessed at all.
Transformation to tridiagonal shape 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.
Field Summary | |
---|---|
private RealMatrix |
cachedQ
Cached value of Q. |
private RealMatrix |
cachedQt
Cached value of Qt. |
private RealMatrix |
cachedT
Cached value of T. |
private double[][] |
householderVectors
Householder vectors. |
private double[] |
main
Main diagonal. |
private double[] |
secondary
Secondary diagonal. |
Constructor Summary | |
---|---|
TriDiagonalTransformer(RealMatrix matrix)
Build the transformation to tridiagonal shape of a symmetrical matrix. |
Method Summary | |
---|---|
(package private) double[][] |
getHouseholderVectorsRef()
Get the Householder vectors of the transform. |
(package private) double[] |
getMainDiagonalRef()
Get the main diagonal elements of the matrix T of the transform. |
RealMatrix |
getQ()
Returns the matrix Q of the transform. |
RealMatrix |
getQT()
Returns the transpose of the matrix Q of the transform. |
(package private) double[] |
getSecondaryDiagonalRef()
Get the secondary diagonal elements of the matrix T of the transform. |
RealMatrix |
getT()
Returns the tridiagonal matrix T of the transform. |
private void |
transform()
Transform original matrix to tridiagonal form. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final double[][] householderVectors
private final double[] main
private final double[] secondary
private RealMatrix cachedQ
private RealMatrix cachedQt
private RealMatrix cachedT
Constructor Detail |
---|
public TriDiagonalTransformer(RealMatrix matrix)
The specified matrix is assumed to be symmetrical without any check. Only the upper triangular part of the matrix is used.
matrix
- Symmetrical matrix to transform.
NonSquareMatrixException
- if the matrix is not square.Method Detail |
---|
public RealMatrix getQ()
Q is an orthogonal matrix, i.e. its transpose is also its inverse.
public RealMatrix getQT()
Q is an orthogonal matrix, i.e. its transpose is also its inverse.
public RealMatrix getT()
double[][] getHouseholderVectorsRef()
Note that since this class is only intended for internal use, it returns directly a reference to its internal arrays, not a copy.
double[] getMainDiagonalRef()
Note that since this class is only intended for internal use, it returns directly a reference to its internal arrays, not a copy.
double[] getSecondaryDiagonalRef()
Note that since this class is only intended for internal use, it returns directly a reference to its internal arrays, not a copy.
private void transform()
Transformation is done using Householder transforms.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |