LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ 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.

Download SLARRK + dependencies [TGZ] [ZIP] [TXT]

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.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 143 of file slarrk.f.

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