# tred2.f

          SUBROUTINE TRED2 (NM, N, A, D, E, Z)
    C***BEGIN PROLOGUE  TRED2
    C***PURPOSE  Reduce a real symmetric matrix to a symmetric tridiagonal
    C            matrix using and accumulating orthogonal transformations.
    C***LIBRARY   SLATEC (EISPACK)
    C***CATEGORY  D4C1B1
    C***TYPE      SINGLE PRECISION (TRED2-S)
    C***KEYWORDS  EIGENVALUES, EIGENVECTORS, EISPACK
    C***AUTHOR  Smith, B. T., et al.
    C***DESCRIPTION
    C
    C     This subroutine is a translation of the ALGOL procedure TRED2,
    C     NUM. MATH. 11, 181-195(1968) by Martin, Reinsch, and Wilkinson.
    C     HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 212-226(1971).
    C
    C     This subroutine reduces a REAL SYMMETRIC matrix to a
    C     symmetric tridiagonal matrix using and accumulating
    C     orthogonal similarity transformations.
    C
    C     On Input
    C
    C        NM must be set to the row dimension of the two-dimensional
    C          array parameters, A and Z, as declared in the calling
    C          program dimension statement.  NM is an INTEGER variable.
    C
    C        N is the order of the matrix A.  N is an INTEGER variable.
    C          N must be less than or equal to NM.
    C
    C        A contains the real symmetric input matrix.  Only the lower
    C          triangle of the matrix need be supplied.  A is a two-
    C          dimensional REAL array, dimensioned A(NM,N).
    C
    C     On Output
    C
    C        D contains the diagonal elements of the symmetric tridiagonal
    C          matrix.  D is a one-dimensional REAL array, dimensioned D(N).
    C
    C        E contains the subdiagonal elements of the symmetric
    C          tridiagonal matrix in its last N-1 positions.  E(1) is set
    C          to zero.  E is a one-dimensional REAL array, dimensioned
    C          E(N).
    C
    C        Z contains the orthogonal transformation matrix produced in
    C          the reduction.  Z is a two-dimensional REAL array,
    C          dimensioned Z(NM,N).
    C
    C        A and Z may coincide.  If distinct, A is unaltered.
    C
    C     Questions and comments should be directed to B. S. Garbow,
    C     APPLIED MATHEMATICS DIVISION, ARGONNE NATIONAL LABORATORY
    C     ------------------------------------------------------------------
    C
    C***REFERENCES  B. T. Smith, J. M. Boyle, J. J. Dongarra, B. S. Garbow,
    C                 Y. Ikebe, V. C. Klema and C. B. Moler, Matrix Eigen-
    C                 system Routines - EISPACK Guide, Springer-Verlag,
    C                 1976.
    C***ROUTINES CALLED  (NONE)
    C***REVISION HISTORY  (YYMMDD)
    C   760101  DATE WRITTEN
    C   890831  Modified array declarations.  (WRB)
    C   890831  REVISION DATE from Version 3.2
    C   891214  Prologue converted to Version 4.0 format.  (BAB)
    C   920501  Reformatted the REFERENCES section.  (WRB)
    C***END PROLOGUE  TRED2