TRIQL

The TRIQL procedure uses the QL algorithm with implicit shifts to determine the eigenvalues and eigenvectors of a real, symmetric, tridiagonal array. The routine TRIRED can be used to reduce a real, symmetric array to the tridiagonal form suitable for input to this procedure.

TRIQL is based on the routine tqli described in section 11.3 of Numerical Recipes in C: The Art of Scientific Computing (Second Edition), published by Cambridge University Press, and is used by permission.

Calling Sequence

TRIQL, D, E, A

Arguments

D

On input, this argument should be an n -element vector containing the diagonal elements of the array being analyzed. On output, D contains the eigenvalues.

E

An n -element vector containing the off-diagonal elements of the array. E 0 is arbitrary. On output, this parameter is destroyed.

A

A named variable that returns the n eigenvectors.

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 TRIRED are desired, A is input as the array Q output by TRIRED.

Keywords

DOUBLE

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

Example

To compute eigenvalues and eigenvectors of a real, symmetric, tridiagonal array, begin with an array A representing a symmetric array.

A = [[ 3.0,  1.0, -4.0], $

    [ 1.0,  3.0, -4.0], $

     [-4.0, -4.0,  8.0]]

TRIRED, A, D, E ; Compute the tridiagonal form of A.

Compute the eigenvalues (returned in vector D) and the eigenvectors (returned in the rows of the array A):

TRIQL, D, E, A

PRINT, D ; Print eigenvalues.

IDL prints:

  2.00000  4.76837e-7  12.0000

The exact values are:

  [2.0, 0.0, 12.0]

PRINT, A ; Print eigenvectors.

IDL prints:

  0.707107  -0.707107   0.00000

 -0.577350  -0.577350  -0.577350

 -0.408248  -0.408248   0.816497

The exact eigenvectors are:

 [ 1.0/sqrt(2.0), -1.0/sqrt(2.0), 0.0/sqrt(2.0)],

 [-1.0/sqrt(3.0), -1.0/sqrt(3.0), -1.0/sqrt(3.0)],

 [-1.0/sqrt(6.0), -1.0/sqrt(6.0), 2.0/sqrt(6.0)

See Also

EIGENVEC , ELMHES , HQR , TRIRED