140 SUBROUTINE cheev( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK,
150 INTEGER INFO, LDA, LWORK, N
153 REAL RWORK( * ), W( * )
154 COMPLEX A( lda, * ), WORK( * )
161 parameter ( zero = 0.0e0, one = 1.0e0 )
163 parameter ( cone = ( 1.0e0, 0.0e0 ) )
166 LOGICAL LOWER, LQUERY, WANTZ
167 INTEGER IINFO, IMAX, INDE, INDTAU, INDWRK, ISCALE,
169 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
176 EXTERNAL ilaenv, lsame, clanhe, slamch
189 wantz = lsame( jobz,
'V' )
190 lower = lsame( uplo,
'L' )
191 lquery = ( lwork.EQ.-1 )
194 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
196 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
198 ELSE IF( n.LT.0 )
THEN
200 ELSE IF( lda.LT.max( 1, n ) )
THEN
205 nb = ilaenv( 1,
'CHETRD', uplo, n, -1, -1, -1 )
206 lwkopt = max( 1, ( nb+1 )*n )
209 IF( lwork.LT.max( 1, 2*n-1 ) .AND. .NOT.lquery )
214 CALL xerbla(
'CHEEV ', -info )
216 ELSE IF( lquery )
THEN
236 safmin = slamch(
'Safe minimum' )
237 eps = slamch(
'Precision' )
238 smlnum = safmin / eps
239 bignum = one / smlnum
240 rmin = sqrt( smlnum )
241 rmax = sqrt( bignum )
245 anrm = clanhe(
'M', uplo, n, a, lda, rwork )
247 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
250 ELSE IF( anrm.GT.rmax )
THEN
255 $
CALL clascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
262 llwork = lwork - indwrk + 1
263 CALL chetrd( uplo, n, a, lda, w, rwork( inde ), work( indtau ),
264 $ work( indwrk ), llwork, iinfo )
269 IF( .NOT.wantz )
THEN
270 CALL ssterf( n, w, rwork( inde ), info )
272 CALL cungtr( uplo, n, a, lda, work( indtau ), work( indwrk ),
275 CALL csteqr( jobz, n, w, rwork( inde ), a, lda,
276 $ rwork( indwrk ), info )
281 IF( iscale.EQ.1 )
THEN
287 CALL sscal( imax, one / sigma, w, 1 )
subroutine clascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
CLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine cheev(JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK, INFO)
CHEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices ...
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine csteqr(COMPZ, N, D, E, Z, LDZ, WORK, INFO)
CSTEQR
subroutine chetrd(UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO)
CHETRD
subroutine sscal(N, SA, SX, INCX)
SSCAL
subroutine cungtr(UPLO, N, A, LDA, TAU, WORK, LWORK, INFO)
CUNGTR
subroutine ssterf(N, D, E, INFO)
SSTERF