192 SUBROUTINE zhpevd( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK,
193 $ RWORK, LRWORK, IWORK, LIWORK, INFO )
201 INTEGER INFO, LDZ, LIWORK, LRWORK, LWORK, N
205 DOUBLE PRECISION RWORK( * ), W( * )
206 COMPLEX*16 AP( * ), WORK( * ), Z( LDZ, * )
212 DOUBLE PRECISION ZERO, ONE
213 parameter( zero = 0.0d+0, one = 1.0d+0 )
215 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
218 LOGICAL LQUERY, WANTZ
219 INTEGER IINFO, IMAX, INDE, INDRWK, INDTAU, INDWRK,
220 $ iscale, liwmin, llrwk, llwrk, lrwmin, lwmin
221 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
226 DOUBLE PRECISION DLAMCH, ZLANHP
227 EXTERNAL lsame, dlamch, zlanhp
240 wantz = lsame( jobz,
'V' )
241 lquery = ( lwork.EQ.-1 .OR. lrwork.EQ.-1 .OR. liwork.EQ.-1 )
244 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
246 ELSE IF( .NOT.( lsame( uplo,
'L' ) .OR. lsame( uplo,
'U' ) ) )
249 ELSE IF( n.LT.0 )
THEN
251 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
263 lrwmin = 1 + 5*n + 2*n**2
275 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
277 ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery )
THEN
279 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
285 CALL xerbla(
'ZHPEVD', -info )
287 ELSE IF( lquery )
THEN
297 w( 1 ) = dble( ap( 1 ) )
305 safmin = dlamch(
'Safe minimum' )
306 eps = dlamch(
'Precision' )
307 smlnum = safmin / eps
308 bignum = one / smlnum
309 rmin = sqrt( smlnum )
310 rmax = sqrt( bignum )
314 anrm = zlanhp(
'M', uplo, n, ap, rwork )
316 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
319 ELSE IF( anrm.GT.rmax )
THEN
323 IF( iscale.EQ.1 )
THEN
324 CALL zdscal( ( n*( n+1 ) ) / 2, sigma, ap, 1 )
333 llwrk = lwork - indwrk + 1
334 llrwk = lrwork - indrwk + 1
335 CALL zhptrd( uplo, n, ap, w, rwork( inde ), work( indtau ),
341 IF( .NOT.wantz )
THEN
342 CALL dsterf( n, w, rwork( inde ), info )
344 CALL zstedc(
'I', n, w, rwork( inde ), z, ldz, work( indwrk ),
345 $ llwrk, rwork( indrwk ), llrwk, iwork, liwork,
347 CALL zupmtr(
'L', uplo,
'N', n, n, ap, work( indtau ), z, ldz,
348 $ work( indwrk ), iinfo )
353 IF( iscale.EQ.1 )
THEN
359 CALL dscal( imax, one / sigma, w, 1 )
subroutine xerbla(srname, info)
subroutine zhpevd(jobz, uplo, n, ap, w, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
ZHPEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrice...
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 zstedc(compz, n, d, e, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
ZSTEDC
subroutine dsterf(n, d, e, info)
DSTERF
subroutine zupmtr(side, uplo, trans, m, n, ap, tau, c, ldc, work, info)
ZUPMTR