Package com.imsl.math

Class ComplexEigen

java.lang.Object
com.imsl.math.ComplexEigen
All Implemented Interfaces:
Serializable

public class ComplexEigen extends Object implements Serializable
Collection of complex Eigen System functions.

ComplexEigen computes the eigenvalues and eigenvectors of a general square complex matrix. The matrix is first scaled and balanced. Orthogonal similarity transformations are used to reduce the scaled and balanced matrix to a complex upper Hessenberg matrix. For small matrices the implicit double-shift QR algorithm and for larger matrices the multi-shift QR algorithm is then used to compute the eigenvalues and eigenvectors of this Hessenberg matrix. The eigenvectors are normalized such that each has Euclidean length one. The largest component is real and positive.

The scaling and balancing methods are based on the LAPACK routines ZLASCL and ZGEBAL, respectively. The reduction method is based on the LAPACK routine ZGEHRD. The QR algorithms are based on the LAPACK routines ZLAHQR and ZLAQR0, ZLAQR1, ..., ZLAQR5. Eigenvectors are computed using LAPACK routine ZTREVC. See the LAPACK Users' Guide [1] for more information on some of the routines used.

The performance index \(\tau\) is defined as $$\tau = \max_{1 \le j \le n} \frac{\|Ax_j - \lambda_j x_j\|}{10 n \epsilon \|A\|_1 \|x_j\|_1}.$$ Here, n is the order of the matrix A and \(\epsilon\) the machine precision.
The norms used are a modified form of the 1-norm. The norm of the complex vector v is $$\|v\|_1 = \sum_{i=1}^n\{|\Re v_i| + |\Im v_i|\}.$$ The performance of ComplexEigen on a matrix A is considered excellent if \(\tau \lt 1\), good if \(1 \le \tau \le 100\), and poor if \( \tau \gt 100\).

The performance index was first developed by the EISPACK project at Argonne National Laboratory; see [2], pages 124-125.

References
1. Anderson, E., Z. Bai, C. Bishop, S. Blackford, J. Demmel, J. Dongarra, J. DuCroz, A. Greenbaum, S. Hammarling, A. McKenney, and D. Sorensen (1999), LAPACK Users' Guide, Third Edition, SIAM, Philadelphia, PA.
2. Smith, B.T., J.M. Boyle, J.J. Dongarra, B.S. Garbow, Y. Ikebe, V.C. Klema, and C.B. Moler (1976), Matrix Eigensystem Routines – EISPACK Guide, Springer-Verlag, New York.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The iteration did not converge.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the computation of the eigenvalues and eigenvectors of a complex square matrix.
    ComplexEigen(ComplexEigen eigenProblem)
    Copy constructor for the computation of the eigenvalues and eigenvectors of a complex square matrix.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the maximum number of iterations.
    double
    Returns the performance index of the complex eigensystem.
    Returns the eigenvalues of a matrix of type Complex.
    Returns the eigenvectors of the input matrix.
    void
    setMaxIterations(int maxIterations)
    Set the maximum number of iterations allowed.
    void
    solve(boolean computeVectors)
    Solves for the eigenvalues and (optionally) the eigenvectors of a complex square matrix.

    Methods inherited from class java.lang.Object

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

    • ComplexEigen

      public ComplexEigen(Complex[][] a)
      Constructor for the computation of the eigenvalues and eigenvectors of a complex square matrix.
      Parameters:
      a - the Complex square matrix whose eigenvalues and eigenvectors are to be computed
    • ComplexEigen

      public ComplexEigen(ComplexEigen eigenProblem)
      Copy constructor for the computation of the eigenvalues and eigenvectors of a complex square matrix.
      Parameters:
      eigenProblem - the ComplexEigen object to be copied
  • Method Details

    • solve

      public void solve(boolean computeVectors) throws ComplexEigen.DidNotConvergeException
      Solves for the eigenvalues and (optionally) the eigenvectors of a complex square matrix.
      Parameters:
      computeVectors - a boolean; set to false if only the eigenvalues are to be computed; set to true if eigenvalues and eigenvectors are to be computed.
      For large matrices, the computing time can be significantly lower if eigenvalues only are required.
      Throws:
      ComplexEigen.DidNotConvergeException - is thrown if the algorithm fails to compute all eigenvalues of the matrix.
    • getValues

      public Complex[] getValues()
      Returns the eigenvalues of a matrix of type Complex.
      Returns:
      a Complex array containing the eigenvalues of the input matrix. Method solve must have been called before calling this method.
    • getVectors

      public Complex[][] getVectors()
      Returns the eigenvectors of the input matrix.
      Returns:
      A Complex matrix containing the right eigenvectors. The eigenvector corresponding to the j-th eigenvalue is stored in the j-th column. Each vector is normalized to have Euclidean length one. Method solve must have been called in the form solve(true) before calling this method.
    • setMaxIterations

      public void setMaxIterations(int maxIterations)
      Set the maximum number of iterations allowed.
      Parameters:
      maxIterations - an int specifying the maximum number of QR iterations allowed per eigenvalue. maxIterations must be greater than 0. By default, maxIterations = 30 * StrictMath.max(10, k), where k is the order of the active block diagonal matrix after balancing the input matrix.
    • getMaxIterations

      public int getMaxIterations()
      Returns the maximum number of iterations.
      Returns:
      an int containing the maximum number of iterations
    • getPerformanceIndex

      public double getPerformanceIndex()
      Returns the performance index of the complex eigensystem.
      Returns:
      A double scalar indicating how well the algorithms which have computed the eigenvalue and eigenvector pairs have performed. A performance index less than 1 is considered excellent, 1 to 100 is good, while greater than 100 is considered poor.