Documentation of 'Catalano.Math.Decompositions.SingularValueDecomposition' Java class
SingularValueDecomposition
Catalano.Math.Decompositions

Class SingularValueDecomposition

  • All Implemented Interfaces:
    java.io.Serializable


    public class SingularValueDecomposition
    extends java.lang.Object
    implements java.io.Serializable
    Singular Value Decomposition.

    For an m-by-n matrix A with m >= n, the singular value decomposition is an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and an n-by-n orthogonal matrix V so that A = U*S*V'.

    The singular values, sigma[k] = S[k][k], are ordered so that sigma[0] >= sigma[1] >= ... >= sigma[n-1].

    The singular value decompostion always exists, so the constructor will never fail. The matrix condition number and the effective numerical rank can be computed from this decomposition.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      SingularValueDecomposition(double[][] matrix)
      Initializes a new instance of the SingularValueDecomposition class.
      SingularValueDecomposition(double[][] matrix, boolean wantU, boolean wantV)
      Initializes a new instance of the SingularValueDecomposition class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double cond()
      Two norm condition number.
      double[][] getS()
      Get Diagonal matrix of singular values.
      double[] getSingularValues()
      Return the one-dimensional array of singular values
      double[][] getU()
      Get Left singular vectors.
      double[][] getV()
      Get Right singular vectors.
      double[][] inverse() 
      boolean isWantU()
      Check if need to compute U.
      boolean isWantV()
      Check if need to compute V.
      double norm2()
      Two norm.
      int rank()
      Effective numerical matrix rank.
      void setWantU(boolean wantu)
      Compute U.
      void setWantV(boolean wantv)
      Compute V.
      double threshold() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SingularValueDecomposition

        public SingularValueDecomposition(double[][] matrix,
                                          boolean wantU,
                                          boolean wantV)
        Initializes a new instance of the SingularValueDecomposition class.
        Parameters:
        matrix - Matrix.
        wantU - Compute U.
        wantV - Compute V.
      • SingularValueDecomposition

        public SingularValueDecomposition(double[][] matrix)
        Initializes a new instance of the SingularValueDecomposition class.
        Parameters:
        matrix - The matrix to be decomposed.
        Throws:
        java.lang.IllegalArgumentException - Matrix does not have any rows or columns.
    • Method Detail

      • isWantU

        public boolean isWantU()
        Check if need to compute U.
        Returns:
        True if the U is computed, otherwise false.
      • setWantU

        public void setWantU(boolean wantu)
        Compute U.
        Parameters:
        wantu - True if need to compute U, otherwise false.
      • isWantV

        public boolean isWantV()
        Check if need to compute V.
        Returns:
        True if the V is computed, otherwise false.
      • setWantV

        public void setWantV(boolean wantv)
        Compute V.
        Parameters:
        wantv - True if need to compute V, otherwise false.
      • getU

        public double[][] getU()
        Get Left singular vectors.
        Returns:
        Left singular vectors.
      • getV

        public double[][] getV()
        Get Right singular vectors.
        Returns:
        Right singular vectors.
      • getSingularValues

        public double[] getSingularValues()
        Return the one-dimensional array of singular values
        Returns:
        diagonal of S.
      • getS

        public double[][] getS()
        Get Diagonal matrix of singular values.
        Returns:
        Diagonal matrix of singular values.
      • norm2

        public double norm2()
        Two norm. max(S).
        Returns:
        Two norm.
      • cond

        public double cond()
        Two norm condition number. max(S)/min(S)
        Returns:
        Two norm condition number.
      • rank

        public int rank()
        Effective numerical matrix rank.
        Returns:
        Number of nonnegligible singular values.
      • threshold

        public double threshold()
      • inverse

        public double[][] inverse()

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.