379 $ IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK,
380 $ LWORK, IWORK, LIWORK, INFO )
389 CHARACTER JOBZ, RANGE, UPLO
390 INTEGER IL, INFO, IU, LDA, LDZ, LIWORK, LWORK, M, N
391 DOUBLE PRECISION ABSTOL, VL, VU
394 INTEGER ISUPPZ( * ), IWORK( * )
395 DOUBLE PRECISION A( LDA, * ), W( * ), WORK( * ), Z( LDZ, * )
401 DOUBLE PRECISION ZERO, ONE, TWO
402 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
405 LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, VALEIG, WANTZ,
408 INTEGER I, IEEEOK, IINFO, IMAX, INDD, INDDD, INDE,
409 $ indee, indibl, indifl, indisp, indiwo, indtau,
410 $ indwk, indwkn, iscale, j, jj, liwmin,
411 $ llwork, llwrkn, lwmin, nsplit,
412 $ lhtrd, lwtrd, kd, ib, indhous
413 DOUBLE PRECISION ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
414 $ SIGMA, SMLNUM, TMP1, VLL, VUU
418 INTEGER ILAENV, ILAENV2STAGE
419 DOUBLE PRECISION DLAMCH, DLANSY
420 EXTERNAL lsame, dlamch, dlansy, ilaenv, ilaenv2stage
427 INTRINSIC max, min, sqrt
433 ieeeok = ilaenv( 10,
'DSYEVR',
'N', 1, 2, 3, 4 )
435 lower = lsame( uplo,
'L' )
436 wantz = lsame( jobz,
'V' )
437 alleig = lsame( range,
'A' )
438 valeig = lsame( range,
'V' )
439 indeig = lsame( range,
'I' )
441 lquery = ( ( lwork.EQ.-1 ) .OR. ( liwork.EQ.-1 ) )
443 kd = ilaenv2stage( 1,
'DSYTRD_2STAGE', jobz, n, -1, -1, -1 )
444 ib = ilaenv2stage( 2,
'DSYTRD_2STAGE', jobz, n, kd, -1, -1 )
445 lhtrd = ilaenv2stage( 3,
'DSYTRD_2STAGE', jobz, n, kd, ib, -1 )
446 lwtrd = ilaenv2stage( 4,
'DSYTRD_2STAGE', jobz, n, kd, ib, -1 )
447 lwmin = max( 26*n, 5*n + lhtrd + lwtrd )
448 liwmin = max( 1, 10*n )
451 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
453 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
455 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
457 ELSE IF( n.LT.0 )
THEN
459 ELSE IF( lda.LT.max( 1, n ) )
THEN
463 IF( n.GT.0 .AND. vu.LE.vl )
465 ELSE IF( indeig )
THEN
466 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
468 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
474 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
476 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
478 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
492 CALL xerbla(
'DSYEVR_2STAGE', -info )
494 ELSE IF( lquery )
THEN
508 IF( alleig .OR. indeig )
THEN
512 IF( vl.LT.a( 1, 1 ) .AND. vu.GE.a( 1, 1 ) )
THEN
527 safmin = dlamch(
'Safe minimum' )
528 eps = dlamch(
'Precision' )
529 smlnum = safmin / eps
530 bignum = one / smlnum
531 rmin = sqrt( smlnum )
532 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
542 anrm = dlansy(
'M', uplo, n, a, lda, work )
543 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
546 ELSE IF( anrm.GT.rmax )
THEN
550 IF( iscale.EQ.1 )
THEN
553 CALL dscal( n-j+1, sigma, a( j, j ), 1 )
557 CALL dscal( j, sigma, a( 1, j ), 1 )
561 $ abstll = abstol*sigma
589 indwk = indhous + lhtrd
590 llwork = lwork - indwk + 1
612 $ work( inde ), work( indtau ), work( indhous ),
613 $ lhtrd, work( indwk ), llwork, iinfo )
618 IF( ( alleig .OR. ( indeig .AND. il.EQ.1 .AND. iu.EQ.n ) ) .AND.
620 IF( .NOT.wantz )
THEN
621 CALL dcopy( n, work( indd ), 1, w, 1 )
622 CALL dcopy( n-1, work( inde ), 1, work( indee ), 1 )
623 CALL dsterf( n, w, work( indee ), info )
625 CALL dcopy( n-1, work( inde ), 1, work( indee ), 1 )
626 CALL dcopy( n, work( indd ), 1, work( inddd ), 1 )
628 IF (abstol .LE. two*n*eps)
THEN
633 CALL dstemr( jobz,
'A', n, work( inddd ), work( indee ),
634 $ vl, vu, il, iu, m, w, z, ldz, n, isuppz,
635 $ tryrac, work( indwk ), lwork, iwork, liwork,
643 IF( wantz .AND. info.EQ.0 )
THEN
645 llwrkn = lwork - indwkn + 1
646 CALL dormtr(
'L', uplo,
'N', n, m, a, lda,
647 $ work( indtau ), z, ldz, work( indwkn ),
671 CALL dstebz( range, order, n, vll, vuu, il, iu, abstll,
672 $ work( indd ), work( inde ), m, nsplit, w,
673 $ iwork( indibl ), iwork( indisp ), work( indwk ),
674 $ iwork( indiwo ), info )
677 CALL dstein( n, work( indd ), work( inde ), m, w,
678 $ iwork( indibl ), iwork( indisp ), z, ldz,
679 $ work( indwk ), iwork( indiwo ), iwork( indifl ),
686 llwrkn = lwork - indwkn + 1
687 CALL dormtr(
'L', uplo,
'N', n, m, a, lda, work( indtau ), z,
688 $ ldz, work( indwkn ), llwrkn, iinfo )
695 IF( iscale.EQ.1 )
THEN
701 CALL dscal( imax, one / sigma, w, 1 )
714 IF( w( jj ).LT.tmp1 )
THEN
723 CALL dswap( n, z( 1, i ), 1, z( 1, j ), 1 )
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dsyevr_2stage(jobz, range, uplo, n, a, lda, vl, vu, il, iu, abstol, m, w, z, ldz, isuppz, work, lwork, iwork, liwork, info)
DSYEVR_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY mat...
subroutine dsytrd_2stage(vect, uplo, n, a, lda, d, e, tau, hous2, lhous2, work, lwork, info)
DSYTRD_2STAGE
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dstebz(range, order, n, vl, vu, il, iu, abstol, d, e, m, nsplit, w, iblock, isplit, work, iwork, info)
DSTEBZ
subroutine dstein(n, d, e, m, w, iblock, isplit, z, ldz, work, iwork, ifail, info)
DSTEIN
subroutine dstemr(jobz, range, n, d, e, vl, vu, il, iu, m, w, z, ldz, nzc, isuppz, tryrac, work, lwork, iwork, liwork, info)
DSTEMR
subroutine dsterf(n, d, e, info)
DSTERF
subroutine dswap(n, dx, incx, dy, incy)
DSWAP
subroutine dormtr(side, uplo, trans, m, n, a, lda, tau, c, ldc, work, lwork, info)
DORMTR