256 SUBROUTINE zheevx( JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU,
257 $ ABSTOL, M, W, Z, LDZ, WORK, LWORK, RWORK,
258 $ IWORK, IFAIL, INFO )
265 CHARACTER JOBZ, RANGE, UPLO
266 INTEGER IL, INFO, IU, LDA, LDZ, LWORK, M, N
267 DOUBLE PRECISION ABSTOL, VL, VU
270 INTEGER IFAIL( * ), IWORK( * )
271 DOUBLE PRECISION RWORK( * ), W( * )
272 COMPLEX*16 A( LDA, * ), WORK( * ), Z( LDZ, * )
278 DOUBLE PRECISION ZERO, ONE
279 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
281 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
284 LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, TEST, VALEIG,
287 INTEGER I, IINFO, IMAX, INDD, INDE, INDEE, INDIBL,
288 $ indisp, indiwk, indrwk, indtau, indwrk, iscale,
289 $ itmp1, j, jj, llwork, lwkmin, lwkopt, nb,
291 DOUBLE PRECISION ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
292 $ SIGMA, SMLNUM, TMP1, VLL, VUU
297 DOUBLE PRECISION DLAMCH, ZLANHE
298 EXTERNAL lsame, ilaenv, dlamch, zlanhe
306 INTRINSIC dble, max, min, sqrt
312 lower = lsame( uplo,
'L' )
313 wantz = lsame( jobz,
'V' )
314 alleig = lsame( range,
'A' )
315 valeig = lsame( range,
'V' )
316 indeig = lsame( range,
'I' )
317 lquery = ( lwork.EQ.-1 )
320 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
322 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
324 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
326 ELSE IF( n.LT.0 )
THEN
328 ELSE IF( lda.LT.max( 1, n ) )
THEN
332 IF( n.GT.0 .AND. vu.LE.vl )
334 ELSE IF( indeig )
THEN
335 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
337 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
343 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
354 nb = ilaenv( 1,
'ZHETRD', uplo, n, -1, -1, -1 )
355 nb = max( nb, ilaenv( 1,
'ZUNMTR', uplo, n, -1, -1, -1 ) )
356 lwkopt = max( 1, ( nb + 1 )*n )
360 IF( lwork.LT.lwkmin .AND. .NOT.lquery )
365 CALL xerbla(
'ZHEEVX', -info )
367 ELSE IF( lquery )
THEN
379 IF( alleig .OR. indeig )
THEN
381 w( 1 ) = dble( a( 1, 1 ) )
382 ELSE IF( valeig )
THEN
383 IF( vl.LT.dble( a( 1, 1 ) ) .AND. vu.GE.dble( a( 1, 1 ) ) )
386 w( 1 ) = dble( a( 1, 1 ) )
396 safmin = dlamch(
'Safe minimum' )
397 eps = dlamch(
'Precision' )
398 smlnum = safmin / eps
399 bignum = one / smlnum
400 rmin = sqrt( smlnum )
401 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
411 anrm = zlanhe(
'M', uplo, n, a, lda, rwork )
412 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
415 ELSE IF( anrm.GT.rmax )
THEN
419 IF( iscale.EQ.1 )
THEN
422 CALL zdscal( n-j+1, sigma, a( j, j ), 1 )
426 CALL zdscal( j, sigma, a( 1, j ), 1 )
430 $ abstll = abstol*sigma
444 llwork = lwork - indwrk + 1
445 CALL zhetrd( uplo, n, a, lda, rwork( indd ), rwork( inde ),
446 $ work( indtau ), work( indwrk ), llwork, iinfo )
454 IF( il.EQ.1 .AND. iu.EQ.n )
THEN
458 IF( ( alleig .OR. test ) .AND. ( abstol.LE.zero ) )
THEN
459 CALL dcopy( n, rwork( indd ), 1, w, 1 )
461 IF( .NOT.wantz )
THEN
462 CALL dcopy( n-1, rwork( inde ), 1, rwork( indee ), 1 )
463 CALL dsterf( n, w, rwork( indee ), info )
465 CALL zlacpy(
'A', n, n, a, lda, z, ldz )
466 CALL zungtr( uplo, n, z, ldz, work( indtau ),
467 $ work( indwrk ), llwork, iinfo )
468 CALL dcopy( n-1, rwork( inde ), 1, rwork( indee ), 1 )
469 CALL zsteqr( jobz, n, w, rwork( indee ), z, ldz,
470 $ rwork( indrwk ), info )
494 CALL dstebz( range, order, n, vll, vuu, il, iu, abstll,
495 $ rwork( indd ), rwork( inde ), m, nsplit, w,
496 $ iwork( indibl ), iwork( indisp ), rwork( indrwk ),
497 $ iwork( indiwk ), info )
500 CALL zstein( n, rwork( indd ), rwork( inde ), m, w,
501 $ iwork( indibl ), iwork( indisp ), z, ldz,
502 $ rwork( indrwk ), iwork( indiwk ), ifail, info )
507 CALL zunmtr(
'L', uplo,
'N', n, m, a, lda, work( indtau ), z,
508 $ ldz, work( indwrk ), llwork, iinfo )
514 IF( iscale.EQ.1 )
THEN
520 CALL dscal( imax, one / sigma, w, 1 )
531 IF( w( jj ).LT.tmp1 )
THEN
538 itmp1 = iwork( indibl+i-1 )
540 iwork( indibl+i-1 ) = iwork( indibl+j-1 )
542 iwork( indibl+j-1 ) = itmp1
543 CALL zswap( n, z( 1, i ), 1, z( 1, j ), 1 )
546 ifail( i ) = ifail( j )
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine zheevx(jobz, range, uplo, n, a, lda, vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, rwork, iwork, ifail, info)
ZHEEVX 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 zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
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 zsteqr(compz, n, d, e, z, ldz, work, info)
ZSTEQR
subroutine dsterf(n, d, e, info)
DSTERF
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine zungtr(uplo, n, a, lda, tau, work, lwork, info)
ZUNGTR
subroutine zunmtr(side, uplo, trans, m, n, a, lda, tau, c, ldc, work, lwork, info)
ZUNMTR