Class SVD


  • public class SVD
    extends java.lang.Object
    Computes singular value decompositions
    • Constructor Summary

      Constructors 
      Constructor Description
      SVD​(int m, int n)
      Creates an empty SVD which will compute all singular values and vectors
      SVD​(int m, int n, boolean vectors)
      Creates an empty SVD
    • Constructor Detail

      • SVD

        public SVD​(int m,
                   int n)
        Creates an empty SVD which will compute all singular values and vectors
        Parameters:
        m - Number of rows
        n - Number of columns
      • SVD

        public SVD​(int m,
                   int n,
                   boolean vectors)
        Creates an empty SVD
        Parameters:
        m - Number of rows
        n - Number of columns
        vectors - True to compute the singular vectors, false for just the singular values
    • Method Detail

      • hasSingularVectors

        public boolean hasSingularVectors()
        True if singular vectors are stored
      • getU

        public DenseMatrix getU()
        Returns the left singular vectors, column-wise. Not available for partial decompositions
        Returns:
        Matrix of size m*m
      • getVt

        public DenseMatrix getVt()
        Returns the right singular vectors, row-wise. Not available for partial decompositions
        Returns:
        Matrix of size n*n
      • getS

        public double[] getS()
        Returns the singular values (stored in descending order)
        Returns:
        Array of size min(m,n)