138 SUBROUTINE zheev( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK,
147 INTEGER INFO, LDA, LWORK, N
150 DOUBLE PRECISION RWORK( * ), W( * )
151 COMPLEX*16 A( LDA, * ), WORK( * )
157 DOUBLE PRECISION ZERO, ONE
158 parameter( zero = 0.0d0, one = 1.0d0 )
160 parameter( cone = ( 1.0d0, 0.0d0 ) )
163 LOGICAL LOWER, LQUERY, WANTZ
164 INTEGER IINFO, IMAX, INDE, INDTAU, INDWRK, ISCALE,
166 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
172 DOUBLE PRECISION DLAMCH, ZLANHE
173 EXTERNAL lsame, ilaenv, dlamch, zlanhe
186 wantz = lsame( jobz,
'V' )
187 lower = lsame( uplo,
'L' )
188 lquery = ( lwork.EQ.-1 )
191 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
193 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
195 ELSE IF( n.LT.0 )
THEN
197 ELSE IF( lda.LT.max( 1, n ) )
THEN
202 nb = ilaenv( 1,
'ZHETRD', uplo, n, -1, -1, -1 )
203 lwkopt = max( 1, ( nb+1 )*n )
206 IF( lwork.LT.max( 1, 2*n-1 ) .AND. .NOT.lquery )
211 CALL xerbla(
'ZHEEV ', -info )
213 ELSE IF( lquery )
THEN
224 w( 1 ) = dble( a( 1, 1 ) )
233 safmin = dlamch(
'Safe minimum' )
234 eps = dlamch(
'Precision' )
235 smlnum = safmin / eps
236 bignum = one / smlnum
237 rmin = sqrt( smlnum )
238 rmax = sqrt( bignum )
242 anrm = zlanhe(
'M', uplo, n, a, lda, rwork )
244 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
247 ELSE IF( anrm.GT.rmax )
THEN
252 $
CALL zlascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
259 llwork = lwork - indwrk + 1
260 CALL zhetrd( uplo, n, a, lda, w, rwork( inde ), work( indtau ),
261 $ work( indwrk ), llwork, iinfo )
266 IF( .NOT.wantz )
THEN
267 CALL dsterf( n, w, rwork( inde ), info )
269 CALL zungtr( uplo, n, a, lda, work( indtau ), work( indwrk ),
272 CALL zsteqr( jobz, n, w, rwork( inde ), a, lda,
273 $ rwork( indwrk ), info )
278 IF( iscale.EQ.1 )
THEN
284 CALL dscal( imax, one / sigma, w, 1 )
subroutine xerbla(srname, info)
subroutine zheev(jobz, uplo, n, a, lda, w, work, lwork, rwork, info)
ZHEEV 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 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
subroutine zungtr(uplo, n, a, lda, tau, work, lwork, info)
ZUNGTR