 LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

◆ slarrk()

 subroutine slarrk ( integer N, integer IW, real GL, real GU, real, dimension( * ) D, real, dimension( * ) E2, real PIVMIN, real RELTOL, real W, real WERR, integer INFO )

SLARRK computes one eigenvalue of a symmetric tridiagonal matrix T to suitable accuracy.

Purpose:
``` SLARRK computes one eigenvalue of a symmetric tridiagonal
matrix T to suitable accuracy. This is an auxiliary code to be
called from SSTEMR.

To avoid overflow, the matrix must be scaled so that its
largest element is no greater than overflow**(1/2) * underflow**(1/4) in absolute value, and for greatest
accuracy, it should not be much smaller than that.

See W. Kahan "Accurate Eigenvalues of a Symmetric Tridiagonal
Matrix", Report CS41, Computer Science Dept., Stanford
University, July 21, 1966.```
Parameters
 [in] N ``` N is INTEGER The order of the tridiagonal matrix T. N >= 0.``` [in] IW ``` IW is INTEGER The index of the eigenvalues to be returned.``` [in] GL ` GL is REAL` [in] GU ``` GU is REAL An upper and a lower bound on the eigenvalue.``` [in] D ``` D is REAL array, dimension (N) The n diagonal elements of the tridiagonal matrix T.``` [in] E2 ``` E2 is REAL array, dimension (N-1) The (n-1) squared off-diagonal elements of the tridiagonal matrix T.``` [in] PIVMIN ``` PIVMIN is REAL The minimum pivot allowed in the Sturm sequence for T.``` [in] RELTOL ``` RELTOL is REAL The minimum relative width of an interval. When an interval is narrower than RELTOL times the larger (in magnitude) endpoint, then it is considered to be sufficiently small, i.e., converged. Note: this should always be at least radix*machine epsilon.``` [out] W ` W is REAL` [out] WERR ``` WERR is REAL The error bound on the corresponding eigenvalue approximation in W.``` [out] INFO ``` INFO is INTEGER = 0: Eigenvalue converged = -1: Eigenvalue did NOT converge```
Internal Parameters:
```  FUDGE   REAL            , default = 2
A "fudge factor" to widen the Gershgorin intervals.```
Date
June 2017

Definition at line 147 of file slarrk.f.

147 *
148 * -- LAPACK auxiliary routine (version 3.7.1) --
149 * -- LAPACK is a software package provided by Univ. of Tennessee, --
150 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
151 * June 2017
152 *
153 * .. Scalar Arguments ..
154  INTEGER info, iw, n
155  REAL pivmin, reltol, gl, gu, w, werr
156 * ..
157 * .. Array Arguments ..
158  REAL d( * ), e2( * )
159 * ..
160 *
161 * =====================================================================
162 *
163 * .. Parameters ..
164  REAL fudge, half, two, zero
165  parameter( half = 0.5e0, two = 2.0e0,
166  \$ fudge = two, zero = 0.0e0 )
167 * ..
168 * .. Local Scalars ..
169  INTEGER i, it, itmax, negcnt
170  REAL atoli, eps, left, mid, right, rtoli, tmp1,
171  \$ tmp2, tnorm
172 * ..
173 * .. External Functions ..
174  REAL slamch
175  EXTERNAL slamch
176 * ..
177 * .. Intrinsic Functions ..
178  INTRINSIC abs, int, log, max
179 * ..
180 * .. Executable Statements ..
181 *
182 * Quick return if possible
183 *
184  IF( n.LE.0 ) THEN
185  info = 0
186  RETURN
187  END IF
188 *
189 * Get machine constants
190  eps = slamch( 'P' )
191
192  tnorm = max( abs( gl ), abs( gu ) )
193  rtoli = reltol
194  atoli = fudge*two*pivmin
195
196  itmax = int( ( log( tnorm+pivmin )-log( pivmin ) ) /
197  \$ log( two ) ) + 2
198
199  info = -1
200
201  left = gl - fudge*tnorm*eps*n - fudge*two*pivmin
202  right = gu + fudge*tnorm*eps*n + fudge*two*pivmin
203  it = 0
204
205  10 CONTINUE
206 *
207 * Check if interval converged or maximum number of iterations reached
208 *
209  tmp1 = abs( right - left )
210  tmp2 = max( abs(right), abs(left) )
211  IF( tmp1.LT.max( atoli, pivmin, rtoli*tmp2 ) ) THEN
212  info = 0
213  GOTO 30
214  ENDIF
215  IF(it.GT.itmax)
216  \$ GOTO 30
217
218 *
219 * Count number of negative pivots for mid-point
220 *
221  it = it + 1
222  mid = half * (left + right)
223  negcnt = 0
224  tmp1 = d( 1 ) - mid
225  IF( abs( tmp1 ).LT.pivmin )
226  \$ tmp1 = -pivmin
227  IF( tmp1.LE.zero )
228  \$ negcnt = negcnt + 1
229 *
230  DO 20 i = 2, n
231  tmp1 = d( i ) - e2( i-1 ) / tmp1 - mid
232  IF( abs( tmp1 ).LT.pivmin )
233  \$ tmp1 = -pivmin
234  IF( tmp1.LE.zero )
235  \$ negcnt = negcnt + 1
236  20 CONTINUE
237
238  IF(negcnt.GE.iw) THEN
239  right = mid
240  ELSE
241  left = mid
242  ENDIF
243  GOTO 10
244
245  30 CONTINUE
246 *
247 * Converged or maximum number of iterations reached
248 *
249  w = half * (left + right)
250  werr = half * abs( right - left )
251
252  RETURN
253 *
254 * End of SLARRK
255 *
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
Here is the caller graph for this function: