Class BidiagonalDecompositionTall_MT_DDRM
- All Implemented Interfaces:
BidiagonalDecomposition<DMatrixRMaj>
,BidiagonalDecomposition_F64<DMatrixRMaj>
,DecompositionInterface<DMatrixRMaj>
BidiagonalDecomposition_F64
specifically designed for tall matrices.
First step is to perform QR decomposition on the input matrix. Then R is decomposed using
a bidiagonal decomposition. By performing the bidiagonal decomposition on the smaller matrix
computations can be saved if m/n > 5/3 and if U is NOT needed.
A = [Q1 Q2][U1 0; 0 I] [B1;0] VT
U=[Q1*U1 Q2]
B=[B1;0]
A = U*B*VT
A QRP decomposition is used internally. That decomposition relies an a fixed threshold for selecting singular values and is known to be less stable than SVD. There is the potential for a degregation of stability by using BidiagonalDecompositionTall instead of BidiagonalDecomposition_F64. A few simple tests have shown that loss in stability to be insignificant.
See page 404 in "Fundamentals of Matrix Computations", 2nd by David S. Watkins.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
decompose
(DMatrixRMaj orig) Computes the decomposition of the input matrix.getB
(@Nullable DMatrixRMaj B, boolean compact) Returns the bidiagonal matrix.void
getDiagonal
(double[] diag, double[] off) Extracts the diagonal and off diagonal elements from the decomposition.getU
(@Nullable DMatrixRMaj U, boolean transpose, boolean compact) Returns the orthogonal U matrix.getV
(@Nullable DMatrixRMaj V, boolean transpose, boolean compact) Returns the orthogonal V matrix.boolean
Checks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)
is modified during the decomposition process.
-
Constructor Details
-
BidiagonalDecompositionTall_MT_DDRM
public BidiagonalDecompositionTall_MT_DDRM()
-
-
Method Details
-
getDiagonal
public void getDiagonal(double[] diag, double[] off) Description copied from interface:BidiagonalDecomposition_F64
Extracts the diagonal and off diagonal elements from the decomposition.- Specified by:
getDiagonal
in interfaceBidiagonalDecomposition_F64<DMatrixRMaj>
- Parameters:
diag
- diagonal elements from B.off
- off diagonal elements form B.
-
getB
Description copied from interface:BidiagonalDecomposition
Returns the bidiagonal matrix.- Specified by:
getB
in interfaceBidiagonalDecomposition<DMatrixRMaj>
- Parameters:
B
- If not null the results are stored here, if null a new matrix is created.- Returns:
- The bidiagonal matrix.
-
getU
Description copied from interface:BidiagonalDecomposition
Returns the orthogonal U matrix.- Specified by:
getU
in interfaceBidiagonalDecomposition<DMatrixRMaj>
- Parameters:
U
- If not null then the results will be stored here. Otherwise a new matrix will be created.- Returns:
- The extracted Q matrix.
-
getV
Description copied from interface:BidiagonalDecomposition
Returns the orthogonal V matrix.- Specified by:
getV
in interfaceBidiagonalDecomposition<DMatrixRMaj>
- Parameters:
V
- If not null then the results will be stored here. Otherwise a new matrix will be created.- Returns:
- The extracted Q matrix.
-
decompose
Description copied from interface:DecompositionInterface
Computes the decomposition of the input matrix. Depending on the implementation the input matrix might be stored internally or modified. If it is modified then the functionDecompositionInterface.inputModified()
will return true and the matrix should not be modified until the decomposition is no longer needed.- Specified by:
decompose
in interfaceDecompositionInterface<DMatrixRMaj>
- Parameters:
orig
- The matrix which is being decomposed. Modification is implementation dependent.- Returns:
- Returns if it was able to decompose the matrix.
-
inputModified
public boolean inputModified()Description copied from interface:DecompositionInterface
Checks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)
is modified during the decomposition process.- Specified by:
inputModified
in interfaceDecompositionInterface<DMatrixRMaj>
- Returns:
- true if the input matrix to decompose() is modified.
-