annotate libcruft/lapack/dsterf.f @ 5086:55f5b61d74b7

[project @ 2004-11-19 21:50:50 by jwe]
author jwe
date Fri, 19 Nov 2004 21:50:50 +0000
parents 15cddaacbc2d
children 68db500cb558
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
1 SUBROUTINE DSTERF( N, D, E, INFO )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
2 *
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
3 * -- LAPACK routine (version 3.0) --
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
4 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
5 * Courant Institute, Argonne National Lab, and Rice University
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
6 * June 30, 1999
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
7 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
8 * .. Scalar Arguments ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
9 INTEGER INFO, N
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
10 * ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
11 * .. Array Arguments ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
12 DOUBLE PRECISION D( * ), E( * )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
13 * ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
14 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
15 * Purpose
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
16 * =======
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
17 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
18 * DSTERF computes all eigenvalues of a symmetric tridiagonal matrix
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
19 * using the Pal-Walker-Kahan variant of the QL or QR algorithm.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
20 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
21 * Arguments
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
22 * =========
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
23 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
24 * N (input) INTEGER
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
25 * The order of the matrix. N >= 0.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
26 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
27 * D (input/output) DOUBLE PRECISION array, dimension (N)
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
28 * On entry, the n diagonal elements of the tridiagonal matrix.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
29 * On exit, if INFO = 0, the eigenvalues in ascending order.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
30 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
31 * E (input/output) DOUBLE PRECISION array, dimension (N-1)
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
32 * On entry, the (n-1) subdiagonal elements of the tridiagonal
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
33 * matrix.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
34 * On exit, E has been destroyed.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
35 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
36 * INFO (output) INTEGER
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
37 * = 0: successful exit
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
38 * < 0: if INFO = -i, the i-th argument had an illegal value
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
39 * > 0: the algorithm failed to find all of the eigenvalues in
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
40 * a total of 30*N iterations; if INFO = i, then i
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
41 * elements of E have not converged to zero.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
42 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
43 * =====================================================================
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
44 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
45 * .. Parameters ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
46 DOUBLE PRECISION ZERO, ONE, TWO, THREE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
47 PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0, TWO = 2.0D0,
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
48 $ THREE = 3.0D0 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
49 INTEGER MAXIT
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
50 PARAMETER ( MAXIT = 30 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
51 * ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
52 * .. Local Scalars ..
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
53 INTEGER I, ISCALE, JTOT, L, L1, LEND, LENDSV, LSV, M,
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
54 $ NMAXIT
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
55 DOUBLE PRECISION ALPHA, ANORM, BB, C, EPS, EPS2, GAMMA, OLDC,
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
56 $ OLDGAM, P, R, RT1, RT2, RTE, S, SAFMAX, SAFMIN,
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
57 $ SIGMA, SSFMAX, SSFMIN
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
58 * ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
59 * .. External Functions ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
60 DOUBLE PRECISION DLAMCH, DLANST, DLAPY2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
61 EXTERNAL DLAMCH, DLANST, DLAPY2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
62 * ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
63 * .. External Subroutines ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
64 EXTERNAL DLAE2, DLASCL, DLASRT, XERBLA
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
65 * ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
66 * .. Intrinsic Functions ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
67 INTRINSIC ABS, SIGN, SQRT
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
68 * ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
69 * .. Executable Statements ..
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
70 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
71 * Test the input parameters.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
72 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
73 INFO = 0
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
74 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
75 * Quick return if possible
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
76 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
77 IF( N.LT.0 ) THEN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
78 INFO = -1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
79 CALL XERBLA( 'DSTERF', -INFO )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
80 RETURN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
81 END IF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
82 IF( N.LE.1 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
83 $ RETURN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
84 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
85 * Determine the unit roundoff for this environment.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
86 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
87 EPS = DLAMCH( 'E' )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
88 EPS2 = EPS**2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
89 SAFMIN = DLAMCH( 'S' )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
90 SAFMAX = ONE / SAFMIN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
91 SSFMAX = SQRT( SAFMAX ) / THREE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
92 SSFMIN = SQRT( SAFMIN ) / EPS2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
93 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
94 * Compute the eigenvalues of the tridiagonal matrix.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
95 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
96 NMAXIT = N*MAXIT
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
97 SIGMA = ZERO
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
98 JTOT = 0
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
99 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
100 * Determine where the matrix splits and choose QL or QR iteration
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
101 * for each block, according to whether top or bottom diagonal
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
102 * element is smaller.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
103 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
104 L1 = 1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
105 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
106 10 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
107 IF( L1.GT.N )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
108 $ GO TO 170
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
109 IF( L1.GT.1 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
110 $ E( L1-1 ) = ZERO
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
111 DO 20 M = L1, N - 1
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
112 IF( ABS( E( M ) ).LE.( SQRT( ABS( D( M ) ) )*SQRT( ABS( D( M+
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
113 $ 1 ) ) ) )*EPS ) THEN
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
114 E( M ) = ZERO
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
115 GO TO 30
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
116 END IF
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
117 20 CONTINUE
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
118 M = N
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
119 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
120 30 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
121 L = L1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
122 LSV = L
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
123 LEND = M
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
124 LENDSV = LEND
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
125 L1 = M + 1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
126 IF( LEND.EQ.L )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
127 $ GO TO 10
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
128 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
129 * Scale submatrix in rows and columns L to LEND
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
130 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
131 ANORM = DLANST( 'I', LEND-L+1, D( L ), E( L ) )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
132 ISCALE = 0
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
133 IF( ANORM.GT.SSFMAX ) THEN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
134 ISCALE = 1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
135 CALL DLASCL( 'G', 0, 0, ANORM, SSFMAX, LEND-L+1, 1, D( L ), N,
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
136 $ INFO )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
137 CALL DLASCL( 'G', 0, 0, ANORM, SSFMAX, LEND-L, 1, E( L ), N,
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
138 $ INFO )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
139 ELSE IF( ANORM.LT.SSFMIN ) THEN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
140 ISCALE = 2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
141 CALL DLASCL( 'G', 0, 0, ANORM, SSFMIN, LEND-L+1, 1, D( L ), N,
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
142 $ INFO )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
143 CALL DLASCL( 'G', 0, 0, ANORM, SSFMIN, LEND-L, 1, E( L ), N,
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
144 $ INFO )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
145 END IF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
146 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
147 DO 40 I = L, LEND - 1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
148 E( I ) = E( I )**2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
149 40 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
150 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
151 * Choose between QL and QR iteration
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
152 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
153 IF( ABS( D( LEND ) ).LT.ABS( D( L ) ) ) THEN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
154 LEND = LSV
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
155 L = LENDSV
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
156 END IF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
157 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
158 IF( LEND.GE.L ) THEN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
159 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
160 * QL Iteration
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
161 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
162 * Look for small subdiagonal element.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
163 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
164 50 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
165 IF( L.NE.LEND ) THEN
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
166 DO 60 M = L, LEND - 1
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
167 IF( ABS( E( M ) ).LE.EPS2*ABS( D( M )*D( M+1 ) ) )
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
168 $ GO TO 70
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
169 60 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
170 END IF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
171 M = LEND
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
172 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
173 70 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
174 IF( M.LT.LEND )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
175 $ E( M ) = ZERO
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
176 P = D( L )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
177 IF( M.EQ.L )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
178 $ GO TO 90
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
179 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
180 * If remaining matrix is 2 by 2, use DLAE2 to compute its
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
181 * eigenvalues.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
182 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
183 IF( M.EQ.L+1 ) THEN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
184 RTE = SQRT( E( L ) )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
185 CALL DLAE2( D( L ), RTE, D( L+1 ), RT1, RT2 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
186 D( L ) = RT1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
187 D( L+1 ) = RT2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
188 E( L ) = ZERO
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
189 L = L + 2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
190 IF( L.LE.LEND )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
191 $ GO TO 50
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
192 GO TO 150
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
193 END IF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
194 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
195 IF( JTOT.EQ.NMAXIT )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
196 $ GO TO 150
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
197 JTOT = JTOT + 1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
198 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
199 * Form shift.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
200 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
201 RTE = SQRT( E( L ) )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
202 SIGMA = ( D( L+1 )-P ) / ( TWO*RTE )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
203 R = DLAPY2( SIGMA, ONE )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
204 SIGMA = P - ( RTE / ( SIGMA+SIGN( R, SIGMA ) ) )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
205 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
206 C = ONE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
207 S = ZERO
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
208 GAMMA = D( M ) - SIGMA
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
209 P = GAMMA*GAMMA
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
210 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
211 * Inner loop
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
212 *
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
213 DO 80 I = M - 1, L, -1
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
214 BB = E( I )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
215 R = P + BB
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
216 IF( I.NE.M-1 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
217 $ E( I+1 ) = S*R
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
218 OLDC = C
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
219 C = P / R
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
220 S = BB / R
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
221 OLDGAM = GAMMA
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
222 ALPHA = D( I )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
223 GAMMA = C*( ALPHA-SIGMA ) - S*OLDGAM
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
224 D( I+1 ) = OLDGAM + ( ALPHA-GAMMA )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
225 IF( C.NE.ZERO ) THEN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
226 P = ( GAMMA*GAMMA ) / C
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
227 ELSE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
228 P = OLDC*BB
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
229 END IF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
230 80 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
231 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
232 E( L ) = S*P
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
233 D( L ) = SIGMA + GAMMA
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
234 GO TO 50
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
235 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
236 * Eigenvalue found.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
237 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
238 90 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
239 D( L ) = P
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
240 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
241 L = L + 1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
242 IF( L.LE.LEND )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
243 $ GO TO 50
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
244 GO TO 150
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
245 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
246 ELSE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
247 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
248 * QR Iteration
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
249 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
250 * Look for small superdiagonal element.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
251 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
252 100 CONTINUE
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
253 DO 110 M = L, LEND + 1, -1
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
254 IF( ABS( E( M-1 ) ).LE.EPS2*ABS( D( M )*D( M-1 ) ) )
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
255 $ GO TO 120
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
256 110 CONTINUE
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
257 M = LEND
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
258 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
259 120 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
260 IF( M.GT.LEND )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
261 $ E( M-1 ) = ZERO
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
262 P = D( L )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
263 IF( M.EQ.L )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
264 $ GO TO 140
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
265 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
266 * If remaining matrix is 2 by 2, use DLAE2 to compute its
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
267 * eigenvalues.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
268 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
269 IF( M.EQ.L-1 ) THEN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
270 RTE = SQRT( E( L-1 ) )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
271 CALL DLAE2( D( L ), RTE, D( L-1 ), RT1, RT2 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
272 D( L ) = RT1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
273 D( L-1 ) = RT2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
274 E( L-1 ) = ZERO
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
275 L = L - 2
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
276 IF( L.GE.LEND )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
277 $ GO TO 100
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
278 GO TO 150
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
279 END IF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
280 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
281 IF( JTOT.EQ.NMAXIT )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
282 $ GO TO 150
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
283 JTOT = JTOT + 1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
284 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
285 * Form shift.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
286 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
287 RTE = SQRT( E( L-1 ) )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
288 SIGMA = ( D( L-1 )-P ) / ( TWO*RTE )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
289 R = DLAPY2( SIGMA, ONE )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
290 SIGMA = P - ( RTE / ( SIGMA+SIGN( R, SIGMA ) ) )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
291 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
292 C = ONE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
293 S = ZERO
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
294 GAMMA = D( M ) - SIGMA
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
295 P = GAMMA*GAMMA
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
296 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
297 * Inner loop
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
298 *
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
299 DO 130 I = M, L - 1
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
300 BB = E( I )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
301 R = P + BB
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
302 IF( I.NE.M )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
303 $ E( I-1 ) = S*R
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
304 OLDC = C
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
305 C = P / R
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
306 S = BB / R
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
307 OLDGAM = GAMMA
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
308 ALPHA = D( I+1 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
309 GAMMA = C*( ALPHA-SIGMA ) - S*OLDGAM
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
310 D( I ) = OLDGAM + ( ALPHA-GAMMA )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
311 IF( C.NE.ZERO ) THEN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
312 P = ( GAMMA*GAMMA ) / C
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
313 ELSE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
314 P = OLDC*BB
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
315 END IF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
316 130 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
317 *
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
318 E( L-1 ) = S*P
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
319 D( L ) = SIGMA + GAMMA
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
320 GO TO 100
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
321 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
322 * Eigenvalue found.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
323 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
324 140 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
325 D( L ) = P
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
326 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
327 L = L - 1
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
328 IF( L.GE.LEND )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
329 $ GO TO 100
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
330 GO TO 150
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
331 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
332 END IF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
333 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
334 * Undo scaling if necessary
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
335 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
336 150 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
337 IF( ISCALE.EQ.1 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
338 $ CALL DLASCL( 'G', 0, 0, SSFMAX, ANORM, LENDSV-LSV+1, 1,
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
339 $ D( LSV ), N, INFO )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
340 IF( ISCALE.EQ.2 )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
341 $ CALL DLASCL( 'G', 0, 0, SSFMIN, ANORM, LENDSV-LSV+1, 1,
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
342 $ D( LSV ), N, INFO )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
343 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
344 * Check for no convergence to an eigenvalue after a total
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
345 * of N*MAXIT iterations.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
346 *
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
347 IF( JTOT.LT.NMAXIT )
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
348 $ GO TO 10
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
349 DO 160 I = 1, N - 1
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
350 IF( E( I ).NE.ZERO )
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
351 $ INFO = INFO + 1
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
352 160 CONTINUE
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
353 GO TO 180
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
354 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
355 * Sort eigenvalues in increasing order.
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
356 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
357 170 CONTINUE
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
358 CALL DLASRT( 'I', N, D, INFO )
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
359 *
3333
15cddaacbc2d [project @ 1999-11-03 19:53:59 by jwe]
jwe
parents: 2814
diff changeset
360 180 CONTINUE
2814
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
361 RETURN
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
362 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
363 * End of DSTERF
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
364 *
ffa60dc8e49b [project @ 1997-03-14 04:30:59 by jwe]
jwe
parents:
diff changeset
365 END