283 SUBROUTINE clarrv( N, VL, VU, D, L, PIVMIN,
284 $ ISPLIT, M, DOL, DOU, MINRGP,
285 $ RTOL1, RTOL2, W, WERR, WGAP,
286 $ IBLOCK, INDEXW, GERS, Z, LDZ, ISUPPZ,
287 $ WORK, IWORK, INFO )
295 INTEGER DOL, DOU, INFO, LDZ, M, N
296 REAL MINRGP, PIVMIN, RTOL1, RTOL2, VL, VU
299 INTEGER IBLOCK( * ), INDEXW( * ), ISPLIT( * ),
300 $ isuppz( * ), iwork( * )
301 REAL D( * ), GERS( * ), L( * ), W( * ), WERR( * ),
302 $ wgap( * ), work( * )
310 parameter( maxitr = 10 )
312 parameter( czero = ( 0.0e0, 0.0e0 ) )
313 REAL ZERO, ONE, TWO, THREE, FOUR, HALF
314 parameter( zero = 0.0e0, one = 1.0e0,
315 $ two = 2.0e0, three = 3.0e0,
316 $ four = 4.0e0, half = 0.5e0)
319 LOGICAL ESKIP, NEEDBS, STP2II, TRYRQC, USEDBS, USEDRQ
320 INTEGER DONE, I, IBEGIN, IDONE, IEND, II, IINDC1,
321 $ iindc2, iindr, iindwk, iinfo, im, in, indeig,
322 $ indld, indlld, indwrk, isupmn, isupmx, iter,
323 $ itmp1, j, jblk, k, miniwsize, minwsize, nclus,
324 $ ndepth, negcnt, newcls, newfst, newftt, newlst,
325 $ newsiz, offset, oldcls, oldfst, oldien, oldlst,
326 $ oldncl, p, parity, q, wbegin, wend, windex,
327 $ windmn, windpl, zfrom, zto, zusedl, zusedu,
329 INTEGER INDIN1, INDIN2
330 REAL BSTRES, BSTW, EPS, FUDGE, GAP, GAPTOL, GL, GU,
331 $ lambda, left, lgap, mingma, nrminv, resid,
332 $ rgap, right, rqcorr, rqtol, savgap, sgndef,
333 $ sigma, spdiam, ssigma, tau, tmp, tol, ztz
344 INTRINSIC abs,
REAL, MAX, MIN
395 zusedw = zusedu - zusedl + 1
398 CALL claset(
'Full', n, zusedw, czero, czero,
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 ) = cmplx( one, zero )
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
560 d( ibegin+k-1 ) =
REAL( Z( IBEGIN+K-1,
$ J ) 561 REAL( Z( IBEGIN+K-1,
$ J+1 ) 563 d( iend ) =
REAL( Z( IEND, J ) )
564 sigma =
REAL( Z( IEND, J+1 ) )
567 CALL claset(
'Full', in, 2, czero, czero,
568 $ z( ibegin, j), ldz )
572 DO 50 j = ibegin, iend-1
574 work( indld-1+j ) = tmp
575 work( indlld-1+j ) = tmp*l( j )
578 IF( ndepth.GT.0 )
THEN 581 p = indexw( wbegin-1+oldfst )
582 q = indexw( wbegin-1+oldlst )
586 offset = indexw( wbegin ) - 1
589 CALL slarrb( in, d( ibegin ),
590 $ work(indlld+ibegin-1),
591 $ p, q, rtol1, rtol2, offset,
592 $ work(wbegin),wgap(wbegin),werr(wbegin),
593 $ work( indwrk ), iwork( iindwk ),
594 $ pivmin, spdiam, in, iinfo )
595 IF( iinfo.NE.0 )
THEN 606 IF( oldfst.GT.1)
THEN 607 wgap( wbegin+oldfst-2 ) =
608 $ max(wgap(wbegin+oldfst-2),
609 $ w(wbegin+oldfst-1)-werr(wbegin+oldfst-1)
610 $ - w(wbegin+oldfst-2)-werr(wbegin+oldfst-2) )
612 IF( wbegin + oldlst -1 .LT. wend )
THEN 613 wgap( wbegin+oldlst-1 ) =
614 $ max(wgap(wbegin+oldlst-1),
615 $ w(wbegin+oldlst)-werr(wbegin+oldlst)
616 $ - w(wbegin+oldlst-1)-werr(wbegin+oldlst-1) )
620 DO 53 j=oldfst,oldlst
621 w(wbegin+j-1) = work(wbegin+j-1)+sigma
627 DO 140 j = oldfst, oldlst
628 IF( j.EQ.oldlst )
THEN 632 ELSE IF ( wgap( wbegin + j -1).GE.
633 $ minrgp* abs( work(wbegin + j -1) ) )
THEN 644 newsiz = newlst - newfst + 1
648 IF((dol.EQ.1).AND.(dou.EQ.m))
THEN 651 newftt = wbegin + newfst - 1
653 IF(wbegin+newfst-1.LT.dol)
THEN 656 ELSEIF(wbegin+newfst-1.GT.dou)
THEN 660 newftt = wbegin + newfst - 1
664 IF( newsiz.GT.1)
THEN 679 IF( newfst.EQ.1 )
THEN 681 $ w(wbegin)-werr(wbegin) - vl )
683 lgap = wgap( wbegin+newfst-2 )
685 rgap = wgap( wbegin+newlst-1 )
694 p = indexw( wbegin-1+newfst )
696 p = indexw( wbegin-1+newlst )
698 offset = indexw( wbegin ) - 1
699 CALL slarrb( in, d(ibegin),
700 $ work( indlld+ibegin-1 ),p,p,
701 $ rqtol, rqtol, offset,
702 $ work(wbegin),wgap(wbegin),
703 $ werr(wbegin),work( indwrk ),
704 $ iwork( iindwk ), pivmin, spdiam,
708 IF((wbegin+newlst-1.LT.dol).OR.
709 $ (wbegin+newfst-1.GT.dou))
THEN 717 idone = idone + newlst - newfst + 1
725 CALL slarrf( in, d( ibegin ), l( ibegin ),
726 $ work(indld+ibegin-1),
727 $ newfst, newlst, work(wbegin),
728 $ wgap(wbegin), werr(wbegin),
729 $ spdiam, lgap, rgap, pivmin, tau,
730 $ work( indin1 ), work( indin2 ),
731 $ work( indwrk ), iinfo )
736 z( ibegin+k-1, newftt ) =
737 $ cmplx( work( indin1+k-1 ), zero )
738 z( ibegin+k-1, newftt+1 ) =
739 $ cmplx( work( indin2+k-1 ), zero )
742 $ cmplx( work( indin1+in-1 ), zero )
743 IF( iinfo.EQ.0 )
THEN 747 z( iend, newftt+1 ) = cmplx( ssigma, zero )
750 DO 116 k = newfst, newlst
752 $ three*eps*abs(work(wbegin+k-1))
753 work( wbegin + k - 1 ) =
754 $ work( wbegin + k - 1) - tau
756 $ four*eps*abs(work(wbegin+k-1))
758 werr( wbegin + k - 1 ) =
759 $ werr( wbegin + k - 1 ) + fudge
771 iwork( k-1 ) = newfst
783 tol = four * log(
REAL(in)) * eps
786 windex = wbegin + k - 1
787 windmn = max(windex - 1,1)
788 windpl = min(windex + 1,m)
789 lambda = work( windex )
792 IF((windex.LT.dol).OR.
793 $ (windex.GT.dou))
THEN 799 left = work( windex ) - werr( windex )
800 right = work( windex ) + werr( windex )
801 indeig = indexw( windex )
816 lgap = eps*max(abs(left),abs(right))
826 rgap = eps*max(abs(left),abs(right))
830 gap = min( lgap, rgap )
831 IF(( k .EQ. 1).OR.(k .EQ. im))
THEN 846 savgap = wgap(windex)
863 itmp1 = iwork( iindr+windex )
864 offset = indexw( wbegin ) - 1
865 CALL slarrb( in, d(ibegin),
866 $ work(indlld+ibegin-1),indeig,indeig,
867 $ zero, two*eps, offset,
868 $ work(wbegin),wgap(wbegin),
869 $ werr(wbegin),work( indwrk ),
870 $ iwork( iindwk ), pivmin, spdiam,
872 IF( iinfo.NE.0 )
THEN 876 lambda = work( windex )
879 iwork( iindr+windex ) = 0
882 CALL clar1v( in, 1, in, lambda, d( ibegin ),
883 $ l( ibegin ), work(indld+ibegin-1),
884 $ work(indlld+ibegin-1),
885 $ pivmin, gaptol, z( ibegin, windex ),
886 $ .NOT.usedbs, negcnt, ztz, mingma,
887 $ iwork( iindr+windex ), isuppz( 2*windex-1 ),
888 $ nrminv, resid, rqcorr, work( indwrk ) )
892 ELSEIF(resid.LT.bstres)
THEN 896 isupmn = min(isupmn,isuppz( 2*windex-1 ))
897 isupmx = max(isupmx,isuppz( 2*windex ))
909 IF( resid.GT.tol*gap .AND. abs( rqcorr ).GT.
910 $ rqtol*abs( lambda ) .AND. .NOT. usedbs)
915 IF(indeig.LE.negcnt)
THEN 924 IF( ( rqcorr*sgndef.GE.zero )
925 $ .AND.( lambda + rqcorr.LE. right)
926 $ .AND.( lambda + rqcorr.GE. left)
930 IF(sgndef.EQ.one)
THEN 949 $ half * (right + left)
952 lambda = lambda + rqcorr
955 $ half * (right-left)
959 IF(right-left.LT.rqtol*abs(lambda))
THEN 964 ELSEIF( iter.LT.maxitr )
THEN 966 ELSEIF( iter.EQ.maxitr )
THEN 975 IF(usedrq .AND. usedbs .AND.
976 $ bstres.LE.resid)
THEN 982 CALL clar1v( in, 1, in, lambda,
983 $ d( ibegin ), l( ibegin ),
984 $ work(indld+ibegin-1),
985 $ work(indlld+ibegin-1),
986 $ pivmin, gaptol, z( ibegin, windex ),
987 $ .NOT.usedbs, negcnt, ztz, mingma,
988 $ iwork( iindr+windex ),
989 $ isuppz( 2*windex-1 ),
990 $ nrminv, resid, rqcorr, work( indwrk ) )
992 work( windex ) = lambda
997 isuppz( 2*windex-1 ) = isuppz( 2*windex-1 )+oldien
998 isuppz( 2*windex ) = isuppz( 2*windex )+oldien
999 zfrom = isuppz( 2*windex-1 )
1000 zto = isuppz( 2*windex )
1001 isupmn = isupmn + oldien
1002 isupmx = isupmx + oldien
1004 IF(isupmn.LT.zfrom)
THEN 1005 DO 122 ii = isupmn,zfrom-1
1006 z( ii, windex ) = zero
1009 IF(isupmx.GT.zto)
THEN 1010 DO 123 ii = zto+1,isupmx
1011 z( ii, windex ) = zero
1014 CALL csscal( zto-zfrom+1, nrminv,
1015 $ z( zfrom, windex ), 1 )
1018 w( windex ) = lambda+sigma
1027 wgap( windmn ) = max( wgap(windmn),
1028 $ w(windex)-werr(windex)
1029 $ - w(windmn)-werr(windmn) )
1031 IF( windex.LT.wend )
THEN 1032 wgap( windex ) = max( savgap,
1033 $ w( windpl )-werr( windpl )
1034 $ - w( windex )-werr( windex) )
1059 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 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 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 scopy(N, SX, INCX, SY, INCY)
SCOPY
subroutine csscal(N, SA, CX, INCX)
CSSCAL