192 SUBROUTINE chpevd( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK,
193 $ RWORK, LRWORK, IWORK, LIWORK, INFO )
201 INTEGER INFO, LDZ, LIWORK, LRWORK, LWORK, N
205 REAL RWORK( * ), W( * )
206 COMPLEX AP( * ), WORK( * ), Z( LDZ, * )
213 parameter( zero = 0.0e+0, one = 1.0e+0 )
215 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
218 LOGICAL LQUERY, WANTZ
219 INTEGER IINFO, IMAX, INDE, INDRWK, INDTAU, INDWRK,
220 $ iscale, liwmin, llrwk, llwrk, lrwmin, lwmin
221 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
226 REAL CLANHP, SLAMCH, SROUNDUP_LWORK
227 EXTERNAL lsame, clanhp, slamch, sroundup_lwork
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
271 work( 1 ) = sroundup_lwork(lwmin)
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(
'CHPEVD', -info )
287 ELSE IF( lquery )
THEN
297 w( 1 ) = real( ap( 1 ) )
305 safmin = slamch(
'Safe minimum' )
306 eps = slamch(
'Precision' )
307 smlnum = safmin / eps
308 bignum = one / smlnum
309 rmin = sqrt( smlnum )
310 rmax = sqrt( bignum )
314 anrm = clanhp(
'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 csscal( ( n*( n+1 ) ) / 2, sigma, ap, 1 )
333 llwrk = lwork - indwrk + 1
334 llrwk = lrwork - indrwk + 1
335 CALL chptrd( uplo, n, ap, w, rwork( inde ), work( indtau ),
341 IF( .NOT.wantz )
THEN
342 CALL ssterf( n, w, rwork( inde ), info )
344 CALL cstedc(
'I', n, w, rwork( inde ), z, ldz, work( indwrk ),
345 $ llwrk, rwork( indrwk ), llrwk, iwork, liwork,
347 CALL cupmtr(
'L', uplo,
'N', n, n, ap, work( indtau ), z, ldz,
348 $ work( indwrk ), iinfo )
353 IF( iscale.EQ.1 )
THEN
359 CALL sscal( imax, one / sigma, w, 1 )
362 work( 1 ) = sroundup_lwork(lwmin)
subroutine xerbla(srname, info)
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 chptrd(uplo, n, ap, d, e, tau, info)
CHPTRD
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine cstedc(compz, n, d, e, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
CSTEDC
subroutine ssterf(n, d, e, info)
SSTERF
subroutine cupmtr(side, uplo, trans, m, n, ap, tau, c, ldc, work, info)
CUPMTR