190 SUBROUTINE chpevd( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK,
191 $ RWORK, LRWORK, IWORK, LIWORK, INFO )
199 INTEGER INFO, LDZ, LIWORK, LRWORK, LWORK, N
203 REAL RWORK( * ), W( * )
204 COMPLEX AP( * ), WORK( * ), Z( LDZ, * )
211 parameter( zero = 0.0e+0, one = 1.0e+0 )
213 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
216 LOGICAL LQUERY, WANTZ
217 INTEGER IINFO, IMAX, INDE, INDRWK, INDTAU, INDWRK,
218 $ iscale, liwmin, llrwk, llwrk, lrwmin, lwmin
219 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
224 REAL CLANHP, SLAMCH, SROUNDUP_LWORK
225 EXTERNAL lsame, clanhp, slamch,
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.
247 $ lsame( uplo,
'U' ) ) )
250 ELSE IF( n.LT.0 )
THEN
252 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
264 lrwmin = 1 + 5*n + 2*n**2
272 work( 1 ) = sroundup_lwork(lwmin)
273 rwork( 1 ) = real( lrwmin )
276 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
278 ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery )
THEN
280 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
286 CALL xerbla(
'CHPEVD', -info )
288 ELSE IF( lquery )
THEN
298 w( 1 ) = real( ap( 1 ) )
306 safmin = slamch(
'Safe minimum' )
307 eps = slamch(
'Precision' )
308 smlnum = safmin / eps
309 bignum = one / smlnum
310 rmin = sqrt( smlnum )
311 rmax = sqrt( bignum )
315 anrm = clanhp(
'M', uplo, n, ap, rwork )
317 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
320 ELSE IF( anrm.GT.rmax )
THEN
324 IF( iscale.EQ.1 )
THEN
325 CALL csscal( ( n*( n+1 ) ) / 2, sigma, ap, 1 )
334 llwrk = lwork - indwrk + 1
335 llrwk = lrwork - indrwk + 1
336 CALL chptrd( uplo, n, ap, w, rwork( inde ), work( indtau ),
342 IF( .NOT.wantz )
THEN
343 CALL ssterf( n, w, rwork( inde ), info )
345 CALL cstedc(
'I', n, w, rwork( inde ), z, ldz,
347 $ llwrk, rwork( indrwk ), llrwk, iwork, liwork,
349 CALL cupmtr(
'L', uplo,
'N', n, n, ap, work( indtau ), z,
351 $ work( indwrk ), iinfo )
356 IF( iscale.EQ.1 )
THEN
362 CALL sscal( imax, one / sigma, w, 1 )
365 work( 1 ) = sroundup_lwork(lwmin)
366 rwork( 1 ) = real( lrwmin )
subroutine chpevd(jobz, uplo, n, ap, w, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
CHPEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrice...
subroutine cstedc(compz, n, d, e, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
CSTEDC