235 SUBROUTINE zhpevx( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
236 $ ABSTOL, M, W, Z, LDZ, WORK, RWORK, IWORK,
244 CHARACTER JOBZ, RANGE, UPLO
245 INTEGER IL, INFO, IU, LDZ, M, N
246 DOUBLE PRECISION ABSTOL, VL, VU
249 INTEGER IFAIL( * ), IWORK( * )
250 DOUBLE PRECISION RWORK( * ), W( * )
251 COMPLEX*16 AP( * ), WORK( * ), Z( LDZ, * )
257 DOUBLE PRECISION ZERO, ONE
258 PARAMETER ( ZERO = 0.0d0, one = 1.0d0 )
260 parameter( cone = ( 1.0d0, 0.0d0 ) )
263 LOGICAL ALLEIG, INDEIG, TEST, VALEIG, WANTZ
265 INTEGER I, IINFO, IMAX, INDD, INDE, INDEE,
266 $ indisp, indiwk, indrwk, indtau, indwrk, iscale,
267 $ itmp1, j, jj, nsplit
268 DOUBLE PRECISION ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
269 $ SIGMA, SMLNUM, TMP1, VLL, VUU
273 DOUBLE PRECISION DLAMCH, ZLANHP
274 EXTERNAL lsame, dlamch, zlanhp
282 INTRINSIC dble, max, min, sqrt
288 wantz = lsame( jobz,
'V' )
289 alleig = lsame( range,
'A' )
290 valeig = lsame( range,
'V' )
291 indeig = lsame( range,
'I' )
294 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
296 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
298 ELSE IF( .NOT.( lsame( uplo,
'L' ) .OR.
299 $ lsame( uplo,
'U' ) ) )
302 ELSE IF( n.LT.0 )
THEN
306 IF( n.GT.0 .AND. vu.LE.vl )
308 ELSE IF( indeig )
THEN
309 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
311 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
317 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
322 CALL xerbla(
'ZHPEVX', -info )
333 IF( alleig .OR. indeig )
THEN
335 w( 1 ) = dble( ap( 1 ) )
337 IF( vl.LT.dble( ap( 1 ) ) .AND. vu.GE.dble( ap( 1 ) ) )
THEN
339 w( 1 ) = dble( ap( 1 ) )
349 safmin = dlamch(
'Safe minimum' )
350 eps = dlamch(
'Precision' )
351 smlnum = safmin / eps
352 bignum = one / smlnum
353 rmin = sqrt( smlnum )
354 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
367 anrm = zlanhp(
'M', uplo, n, ap, rwork )
368 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
371 ELSE IF( anrm.GT.rmax )
THEN
375 IF( iscale.EQ.1 )
THEN
376 CALL zdscal( ( n*( n+1 ) ) / 2, sigma, ap, 1 )
378 $ abstll = abstol*sigma
392 CALL zhptrd( uplo, n, ap, rwork( indd ), rwork( inde ),
393 $ work( indtau ), iinfo )
401 IF (il.EQ.1 .AND. iu.EQ.n)
THEN
405 IF ((alleig .OR. test) .AND. (abstol.LE.zero))
THEN
406 CALL dcopy( n, rwork( indd ), 1, w, 1 )
408 IF( .NOT.wantz )
THEN
409 CALL dcopy( n-1, rwork( inde ), 1, rwork( indee ), 1 )
410 CALL dsterf( n, w, rwork( indee ), info )
412 CALL zupgtr( uplo, n, ap, work( indtau ), z, ldz,
413 $ work( indwrk ), iinfo )
414 CALL dcopy( n-1, rwork( inde ), 1, rwork( indee ), 1 )
415 CALL zsteqr( jobz, n, w, rwork( indee ), z, ldz,
416 $ rwork( indrwk ), info )
439 CALL dstebz( range, order, n, vll, vuu, il, iu, abstll,
440 $ rwork( indd ), rwork( inde ), m, nsplit, w,
441 $ iwork( 1 ), iwork( indisp ), rwork( indrwk ),
442 $ iwork( indiwk ), info )
445 CALL zstein( n, rwork( indd ), rwork( inde ), m, w,
446 $ iwork( 1 ), iwork( indisp ), z, ldz,
447 $ rwork( indrwk ), iwork( indiwk ), ifail, info )
453 CALL zupmtr(
'L', uplo,
'N', n, m, ap, work( indtau ), z,
455 $ work( indwrk ), iinfo )
461 IF( iscale.EQ.1 )
THEN
467 CALL dscal( imax, one / sigma, w, 1 )
478 IF( w( jj ).LT.tmp1 )
THEN
485 itmp1 = iwork( 1 + i-1 )
487 iwork( 1 + i-1 ) = iwork( 1 + j-1 )
489 iwork( 1 + j-1 ) = itmp1
490 CALL zswap( n, z( 1, i ), 1, z( 1, j ), 1 )
493 ifail( i ) = ifail( j )
subroutine zhpevx(jobz, range, uplo, n, ap, vl, vu, il, iu, abstol, m, w, z, ldz, work, rwork, iwork, ifail, info)
ZHPEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrice...