Interface Eigen


public interface Eigen
Eigenvalue algorithms such as power iteration and Lanczos algorithms. Power iteration is a very simple algorithm, but it may converge slowly. The most time-consuming operation of the algorithm is the multiplication of matrix by a vector, so it is effective for a very large sparse matrix with appropriate implementation.

The Lanczos algorithm is a direct algorithm devised by Cornelius Lanczos that is an adaptation of power methods to find the most useful eigenvalues and eigenvectors of a nth order linear system with a limited number of operations, m, where m is much smaller than n.

Although computationally efficient in principle, the method as initially formulated was not useful, due to its numerical instability. In this implementation, we use partial reorthogonalization to make the method numerically stable.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
     
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static EVD
    of(Matrix A, int k)
    Find k-largest approximate eigen pairs of a symmetric matrix by the Lanczos algorithm.
    static EVD
    of(Matrix A, int k, double kappa, int maxIter)
    Find k-largest approximate eigen pairs of a symmetric matrix by the Lanczos algorithm.
    static double
    Returns the largest eigen pair of matrix with the power iteration under the assumptions A has an eigenvalue that is strictly greater in magnitude than its other eigenvalues and the starting vector has a nonzero component in the direction of an eigenvector associated with the dominant eigenvalue.
    static double
    power(Matrix A, Vector v, double p, double tol, int maxIter)
    Returns the largest eigen pair of matrix with the power iteration under the assumptions A has an eigenvalue that is strictly greater in magnitude than its other eigenvalues and the starting vector has a nonzero component in the direction of an eigenvector associated with the dominant eigenvalue.
  • Field Details

    • logger

      static final org.slf4j.Logger logger
  • Method Details

    • power

      static double power(Matrix A, Vector v)
      Returns the largest eigen pair of matrix with the power iteration under the assumptions A has an eigenvalue that is strictly greater in magnitude than its other eigenvalues and the starting vector has a nonzero component in the direction of an eigenvector associated with the dominant eigenvalue.
      Parameters:
      v - on input, it is the non-zero initial guess of the eigen vector. On output, it is the eigen vector corresponding largest eigen value.
      Returns:
      the largest eigen value.
    • power

      static double power(Matrix A, Vector v, double p, double tol, int maxIter)
      Returns the largest eigen pair of matrix with the power iteration under the assumptions A has an eigenvalue that is strictly greater in magnitude than its other eigenvalues and the starting vector has a nonzero component in the direction of an eigenvector associated with the dominant eigenvalue.
      Parameters:
      v - on input, it is the non-zero initial guess of the eigen vector. On output, it is the eigen vector corresponding largest eigen value.
      p - the origin in the shifting power method. A - pI will be used in the iteration to accelerate the method. p should be such that |(λ2 - p) / (λ1 - p)| < |λ2 / λ1|, where λ2 is the second-largest eigenvalue in magnitude. If we know the eigenvalue spectrum of A, (λ2 + λn)/2 is the optimal choice of p, where λn is the smallest eigenvalue in magnitude. Good estimates of λ2 are more difficult to compute. However, if μ is an approximation to the largest eigenvector, then using any x0 such that x0*μ = 0 as the initial vector for a few iterations may yield a reasonable estimate of λ2.
      tol - the desired convergence tolerance.
      maxIter - the maximum number of iterations in case that the algorithm does not converge.
      Returns:
      the largest eigen value.
    • of

      static EVD of(Matrix A, int k)
      Find k-largest approximate eigen pairs of a symmetric matrix by the Lanczos algorithm.
      Parameters:
      A - the matrix supporting matrix vector multiplication operation.
      k - the number of eigenvalues we wish to compute for the input matrix. This number cannot exceed the size of A.
      Returns:
      eigen value decomposition.
    • of

      static EVD of(Matrix A, int k, double kappa, int maxIter)
      Find k-largest approximate eigen pairs of a symmetric matrix by the Lanczos algorithm.
      Parameters:
      A - the matrix supporting matrix vector multiplication operation.
      k - the number of eigenvalues we wish to compute for the input matrix. This number cannot exceed the size of A.
      kappa - relative accuracy of ritz values acceptable as eigenvalues.
      maxIter - Maximum number of iterations.
      Returns:
      eigen value decomposition.