|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.linear.SchurTransformer
class SchurTransformer
Class transforming a general real matrix to Schur form.
A m × m matrix A can be written as the product of three matrices: A = P × T × PT with P an orthogonal matrix and T an quasi-triangular matrix. Both P and T are m × m matrices.
Transformation to Schur 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 hqr2 in class EigenvalueDecomposition from the JAMA library.
Nested Class Summary | |
---|---|
private static class |
SchurTransformer.ShiftInfo
Internal data structure holding the current shift information. |
Field Summary | |
---|---|
private RealMatrix |
cachedP
Cached value of P. |
private RealMatrix |
cachedPt
Cached value of PT. |
private RealMatrix |
cachedT
Cached value of T. |
private double |
epsilon
Epsilon criteria taken from JAMA code (originally was 2^-52). |
private double[][] |
matrixP
P matrix. |
private double[][] |
matrixT
T matrix. |
private static int |
MAX_ITERATIONS
Maximum allowed iterations for convergence of the transformation. |
Constructor Summary | |
---|---|
SchurTransformer(RealMatrix matrix)
Build the transformation to Schur form of a general real matrix. |
Method Summary | |
---|---|
private void |
computeShift(int l,
int idx,
int iteration,
SchurTransformer.ShiftInfo shift)
Compute the shift for the current iteration. |
private int |
findSmallSubDiagonalElement(int startIdx,
double norm)
Find the first small sub-diagonal element and returns its index. |
private double |
getNorm()
Computes the L1 norm of the (quasi-)triangular matrix T. |
RealMatrix |
getP()
Returns the matrix P of the transform. |
RealMatrix |
getPT()
Returns the transpose of the matrix P of the transform. |
RealMatrix |
getT()
Returns the quasi-triangular Schur matrix T of the transform. |
private int |
initQRStep(int il,
int iu,
SchurTransformer.ShiftInfo shift,
double[] hVec)
Initialize the householder vectors for the QR step. |
private void |
performDoubleQRStep(int il,
int im,
int iu,
SchurTransformer.ShiftInfo shift,
double[] hVec)
Perform a double QR step involving rows l:idx and columns m:n |
private void |
transform()
Transform original matrix to Schur form. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int MAX_ITERATIONS
private final double[][] matrixP
private final double[][] matrixT
private RealMatrix cachedP
private RealMatrix cachedT
private RealMatrix cachedPt
private final double epsilon
Constructor Detail |
---|
public SchurTransformer(RealMatrix matrix)
matrix
- matrix to transform
NonSquareMatrixException
- if the matrix is not squareMethod Detail |
---|
public RealMatrix getP()
P is an orthogonal matrix, i.e. its inverse is also its transpose.
public RealMatrix getPT()
P is an orthogonal matrix, i.e. its inverse is also its transpose.
public RealMatrix getT()
private void transform()
MaxCountExceededException
- if the transformation does not convergeprivate double getNorm()
private int findSmallSubDiagonalElement(int startIdx, double norm)
startIdx
- the starting index for the searchnorm
- the L1 norm of the matrix
private void computeShift(int l, int idx, int iteration, SchurTransformer.ShiftInfo shift)
l
- the index of the small sub-diagonal elementidx
- the current eigenvalue indexiteration
- the current iterationshift
- holder for shift informationprivate int initQRStep(int il, int iu, SchurTransformer.ShiftInfo shift, double[] hVec)
il
- the index of the small sub-diagonal elementiu
- the current eigenvalue indexshift
- shift information holderhVec
- the initial houseHolder vector
private void performDoubleQRStep(int il, int im, int iu, SchurTransformer.ShiftInfo shift, double[] hVec)
il
- the index of the small sub-diagonal elementim
- the start index for the QR stepiu
- the current eigenvalue indexshift
- shift information holderhVec
- the initial houseHolder vector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |