 
      SUBROUTINE QZIT(NM,N,A,B,EPS1,MATZ,Z,IERR)
C***BEGIN PROLOGUE  QZIT
C***DATE WRITTEN   760101   (YYMMDD)
C***REVISION DATE  830518   (YYMMDD)
C***CATEGORY NO.  D4C1B3
C***KEYWORDS  EIGENVALUES,EIGENVECTORS,EISPACK
C***AUTHOR  SMITH, B. T., ET AL.
C***PURPOSE  The second step of the QZ algorithm for generalized
C            eigenproblems. Accepts an upper Hessenberg and an upper
C            triangular matrix and reduces the former to
C            quasi-triangular form while preserving the form of the
C            latter. Usually preceeded by QZHES and followed by QZVAL
C            and QZVEC.
C***DESCRIPTION
C
C     This subroutine is the second step of the QZ algorithm
C     for solving generalized matrix eigenvalue problems,
C     SIAM J. NUMER. ANAL. 10, 241-256(1973) by MOLER and STEWART,
C     as modified in technical note NASA TN D-7305(1973) by WARD.
C
C     This subroutine accepts a pair of REAL matrices, one of them
C     in upper Hessenberg form and the other in upper triangular form.
C     It reduces the Hessenberg matrix to quasi-triangular form using
C     orthogonal transformations while maintaining the triangular form
C     of the other matrix.  It is usually preceded by  QZHES  and
C     followed by  QZVAL  and, possibly,  QZVEC.
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 matrices.
C
C        A contains a real upper Hessenberg matrix.
C
C        B contains a real upper triangular matrix.
C
C        EPS1 is a tolerance used to determine negligible elements.
C          EPS1 = 0.0 (or negative) may be input, in which case an
C          element will be neglected only if it is less than roundoff
C          error times the norm of its matrix.  If the input EPS1 is
C          positive, then an element will be considered negligible
C          if it is less than EPS1 times the norm of its matrix.  A
C          positive value of EPS1 may result in faster execution,
C          but less accurate results.
C
C        MATZ should be set to .TRUE. If the right hand transformations
C          are to be accumulated for later use in computing
C          eigenvectors, and to .FALSE. otherwise.
C
C        Z contains, if MATZ has been set to .TRUE., the
C          transformation matrix produced in the reduction
C          by  QZHES, if performed, or else the identity matrix.
C          If MATZ has been set to .FALSE., Z is not referenced.
C
C     On Output
C
C        A has been reduced to quasi-triangular form.  The elements
C          below the first subdiagonal are still zero and no two
C          consecutive subdiagonal elements are nonzero.
C
C        B is still in upper triangular form, although its elements
C          have been altered.  The location B(N,1) is used to store
C          EPS1 times the norm of B for later use by  QZVAL  and  QZVEC.
C
C        Z contains the product of the right hand transformations
C          (for both steps) if MATZ has been set to .TRUE.
C
C        IERR is set to
C          ZERO       for normal return,
C          J          if neither A(J,J-1) nor A(J-1,J-2) has become
C                     zero after a total of 30*N iterations.
C
C     Questions and comments should be directed to B. S. Garbow,
C     APPLIED MATHEMATICS DIVISION, ARGONNE NATIONAL LABORATORY
C     ------------------------------------------------------------------
C***REFERENCES  B. T. SMITH, J. M. BOYLE, J. J. DONGARRA, B. S. GARBOW,
C                 Y. IKEBE, V. C. KLEMA, C. B. MOLER, *MATRIX EIGEN-
C                 SYSTEM ROUTINES - EISPACK GUIDE*, SPRINGER-VERLAG,
C                 1976.
C***ROUTINES CALLED  (NONE)
C***END PROLOGUE  QZIT
 
 
