public class SvdImplicitQrDecompose extends Object implements SingularValueDecomposition<DenseMatrix64F>
Computes the Singular value decomposition of a matrix using the implicit QR algorithm for singular value decomposition. It works by first by transforming the matrix to a bidiagonal A=U*B*VT form, then it implicitly computing the eigenvalues of the BTB matrix, which are the same as the singular values in the original A matrix.
Based off of the description provided in:
David S. Watkins, "Fundamentals of Matrix Computations," Second Edition. Page 404-411
| Constructor and Description |
|---|
SvdImplicitQrDecompose(boolean compact,
boolean computeU,
boolean computeV,
boolean canUseTallBidiagonal)
Configures the class
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
decompose(DenseMatrix64F orig)
Computes the decomposition of the input matrix.
|
double[] |
getSingularValues()
Returns the singular values.
|
DenseMatrix64F |
getU(DenseMatrix64F U,
boolean transpose)
Returns the orthogonal 'U' matrix.
|
DenseMatrix64F |
getV(DenseMatrix64F V,
boolean transpose)
Returns the orthogonal 'V' matrix.
|
DenseMatrix64F |
getW(DenseMatrix64F W)
Returns a diagonal matrix with the singular values.
|
boolean |
inputModified()
Is the input matrix to
DecompositionInterface.decompose(org.ejml.data.Matrix64F) is modified during
the decomposition process. |
boolean |
isCompact()
If true then compact matrices are returned.
|
int |
numberOfSingularValues()
The number of singular values in the matrix.
|
int |
numCols()
Number of columns in the decomposed matrix.
|
int |
numRows()
Number of rows in the decomposed matrix.
|
public SvdImplicitQrDecompose(boolean compact,
boolean computeU,
boolean computeV,
boolean canUseTallBidiagonal)
compact - Compute a compact SVDcomputeU - If true it will compute the U matrixcomputeV - If true it will compute the V matrixcanUseTallBidiagonal - If true then it can choose to use a tall Bidiagonal decomposition to improve runtime performance.public double[] getSingularValues()
SingularValueDecompositiongetSingularValues in interface SingularValueDecomposition<DenseMatrix64F>public int numberOfSingularValues()
SingularValueDecompositionnumberOfSingularValues in interface SingularValueDecomposition<DenseMatrix64F>public boolean isCompact()
SingularValueDecompositionisCompact in interface SingularValueDecomposition<DenseMatrix64F>public DenseMatrix64F getU(DenseMatrix64F U, boolean transpose)
SingularValueDecompositionReturns the orthogonal 'U' matrix.
Internally the SVD algorithm might compute U transposed or it might not. To avoid an unnecessary double transpose the option is provided to select if the transpose is returned.
getU in interface SingularValueDecomposition<DenseMatrix64F>U - Optional storage for U. If null a new instance or internally maintained matrix is returned. Modified.transpose - If the returned U is transposed.public DenseMatrix64F getV(DenseMatrix64F V, boolean transpose)
SingularValueDecompositionReturns the orthogonal 'V' matrix.
Internally the SVD algorithm might compute V transposed or it might not. To avoid an unnecessary double transpose the option is provided to select if the transpose is returned.
getV in interface SingularValueDecomposition<DenseMatrix64F>V - Optional storage for v. If null a new instance or internally maintained matrix is returned. Modified.transpose - If the returned V is transposed.public DenseMatrix64F getW(DenseMatrix64F W)
SingularValueDecompositiongetW in interface SingularValueDecomposition<DenseMatrix64F>W - Optional storage for W. If null a new instance or internally maintained matrix is returned. Modified.public boolean decompose(DenseMatrix64F orig)
DecompositionInterfaceDecompositionInterface.inputModified() will return true and the matrix should not be
modified until the decomposition is no longer needed.decompose in interface DecompositionInterface<DenseMatrix64F>orig - The matrix which is being decomposed. Modification is implementation dependent.public boolean inputModified()
DecompositionInterfaceDecompositionInterface.decompose(org.ejml.data.Matrix64F) is modified during
the decomposition process.inputModified in interface DecompositionInterface<DenseMatrix64F>public int numRows()
SingularValueDecompositionnumRows in interface SingularValueDecomposition<DenseMatrix64F>public int numCols()
SingularValueDecompositionnumCols in interface SingularValueDecomposition<DenseMatrix64F>Copyright © 2013. All Rights Reserved.