Previous: figi2 Up: ../eispas.html Next: hqr2


HQR(NM,N,LOW,IGH,H,WR,WI,IERR)

       SUBROUTINE HQR(NM,N,LOW,IGH,H,WR,WI,IERR)
 C
       INTEGER I,J,K,L,M,N,EN,LL,MM,NA,NM,IGH,ITN,ITS,LOW,MP2,ENM2,IERR
       REAL H(NM,N),WR(N),WI(N)
       REAL P,Q,R,S,T,W,X,Y,ZZ,NORM,TST1,TST2
       LOGICAL NOTLAS
 C
 C     THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE HQR,
 C     NUM. MATH. 14, 219-231(1970) BY MARTIN, PETERS, AND WILKINSON.
 C     HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 359-371(1971).
 C
 C     THIS SUBROUTINE FINDS THE EIGENVALUES OF A REAL
 C     UPPER HESSENBERG MATRIX BY THE QR METHOD.
 C
 C     ON INPUT
 C
 C        NM MUST BE SET TO THE ROW DIMENSION OF TWO-DIMENSIONAL
 C          ARRAY PARAMETERS AS DECLARED IN THE CALLING PROGRAM
 C          DIMENSION STATEMENT.
 C
 C        N IS THE ORDER OF THE MATRIX.
 C
 C        LOW AND IGH ARE INTEGERS DETERMINED BY THE BALANCING
 C          SUBROUTINE  BALANC.  IF  BALANC  HAS NOT BEEN USED,
 C          SET LOW=1, IGH=N.
 C
 C        H CONTAINS THE UPPER HESSENBERG MATRIX.  INFORMATION ABOUT
 C          THE TRANSFORMATIONS USED IN THE REDUCTION TO HESSENBERG
 C          FORM BY  ELMHES  OR  ORTHES, IF PERFORMED, IS STORED
 C          IN THE REMAINING TRIANGLE UNDER THE HESSENBERG MATRIX.
 C
 C     ON OUTPUT
 C
 C        H HAS BEEN DESTROYED.  THEREFORE, IT MUST BE SAVED
 C          BEFORE CALLING  HQR  IF SUBSEQUENT CALCULATION AND
 C          BACK TRANSFORMATION OF EIGENVECTORS IS TO BE PERFORMED.
 C
 C        WR AND WI CONTAIN THE REAL AND IMAGINARY PARTS,
 C          RESPECTIVELY, OF THE EIGENVALUES.  THE EIGENVALUES
 C          ARE UNORDERED EXCEPT THAT COMPLEX CONJUGATE PAIRS
 C          OF VALUES APPEAR CONSECUTIVELY WITH THE EIGENVALUE
 C          HAVING THE POSITIVE IMAGINARY PART FIRST.  IF AN
 C          ERROR EXIT IS MADE, THE EIGENVALUES SHOULD BE CORRECT
 C          FOR INDICES IERR+1,...,N.
 C
 C        IERR IS SET TO
 C          ZERO       FOR NORMAL RETURN,
 C          J          IF THE LIMIT OF 30*N ITERATIONS IS EXHAUSTED
 C                     WHILE THE J-TH EIGENVALUE IS BEING SOUGHT.
 C
 C     QUESTIONS AND COMMENTS SHOULD BE DIRECTED TO BURTON S. GARBOW,
 C     MATHEMATICS AND COMPUTER SCIENCE DIV, ARGONNE NATIONAL LABORATORY
 C
 C     THIS VERSION DATED AUGUST 1983.
 C
 C     ------------------------------------------------------------------
 C