Previous: tql1 Up: ../eispad.html Next: tqlrat


TQL2(NM,N,D,E,Z,IERR)

       SUBROUTINE TQL2(NM,N,D,E,Z,IERR)
 C
       INTEGER I,J,K,L,M,N,II,L1,L2,NM,MML,IERR
       DOUBLE PRECISION D(N),E(N),Z(NM,N)
       DOUBLE PRECISION C,C2,C3,DL1,EL1,F,G,H,P,R,S,S2,TST1,TST2,PYTHAG
 C
 C     THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE TQL2,
 C     NUM. MATH. 11, 293-306(1968) BY BOWDLER, MARTIN, REINSCH, AND
 C     WILKINSON.
 C     HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 227-240(1971).
 C
 C     THIS SUBROUTINE FINDS THE EIGENVALUES AND EIGENVECTORS
 C     OF A SYMMETRIC TRIDIAGONAL MATRIX BY THE QL METHOD.
 C     THE EIGENVECTORS OF A FULL SYMMETRIC MATRIX CAN ALSO
 C     BE FOUND IF  TRED2  HAS BEEN USED TO REDUCE THIS
 C     FULL MATRIX TO TRIDIAGONAL FORM.
 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        D CONTAINS THE DIAGONAL ELEMENTS OF THE INPUT MATRIX.
 C
 C        E CONTAINS THE SUBDIAGONAL ELEMENTS OF THE INPUT MATRIX
 C          IN ITS LAST N-1 POSITIONS.  E(1) IS ARBITRARY.
 C
 C        Z CONTAINS THE TRANSFORMATION MATRIX PRODUCED IN THE
 C          REDUCTION BY  TRED2, IF PERFORMED.  IF THE EIGENVECTORS
 C          OF THE TRIDIAGONAL MATRIX ARE DESIRED, Z MUST CONTAIN
 C          THE IDENTITY MATRIX.
 C
 C      ON OUTPUT
 C
 C        D CONTAINS THE EIGENVALUES IN ASCENDING ORDER.  IF AN
 C          ERROR EXIT IS MADE, THE EIGENVALUES ARE CORRECT BUT
 C          UNORDERED FOR INDICES 1,2,...,IERR-1.
 C
 C        E HAS BEEN DESTROYED.
 C
 C        Z CONTAINS ORTHONORMAL EIGENVECTORS OF THE SYMMETRIC
 C          TRIDIAGONAL (OR FULL) MATRIX.  IF AN ERROR EXIT IS MADE,
 C          Z CONTAINS THE EIGENVECTORS ASSOCIATED WITH THE STORED
 C          EIGENVALUES.
 C
 C        IERR IS SET TO
 C          ZERO       FOR NORMAL RETURN,
 C          J          IF THE J-TH EIGENVALUE HAS NOT BEEN
 C                     DETERMINED AFTER 30 ITERATIONS.
 C
 C     CALLS PYTHAG FOR  DSQRT(A*A + B*B) .
 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