354 SUBROUTINE zheevr( JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU,
355 $ ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK,
356 $ RWORK, LRWORK, IWORK, LIWORK, INFO )
363 CHARACTER JOBZ, RANGE, UPLO
364 INTEGER IL, INFO, IU, LDA, LDZ, LIWORK, LRWORK, LWORK,
366 DOUBLE PRECISION ABSTOL, VL, VU
369 INTEGER ISUPPZ( * ), IWORK( * )
370 DOUBLE PRECISION RWORK( * ), W( * )
371 COMPLEX*16 A( LDA, * ), WORK( * ), Z( LDZ, * )
377 DOUBLE PRECISION ZERO, ONE, TWO
378 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
381 LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, TEST, VALEIG,
384 INTEGER I, IEEEOK, IINFO, IMAX, INDIBL, INDIFL, INDISP,
385 $ indiwo, indrd, indrdd, indre, indree, indrwk,
386 $ indtau, indwk, indwkn, iscale, itmp1, j, jj,
387 $ liwmin, llwork, llrwork, llwrkn, lrwmin,
388 $ lwkopt, lwmin, nb, nsplit
389 DOUBLE PRECISION ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
390 $ SIGMA, SMLNUM, TMP1, VLL, VUU
395 DOUBLE PRECISION DLAMCH, ZLANSY
396 EXTERNAL lsame, ilaenv, dlamch, zlansy
403 INTRINSIC dble, max, min, sqrt
409 ieeeok = ilaenv( 10,
'ZHEEVR',
'N', 1, 2, 3, 4 )
411 lower = lsame( uplo,
'L' )
412 wantz = lsame( jobz,
'V' )
413 alleig = lsame( range,
'A' )
414 valeig = lsame( range,
'V' )
415 indeig = lsame( range,
'I' )
417 lquery = ( ( lwork.EQ.-1 ) .OR. ( lrwork.EQ.-1 ) .OR.
420 lrwmin = max( 1, 24*n )
421 liwmin = max( 1, 10*n )
422 lwmin = max( 1, 2*n )
425 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
427 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
429 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
431 ELSE IF( n.LT.0 )
THEN
433 ELSE IF( lda.LT.max( 1, n ) )
THEN
437 IF( n.GT.0 .AND. vu.LE.vl )
439 ELSE IF( indeig )
THEN
440 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
442 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
448 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
454 nb = ilaenv( 1,
'ZHETRD', uplo, n, -1, -1, -1 )
455 nb = max( nb, ilaenv( 1,
'ZUNMTR', uplo, n, -1, -1, -1 ) )
456 lwkopt = max( ( nb+1 )*n, lwmin )
461 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
463 ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery )
THEN
465 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
471 CALL xerbla(
'ZHEEVR', -info )
473 ELSE IF( lquery )
THEN
487 IF( alleig .OR. indeig )
THEN
489 w( 1 ) = dble( a( 1, 1 ) )
491 IF( vl.LT.dble( a( 1, 1 ) ) .AND. vu.GE.dble( a( 1, 1 ) ) )
494 w( 1 ) = dble( a( 1, 1 ) )
507 safmin = dlamch(
'Safe minimum' )
508 eps = dlamch(
'Precision' )
509 smlnum = safmin / eps
510 bignum = one / smlnum
511 rmin = sqrt( smlnum )
512 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
522 anrm = zlansy(
'M', uplo, n, a, lda, rwork )
523 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
526 ELSE IF( anrm.GT.rmax )
THEN
530 IF( iscale.EQ.1 )
THEN
533 CALL zdscal( n-j+1, sigma, a( j, j ), 1 )
537 CALL zdscal( j, sigma, a( 1, j ), 1 )
541 $ abstll = abstol*sigma
557 llwork = lwork - indwk + 1
574 llrwork = lrwork - indrwk + 1
593 CALL zhetrd( uplo, n, a, lda, rwork( indrd ), rwork( indre ),
594 $ work( indtau ), work( indwk ), llwork, iinfo )
601 IF( il.EQ.1 .AND. iu.EQ.n )
THEN
605 IF( ( alleig.OR.test ) .AND. ( ieeeok.EQ.1 ) )
THEN
606 IF( .NOT.wantz )
THEN
607 CALL dcopy( n, rwork( indrd ), 1, w, 1 )
608 CALL dcopy( n-1, rwork( indre ), 1, rwork( indree ), 1 )
609 CALL dsterf( n, w, rwork( indree ), info )
611 CALL dcopy( n-1, rwork( indre ), 1, rwork( indree ), 1 )
612 CALL dcopy( n, rwork( indrd ), 1, rwork( indrdd ), 1 )
614 IF (abstol .LE. two*n*eps)
THEN
619 CALL zstemr( jobz,
'A', n, rwork( indrdd ),
620 $ rwork( indree ), vl, vu, il, iu, m, w,
621 $ z, ldz, n, isuppz, tryrac,
622 $ rwork( indrwk ), llrwork,
623 $ iwork, liwork, info )
628 IF( wantz .AND. info.EQ.0 )
THEN
630 llwrkn = lwork - indwkn + 1
631 CALL zunmtr(
'L', uplo,
'N', n, m, a, lda,
632 $ work( indtau ), z, ldz, work( indwkn ),
654 CALL dstebz( range, order, n, vll, vuu, il, iu, abstll,
655 $ rwork( indrd ), rwork( indre ), m, nsplit, w,
656 $ iwork( indibl ), iwork( indisp ), rwork( indrwk ),
657 $ iwork( indiwo ), info )
660 CALL zstein( n, rwork( indrd ), rwork( indre ), m, w,
661 $ iwork( indibl ), iwork( indisp ), z, ldz,
662 $ rwork( indrwk ), iwork( indiwo ), iwork( indifl ),
669 llwrkn = lwork - indwkn + 1
670 CALL zunmtr(
'L', uplo,
'N', n, m, a, lda, work( indtau ), z,
671 $ ldz, work( indwkn ), llwrkn, iinfo )
677 IF( iscale.EQ.1 )
THEN
683 CALL dscal( imax, one / sigma, w, 1 )
694 IF( w( jj ).LT.tmp1 )
THEN
701 itmp1 = iwork( indibl+i-1 )
703 iwork( indibl+i-1 ) = iwork( indibl+j-1 )
705 iwork( indibl+j-1 ) = itmp1
706 CALL zswap( n, z( 1, i ), 1, z( 1, j ), 1 )
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine zheevr(jobz, range, uplo, n, a, lda, vl, vu, il, iu, abstol, m, w, z, ldz, isuppz, work, lwork, rwork, lrwork, iwork, liwork, info)
ZHEEVR computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
subroutine zhetrd(uplo, n, a, lda, d, e, tau, work, lwork, info)
ZHETRD
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine zdscal(n, da, zx, incx)
ZDSCAL
subroutine dstebz(range, order, n, vl, vu, il, iu, abstol, d, e, m, nsplit, w, iblock, isplit, work, iwork, info)
DSTEBZ
subroutine zstein(n, d, e, m, w, iblock, isplit, z, ldz, work, iwork, ifail, info)
ZSTEIN
subroutine zstemr(jobz, range, n, d, e, vl, vu, il, iu, m, w, z, ldz, nzc, isuppz, tryrac, work, lwork, iwork, liwork, info)
ZSTEMR
subroutine dsterf(n, d, e, info)
DSTERF
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine zunmtr(side, uplo, trans, m, n, a, lda, tau, c, ldc, work, lwork, info)
ZUNMTR