org.ejml.alg.dense.decomposition.hessenberg
Class TridiagonalDecompositionHouseholder_D64
- java.lang.Object
-
- org.ejml.alg.dense.decomposition.hessenberg.TridiagonalDecompositionHouseholder_D64
-
- All Implemented Interfaces:
- DecompositionInterface<DenseMatrix64F>, TridiagonalSimilarDecomposition<DenseMatrix64F>
public class TridiagonalDecompositionHouseholder_D64 extends java.lang.Object implements TridiagonalSimilarDecomposition<DenseMatrix64F>
Performs a
similar tridiagonal decompositionon 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
-
-
Constructor Summary
Constructors Constructor and Description TridiagonalDecompositionHouseholder_D64()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleandecompose(DenseMatrix64F A)Decomposes the provided symmetric matrix.voidgetDiagonal(double[] diag, double[] off)Extracts the diagonal and off diagonal elements of the decomposed tridiagonal matrix.DenseMatrix64FgetQ(DenseMatrix64F Q, boolean transposed)An orthogonal matrix that has the following property: T = QTAQDenseMatrix64FgetQT()Returns the internal matrix where the decomposed results are stored.DenseMatrix64FgetT(DenseMatrix64F 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(DenseMatrix64F A)If needed declares and sets up internal data structures.booleaninputModified()Is the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.
-
-
-
Constructor Detail
-
TridiagonalDecompositionHouseholder_D64
public TridiagonalDecompositionHouseholder_D64()
-
-
Method Detail
-
getQT
public DenseMatrix64F getQT()
Returns the internal matrix where the decomposed results are stored.- Returns:
-
getDiagonal
public void getDiagonal(double[] diag, double[] off)Description copied from interface:TridiagonalSimilarDecompositionExtracts 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<DenseMatrix64F>- Parameters:
diag- Diagonal elements. Modified.off- off diagonal elements. Modified.
-
getT
public DenseMatrix64F getT(DenseMatrix64F T)
Extracts the tridiagonal matrix found in the decomposition.- Specified by:
getTin interfaceTridiagonalSimilarDecomposition<DenseMatrix64F>- 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
public DenseMatrix64F getQ(DenseMatrix64F Q, boolean transposed)
An orthogonal matrix that has the following property: T = QTAQ- Specified by:
getQin interfaceTridiagonalSimilarDecomposition<DenseMatrix64F>- Parameters:
Q- If not null then the results will be stored here. Otherwise a new matrix will be created.- Returns:
- The extracted Q matrix.
-
decompose
public boolean decompose(DenseMatrix64F A)
Decomposes the provided symmetric matrix.- Specified by:
decomposein interfaceDecompositionInterface<DenseMatrix64F>- 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
public void init(DenseMatrix64F A)
If needed declares and sets up internal data structures.- Parameters:
A- Matrix being decomposed.
-
inputModified
public boolean inputModified()
Description copied from interface:DecompositionInterfaceIs the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.- Specified by:
inputModifiedin interfaceDecompositionInterface<DenseMatrix64F>- Returns:
- true if the input matrix to decompose() is modified.
-
-
DMelt 3.0 © DataMelt by jWork.ORG