150 SUBROUTINE zhbev( JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ, WORK,
159 INTEGER INFO, KD, LDAB, LDZ, N
162 DOUBLE PRECISION RWORK( * ), W( * )
163 COMPLEX*16 AB( LDAB, * ), WORK( * ), Z( LDZ, * )
169 DOUBLE PRECISION ZERO, ONE
170 parameter( zero = 0.0d0, one = 1.0d0 )
174 INTEGER IINFO, IMAX, INDE, INDRWK, ISCALE
175 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
180 DOUBLE PRECISION DLAMCH, ZLANHB
181 EXTERNAL lsame, dlamch, zlanhb
193 wantz = lsame( jobz,
'V' )
194 lower = lsame( uplo,
'L' )
197 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
199 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
201 ELSE IF( n.LT.0 )
THEN
203 ELSE IF( kd.LT.0 )
THEN
205 ELSE IF( ldab.LT.kd+1 )
THEN
207 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
212 CALL xerbla(
'ZHBEV ', -info )
223 w( 1 ) = dble( ab( 1, 1 ) )
225 w( 1 ) = dble( ab( kd+1, 1 ) )
234 safmin = dlamch(
'Safe minimum' )
235 eps = dlamch(
'Precision' )
236 smlnum = safmin / eps
237 bignum = one / smlnum
238 rmin = sqrt( smlnum )
239 rmax = sqrt( bignum )
243 anrm = zlanhb(
'M', uplo, n, kd, ab, ldab, rwork )
245 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
248 ELSE IF( anrm.GT.rmax )
THEN
252 IF( iscale.EQ.1 )
THEN
254 CALL zlascl(
'B', kd, kd, one, sigma, n, n, ab, ldab, info )
256 CALL zlascl(
'Q', kd, kd, one, sigma, n, n, ab, ldab, info )
263 CALL zhbtrd( jobz, uplo, n, kd, ab, ldab, w, rwork( inde ), z,
268 IF( .NOT.wantz )
THEN
269 CALL dsterf( n, w, rwork( inde ), info )
272 CALL zsteqr( jobz, n, w, rwork( inde ), z, ldz,
273 $ rwork( indrwk ), info )
278 IF( iscale.EQ.1 )
THEN
284 CALL dscal( imax, one / sigma, w, 1 )
subroutine xerbla(srname, info)
subroutine zhbev(jobz, uplo, n, kd, ab, ldab, w, z, ldz, work, rwork, info)
ZHBEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices
subroutine zhbtrd(vect, uplo, n, kd, ab, ldab, d, e, q, ldq, work, info)
ZHBTRD
subroutine zlascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
ZLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine zsteqr(compz, n, d, e, z, ldz, work, info)
ZSTEQR
subroutine dsterf(n, d, e, info)
DSTERF