289 SUBROUTINE slarrv( N, VL, VU, D, L, PIVMIN,
290 $ ISPLIT, M, DOL, DOU, MINRGP,
291 $ RTOL1, RTOL2, W, WERR, WGAP,
292 $ IBLOCK, INDEXW, GERS, Z, LDZ, ISUPPZ,
293 $ WORK, IWORK, INFO )
301 INTEGER DOL, DOU, INFO, LDZ, M, N
302 REAL MINRGP, PIVMIN, RTOL1, RTOL2, VL, VU
305 INTEGER IBLOCK( * ), INDEXW( * ), ISPLIT( * ),
306 $ isuppz( * ), iwork( * )
307 REAL D( * ), GERS( * ), L( * ), W( * ), WERR( * ),
308 $ wgap( * ), work( * )
316 parameter( maxitr = 10 )
317 REAL ZERO, ONE, TWO, THREE, FOUR, HALF
318 parameter( zero = 0.0e0, one = 1.0e0,
319 $ two = 2.0e0, three = 3.0e0,
320 $ four = 4.0e0, half = 0.5e0)
323 LOGICAL ESKIP, NEEDBS, STP2II, TRYRQC, USEDBS, USEDRQ
324 INTEGER DONE, I, IBEGIN, IDONE, IEND, II, IINDC1,
325 $ iindc2, iindr, iindwk, iinfo, im, in, indeig,
326 $ indld, indlld, indwrk, isupmn, isupmx, iter,
327 $ itmp1, j, jblk, k, miniwsize, minwsize, nclus,
328 $ ndepth, negcnt, newcls, newfst, newftt, newlst,
329 $ newsiz, offset, oldcls, oldfst, oldien, oldlst,
330 $ oldncl, p, parity, q, wbegin, wend, windex,
331 $ windmn, windpl, zfrom, zto, zusedl, zusedu,
333 REAL BSTRES, BSTW, EPS, FUDGE, GAP, GAPTOL, GL, GU,
334 $ lambda, left, lgap, mingma, nrminv, resid,
335 $ rgap, right, rqcorr, rqtol, savgap, sgndef,
336 $ sigma, spdiam, ssigma, tau, tmp, tol, ztz
347 INTRINSIC abs,
REAL, MAX, MIN
395 zusedw = zusedu - zusedl + 1
398 CALL slaset(
'Full', n, zusedw, zero, zero,
401 eps = slamch(
'Precision' )
407 IF((dol.EQ.1).AND.(dou.EQ.m))
THEN 426 DO 170 jblk = 1, iblock( m )
427 iend = isplit( jblk )
434 IF( iblock( wend+1 ).EQ.jblk )
THEN 439 IF( wend.LT.wbegin )
THEN 442 ELSEIF( (wend.LT.dol).OR.(wbegin.GT.dou) )
THEN 449 gl = gers( 2*ibegin-1 )
450 gu = gers( 2*ibegin )
451 DO 20 i = ibegin+1 , iend
452 gl = min( gers( 2*i-1 ), gl )
453 gu = max( gers( 2*i ), gu )
460 in = iend - ibegin + 1
462 im = wend - wbegin + 1
465 IF( ibegin.EQ.iend )
THEN 467 z( ibegin, wbegin ) = one
468 isuppz( 2*wbegin-1 ) = ibegin
469 isuppz( 2*wbegin ) = ibegin
470 w( wbegin ) = w( wbegin ) + sigma
471 work( wbegin ) = w( wbegin )
483 CALL scopy( im, w( wbegin ), 1,
484 $ work( wbegin ), 1 )
489 w(wbegin+i-1) = w(wbegin+i-1)+sigma
500 iwork( iindc1+1 ) = 1
501 iwork( iindc1+2 ) = im
510 IF( idone.LT.im )
THEN 512 IF( ndepth.GT.m )
THEN 523 IF( parity.EQ.0 )
THEN 536 oldfst = iwork( j-1 )
538 IF( ndepth.GT.0 )
THEN 544 IF((dol.EQ.1).AND.(dou.EQ.m))
THEN 547 j = wbegin + oldfst - 1
549 IF(wbegin+oldfst-1.LT.dol)
THEN 552 ELSEIF(wbegin+oldfst-1.GT.dou)
THEN 556 j = wbegin + oldfst - 1
559 CALL scopy( in, z( ibegin, j ), 1, d( ibegin ), 1 )
560 CALL scopy( in-1, z( ibegin, j+1 ), 1, l( ibegin ),
562 sigma = z( iend, j+1 )
565 CALL slaset(
'Full', in, 2, zero, zero,
566 $ z( ibegin, j), ldz )
570 DO 50 j = ibegin, iend-1
572 work( indld-1+j ) = tmp
573 work( indlld-1+j ) = tmp*l( j )
576 IF( ndepth.GT.0 )
THEN 579 p = indexw( wbegin-1+oldfst )
580 q = indexw( wbegin-1+oldlst )
584 offset = indexw( wbegin ) - 1
587 CALL slarrb( in, d( ibegin ),
588 $ work(indlld+ibegin-1),
589 $ p, q, rtol1, rtol2, offset,
590 $ work(wbegin),wgap(wbegin),werr(wbegin),
591 $ work( indwrk ), iwork( iindwk ),
592 $ pivmin, spdiam, in, iinfo )
593 IF( iinfo.NE.0 )
THEN 604 IF( oldfst.GT.1)
THEN 605 wgap( wbegin+oldfst-2 ) =
606 $ max(wgap(wbegin+oldfst-2),
607 $ w(wbegin+oldfst-1)-werr(wbegin+oldfst-1)
608 $ - w(wbegin+oldfst-2)-werr(wbegin+oldfst-2) )
610 IF( wbegin + oldlst -1 .LT. wend )
THEN 611 wgap( wbegin+oldlst-1 ) =
612 $ max(wgap(wbegin+oldlst-1),
613 $ w(wbegin+oldlst)-werr(wbegin+oldlst)
614 $ - w(wbegin+oldlst-1)-werr(wbegin+oldlst-1) )
618 DO 53 j=oldfst,oldlst
619 w(wbegin+j-1) = work(wbegin+j-1)+sigma
625 DO 140 j = oldfst, oldlst
626 IF( j.EQ.oldlst )
THEN 630 ELSE IF ( wgap( wbegin + j -1).GE.
631 $ minrgp* abs( work(wbegin + j -1) ) )
THEN 642 newsiz = newlst - newfst + 1
646 IF((dol.EQ.1).AND.(dou.EQ.m))
THEN 649 newftt = wbegin + newfst - 1
651 IF(wbegin+newfst-1.LT.dol)
THEN 654 ELSEIF(wbegin+newfst-1.GT.dou)
THEN 658 newftt = wbegin + newfst - 1
662 IF( newsiz.GT.1)
THEN 677 IF( newfst.EQ.1 )
THEN 679 $ w(wbegin)-werr(wbegin) - vl )
681 lgap = wgap( wbegin+newfst-2 )
683 rgap = wgap( wbegin+newlst-1 )
692 p = indexw( wbegin-1+newfst )
694 p = indexw( wbegin-1+newlst )
696 offset = indexw( wbegin ) - 1
697 CALL slarrb( in, d(ibegin),
698 $ work( indlld+ibegin-1 ),p,p,
699 $ rqtol, rqtol, offset,
700 $ work(wbegin),wgap(wbegin),
701 $ werr(wbegin),work( indwrk ),
702 $ iwork( iindwk ), pivmin, spdiam,
706 IF((wbegin+newlst-1.LT.dol).OR.
707 $ (wbegin+newfst-1.GT.dou))
THEN 715 idone = idone + newlst - newfst + 1
723 CALL slarrf( in, d( ibegin ), l( ibegin ),
724 $ work(indld+ibegin-1),
725 $ newfst, newlst, work(wbegin),
726 $ wgap(wbegin), werr(wbegin),
727 $ spdiam, lgap, rgap, pivmin, tau,
728 $ z(ibegin, newftt),z(ibegin, newftt+1),
729 $ work( indwrk ), iinfo )
730 IF( iinfo.EQ.0 )
THEN 734 z( iend, newftt+1 ) = ssigma
737 DO 116 k = newfst, newlst
739 $ three*eps*abs(work(wbegin+k-1))
740 work( wbegin + k - 1 ) =
741 $ work( wbegin + k - 1) - tau
743 $ four*eps*abs(work(wbegin+k-1))
745 werr( wbegin + k - 1 ) =
746 $ werr( wbegin + k - 1 ) + fudge
758 iwork( k-1 ) = newfst
770 tol = four * log(
REAL(in)) * eps
773 windex = wbegin + k - 1
774 windmn = max(windex - 1,1)
775 windpl = min(windex + 1,m)
776 lambda = work( windex )
779 IF((windex.LT.dol).OR.
780 $ (windex.GT.dou))
THEN 786 left = work( windex ) - werr( windex )
787 right = work( windex ) + werr( windex )
788 indeig = indexw( windex )
803 lgap = eps*max(abs(left),abs(right))
813 rgap = eps*max(abs(left),abs(right))
817 gap = min( lgap, rgap )
818 IF(( k .EQ. 1).OR.(k .EQ. im))
THEN 833 savgap = wgap(windex)
850 itmp1 = iwork( iindr+windex )
851 offset = indexw( wbegin ) - 1
852 CALL slarrb( in, d(ibegin),
853 $ work(indlld+ibegin-1),indeig,indeig,
854 $ zero, two*eps, offset,
855 $ work(wbegin),wgap(wbegin),
856 $ werr(wbegin),work( indwrk ),
857 $ iwork( iindwk ), pivmin, spdiam,
859 IF( iinfo.NE.0 )
THEN 863 lambda = work( windex )
866 iwork( iindr+windex ) = 0
869 CALL slar1v( in, 1, in, lambda, d( ibegin ),
870 $ l( ibegin ), work(indld+ibegin-1),
871 $ work(indlld+ibegin-1),
872 $ pivmin, gaptol, z( ibegin, windex ),
873 $ .NOT.usedbs, negcnt, ztz, mingma,
874 $ iwork( iindr+windex ), isuppz( 2*windex-1 ),
875 $ nrminv, resid, rqcorr, work( indwrk ) )
879 ELSEIF(resid.LT.bstres)
THEN 883 isupmn = min(isupmn,isuppz( 2*windex-1 ))
884 isupmx = max(isupmx,isuppz( 2*windex ))
896 IF( resid.GT.tol*gap .AND. abs( rqcorr ).GT.
897 $ rqtol*abs( lambda ) .AND. .NOT. usedbs)
902 IF(indeig.LE.negcnt)
THEN 911 IF( ( rqcorr*sgndef.GE.zero )
912 $ .AND.( lambda + rqcorr.LE. right)
913 $ .AND.( lambda + rqcorr.GE. left)
917 IF(sgndef.EQ.one)
THEN 936 $ half * (right + left)
939 lambda = lambda + rqcorr
942 $ half * (right-left)
946 IF(right-left.LT.rqtol*abs(lambda))
THEN 951 ELSEIF( iter.LT.maxitr )
THEN 953 ELSEIF( iter.EQ.maxitr )
THEN 962 IF(usedrq .AND. usedbs .AND.
963 $ bstres.LE.resid)
THEN 969 CALL slar1v( in, 1, in, lambda,
970 $ d( ibegin ), l( ibegin ),
971 $ work(indld+ibegin-1),
972 $ work(indlld+ibegin-1),
973 $ pivmin, gaptol, z( ibegin, windex ),
974 $ .NOT.usedbs, negcnt, ztz, mingma,
975 $ iwork( iindr+windex ),
976 $ isuppz( 2*windex-1 ),
977 $ nrminv, resid, rqcorr, work( indwrk ) )
979 work( windex ) = lambda
984 isuppz( 2*windex-1 ) = isuppz( 2*windex-1 )+oldien
985 isuppz( 2*windex ) = isuppz( 2*windex )+oldien
986 zfrom = isuppz( 2*windex-1 )
987 zto = isuppz( 2*windex )
988 isupmn = isupmn + oldien
989 isupmx = isupmx + oldien
991 IF(isupmn.LT.zfrom)
THEN 992 DO 122 ii = isupmn,zfrom-1
993 z( ii, windex ) = zero
996 IF(isupmx.GT.zto)
THEN 997 DO 123 ii = zto+1,isupmx
998 z( ii, windex ) = zero
1001 CALL sscal( zto-zfrom+1, nrminv,
1002 $ z( zfrom, windex ), 1 )
1005 w( windex ) = lambda+sigma
1014 wgap( windmn ) = max( wgap(windmn),
1015 $ w(windex)-werr(windex)
1016 $ - w(windmn)-werr(windmn) )
1018 IF( windex.LT.wend )
THEN 1019 wgap( windex ) = max( savgap,
1020 $ w( windpl )-werr( windpl )
1021 $ - w( windex )-werr( windex) )
subroutine slarrf(N, D, L, LD, CLSTRT, CLEND, W, WGAP, WERR, SPDIAM, CLGAPL, CLGAPR, PIVMIN, SIGMA, DPLUS, LPLUS, WORK, INFO)
SLARRF finds a new relatively robust representation such that at least one of the eigenvalues is rela...
subroutine slarrb(N, D, LLD, IFIRST, ILAST, RTOL1, RTOL2, OFFSET, W, WGAP, WERR, WORK, IWORK, PIVMIN, SPDIAM, TWIST, INFO)
SLARRB provides limited bisection to locate eigenvalues for more accuracy.
subroutine slaset(UPLO, M, N, ALPHA, BETA, A, LDA)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
subroutine sscal(N, SA, SX, INCX)
SSCAL
subroutine slarrv(N, VL, VU, D, L, PIVMIN, ISPLIT, M, DOL, DOU, MINRGP, RTOL1, RTOL2, W, WERR, WGAP, IBLOCK, INDEXW, GERS, Z, LDZ, ISUPPZ, WORK, IWORK, INFO)
SLARRV computes the eigenvectors of the tridiagonal matrix T = L D LT given L, D and the eigenvalues ...
subroutine scopy(N, SX, INCX, SY, INCY)
SCOPY
subroutine slar1v(N, B1, BN, LAMBDA, D, L, LD, LLD, PIVMIN, GAPTOL, Z, WANTNC, NEGCNT, ZTZ, MINGMA, R, ISUPPZ, NRMINV, RESID, RQCORR, WORK)
SLAR1V computes the (scaled) r-th column of the inverse of the submatrix in rows b1 through bn of the...