LAPACK 3.12.1
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 , 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  to widen the Gershgorin intervals.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 141 of file slarrk.f.

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