323 SUBROUTINE slarrd( RANGE, ORDER, N, VL, VU, IL, IU, GERS,
324 $ RELTOL, D, E, E2, PIVMIN, NSPLIT, ISPLIT,
325 $ M, W, WERR, WL, WU, IBLOCK, INDEXW,
326 $ WORK, IWORK, INFO )
333 CHARACTER ORDER, RANGE
334 INTEGER IL, INFO, IU, M, N, NSPLIT
335 REAL PIVMIN, RELTOL, VL, VU, WL, WU
338 INTEGER IBLOCK( * ), INDEXW( * ),
339 $ ISPLIT( * ), IWORK( * )
340 REAL D( * ), E( * ), E2( * ),
341 $ gers( * ), w( * ), werr( * ), work( * )
347 REAL ZERO, ONE, TWO, HALF, FUDGE
348 PARAMETER ( ZERO = 0.0e0, one = 1.0e0,
349 $ two = 2.0e0, half = one/two,
351 INTEGER ALLRNG, VALRNG, INDRNG
352 PARAMETER ( ALLRNG = 1, valrng = 2, indrng = 3 )
355 LOGICAL NCNVRG, TOOFEW
356 INTEGER I, IB, IBEGIN, IDISCL, IDISCU, IE, IEND, IINFO,
357 $ IM, IN, IOFF, IOUT, IRANGE, ITMAX, ITMP1,
358 $ itmp2, iw, iwoff, j, jblk, jdisc, je, jee, nb,
360 REAL ATOLI, EPS, GL, GU, RTOLI, TMP1, TMP2,
361 $ TNORM, UFLOW, WKILL, WLU, WUL
371 EXTERNAL lsame, ilaenv, slamch
377 INTRINSIC abs, int, log, max, min
392 IF( lsame( range,
'A' ) )
THEN
394 ELSE IF( lsame( range,
'V' ) )
THEN
396 ELSE IF( lsame( range,
'I' ) )
THEN
404 IF( irange.LE.0 )
THEN
406 ELSE IF( .NOT.(lsame(order,
'B').OR.lsame(order,
'E')) )
THEN
408 ELSE IF( n.LT.0 )
THEN
410 ELSE IF( irange.EQ.valrng )
THEN
413 ELSE IF( irange.EQ.indrng .AND.
414 $ ( il.LT.1 .OR. il.GT.max( 1, n ) ) )
THEN
416 ELSE IF( irange.EQ.indrng .AND.
417 $ ( iu.LT.min( n, il ) .OR. iu.GT.n ) )
THEN
430 IF( irange.EQ.indrng .AND. il.EQ.1 .AND. iu.EQ.n ) irange = 1
434 uflow = slamch(
'U' )
440 IF( (irange.EQ.allrng).OR.
441 $ ((irange.EQ.valrng).AND.(d(1).GT.vl).AND.(d(1).LE.vu)).OR.
442 $ ((irange.EQ.indrng).AND.(il.EQ.1).AND.(iu.EQ.1)) )
THEN
455 nb = ilaenv( 1,
'SSTEBZ',
' ', n, -1, -1, -1 )
462 gl = min( gl, gers( 2*i - 1))
463 gu = max( gu, gers(2*i) )
466 tnorm = max( abs( gl ), abs( gu ) )
467 gl = gl - fudge*tnorm*eps*real( n ) - fudge*two*pivmin
468 gu = gu + fudge*tnorm*eps*real( n ) + fudge*two*pivmin
481 atoli = fudge*two*uflow + fudge*two*pivmin
483 IF( irange.EQ.indrng )
THEN
488 itmax = int( ( log( tnorm+pivmin )-log( pivmin ) ) /
503 CALL slaebz( 3, itmax, n, 2, 2, nb, atoli, rtoli, pivmin,
504 $ d, e, e2, iwork( 5 ), work( n+1 ), work( n+5 ), iout,
505 $ iwork, w, iblock, iinfo )
506 IF( iinfo .NE. 0 )
THEN
511 IF( iwork( 6 ).EQ.iu )
THEN
528 IF( nwl.LT.0 .OR. nwl.GE.n .OR. nwu.LT.1 .OR. nwu.GT.n )
THEN
533 ELSEIF( irange.EQ.valrng )
THEN
537 ELSEIF( irange.EQ.allrng )
THEN
553 DO 70 jblk = 1, nsplit
556 iend = isplit( jblk )
561 IF( wl.GE.d( ibegin )-pivmin )
563 IF( wu.GE.d( ibegin )-pivmin )
565 IF( irange.EQ.allrng .OR.
566 $ ( wl.LT.d( ibegin )-pivmin
567 $ .AND. wu.GE. d( ibegin )-pivmin ) )
THEN
631 DO 40 j = ibegin, iend
632 gl = min( gl, gers( 2*j - 1))
633 gu = max( gu, gers(2*j) )
641 gl = gl - fudge*tnorm*eps*real( in ) - fudge*pivmin
642 gu = gu + fudge*tnorm*eps*real( in ) + fudge*pivmin
644 IF( irange.GT.1 )
THEN
661 CALL slaebz( 1, 0, in, in, 1, nb, atoli, rtoli, pivmin,
662 $ d( ibegin ), e( ibegin ), e2( ibegin ),
663 $ idumma, work( n+1 ), work( n+2*in+1 ), im,
664 $ iwork, w( m+1 ), iblock( m+1 ), iinfo )
665 IF( iinfo .NE. 0 )
THEN
670 nwl = nwl + iwork( 1 )
671 nwu = nwu + iwork( in+1 )
672 iwoff = m - iwork( 1 )
675 itmax = int( ( log( gu-gl+pivmin )-log( pivmin ) ) /
677 CALL slaebz( 2, itmax, in, in, 1, nb, atoli, rtoli,
679 $ d( ibegin ), e( ibegin ), e2( ibegin ),
680 $ idumma, work( n+1 ), work( n+2*in+1 ), iout,
681 $ iwork, w( m+1 ), iblock( m+1 ), iinfo )
682 IF( iinfo .NE. 0 )
THEN
692 tmp1 = half*( work( j+n )+work( j+in+n ) )
694 tmp2 = half*abs( work( j+n )-work( j+in+n ) )
695 IF( j.GT.iout-iinfo )
THEN
702 DO 50 je = iwork( j ) + 1 + iwoff,
703 $ iwork( j+in ) + iwoff
706 indexw( je ) = je - iwoff
717 IF( irange.EQ.indrng )
THEN
718 idiscl = il - 1 - nwl
721 IF( idiscl.GT.0 )
THEN
726 IF( w( je ).LE.wlu .AND. idiscl.GT.0 )
THEN
731 werr( im ) = werr( je )
732 indexw( im ) = indexw( je )
733 iblock( im ) = iblock( je )
738 IF( idiscu.GT.0 )
THEN
743 IF( w( je ).GE.wul .AND. idiscu.GT.0 )
THEN
748 werr( im ) = werr( je )
749 indexw( im ) = indexw( je )
750 iblock( im ) = iblock( je )
757 werr( jee ) = werr( je )
758 indexw( jee ) = indexw( je )
759 iblock( jee ) = iblock( je )
764 IF( idiscl.GT.0 .OR. idiscu.GT.0 )
THEN
771 IF( idiscl.GT.0 )
THEN
773 DO 100 jdisc = 1, idiscl
776 IF( iblock( je ).NE.0 .AND.
777 $ ( w( je ).LT.wkill .OR. iw.EQ.0 ) )
THEN
785 IF( idiscu.GT.0 )
THEN
787 DO 120 jdisc = 1, idiscu
790 IF( iblock( je ).NE.0 .AND.
791 $ ( w( je ).GE.wkill .OR. iw.EQ.0 ) )
THEN
802 IF( iblock( je ).NE.0 )
THEN
805 werr( im ) = werr( je )
806 indexw( im ) = indexw( je )
807 iblock( im ) = iblock( je )
812 IF( idiscl.LT.0 .OR. idiscu.LT.0 )
THEN
817 IF(( irange.EQ.allrng .AND. m.NE.n ).OR.
818 $ ( irange.EQ.indrng .AND. m.NE.iu-il+1 ) )
THEN
826 IF( lsame(order,
'E') .AND. nsplit.GT.1 )
THEN
831 IF( w( j ).LT.tmp1 )
THEN
841 werr( ie ) = werr( je )
842 iblock( ie ) = iblock( je )
843 indexw( ie ) = indexw( je )