2 SUBROUTINE TRED1 (NM, N, A, D, E, E2)
3 C***BEGIN PROLOGUE TRED1
4 C***PURPOSE Reduce a real symmetric matrix to symmetric tridiagonal
5 C matrix using orthogonal similarity transformations.
6 C***LIBRARY SLATEC (EISPACK)
8 C***TYPE SINGLE PRECISION (TRED1-S)
9 C***KEYWORDS EIGENVALUES, EIGENVECTORS, EISPACK
10 C***AUTHOR Smith, B. T., et al.
13 C This subroutine is a translation of the ALGOL procedure TRED1,
14 C NUM. MATH. 11, 181-195(1968) by Martin, Reinsch, and Wilkinson.
15 C HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 212-226(1971).
17 C This subroutine reduces a REAL SYMMETRIC matrix
18 C to a symmetric tridiagonal matrix using
19 C orthogonal similarity transformations.
23 C NM must be set to the row dimension of the two-dimensional
24 C array parameter, A, as declared in the calling program
25 C dimension statement. NM is an INTEGER variable.
27 C N is the order of the matrix A. N is an INTEGER variable.
28 C N must be less than or equal to NM.
30 C A contains the real symmetric input matrix. Only the lower
31 C triangle of the matrix need be supplied. A is a two-
32 C dimensional REAL array, dimensioned A(NM,N).
36 C A contains information about the orthogonal transformations
37 C used in the reduction in its strict lower triangle. The
38 C full upper triangle of A is unaltered.
40 C D contains the diagonal elements of the symmetric tridiagonal
41 C matrix. D is a one-dimensional REAL array, dimensioned D(N).
43 C E contains the subdiagonal elements of the symmetric
44 C tridiagonal matrix in its last N-1 positions. E(1) is set
45 C to zero. E is a one-dimensional REAL array, dimensioned
48 C E2 contains the squares of the corresponding elements of E.
49 C E2 may coincide with E if the squares are not needed.
50 C E2 is a one-dimensional REAL array, dimensioned E2(N).
52 C Questions and comments should be directed to B. S. Garbow,
53 C APPLIED MATHEMATICS DIVISION, ARGONNE NATIONAL LABORATORY
54 C ------------------------------------------------------------------
56 C***REFERENCES B. T. Smith, J. M. Boyle, J. J. Dongarra, B. S. Garbow,
57 C Y. Ikebe, V. C. Klema and C. B. Moler, Matrix Eigen-
58 C system Routines - EISPACK Guide, Springer-Verlag,
60 C***ROUTINES CALLED (NONE)
61 C***REVISION HISTORY (YYMMDD)
63 C 890831 Modified array declarations. (WRB)
64 C 890831 REVISION DATE from Version 3.2
65 C 891214 Prologue converted to Version 4.0 format. (BAB)
66 C 920501 Reformatted the REFERENCES section. (WRB)
67 C***END PROLOGUE TRED1
69 INTEGER I,J,K,L,N,II,NM,JP1
70 REAL A(NM,*),D(*),E(*),E2(*)
73 C***FIRST EXECUTABLE STATEMENT TRED1
76 C .......... FOR I=N STEP -1 UNTIL 1 DO -- ..........
82 IF (L .LT. 1) GO TO 130
83 C .......... SCALE ROW (ALGOL TOL THEN NOT NEEDED) ..........
85 120 SCALE = SCALE + ABS(A(I,K))
87 IF (SCALE .NE. 0.0E0) GO TO 140
93 A(I,K) = A(I,K) / SCALE
94 H = H + A(I,K) * A(I,K)
97 E2(I) = SCALE * SCALE * H
103 IF (L .EQ. 1) GO TO 270
108 C .......... FORM ELEMENT OF A*U ..........
110 180 G = G + A(J,K) * A(I,K)
113 IF (L .LT. JP1) GO TO 220
116 200 G = G + A(K,J) * A(I,K)
117 C .......... FORM ELEMENT OF P ..........
119 F = F + E(J) * A(I,J)
123 C .......... FORM REDUCED A ..........
130 A(J,K) = A(J,K) - F * E(K) - G * A(I,K)
134 280 A(I,K) = SCALE * A(I,K)