Documentation of 'jsat.linear.EigenValueDecomposition' Java class
EigenValueDecomposition
jsat.linear

Class EigenValueDecomposition

  • All Implemented Interfaces:
    java.io.Serializable


    public class EigenValueDecomposition
    extends java.lang.Object
    implements java.io.Serializable
    Class for performing the Eigen Value Decomposition of a matrix. The EVD of a real matrix may contain complex results. When this occurs, the EVD is less useful since JSAT only supports real matrices. The SingularValueDecomposition of a real matrix is always real, and may be more useful.

    Implementation adapted from the Public Domain work of JAMA: A Java Matrix Package

    If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is diagonal and the eigenvector matrix V is orthogonal. V * V' equals the identity matrix.

    If A is not symmetric, then the eigenvalue matrix D is block diagonal with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues, lambda + i*mu, in 2-by-2 blocks, [lambda, mu; -mu, lambda]. The columns of V represent the eigenvectors in the sense that A*V = V*D. The matrix V may be badly conditioned, or even singular, so the validity of the equation A = V*D*inverse(V) depends upon the condition of V.
    If there are no complex eigen values, which can be checked using isComplex(), then D is a normal diagonal matrix.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      Matrix getD()
      Return the block diagonal eigenvalue matrix
      double[] getImagEigenvalues()
      Return the imaginary parts of the eigenvalues
      double[] getRealEigenvalues()
      Return the real parts of the eigenvalues
      Matrix getV()
      Return a copy of the eigenvector matrix
      Matrix getVRaw()
      Returns the raw eigenvector matrix.
      Matrix getVT()
      Returns a copy of the transposed eigenvector matrix.
      boolean isComplex()
      Indicates wether or not the EVD contains complex eigen values.
      void sortByEigenValue(java.util.Comparator<java.lang.Double> cmp)
      Sorts the eigen values and the corresponding eigenvector columns by the associated eigen value.
      • Methods inherited from class java.lang.Object

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

      • EigenValueDecomposition

        public EigenValueDecomposition(Matrix A)
        Creates a new new Eigen Value Decomposition. The input matrix will not be altered. If the input is symmetric, a more efficient algorithm will be used.
        Parameters:
        A - the square matrix to work on.
      • EigenValueDecomposition

        public EigenValueDecomposition(Matrix A,
                                       double eps)
        Creates a new new Eigen Value Decomposition. The input matrix will not be altered. If the input is symmetric, a more efficient algorithm will be used.
        Parameters:
        A - the square matrix to work on.
        eps - the numerical tolerance for differences in value to be considered the same.
    • Method Detail

      • sortByEigenValue

        public void sortByEigenValue(java.util.Comparator<java.lang.Double> cmp)
        Sorts the eigen values and the corresponding eigenvector columns by the associated eigen value. Sorting can not occur if complex values are present.
        Parameters:
        cmp - the comparator to use to sort the eigen values
      • getV

        public Matrix getV()
        Return a copy of the eigenvector matrix
        Returns:
        the eigen vector matrix
      • getVRaw

        public Matrix getVRaw()
        Returns the raw eigenvector matrix. Modifying this matrix will effect others using the same matrix.
        Returns:
        the eigen vector matrix
      • getVT

        public Matrix getVT()
        Returns a copy of the transposed eigenvector matrix.
        Returns:
        the transposed eigen the eigen vector matrix
      • getRealEigenvalues

        public double[] getRealEigenvalues()
        Return the real parts of the eigenvalues
        Returns:
        real(diag(D))
      • getImagEigenvalues

        public double[] getImagEigenvalues()
        Return the imaginary parts of the eigenvalues
        Returns:
        imag(diag(D))
      • getD

        public Matrix getD()
        Return the block diagonal eigenvalue matrix
        Returns:
        D
      • isComplex

        public boolean isComplex()
        Indicates wether or not the EVD contains complex eigen values. Because EVD works with real matrices, the complex eigen vectors are lost - and the complex eigen values are in the off diagonal spaces of the D matrix.
        Returns:
        true if the EVD results in complex eigen values.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.