HQR is based on the routine hqr described in section 11.6 of Numerical Recipes in C: The Art of Scientific Computing (Second Edition), published by Cambridge University Press, and is used by permission.
Note: If you are working with complex inputs, use the LA_HQR function instead.
To compute the eigenvalues of a real, non-symmetric unbalanced array, first define the array A:
A = [[ 1.0, 2.0, 0.0, 0.0, 0.0], $
[-2.0, 3.0, 0.0, 0.0, 0.0], $
[ 3.0, 4.0, 50.0, 0.0, 0.0], $
[-4.0, 5.0, -60.0, 7.0, 0.0], $
[-5.0, 6.0, -70.0, 8.0, -9.0]]
; Compute the upper Hessenberg form of the array:
hes = ELMHES(A)
; Compute the eigenvalues:
evals = HQR(hes)
; Sort the eigenvalues into ascending order based on their
; real components:
evals = evals(SORT(FLOAT(evals)))
;Print the result.
( -9.00000, 0.00000)( 2.00000, -1.73205)
( 2.00000, 1.73205)( 7.00000, 0.00000)
( 50.0000, 0.00000)
This is the exact solution vector to five-decimal accuracy.
The result is an n-element complex vector.
An n by n upper Hessenberg array. Typically, A would be an array resulting from an application of ELMHES.
Note: If HQR is complex then only the real part is used for the computation.
Set this keyword if the input array A is in column-major format (composed of column vectors) rather than in row-major format (composed of row vectors).
Set this keyword to force the computation to be done in double-precision arithmetic.
This page has no comments yet. Be the first one!