190 SUBROUTINE zhpevd( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK,
191 $ RWORK, LRWORK, IWORK, LIWORK, INFO )
199 INTEGER INFO, LDZ, LIWORK, LRWORK, LWORK, N
203 DOUBLE PRECISION RWORK( * ), W( * )
204 COMPLEX*16 AP( * ), WORK( * ), Z( LDZ, * )
210 DOUBLE PRECISION ZERO, ONE
211 parameter( zero = 0.0d+0, one = 1.0d+0 )
213 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
216 LOGICAL LQUERY, WANTZ
217 INTEGER IINFO, IMAX, INDE, INDRWK, INDTAU, INDWRK,
218 $ iscale, liwmin, llrwk, llwrk, lrwmin, lwmin
219 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
224 DOUBLE PRECISION DLAMCH, ZLANHP
225 EXTERNAL lsame, dlamch, zlanhp
239 wantz = lsame( jobz,
'V' )
240 lquery = ( lwork.EQ.-1 .OR. lrwork.EQ.-1 .OR. liwork.EQ.-1 )
243 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
245 ELSE IF( .NOT.( lsame( uplo,
'L' ) .OR.
246 $ 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
272 rwork( 1 ) = real( lrwmin )
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,
346 $ llwrk, rwork( indrwk ), llrwk, iwork, liwork,
348 CALL zupmtr(
'L', uplo,
'N', n, n, ap, work( indtau ), z,
350 $ work( indwrk ), iinfo )
355 IF( iscale.EQ.1 )
THEN
361 CALL dscal( imax, one / sigma, w, 1 )
365 rwork( 1 ) = real( lrwmin )
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 zstedc(compz, n, d, e, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
ZSTEDC