1 *> \brief \b SLARRK computes one eigenvalue of a symmetric tridiagonal matrix T to suitable accuracy.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SLARRK + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slarrk.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slarrk.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slarrk.f">
21 * SUBROUTINE SLARRK( N, IW, GL, GU,
22 * D, E2, PIVMIN, RELTOL, W, WERR, INFO)
24 * .. Scalar Arguments ..
26 * REAL PIVMIN, RELTOL, GL, GU, W, WERR
28 * .. Array Arguments ..
29 * REAL D( * ), E2( * )
38 *> SLARRK computes one eigenvalue of a symmetric tridiagonal
39 *> matrix T to suitable accuracy. This is an auxiliary code to be
40 *> called from SSTEMR.
42 *> To avoid overflow, the matrix must be scaled so that its
43 *> largest element is no greater than overflow**(1/2) * underflow**(1/4) in absolute value, and for greatest
44 *> accuracy, it should not be much smaller than that.
46 *> See W. Kahan "Accurate Eigenvalues of a Symmetric Tridiagonal
47 *> Matrix", Report CS41, Computer Science Dept., Stanford
48 *> University, July 21, 1966.
57 *> The order of the tridiagonal matrix T. N >= 0.
63 *> The index of the eigenvalues to be returned.
74 *> An upper and a lower bound on the eigenvalue.
79 *> D is REAL array, dimension (N)
80 *> The n diagonal elements of the tridiagonal matrix T.
85 *> E2 is REAL array, dimension (N-1)
86 *> The (n-1) squared off-diagonal elements of the tridiagonal matrix T.
92 *> The minimum pivot allowed in the Sturm sequence for T.
98 *> The minimum relative width of an interval. When an interval
99 *> is narrower than RELTOL times the larger (in
100 *> magnitude) endpoint, then it is considered to be
101 *> sufficiently small, i.e., converged. Note: this should
102 *> always be at least radix*machine epsilon.
113 *> The error bound on the corresponding eigenvalue approximation
120 *> = 0: Eigenvalue converged
121 *> = -1: Eigenvalue did NOT converge
124 *> \par Internal Parameters:
125 * =========================
128 *> FUDGE REAL , default = 2
129 *> A "fudge factor" to widen the Gershgorin intervals.
135 *> \author Univ. of Tennessee
136 *> \author Univ. of California Berkeley
137 *> \author Univ. of Colorado Denver
140 *> \date September 2012
142 *> \ingroup OTHERauxiliary
144 * =====================================================================
145 SUBROUTINE SLARRK( N, IW, GL, GU,
146 $ D, E2, PIVMIN, RELTOL, W, WERR, INFO)
148 * -- LAPACK auxiliary routine (version 3.4.2) --
149 * -- LAPACK is a software package provided by Univ. of Tennessee, --
150 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
153 * .. Scalar Arguments ..
155 REAL PIVMIN, RELTOL, GL, GU, W, WERR
157 * .. Array Arguments ..
161 * =====================================================================
164 REAL FUDGE, HALF, TWO, ZERO
165 PARAMETER ( HALF = 0.5E0, TWO = 2.0E0,
166 $ FUDGE = TWO, ZERO = 0.0E0 )
168 * .. Local Scalars ..
169 INTEGER I, IT, ITMAX, NEGCNT
170 REAL ATOLI, EPS, LEFT, MID, RIGHT, RTOLI, TMP1,
173 * .. External Functions ..
177 * .. Intrinsic Functions ..
178 INTRINSIC ABS, INT, LOG, MAX
180 * .. Executable Statements ..
182 * Get machine constants
185 TNORM = MAX( ABS( GL ), ABS( GU ) )
187 ATOLI = FUDGE*TWO*PIVMIN
189 ITMAX = INT( ( LOG( TNORM+PIVMIN )-LOG( PIVMIN ) ) /
194 LEFT = GL - FUDGE*TNORM*EPS*N - FUDGE*TWO*PIVMIN
195 RIGHT = GU + FUDGE*TNORM*EPS*N + FUDGE*TWO*PIVMIN
200 * Check if interval converged or maximum number of iterations reached
202 TMP1 = ABS( RIGHT - LEFT )
203 TMP2 = MAX( ABS(RIGHT), ABS(LEFT) )
204 IF( TMP1.LT.MAX( ATOLI, PIVMIN, RTOLI*TMP2 ) ) THEN
212 * Count number of negative pivots for mid-point
215 MID = HALF * (LEFT + RIGHT)
218 IF( ABS( TMP1 ).LT.PIVMIN )
221 $ NEGCNT = NEGCNT + 1
224 TMP1 = D( I ) - E2( I-1 ) / TMP1 - MID
225 IF( ABS( TMP1 ).LT.PIVMIN )
228 $ NEGCNT = NEGCNT + 1
231 IF(NEGCNT.GE.IW) THEN
240 * Converged or maximum number of iterations reached
242 W = HALF * (LEFT + RIGHT)
243 WERR = HALF * ABS( RIGHT - LEFT )