TQLI Procedure
Uses the QL algorithm with implicit shifts to determine the eigenvalues and eigenvectors of a real, symmetric, tri-diagonal matrix, or an orthogonal transformation thereof.
Usage
TQLI, d, e, z
Input Parameters
d—An n-element vector. On input, it contains the diagonal elements of the matrix.
e—An n-element vector. On input, it contains the off-diagonal elements of the matrix. e0 is arbitrary.
z—An (n,n) matrix. z defines an orthogonal transformation of a tri-diagonal matrix b, i.e., c = TRANSPOSE(z) # b # z. TQLI returns the eigenvectors of c. Note if z = DIAG(REPLICATE(1.0, n)) then c = b.
Output Parameters
d—An n-element vector. On output, it contains the eigenvalues.
e—An n-element vector. On output, it is destroyed.
z—On output, z(*, j) contains the jth eigenvector.
Keywords
None.
Discussion
The TRED2 procedure may be used to reduce a real symmetric matrix to the tridiagonal form that is suitable for input to TQLI.
If the eigenvectors of a tridiagonal matrix are desired, z should be input as an identity matrix. If the eigenvectors of a matrix that has been reduced by TRED2 are desired, z should be input as the matrix Q output by TRED2.
TQLI is based on the routine of the same name found in Numerical Recipes in C: The Art of Scientific Computing, by Flannery, Press, Teukolsky, and Vetterling, Cambridge University Press, Cambridge, MA, 1988. It is used by permission.
However, because the order of subscripts in PV‑WAVE are reversed in comparison to those in Numerical Recipes, the z matrix is transposed from the result described in that book.
Example
To determine the eigenvalues and eigenvectors of a real, symmetric matrix A:
s = 0
c = 2*RANDOMU(s, 4, 4) - 1
c = c + TRANSPOSE(c)
; Print symmetric matrix c
PM, c
PM, ' '
b = c
TRED2, b, d, e
; eigenvalues d and eigenvectors b of c
TQLI, d, e, b
; Verify the solution
PM, c#b
PM, ' '
PM, b#DIAG(d)
PM, ' '
PM, SAME(c#b, b#DIAG(d), Tl=1e-5)
See Also
Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.