SingularOps
org.ejml.ops

Class SingularOps



  • public class SingularOpsextends Object
    Operations related to singular value decomposition.
    • Constructor Detail

      • SingularOps

        public SingularOps()
    • Method Detail

      • descendingOrder

        public static void descendingOrder(DenseMatrix64F U,                   boolean tranU,                   DenseMatrix64F W,                   DenseMatrix64F V,                   boolean tranV)

        Adjusts the matrices so that the singular values are in descending order.

        In most implementations of SVD the singular values are automatically arranged in in descending order. In EJML this is not the case since it is often not needed and some computations can be saved by not doing that.

        Parameters:
        U - Matrix. Modified.
        tranU - is U transposed or not.
        W - Diagonal matrix with singular values. Modified.
        V - Matrix. Modified.
        tranV - is V transposed or not.
      • checkSvdMatrixSize

        public static void checkSvdMatrixSize(DenseMatrix64F U,                      boolean tranU,                      DenseMatrix64F W,                      DenseMatrix64F V,                      boolean tranV)
        Checks to see if all the provided matrices are the expected size for an SVD. If an error is encountered then an exception is thrown. This automatically handles compact and non-compact formats
      • nullSpace

        public static DenseMatrix64F nullSpace(SingularValueDecomposition<DenseMatrix64F> svd,                       DenseMatrix64F nullSpace,                       double tol)

        Returns the null-space from the singular value decomposition. The null space is a set of non-zero vectors that when multiplied by the original matrix return zero.

        The null space is found by extracting the columns in V that are associated singular values less than or equal to the threshold. In some situations a non-compact SVD is required.

        Parameters:
        svd - A precomputed decomposition. Not modified.
        nullSpace - Storage for null space. Will be reshaped as needed. Modified.
        tol - Threshold for selecting singular values. Try UtilEjml.EPS.
        Returns:
        The null space.
      • nullVector

        public static DenseMatrix64F nullVector(SingularValueDecomposition<DenseMatrix64F> svd,                        boolean isRight,                        DenseMatrix64F nullVector)

        The vector associated will the smallest singular value is returned as the null space of the decomposed system. A right null space is returned if 'isRight' is set to true, and a left null space if false.

        Parameters:
        svd - A precomputed decomposition. Not modified.
        isRight - true for right null space and false for left null space. Right is more commonly used.
        nullVector - Optional storage for a vector for the null space. Modified.
        Returns:
        Vector in V associated with smallest singular value..
      • rank

        public static int rank(SingularValueDecomposition svd,       double threshold)
        Extracts the rank of a matrix using a preexisting decomposition.
        Parameters:
        svd - A precomputed decomposition. Not modified.
        threshold - Tolerance used to determine of a singular value is singular.
        Returns:
        The rank of the decomposed matrix.
      • nullity

        public static int nullity(SingularValueDecomposition svd,          double threshold)
        Extracts the nullity of a matrix using a preexisting decomposition.
        Parameters:
        svd - A precomputed decomposition. Not modified.
        threshold - Tolerance used to determine of a singular value is singular.
        Returns:
        The nullity of the decomposed matrix.

SCaVis 2.2 © jWork.ORG