Class BidiagonalDecompositionTall_D64
- java.lang.Object
-
- org.ejml.alg.dense.decomposition.bidiagonal.BidiagonalDecompositionTall_D64
-
- All Implemented Interfaces:
- BidiagonalDecomposition<DenseMatrix64F>, DecompositionInterface<DenseMatrix64F>
public class BidiagonalDecompositionTall_D64 extends java.lang.Object implements BidiagonalDecomposition<DenseMatrix64F>
BidiagonalDecompositionspecifically 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*VTA 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. 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
Constructors Constructor and Description BidiagonalDecompositionTall_D64()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleandecompose(DenseMatrix64F orig)Computes the decomposition of the input matrix.DenseMatrix64FgetB(DenseMatrix64F B, boolean compact)Returns the bidiagonal matrix.voidgetDiagonal(double[] diag, double[] off)Extracts the diagonal and off diagonal elements from the decomposition.DenseMatrix64FgetU(DenseMatrix64F U, boolean transpose, boolean compact)Returns the orthogonal U matrix.DenseMatrix64FgetV(DenseMatrix64F V, boolean transpose, boolean compact)Returns the orthogonal V matrix.booleaninputModified()Is the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.
-
-
-
Method Detail
-
getDiagonal
public void getDiagonal(double[] diag, double[] off)Description copied from interface:BidiagonalDecompositionExtracts the diagonal and off diagonal elements from the decomposition.- Specified by:
getDiagonalin interfaceBidiagonalDecomposition<DenseMatrix64F>- Parameters:
diag- diagonal elements from B.off- off diagonal elements form B.
-
getB
public DenseMatrix64F getB(DenseMatrix64F B, boolean compact)
Description copied from interface:BidiagonalDecompositionReturns the bidiagonal matrix.- Specified by:
getBin interfaceBidiagonalDecomposition<DenseMatrix64F>- Parameters:
B- If not null the results are stored here, if null a new matrix is created.- Returns:
- The bidiagonal matrix.
-
getU
public DenseMatrix64F getU(DenseMatrix64F U, boolean transpose, boolean compact)
Description copied from interface:BidiagonalDecompositionReturns the orthogonal U matrix.- Specified by:
getUin interfaceBidiagonalDecomposition<DenseMatrix64F>- 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
public DenseMatrix64F getV(DenseMatrix64F V, boolean transpose, boolean compact)
Description copied from interface:BidiagonalDecompositionReturns the orthogonal V matrix.- Specified by:
getVin interfaceBidiagonalDecomposition<DenseMatrix64F>- 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
public boolean decompose(DenseMatrix64F orig)
Description copied from interface:DecompositionInterfaceComputes 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:
decomposein interfaceDecompositionInterface<DenseMatrix64F>- 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: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