Class SvdImplicitQrDecompose_DDRM
java.lang.Object
org.ejml.dense.row.decomposition.svd.SvdImplicitQrDecompose_DDRM
- All Implemented Interfaces:
org.ejml.interfaces.decomposition.DecompositionInterface<org.ejml.data.DMatrixRMaj>,org.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>,org.ejml.interfaces.decomposition.SingularValueDecomposition_F64<org.ejml.data.DMatrixRMaj>
- Direct Known Subclasses:
SvdImplicitQrDecompose_MT_DDRM
public class SvdImplicitQrDecompose_DDRM
extends java.lang.Object
implements org.ejml.interfaces.decomposition.SingularValueDecomposition_F64<org.ejml.data.DMatrixRMaj>
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
-
Field Summary
Fields Modifier and Type Field Description protected org.ejml.interfaces.decomposition.BidiagonalDecomposition_F64<org.ejml.data.DMatrixRMaj>bidiagprotected booleancanUseTallBidiagonalprotected booleancompactprotected booleancomputeUprotected booleancomputeVprotected intnumColsprotected intnumColsTprotected intnumRowsprotected intnumRowsTprotected booleanprefComputeUprotected booleanprefComputeVprotected SvdImplicitQrAlgorithm_DDRMqralgprotected booleantransposed -
Constructor Summary
Constructors Constructor Description SvdImplicitQrDecompose_DDRM(boolean compact, boolean computeU, boolean computeV, boolean canUseTallBidiagonal)Configures the class -
Method Summary
Modifier and Type Method Description protected voiddeclareBidiagonalDecomposition()booleandecompose(org.ejml.data.DMatrixRMaj orig)double[]getSingularValues()org.ejml.data.DMatrixRMajgetU(@Nullable org.ejml.data.DMatrixRMaj U, boolean transpose)org.ejml.data.DMatrixRMajgetV(@Nullable org.ejml.data.DMatrixRMaj V, boolean transpose)org.ejml.data.DMatrixRMajgetW(@Nullable org.ejml.data.DMatrixRMaj W)booleaninputModified()booleanisCompact()intnumberOfSingularValues()intnumCols()intnumRows()protected voidtranspose(@NotNull org.ejml.data.DMatrixRMaj V, org.ejml.data.DMatrixRMaj Vt)
-
Field Details
-
numRows
protected int numRows -
numCols
protected int numCols -
numRowsT
protected int numRowsT -
numColsT
protected int numColsT -
canUseTallBidiagonal
protected boolean canUseTallBidiagonal -
bidiag
protected org.ejml.interfaces.decomposition.BidiagonalDecomposition_F64<org.ejml.data.DMatrixRMaj> bidiag -
qralg
-
compact
protected boolean compact -
computeU
protected boolean computeU -
computeV
protected boolean computeV -
prefComputeU
protected boolean prefComputeU -
prefComputeV
protected boolean prefComputeV -
transposed
protected boolean transposed
-
-
Constructor Details
-
SvdImplicitQrDecompose_DDRM
public SvdImplicitQrDecompose_DDRM(boolean compact, boolean computeU, boolean computeV, boolean canUseTallBidiagonal)Configures the class- Parameters:
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.
-
-
Method Details
-
getSingularValues
public double[] getSingularValues()- Specified by:
getSingularValuesin interfaceorg.ejml.interfaces.decomposition.SingularValueDecomposition_F64<org.ejml.data.DMatrixRMaj>
-
numberOfSingularValues
public int numberOfSingularValues()- Specified by:
numberOfSingularValuesin interfaceorg.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
-
isCompact
public boolean isCompact()- Specified by:
isCompactin interfaceorg.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
-
getU
public org.ejml.data.DMatrixRMaj getU(@Nullable @Nullable org.ejml.data.DMatrixRMaj U, boolean transpose)- Specified by:
getUin interfaceorg.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
-
getV
public org.ejml.data.DMatrixRMaj getV(@Nullable @Nullable org.ejml.data.DMatrixRMaj V, boolean transpose)- Specified by:
getVin interfaceorg.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
-
transpose
protected void transpose(@NotNull @NotNull org.ejml.data.DMatrixRMaj V, org.ejml.data.DMatrixRMaj Vt) -
getW
public org.ejml.data.DMatrixRMaj getW(@Nullable @Nullable org.ejml.data.DMatrixRMaj W)- Specified by:
getWin interfaceorg.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
-
decompose
public boolean decompose(org.ejml.data.DMatrixRMaj orig)- Specified by:
decomposein interfaceorg.ejml.interfaces.decomposition.DecompositionInterface<org.ejml.data.DMatrixRMaj>
-
inputModified
public boolean inputModified()- Specified by:
inputModifiedin interfaceorg.ejml.interfaces.decomposition.DecompositionInterface<org.ejml.data.DMatrixRMaj>
-
declareBidiagonalDecomposition
protected void declareBidiagonalDecomposition() -
numRows
public int numRows()- Specified by:
numRowsin interfaceorg.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
-
numCols
public int numCols()- Specified by:
numColsin interfaceorg.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
-