195 SUBROUTINE dlarrb( N, D, LLD, IFIRST, ILAST, RTOL1,
196 $ rtol2, offset, w, wgap, werr, work, iwork,
197 $ pivmin, spdiam, twist, info )
205 INTEGER ifirst, ilast, info, n, offset, twist
206 DOUBLE PRECISION pivmin, rtol1, rtol2, spdiam
210 DOUBLE PRECISION d( * ), lld( * ), w( * ),
211 $ werr( * ), wgap( * ), work( * )
217 DOUBLE PRECISION zero, two, half
218 parameter( zero = 0.0d0, two = 2.0d0,
223 INTEGER i, i1, ii, ip, iter, k, negcnt, next, nint,
225 DOUBLE PRECISION back, cvrgd, gap, left, lgap, mid, mnwdth,
226 $ rgap, right, tmp, width
234 INTRINSIC abs, max, min
240 maxitr = int( ( log( spdiam+pivmin )-log( pivmin ) ) /
242 mnwdth = two * pivmin
245 IF((r.LT.1).OR.(r.GT.n)) r = n
260 rgap = wgap( i1-offset )
264 left = w( ii ) - werr( ii )
265 right = w( ii ) + werr( ii )
268 gap = min( lgap, rgap )
277 negcnt =
dlaneg( n, d, lld, left, pivmin, r )
278 IF( negcnt.GT.i-1 )
THEN
290 negcnt =
dlaneg( n, d, lld, right, pivmin, r )
291 IF( negcnt.LT.i )
THEN
296 width = half*abs( left - right )
297 tmp = max( abs( left ), abs( right ) )
298 cvrgd = max(rtol1*gap,rtol2*tmp)
299 IF( width.LE.cvrgd .OR. width.LE.mnwdth )
THEN
306 IF((i.EQ.i1).AND.(i.LT.ilast)) i1 = i + 1
307 IF((prev.GE.i1).AND.(i.LE.ilast)) iwork( 2*prev-1 ) = i + 1
329 DO 100 ip = 1, olnint
334 IF(ii.GT.1) lgap = wgap( ii-1 )
335 gap = min( lgap, rgap )
339 mid = half*( left + right )
343 tmp = max( abs( left ), abs( right ) )
344 cvrgd = max(rtol1*gap,rtol2*tmp)
345 IF( ( width.LE.cvrgd ) .OR. ( width.LE.mnwdth ).OR.
346 $ ( iter.EQ.maxitr ) )
THEN
355 IF(prev.GE.i1) iwork( 2*prev-1 ) = next
364 negcnt =
dlaneg( n, d, lld, mid, pivmin, r )
365 IF( negcnt.LE.i-1 )
THEN
376 IF( ( nint.GT.0 ).AND.(iter.LE.maxitr) ) go to 80
380 DO 110 i = ifirst, ilast
384 IF( iwork( k-1 ).EQ.0 )
THEN
385 w( ii ) = half*( work( k-1 )+work( k ) )
386 werr( ii ) = work( k ) - w( ii )
390 DO 111 i = ifirst+1, ilast
393 wgap( ii-1 ) = max( zero,
394 $ w(ii) - werr(ii) - w( ii-1 ) - werr( ii-1 ))