Class SVDTask.SVDMatrix

  • Enclosing class:
    SVDTask

    private final class SVDTask.SVDMatrix
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double EPSILON  
      private int m
      Row and column dimensions.
      private int n
      Row and column dimensions.
      private int ncu
      Row and column dimensions.
      private double[] s
      Array for internal storage of singular values.
      private boolean thin
      Column specification of matrix U
      private double TINY  
      private double[][] U
      Arrays for internal storage of U and V.
      private double[][] V
      Arrays for internal storage of U and V.
    • Constructor Summary

      Constructors 
      Constructor Description
      SVDMatrix​(Matrix Arg, boolean thin, boolean wantu, boolean wantv)
      Construct the singular value decomposition
    • Field Detail

      • EPSILON

        private final double EPSILON
      • TINY

        private final double TINY
      • U

        private final double[][] U
        Arrays for internal storage of U and V.
      • V

        private final double[][] V
        Arrays for internal storage of U and V.
      • s

        private final double[] s
        Array for internal storage of singular values.
      • m

        private final int m
        Row and column dimensions.
      • n

        private final int n
        Row and column dimensions.
      • ncu

        private final int ncu
        Row and column dimensions.
      • thin

        private final boolean thin
        Column specification of matrix U
    • Constructor Detail

      • SVDMatrix

        public SVDMatrix​(Matrix Arg,
                         boolean thin,
                         boolean wantu,
                         boolean wantv)
        Construct the singular value decomposition
        Parameters:
        Arg - Rectangular matrix
        thin - If true U is economy sized
        wantu - If true generate the U matrix
        wantv - If true generate the V matrix
    • Method Detail

      • getSingularValues

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

        public final DenseDoubleMatrix2D getS()
        Return the diagonal matrix of singular values
        Returns:
        S
      • getreciprocalS

        public final DenseDoubleMatrix2D getreciprocalS()
        Return the diagonal matrix of the reciprocals of the singular values
        Returns:
        S+
      • inverse

        public final DenseDoubleMatrix2D inverse​(boolean omit)
        Return the Moore-Penrose (generalized) inverse Slightly modified version of Kim van der Linde's code
        Parameters:
        omit - if true tolerance based omitting of negligible singular values
        Returns:
        A+
      • norm2

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

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

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