Class BidiagonalDecompositionTall_MT_FDRM
- All Implemented Interfaces:
BidiagonalDecomposition<FMatrixRMaj>
,BidiagonalDecomposition_F32<FMatrixRMaj>
,DecompositionInterface<FMatrixRMaj>
BidiagonalDecomposition_F32
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_F32. 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
(FMatrixRMaj orig) Computes the decomposition of the input matrix.getB
(@Nullable FMatrixRMaj B, boolean compact) Returns the bidiagonal matrix.void
getDiagonal
(float[] diag, float[] off) Extracts the diagonal and off diagonal elements from the decomposition.getU
(@Nullable FMatrixRMaj U, boolean transpose, boolean compact) Returns the orthogonal U matrix.getV
(@Nullable FMatrixRMaj 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_FDRM
public BidiagonalDecompositionTall_MT_FDRM()
-
-
Method Details
-
getDiagonal
public void getDiagonal(float[] diag, float[] off) Description copied from interface:BidiagonalDecomposition_F32
Extracts the diagonal and off diagonal elements from the decomposition.- Specified by:
getDiagonal
in interfaceBidiagonalDecomposition_F32<FMatrixRMaj>
- 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<FMatrixRMaj>
- 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<FMatrixRMaj>
- 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<FMatrixRMaj>
- 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<FMatrixRMaj>
- 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<FMatrixRMaj>
- Returns:
- true if the input matrix to decompose() is modified.
-