136 SUBROUTINE zhpev( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, RWORK,
148 DOUBLE PRECISION RWORK( * ), W( * )
149 COMPLEX*16 AP( * ), WORK( * ), Z( LDZ, * )
155 DOUBLE PRECISION ZERO, ONE
156 parameter( zero = 0.0d0, one = 1.0d0 )
160 INTEGER IINFO, IMAX, INDE, INDRWK, INDTAU, INDWRK,
162 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
167 DOUBLE PRECISION DLAMCH, ZLANHP
168 EXTERNAL lsame, dlamch, zlanhp
181 wantz = lsame( jobz,
'V' )
184 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
186 ELSE IF( .NOT.( lsame( uplo,
'L' ) .OR. lsame( uplo,
'U' ) ) )
189 ELSE IF( n.LT.0 )
THEN
191 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
196 CALL xerbla(
'ZHPEV ', -info )
206 w( 1 ) = dble( ap( 1 ) )
215 safmin = dlamch(
'Safe minimum' )
216 eps = dlamch(
'Precision' )
217 smlnum = safmin / eps
218 bignum = one / smlnum
219 rmin = sqrt( smlnum )
220 rmax = sqrt( bignum )
224 anrm = zlanhp(
'M', uplo, n, ap, rwork )
226 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
229 ELSE IF( anrm.GT.rmax )
THEN
233 IF( iscale.EQ.1 )
THEN
234 CALL zdscal( ( n*( n+1 ) ) / 2, sigma, ap, 1 )
241 CALL zhptrd( uplo, n, ap, w, rwork( inde ), work( indtau ),
247 IF( .NOT.wantz )
THEN
248 CALL dsterf( n, w, rwork( inde ), info )
251 CALL zupgtr( uplo, n, ap, work( indtau ), z, ldz,
252 $ work( indwrk ), iinfo )
254 CALL zsteqr( jobz, n, w, rwork( inde ), z, ldz,
255 $ rwork( indrwk ), info )
260 IF( iscale.EQ.1 )
THEN
266 CALL dscal( imax, one / sigma, w, 1 )
subroutine xerbla(srname, info)
subroutine zhpev(jobz, uplo, n, ap, w, z, ldz, work, rwork, info)
ZHPEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices
subroutine zhptrd(uplo, n, ap, d, e, tau, info)
ZHPTRD
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine zdscal(n, da, zx, incx)
ZDSCAL
subroutine zsteqr(compz, n, d, e, z, ldz, work, info)
ZSTEQR
subroutine dsterf(n, d, e, info)
DSTERF
subroutine zupgtr(uplo, n, ap, tau, q, ldq, work, info)
ZUPGTR