324 $ Q, LDQ, VL, VU, IL, IU, ABSTOL, M, W,
325 $ Z, LDZ, WORK, LWORK, RWORK, IWORK,
335 CHARACTER JOBZ, RANGE, UPLO
336 INTEGER IL, INFO, IU, KD, LDAB, LDQ, LDZ, M, N, LWORK
340 INTEGER IFAIL( * ), IWORK( * )
341 REAL RWORK( * ), W( * )
342 COMPLEX AB( LDAB, * ), Q( LDQ, * ), WORK( * ),
350 PARAMETER ( ZERO = 0.0e0, one = 1.0e0 )
352 parameter( czero = ( 0.0e0, 0.0e0 ),
353 $ cone = ( 1.0e0, 0.0e0 ) )
356 LOGICAL ALLEIG, INDEIG, LOWER, TEST, VALEIG, WANTZ,
359 INTEGER I, IINFO, IMAX, INDD, INDE, INDEE, INDIBL,
360 $ INDISP, INDIWK, INDRWK, INDWRK, ISCALE, ITMP1,
361 $ llwork, lwmin, lhtrd, lwtrd, ib, indhous,
363 REAL ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
364 $ SIGMA, SMLNUM, TMP1, VLL, VUU
370 REAL SLAMCH, CLANHB, SROUNDUP_LWORK
371 EXTERNAL lsame, slamch, clanhb, ilaenv2stage,
380 INTRINSIC real, max, min, sqrt
386 wantz = lsame( jobz,
'V' )
387 alleig = lsame( range,
'A' )
388 valeig = lsame( range,
'V' )
389 indeig = lsame( range,
'I' )
390 lower = lsame( uplo,
'L' )
391 lquery = ( lwork.EQ.-1 )
394 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
396 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
398 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
400 ELSE IF( n.LT.0 )
THEN
402 ELSE IF( kd.LT.0 )
THEN
404 ELSE IF( ldab.LT.kd+1 )
THEN
406 ELSE IF( wantz .AND. ldq.LT.max( 1, n ) )
THEN
410 IF( n.GT.0 .AND. vu.LE.vl )
412 ELSE IF( indeig )
THEN
413 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
415 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
421 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
428 work( 1 ) = sroundup_lwork(lwmin)
430 ib = ilaenv2stage( 2,
'CHETRD_HB2ST', jobz,
432 lhtrd = ilaenv2stage( 3,
'CHETRD_HB2ST', jobz,
434 lwtrd = ilaenv2stage( 4,
'CHETRD_HB2ST', jobz,
436 lwmin = lhtrd + lwtrd
437 work( 1 ) = sroundup_lwork(lwmin)
440 IF( lwork.LT.lwmin .AND. .NOT.lquery )
445 CALL xerbla(
'CHBEVX_2STAGE', -info )
447 ELSE IF( lquery )
THEN
462 ctmp1 = ab( kd+1, 1 )
466 IF( .NOT.( vl.LT.tmp1 .AND. vu.GE.tmp1 ) )
470 w( 1 ) = real( ctmp1 )
479 safmin = slamch(
'Safe minimum' )
480 eps = slamch(
'Precision' )
481 smlnum = safmin / eps
482 bignum = one / smlnum
483 rmin = sqrt( smlnum )
484 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
497 anrm = clanhb(
'M', uplo, n, kd, ab, ldab, rwork )
498 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
501 ELSE IF( anrm.GT.rmax )
THEN
505 IF( iscale.EQ.1 )
THEN
507 CALL clascl(
'B', kd, kd, one, sigma, n, n, ab, ldab, info )
509 CALL clascl(
'Q', kd, kd, one, sigma, n, n, ab, ldab, info )
512 $ abstll = abstol*sigma
526 indwrk = indhous + lhtrd
527 llwork = lwork - indwrk + 1
530 $ rwork( indd ), rwork( inde ), work( indhous ),
531 $ lhtrd, work( indwrk ), llwork, iinfo )
539 IF (il.EQ.1 .AND. iu.EQ.n)
THEN
543 IF ((alleig .OR. test) .AND. (abstol.LE.zero))
THEN
544 CALL scopy( n, rwork( indd ), 1, w, 1 )
546 IF( .NOT.wantz )
THEN
547 CALL scopy( n-1, rwork( inde ), 1, rwork( indee ), 1 )
548 CALL ssterf( n, w, rwork( indee ), info )
550 CALL clacpy(
'A', n, n, q, ldq, z, ldz )
551 CALL scopy( n-1, rwork( inde ), 1, rwork( indee ), 1 )
552 CALL csteqr( jobz, n, w, rwork( indee ), z, ldz,
553 $ rwork( indrwk ), info )
577 CALL sstebz( range, order, n, vll, vuu, il, iu, abstll,
578 $ rwork( indd ), rwork( inde ), m, nsplit, w,
579 $ iwork( indibl ), iwork( indisp ), rwork( indrwk ),
580 $ iwork( indiwk ), info )
583 CALL cstein( n, rwork( indd ), rwork( inde ), m, w,
584 $ iwork( indibl ), iwork( indisp ), z, ldz,
585 $ rwork( indrwk ), iwork( indiwk ), ifail, info )
591 CALL ccopy( n, z( 1, j ), 1, work( 1 ), 1 )
592 CALL cgemv(
'N', n, n, cone, q, ldq, work, 1, czero,
600 IF( iscale.EQ.1 )
THEN
606 CALL sscal( imax, one / sigma, w, 1 )
617 IF( w( jj ).LT.tmp1 )
THEN
624 itmp1 = iwork( indibl+i-1 )
626 iwork( indibl+i-1 ) = iwork( indibl+j-1 )
628 iwork( indibl+j-1 ) = itmp1
629 CALL cswap( n, z( 1, i ), 1, z( 1, j ), 1 )
632 ifail( i ) = ifail( j )
641 work( 1 ) = sroundup_lwork(lwmin)
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine chbevx_2stage(jobz, range, uplo, n, kd, ab, ldab, q, ldq, vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, rwork, iwork, ifail, info)
CHBEVX_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER ...
subroutine chetrd_hb2st(stage1, vect, uplo, n, kd, ab, ldab, d, e, hous, lhous, work, lwork, info)
CHETRD_HB2ST reduces a complex Hermitian band matrix A to real symmetric tridiagonal form T
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine clascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
CLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sstebz(range, order, n, vl, vu, il, iu, abstol, d, e, m, nsplit, w, iblock, isplit, work, iwork, info)
SSTEBZ
subroutine cstein(n, d, e, m, w, iblock, isplit, z, ldz, work, iwork, ifail, info)
CSTEIN
subroutine csteqr(compz, n, d, e, z, ldz, work, info)
CSTEQR
subroutine ssterf(n, d, e, info)
SSTERF
subroutine cswap(n, cx, incx, cy, incy)
CSWAP