public class ComplexEigen extends Object implements 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.
Modifier and Type | Class and Description |
---|---|
static class |
ComplexEigen.DidNotConvergeException
The iteration did not converge.
|
Constructor and Description |
---|
ComplexEigen(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.
|
Modifier and Type | Method and Description |
---|---|
int |
getMaxIterations()
Returns the maximum number of iterations.
|
double |
getPerformanceIndex()
Returns the performance index of the complex eigensystem.
|
Complex[] |
getValues()
Returns the eigenvalues of a matrix of type
Complex . |
Complex[][] |
getVectors()
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.
|
public ComplexEigen(Complex[][] a)
a
- the Complex
square matrix whose eigenvalues
and eigenvectors are to be computedpublic ComplexEigen(ComplexEigen eigenProblem)
eigenProblem
- the ComplexEigen
object to be copiedpublic void solve(boolean computeVectors) throws ComplexEigen.DidNotConvergeException
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.
ComplexEigen.DidNotConvergeException
- is thrown if the algorithm
fails to compute all eigenvalues of the matrix.public Complex[] getValues()
Complex
.Complex
array containing the eigenvalues
of the input matrix. Method solve
must have been
called before calling this method.public Complex[][] getVectors()
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.public void setMaxIterations(int maxIterations)
maxIterations
- an int
specifying the maximum number
of QR iterations allowed per eigenvalue.
maxIterations
must be greater than 0.
By default, maxIterations
=
30 * Math.max(10, k
), where
k
is the order of the active block
diagonal matrix after balancing the input matrix.public int getMaxIterations()
int
containing the maximum number of iterationspublic double getPerformanceIndex()
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.Copyright © 2020 Rogue Wave Software. All rights reserved.