235 SUBROUTINE chpevx( 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
249 INTEGER IFAIL( * ), IWORK( * )
250 REAL RWORK( * ), W( * )
251 COMPLEX AP( * ), WORK( * ), Z( LDZ, * )
258 PARAMETER ( ZERO = 0.0e0, one = 1.0e0 )
260 parameter( cone = ( 1.0e0, 0.0e0 ) )
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 REAL ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
269 $ SIGMA, SMLNUM, TMP1, VLL, VUU
274 EXTERNAL lsame, clanhp, slamch
282 INTRINSIC max, min, real, 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(
'CHPEVX', -info )
333 IF( alleig .OR. indeig )
THEN
335 w( 1 ) = real( ap( 1 ) )
337 IF( vl.LT.real( ap( 1 ) ) .AND. vu.GE.real( ap( 1 ) ) )
THEN
339 w( 1 ) = real( ap( 1 ) )
349 safmin = slamch(
'Safe minimum' )
350 eps = slamch(
'Precision' )
351 smlnum = safmin / eps
352 bignum = one / smlnum
353 rmin = sqrt( smlnum )
354 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
367 anrm = clanhp(
'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 csscal( ( n*( n+1 ) ) / 2, sigma, ap, 1 )
378 $ abstll = abstol*sigma
392 CALL chptrd( 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 scopy( n, rwork( indd ), 1, w, 1 )
408 IF( .NOT.wantz )
THEN
409 CALL scopy( n-1, rwork( inde ), 1, rwork( indee ), 1 )
410 CALL ssterf( n, w, rwork( indee ), info )
412 CALL cupgtr( uplo, n, ap, work( indtau ), z, ldz,
413 $ work( indwrk ), iinfo )
414 CALL scopy( n-1, rwork( inde ), 1, rwork( indee ), 1 )
415 CALL csteqr( jobz, n, w, rwork( indee ), z, ldz,
416 $ rwork( indrwk ), info )
439 CALL sstebz( 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 cstein( n, rwork( indd ), rwork( inde ), m, w,
446 $ iwork( 1 ), iwork( indisp ), z, ldz,
447 $ rwork( indrwk ), iwork( indiwk ), ifail, info )
453 CALL cupmtr(
'L', uplo,
'N', n, m, ap, work( indtau ), z,
455 $ work( indwrk ), iinfo )
461 IF( iscale.EQ.1 )
THEN
467 CALL sscal( 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 cswap( n, z( 1, i ), 1, z( 1, j ), 1 )
493 ifail( i ) = ifail( j )
subroutine chpevx(jobz, range, uplo, n, ap, vl, vu, il, iu, abstol, m, w, z, ldz, work, rwork, iwork, ifail, info)
CHPEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrice...