136 SUBROUTINE zheev( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK,
145 INTEGER INFO, LDA, LWORK, N
148 DOUBLE PRECISION RWORK( * ), W( * )
149 COMPLEX*16 A( LDA, * ), WORK( * )
155 DOUBLE PRECISION ZERO, ONE
156 parameter( zero = 0.0d0, one = 1.0d0 )
158 parameter( cone = ( 1.0d0, 0.0d0 ) )
161 LOGICAL LOWER, LQUERY, WANTZ
162 INTEGER IINFO, IMAX, INDE, INDTAU, INDWRK, ISCALE,
164 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
170 DOUBLE PRECISION DLAMCH, ZLANHE
171 EXTERNAL lsame, ilaenv, dlamch, zlanhe
185 wantz = lsame( jobz,
'V' )
186 lower = lsame( uplo,
'L' )
187 lquery = ( lwork.EQ.-1 )
190 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
192 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
194 ELSE IF( n.LT.0 )
THEN
196 ELSE IF( lda.LT.max( 1, n ) )
THEN
201 nb = ilaenv( 1,
'ZHETRD', uplo, n, -1, -1, -1 )
202 lwkopt = max( 1, ( nb+1 )*n )
205 IF( lwork.LT.max( 1, 2*n-1 ) .AND. .NOT.lquery )
210 CALL xerbla(
'ZHEEV ', -info )
212 ELSE IF( lquery )
THEN
223 w( 1 ) = dble( a( 1, 1 ) )
232 safmin = dlamch(
'Safe minimum' )
233 eps = dlamch(
'Precision' )
234 smlnum = safmin / eps
235 bignum = one / smlnum
236 rmin = sqrt( smlnum )
237 rmax = sqrt( bignum )
241 anrm = zlanhe(
'M', uplo, n, a, lda, rwork )
243 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
246 ELSE IF( anrm.GT.rmax )
THEN
251 $
CALL zlascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
258 llwork = lwork - indwrk + 1
259 CALL zhetrd( uplo, n, a, lda, w, rwork( inde ), work( indtau ),
260 $ work( indwrk ), llwork, iinfo )
265 IF( .NOT.wantz )
THEN
266 CALL dsterf( n, w, rwork( inde ), info )
268 CALL zungtr( uplo, n, a, lda, work( indtau ),
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 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.