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> bidiag  
    protected boolean canUseTallBidiagonal  
    protected boolean compact  
    protected boolean computeU  
    protected boolean computeV  
    protected int numCols  
    protected int numColsT  
    protected int numRows  
    protected int numRowsT  
    protected boolean prefComputeU  
    protected boolean prefComputeV  
    protected SvdImplicitQrAlgorithm_DDRM qralg  
    protected boolean transposed  
  • 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 void declareBidiagonalDecomposition()  
    boolean decompose​(org.ejml.data.DMatrixRMaj orig)  
    double[] getSingularValues()  
    org.ejml.data.DMatrixRMaj getU​(@Nullable org.ejml.data.DMatrixRMaj U, boolean transpose)  
    org.ejml.data.DMatrixRMaj getV​(@Nullable org.ejml.data.DMatrixRMaj V, boolean transpose)  
    org.ejml.data.DMatrixRMaj getW​(@Nullable org.ejml.data.DMatrixRMaj W)  
    boolean inputModified()  
    boolean isCompact()  
    int numberOfSingularValues()  
    int numCols()  
    int numRows()  
    protected void transpose​(@NotNull org.ejml.data.DMatrixRMaj V, org.ejml.data.DMatrixRMaj Vt)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SvdImplicitQrDecompose_DDRM

      public SvdImplicitQrDecompose_DDRM​(boolean compact, boolean computeU, boolean computeV, boolean canUseTallBidiagonal)
      Configures the class
      Parameters:
      compact - Compute a compact SVD
      computeU - If true it will compute the U matrix
      computeV - If true it will compute the V matrix
      canUseTallBidiagonal - If true then it can choose to use a tall Bidiagonal decomposition to improve runtime performance.
  • Method Details

    • getSingularValues

      public double[] getSingularValues()
      Specified by:
      getSingularValues in interface org.ejml.interfaces.decomposition.SingularValueDecomposition_F64<org.ejml.data.DMatrixRMaj>
    • numberOfSingularValues

      public int numberOfSingularValues()
      Specified by:
      numberOfSingularValues in interface org.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
    • isCompact

      public boolean isCompact()
      Specified by:
      isCompact in interface org.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:
      getU in interface org.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:
      getV in interface org.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:
      getW in interface org.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
    • decompose

      public boolean decompose​(org.ejml.data.DMatrixRMaj orig)
      Specified by:
      decompose in interface org.ejml.interfaces.decomposition.DecompositionInterface<org.ejml.data.DMatrixRMaj>
    • inputModified

      public boolean inputModified()
      Specified by:
      inputModified in interface org.ejml.interfaces.decomposition.DecompositionInterface<org.ejml.data.DMatrixRMaj>
    • declareBidiagonalDecomposition

      protected void declareBidiagonalDecomposition()
    • numRows

      public int numRows()
      Specified by:
      numRows in interface org.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>
    • numCols

      public int numCols()
      Specified by:
      numCols in interface org.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DMatrixRMaj>