281 SUBROUTINE clarrv( N, VL, VU, D, L, PIVMIN,
282 $ ISPLIT, M, DOL, DOU, MINRGP,
283 $ RTOL1, RTOL2, W, WERR, WGAP,
284 $ IBLOCK, INDEXW, GERS, Z, LDZ, ISUPPZ,
285 $ WORK, IWORK, INFO )
292 INTEGER DOL, DOU, INFO, LDZ, M, N
293 REAL MINRGP, PIVMIN, RTOL1, RTOL2, VL, VU
296 INTEGER IBLOCK( * ), INDEXW( * ), ISPLIT( * ),
297 $ isuppz( * ), iwork( * )
298 REAL D( * ), GERS( * ), L( * ), W( * ), WERR( * ),
299 $ wgap( * ), work( * )
307 parameter( maxitr = 10 )
309 parameter( czero = ( 0.0e0, 0.0e0 ) )
310 REAL ZERO, ONE, TWO, THREE, FOUR, HALF
311 parameter( zero = 0.0e0, one = 1.0e0,
312 $ two = 2.0e0, three = 3.0e0,
313 $ four = 4.0e0, half = 0.5e0)
316 LOGICAL ESKIP, NEEDBS, STP2II, TRYRQC, USEDBS, USEDRQ
317 INTEGER DONE, I, IBEGIN, IDONE, IEND, II, IINDC1,
318 $ iindc2, iindr, iindwk, iinfo, im, in, indeig,
319 $ indld, indlld, indwrk, isupmn, isupmx, iter,
320 $ itmp1, j, jblk, k, miniwsize, minwsize, nclus,
321 $ ndepth, negcnt, newcls, newfst, newftt, newlst,
322 $ newsiz, offset, oldcls, oldfst, oldien, oldlst,
323 $ oldncl, p, parity, q, wbegin, wend, windex,
324 $ windmn, windpl, zfrom, zto, zusedl, zusedu,
326 INTEGER INDIN1, INDIN2
327 REAL BSTRES, BSTW, EPS, FUDGE, GAP, GAPTOL, GL, GU,
328 $ lambda, left, lgap, mingma, nrminv, resid,
329 $ rgap, right, rqcorr, rqtol, savgap, sgndef,
330 $ sigma, spdiam, ssigma, tau, tmp, tol, ztz
341 INTRINSIC abs,
REAL, MAX, MIN
351 IF( (n.LE.0).OR.(m.LE.0) )
THEN 392 zusedw = zusedu - zusedl + 1
395 CALL claset(
'Full', n, zusedw, czero, czero,
398 eps = slamch(
'Precision' )
404 IF((dol.EQ.1).AND.(dou.EQ.m))
THEN 423 DO 170 jblk = 1, iblock( m )
424 iend = isplit( jblk )
431 IF( iblock( wend+1 ).EQ.jblk )
THEN 436 IF( wend.LT.wbegin )
THEN 439 ELSEIF( (wend.LT.dol).OR.(wbegin.GT.dou) )
THEN 446 gl = gers( 2*ibegin-1 )
447 gu = gers( 2*ibegin )
448 DO 20 i = ibegin+1 , iend
449 gl = min( gers( 2*i-1 ), gl )
450 gu = max( gers( 2*i ), gu )
457 in = iend - ibegin + 1
459 im = wend - wbegin + 1
462 IF( ibegin.EQ.iend )
THEN 464 z( ibegin, wbegin ) = cmplx( one, zero )
465 isuppz( 2*wbegin-1 ) = ibegin
466 isuppz( 2*wbegin ) = ibegin
467 w( wbegin ) = w( wbegin ) + sigma
468 work( wbegin ) = w( wbegin )
480 CALL scopy( im, w( wbegin ), 1,
481 $ work( wbegin ), 1 )
486 w(wbegin+i-1) = w(wbegin+i-1)+sigma
497 iwork( iindc1+1 ) = 1
498 iwork( iindc1+2 ) = im
507 IF( idone.LT.im )
THEN 509 IF( ndepth.GT.m )
THEN 520 IF( parity.EQ.0 )
THEN 533 oldfst = iwork( j-1 )
535 IF( ndepth.GT.0 )
THEN 541 IF((dol.EQ.1).AND.(dou.EQ.m))
THEN 544 j = wbegin + oldfst - 1
546 IF(wbegin+oldfst-1.LT.dol)
THEN 549 ELSEIF(wbegin+oldfst-1.GT.dou)
THEN 553 j = wbegin + oldfst - 1
557 d( ibegin+k-1 ) =
REAL( Z( IBEGIN+K-1,
$ J ) 558 REAL( Z( IBEGIN+K-1,
$ J+1 ) 560 d( iend ) =
REAL( Z( IEND, J ) )
561 sigma =
REAL( Z( IEND, J+1 ) )
564 CALL claset(
'Full', in, 2, czero, czero,
565 $ z( ibegin, j), ldz )
569 DO 50 j = ibegin, iend-1
571 work( indld-1+j ) = tmp
572 work( indlld-1+j ) = tmp*l( j )
575 IF( ndepth.GT.0 )
THEN 578 p = indexw( wbegin-1+oldfst )
579 q = indexw( wbegin-1+oldlst )
583 offset = indexw( wbegin ) - 1
586 CALL slarrb( in, d( ibegin ),
587 $ work(indlld+ibegin-1),
588 $ p, q, rtol1, rtol2, offset,
589 $ work(wbegin),wgap(wbegin),werr(wbegin),
590 $ work( indwrk ), iwork( iindwk ),
591 $ pivmin, spdiam, in, iinfo )
592 IF( iinfo.NE.0 )
THEN 603 IF( oldfst.GT.1)
THEN 604 wgap( wbegin+oldfst-2 ) =
605 $ max(wgap(wbegin+oldfst-2),
606 $ w(wbegin+oldfst-1)-werr(wbegin+oldfst-1)
607 $ - w(wbegin+oldfst-2)-werr(wbegin+oldfst-2) )
609 IF( wbegin + oldlst -1 .LT. wend )
THEN 610 wgap( wbegin+oldlst-1 ) =
611 $ max(wgap(wbegin+oldlst-1),
612 $ w(wbegin+oldlst)-werr(wbegin+oldlst)
613 $ - w(wbegin+oldlst-1)-werr(wbegin+oldlst-1) )
617 DO 53 j=oldfst,oldlst
618 w(wbegin+j-1) = work(wbegin+j-1)+sigma
624 DO 140 j = oldfst, oldlst
625 IF( j.EQ.oldlst )
THEN 629 ELSE IF ( wgap( wbegin + j -1).GE.
630 $ minrgp* abs( work(wbegin + j -1) ) )
THEN 641 newsiz = newlst - newfst + 1
645 IF((dol.EQ.1).AND.(dou.EQ.m))
THEN 648 newftt = wbegin + newfst - 1
650 IF(wbegin+newfst-1.LT.dol)
THEN 653 ELSEIF(wbegin+newfst-1.GT.dou)
THEN 657 newftt = wbegin + newfst - 1
661 IF( newsiz.GT.1)
THEN 676 IF( newfst.EQ.1 )
THEN 678 $ w(wbegin)-werr(wbegin) - vl )
680 lgap = wgap( wbegin+newfst-2 )
682 rgap = wgap( wbegin+newlst-1 )
691 p = indexw( wbegin-1+newfst )
693 p = indexw( wbegin-1+newlst )
695 offset = indexw( wbegin ) - 1
696 CALL slarrb( in, d(ibegin),
697 $ work( indlld+ibegin-1 ),p,p,
698 $ rqtol, rqtol, offset,
699 $ work(wbegin),wgap(wbegin),
700 $ werr(wbegin),work( indwrk ),
701 $ iwork( iindwk ), pivmin, spdiam,
705 IF((wbegin+newlst-1.LT.dol).OR.
706 $ (wbegin+newfst-1.GT.dou))
THEN 714 idone = idone + newlst - newfst + 1
722 CALL slarrf( in, d( ibegin ), l( ibegin ),
723 $ work(indld+ibegin-1),
724 $ newfst, newlst, work(wbegin),
725 $ wgap(wbegin), werr(wbegin),
726 $ spdiam, lgap, rgap, pivmin, tau,
727 $ work( indin1 ), work( indin2 ),
728 $ work( indwrk ), iinfo )
733 z( ibegin+k-1, newftt ) =
734 $ cmplx( work( indin1+k-1 ), zero )
735 z( ibegin+k-1, newftt+1 ) =
736 $ cmplx( work( indin2+k-1 ), zero )
739 $ cmplx( work( indin1+in-1 ), zero )
740 IF( iinfo.EQ.0 )
THEN 744 z( iend, newftt+1 ) = cmplx( ssigma, zero )
747 DO 116 k = newfst, newlst
749 $ three*eps*abs(work(wbegin+k-1))
750 work( wbegin + k - 1 ) =
751 $ work( wbegin + k - 1) - tau
753 $ four*eps*abs(work(wbegin+k-1))
755 werr( wbegin + k - 1 ) =
756 $ werr( wbegin + k - 1 ) + fudge
768 iwork( k-1 ) = newfst
780 tol = four * log(
REAL(in)) * eps
783 windex = wbegin + k - 1
784 windmn = max(windex - 1,1)
785 windpl = min(windex + 1,m)
786 lambda = work( windex )
789 IF((windex.LT.dol).OR.
790 $ (windex.GT.dou))
THEN 796 left = work( windex ) - werr( windex )
797 right = work( windex ) + werr( windex )
798 indeig = indexw( windex )
813 lgap = eps*max(abs(left),abs(right))
823 rgap = eps*max(abs(left),abs(right))
827 gap = min( lgap, rgap )
828 IF(( k .EQ. 1).OR.(k .EQ. im))
THEN 843 savgap = wgap(windex)
860 itmp1 = iwork( iindr+windex )
861 offset = indexw( wbegin ) - 1
862 CALL slarrb( in, d(ibegin),
863 $ work(indlld+ibegin-1),indeig,indeig,
864 $ zero, two*eps, offset,
865 $ work(wbegin),wgap(wbegin),
866 $ werr(wbegin),work( indwrk ),
867 $ iwork( iindwk ), pivmin, spdiam,
869 IF( iinfo.NE.0 )
THEN 873 lambda = work( windex )
876 iwork( iindr+windex ) = 0
879 CALL clar1v( in, 1, in, lambda, d( ibegin ),
880 $ l( ibegin ), work(indld+ibegin-1),
881 $ work(indlld+ibegin-1),
882 $ pivmin, gaptol, z( ibegin, windex ),
883 $ .NOT.usedbs, negcnt, ztz, mingma,
884 $ iwork( iindr+windex ), isuppz( 2*windex-1 ),
885 $ nrminv, resid, rqcorr, work( indwrk ) )
889 ELSEIF(resid.LT.bstres)
THEN 893 isupmn = min(isupmn,isuppz( 2*windex-1 ))
894 isupmx = max(isupmx,isuppz( 2*windex ))
906 IF( resid.GT.tol*gap .AND. abs( rqcorr ).GT.
907 $ rqtol*abs( lambda ) .AND. .NOT. usedbs)
912 IF(indeig.LE.negcnt)
THEN 921 IF( ( rqcorr*sgndef.GE.zero )
922 $ .AND.( lambda + rqcorr.LE. right)
923 $ .AND.( lambda + rqcorr.GE. left)
927 IF(sgndef.EQ.one)
THEN 946 $ half * (right + left)
949 lambda = lambda + rqcorr
952 $ half * (right-left)
956 IF(right-left.LT.rqtol*abs(lambda))
THEN 961 ELSEIF( iter.LT.maxitr )
THEN 963 ELSEIF( iter.EQ.maxitr )
THEN 972 IF(usedrq .AND. usedbs .AND.
973 $ bstres.LE.resid)
THEN 979 CALL clar1v( in, 1, in, lambda,
980 $ d( ibegin ), l( ibegin ),
981 $ work(indld+ibegin-1),
982 $ work(indlld+ibegin-1),
983 $ pivmin, gaptol, z( ibegin, windex ),
984 $ .NOT.usedbs, negcnt, ztz, mingma,
985 $ iwork( iindr+windex ),
986 $ isuppz( 2*windex-1 ),
987 $ nrminv, resid, rqcorr, work( indwrk ) )
989 work( windex ) = lambda
994 isuppz( 2*windex-1 ) = isuppz( 2*windex-1 )+oldien
995 isuppz( 2*windex ) = isuppz( 2*windex )+oldien
996 zfrom = isuppz( 2*windex-1 )
997 zto = isuppz( 2*windex )
998 isupmn = isupmn + oldien
999 isupmx = isupmx + oldien
1001 IF(isupmn.LT.zfrom)
THEN 1002 DO 122 ii = isupmn,zfrom-1
1003 z( ii, windex ) = zero
1006 IF(isupmx.GT.zto)
THEN 1007 DO 123 ii = zto+1,isupmx
1008 z( ii, windex ) = zero
1011 CALL csscal( zto-zfrom+1, nrminv,
1012 $ z( zfrom, windex ), 1 )
1015 w( windex ) = lambda+sigma
1024 wgap( windmn ) = max( wgap(windmn),
1025 $ w(windex)-werr(windex)
1026 $ - w(windmn)-werr(windmn) )
1028 IF( windex.LT.wend )
THEN 1029 wgap( windex ) = max( savgap,
1030 $ w( windpl )-werr( windpl )
1031 $ - w( windex )-werr( windex) )
1056 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 csscal(N, SA, CX, INCX)
CSSCAL
subroutine clar1v(N, B1, BN, LAMBDA, D, L, LD, LLD, PIVMIN, GAPTOL, Z, WANTNC, NEGCNT, ZTZ, MINGMA, R, ISUPPZ, NRMINV, RESID, RQCORR, WORK)
CLAR1V computes the (scaled) r-th column of the inverse of the submatrix in rows b1 through bn of the...
subroutine clarrv(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)
CLARRV computes the eigenvectors of the tridiagonal matrix T = L D LT given L, D and the eigenvalues ...
subroutine claset(UPLO, M, N, ALPHA, BETA, A, LDA)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
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 scopy(N, SX, INCX, SY, INCY)
SCOPY