|
IDL Reference Guide: Procedures and Functions |
|
The LA_TRIQL procedure uses the QL and QR variants of the implicitly-shifted QR algorithm to compute the eigenvalues and eigenvectors of a symmetric tridiagonal array. The LA_TRIRED routine can be used to reduce a real symmetric (or complex Hermitian) array to tridiagonal form suitable for input to this procedure.
LA_TRIQL is based on the following LAPACK routines:
|
Output Type
|
LAPACK Routine
|
|---|---|
|
Float
|
|
|
Double
|
|
|
Complex
|
|
|
Double complex
|
|
For details see Anderson et al., LAPACK Users' Guide, 3rd ed., SIAM, 1999.
LA_TRIQL, D, E [, A] [, /DOUBLE] [, STATUS=variable]
A named vector of length n containing the real diagonal elements, optionally created by the LA_TRIRED procedure. Upon output, D is replaced by a real vector of length n containing the eigenvalues.
The (n - 1) real subdiagonal elements, optionally created by the LA_TRIRED procedure. On output, the values within E are destroyed.
An optional named variable that returns the eigenvectors as a set of n row vectors. If the eigenvectors of a tridiagonal array are desired, A should be input as an identity array. If the eigenvectors of an array that has been reduced by LA_TRIRED are desired, A should be input as the Array output from LA_TRIRED. If A is not input, then eigenvectors are not computed. A may be either real or complex.
Set this keyword to use double-precision for computations and to return a double-precision (real or complex) result. Set DOUBLE = 0 to use single-precision for computations and to return a single-precision (real or complex) result. The default is DOUBLE = 0 if none of the inputs are double precision. If A is not input, then the default is /DOUBLE if D is double precision. If A is input, then the default is /DOUBLE if A is double precision (real or complex).
Set this keyword to a named variable that will contain the status of the computation. Possible values are:
The following example program computes the eigenvalues and eigenvectors of a given symmetric array:
PRO ExLA_TRIQL ; Create a symmetric random array: n = 4 seed = 12321 Array = RANDOMN(seed, n, n) array = array + TRANSPOSE(array) ; Reduce to tridiagonal form q = array ; make a copy LA_TRIRED, q, d, e ; Compute eigenvalues and eigenvectors eigenvalues = d eigenvectors = q LA_TRIQL, eigenvalues, e, eigenvectors PRINT, 'LA_TRIQL eigenvalues:' PRINT, eigenvalues END
When this program is compiled and run, IDL prints: