java.lang.Object
org.ujmp.core.doublematrix.calculation.general.decomposition.SVDTask.SVDMatrix
Enclosing class:
SVDTask

private final class SVDTask.SVDMatrix extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final double
     
    private final int
    Row and column dimensions.
    private final int
    Row and column dimensions.
    private final int
    Row and column dimensions.
    private final double[]
    Array for internal storage of singular values.
    private final boolean
    Column specification of matrix U
    private final double
     
    private final double[][]
    Arrays for internal storage of U and V.
    private final double[][]
    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
  • Method Summary

    Modifier and Type
    Method
    Description
    final double
    Two norm condition number
    Return the diagonal matrix of the reciprocals of the singular values
    Return the diagonal matrix of singular values
    final double[]
    Return the one-dimensional array of singular values
    Return the left singular vectors
    Return the right singular vectors
    inverse(boolean omit)
    Return the Moore-Penrose (generalized) inverse Slightly modified version of Kim van der Linde's code
    final double
    Two norm
    final int
    Effective numerical matrix rank

    Methods inherited from class java.lang.Object

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

    • 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 Details

    • 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 Details

    • getU

      public final DenseDoubleMatrix2D getU()
      Return the left singular vectors
      Returns:
      U
    • getV

      public final DenseDoubleMatrix2D getV()
      Return the right singular vectors
      Returns:
      V
    • 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.