Class TridiagonalDecompositionHouseholder_DDRM
java.lang.Object
org.ejml.dense.row.decomposition.hessenberg.TridiagonalDecompositionHouseholder_DDRM
- All Implemented Interfaces:
DecompositionInterface<DMatrixRMaj>,TridiagonalSimilarDecomposition<DMatrixRMaj>,TridiagonalSimilarDecomposition_F64<DMatrixRMaj>
- Direct Known Subclasses:
TridiagonalDecompositionHouseholder_MT_DDRM
public class TridiagonalDecompositionHouseholder_DDRM
extends Object
implements TridiagonalSimilarDecomposition_F64<DMatrixRMaj>
Performs a similar tridiagonal decomposition on a square symmetric input matrix.
Householder vectors perform the similar operation and the symmetry is taken advantage
of for good performance.
Finds the decomposition of a matrix in the form of:
A = O*T*OT
where A is a symmetric m by m matrix, O is an orthogonal matrix, and T is a tridiagonal matrix.
This implementation is based off of the algorithm described in:
David S. Watkins, "Fundamentals of Matrix Computations," Second Edition. Page 349-355
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDecomposes the provided symmetric matrix.voidgetDiagonal(double[] diag, double[] off) Extracts the diagonal and off diagonal elements of the decomposed tridiagonal matrix.getQ(@Nullable DMatrixRMaj Q, boolean transposed) An orthogonal matrix that has the following property: T = QTAQgetQT()Returns the internal matrix where the decomposed results are stored.getT(@Nullable DMatrixRMaj T) Extracts the tridiagonal matrix found in the decomposition.voidhouseholderSymmetric(int row, double gamma) Performs the householder operations on left and right and side of the matrix.voidinit(DMatrixRMaj A) If needed declares and sets up internal data structures.booleanChecks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.protected voidrank1UpdateMultL(DMatrixRMaj A, double gamma, int colA0, int w0, int w1) protected voidrank1UpdateMultR(DMatrixRMaj A, double gamma, int colA0, int w0, int w1)
-
Field Details
-
QT
Only the upper right triangle is used. The Tridiagonal portion stores the tridiagonal matrix. The rows store householder vectors. -
N
protected int N -
w
protected double[] w -
gammas
protected double[] gammas -
b
protected double[] b
-
-
Constructor Details
-
TridiagonalDecompositionHouseholder_DDRM
public TridiagonalDecompositionHouseholder_DDRM()
-
-
Method Details
-
getQT
Returns the internal matrix where the decomposed results are stored. -
getDiagonal
public void getDiagonal(double[] diag, double[] off) Description copied from interface:TridiagonalSimilarDecomposition_F64Extracts the diagonal and off diagonal elements of the decomposed tridiagonal matrix. Since it is symmetric only one off diagonal array is returned.- Specified by:
getDiagonalin interfaceTridiagonalSimilarDecomposition_F64<DMatrixRMaj>- Parameters:
diag- Diagonal elements. Modified.off- off diagonal elements. Modified.
-
getT
Extracts the tridiagonal matrix found in the decomposition.- Specified by:
getTin interfaceTridiagonalSimilarDecomposition<DMatrixRMaj>- Parameters:
T- If not null then the results will be stored here. Otherwise a new matrix will be created.- Returns:
- The extracted T matrix.
-
getQ
An orthogonal matrix that has the following property: T = QTAQ- Specified by:
getQin interfaceTridiagonalSimilarDecomposition<DMatrixRMaj>- Parameters:
Q- If not null then the results will be stored here. Otherwise a new matrix will be created.transposed- If true then the transpose (real) or conjugate transpose (complex) of Q is returned.- Returns:
- The extracted Q matrix.
-
decompose
Decomposes the provided symmetric matrix.- Specified by:
decomposein interfaceDecompositionInterface<DMatrixRMaj>- Parameters:
A- Symmetric matrix that is going to be decomposed. Not modified.- Returns:
- Returns if it was able to decompose the matrix.
-
householderSymmetric
public void householderSymmetric(int row, double gamma) Performs the householder operations on left and right and side of the matrix. QTAQ- Parameters:
row- Specifies the submatrix.gamma- The gamma for the householder operation
-
init
If needed declares and sets up internal data structures.- Parameters:
A- Matrix being decomposed.
-
rank1UpdateMultL
-
rank1UpdateMultR
-
inputModified
public boolean inputModified()Description copied from interface:DecompositionInterfaceChecks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.- Specified by:
inputModifiedin interfaceDecompositionInterface<DMatrixRMaj>- Returns:
- true if the input matrix to decompose() is modified.
-