Class ComplexEigen
- All Implemented Interfaces:
Serializable
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 ClassesModifier and TypeClassDescriptionstatic classThe iteration did not converge. -
Constructor Summary
ConstructorsConstructorDescriptionComplexEigen(Complex[][] a) 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 TypeMethodDescriptionintReturns the maximum number of iterations.doubleReturns the performance index of the complex eigensystem.Complex[]Returns the eigenvalues of a matrix of typeComplex.Complex[][]Returns the eigenvectors of the input matrix.voidsetMaxIterations(int maxIterations) Set the maximum number of iterations allowed.voidsolve(boolean computeVectors) Solves for the eigenvalues and (optionally) the eigenvectors of a complex square matrix.
-
Constructor Details
-
ComplexEigen
Constructor for the computation of the eigenvalues and eigenvectors of a complex square matrix.- Parameters:
a- theComplexsquare matrix whose eigenvalues and eigenvectors are to be computed
-
ComplexEigen
Copy constructor for the computation of the eigenvalues and eigenvectors of a complex square matrix.- Parameters:
eigenProblem- theComplexEigenobject to be copied
-
-
Method Details
-
solve
Solves for the eigenvalues and (optionally) the eigenvectors of a complex square matrix.- Parameters:
computeVectors- aboolean; set tofalseif only the eigenvalues are to be computed; set totrueif 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
Returns the eigenvalues of a matrix of typeComplex.- Returns:
- a
Complexarray containing the eigenvalues of the input matrix. Methodsolvemust have been called before calling this method.
-
getVectors
Returns the eigenvectors of the input matrix.- Returns:
- A
Complexmatrix 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. Methodsolvemust have been called in the formsolve(true)before calling this method.
-
setMaxIterations
public void setMaxIterations(int maxIterations) Set the maximum number of iterations allowed.- Parameters:
maxIterations- anintspecifying the maximum number of QR iterations allowed per eigenvalue.maxIterationsmust be greater than 0. By default,maxIterations= 30 * StrictMath.max(10,k), wherekis 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
intcontaining the maximum number of iterations
-
getPerformanceIndex
public double getPerformanceIndex()Returns the performance index of the complex eigensystem.- Returns:
- A
doublescalar 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.
-