Class SymmetricSVD

  • All Implemented Interfaces:
    SVDDecomposition

    public class SymmetricSVD
    extends Object
    implements SVDDecomposition
    This algorithm calculates the Singular Value Decomposition (SVD) of a square, symmetric matrix A using QR algorithm. A=UDV', where U and V are orthogonal matrices. D is a diagonal matrix. We use QR algorithm to compute the eigenvalues of A, and the orthogonal matrix Q, so that Q'AQ is a diagonal matrix.

    The orthogonal matrix U equals Q. To make the entries in D non-negative, we flip the sign of the columns of V that correspond to negative entries of D. The remaining columns in V are the same as those in Q.

    See Also:
    SymmetricQRAlgorithm
    • Constructor Detail

      • SymmetricSVD

        public SymmetricSVD​(Matrix A)
        Calculates the SVD of A.
        Parameters:
        A - a symmetric matrix
        Throws:
        IllegalArgumentException - if A is not square or if A is not symmetric
      • SymmetricSVD

        public SymmetricSVD​(Matrix A,
                            double epsilon)
        Calculates the SVD of A.
        Parameters:
        A - a symmetric matrix
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
        Throws:
        IllegalArgumentException - if A is not square or if A is not symmetric