Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

EIGENVEC


Syntax | Return Value | Arguments | Keywords | Examples | Version History | See Also

The EIGENVEC function computes the eigenvectors of an n-by-n real, non-symmetric array using Inverse Subspace Iteration. Use ELMHES and HQR to find the eigenvalues of an n-by-n real, nonsymmetric array.

This routine is written in the IDL language. Its source code can be found in the file eigenvec.pro in the lib subdirectory of the IDL distribution.

Note
If you are working with complex inputs, instead use the LA_EIGENVEC function.

Syntax

Result = EIGENVEC( A, Eval [, /DOUBLE] [, ITMAX=value] [, RESIDUAL=variable] )

Return Value

This function returns a complex array with a column dimension equal to n and a row dimension equal to the number of eigenvalues.

Arguments

A

An n-by-n nonsymmetric, single- or double-precision floating-point array.

EVAL

An n-element complex vector of eigenvalues.

Keywords

DOUBLE

Set this keyword to force the computation to be done in double-precision arithmetic.

ITMAX

The maximum number of iterations allowed in the computation of each eigenvector. The default value is 4.

RESIDUAL

Use this keyword to specify a named variable that will contain the residuals for each eigenvalue/eigenvector (l/x) pair. The residual is based on the definition Ax - lx = 0 and is an array of the same size and type as that returned by the function. The rows of this array correspond to the residuals for each eigenvalue/eigenvector pair.

Examples

; Define an n-by-n real, nonsymmetric array: 
A = [[1.0, -2.0, -4.0,  1.0], $ 
     [0.0, -2.0,  3.0,  4.0], $ 
     [2.0, -6.0, -1.0,  4.0], $ 
     [3.0, -3.0,  1.0, -2.0]] 
; Compute the eigenvalues of A using double-precision complex 
; arithmetic and print the result: 
eval = HQR(ELMHES(A), /DOUBLE) 
PRINT, 'Eigenvalues: ' 
PRINT, eval 
evec = EIGENVEC(A, eval, RESIDUAL = residual) 
 
; Print the eigenvectors: 
PRINT, 'Eigenvectors:' 
PRINT, evec[*,0], evec[*,1], evec[*,2], evec[*,3] 

IDL prints:

Eigenvalues: 
(  0.26366255, -6.1925899)(  0.26366255, 6.1925899) 
(  -4.9384492,  0.0000000)(  0.41112406, 0.0000000) 
Eigenvectors: 
( 0.0076733129,  -0.42912489)(  0.40651652,  0.32973069) 
(   0.54537624,  -0.28856257)(  0.33149359, -0.22632585) 
(  -0.42145884, -0.081113711)(  0.23867007,  0.46584824) 
(  -0.39497143,   0.47402647)( -0.28990600,  0.27760747) 
(  -0.54965842,    0.0000000)( -0.18401243,   0.0000000) 
(  -0.58124548,    0.0000000)(  0.57111192,   0.0000000) 
(   0.79297048,    0.0000000)(  0.50289130,   0.0000000) 
( -0.049618509,    0.0000000)(  0.34034720,   0.0000000) 

You can check the accuracy of each eigenvalue/eigenvector (l/x) pair by printing the residual array. All residual values should be floating-point zeros.

Version History

Introduced: 4.0

See Also

ELMHES, HQR, LA_EIGENVEC, TRIQL, TRIRED


Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]