136 SUBROUTINE chpev( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, RWORK,
148 REAL RWORK( * ), W( * )
149 COMPLEX AP( * ), WORK( * ), Z( LDZ, * )
156 parameter( zero = 0.0e0, one = 1.0e0 )
160 INTEGER IINFO, IMAX, INDE, INDRWK, INDTAU, INDWRK,
162 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
168 EXTERNAL lsame, clanhp, slamch
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(
'CHPEV ', -info )
206 w( 1 ) = real( ap( 1 ) )
215 safmin = slamch(
'Safe minimum' )
216 eps = slamch(
'Precision' )
217 smlnum = safmin / eps
218 bignum = one / smlnum
219 rmin = sqrt( smlnum )
220 rmax = sqrt( bignum )
224 anrm = clanhp(
'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 csscal( ( n*( n+1 ) ) / 2, sigma, ap, 1 )
241 CALL chptrd( uplo, n, ap, w, rwork( inde ), work( indtau ),
247 IF( .NOT.wantz )
THEN
248 CALL ssterf( n, w, rwork( inde ), info )
251 CALL cupgtr( uplo, n, ap, work( indtau ), z, ldz,
252 $ work( indwrk ), iinfo )
254 CALL csteqr( jobz, n, w, rwork( inde ), z, ldz,
255 $ rwork( indrwk ), info )
260 IF( iscale.EQ.1 )
THEN
266 CALL sscal( imax, one / sigma, w, 1 )
subroutine xerbla(srname, info)
subroutine chpev(jobz, uplo, n, ap, w, z, ldz, work, rwork, info)
CHPEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices
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 csteqr(compz, n, d, e, z, ldz, work, info)
CSTEQR
subroutine ssterf(n, d, e, info)
SSTERF
subroutine cupgtr(uplo, n, ap, tau, q, ldq, work, info)
CUPGTR