138 SUBROUTINE cheev( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK,
147 INTEGER INFO, LDA, LWORK, N
150 REAL RWORK( * ), W( * )
151 COMPLEX A( LDA, * ), WORK( * )
158 parameter( zero = 0.0e0, one = 1.0e0 )
160 parameter( cone = ( 1.0e0, 0.0e0 ) )
163 LOGICAL LOWER, LQUERY, WANTZ
164 INTEGER IINFO, IMAX, INDE, INDTAU, INDWRK, ISCALE,
166 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
172 REAL CLANHE, SLAMCH, SROUNDUP_LWORK
173 EXTERNAL ilaenv, lsame, clanhe, slamch, sroundup_lwork
186 wantz = lsame( jobz,
'V' )
187 lower = lsame( uplo,
'L' )
188 lquery = ( lwork.EQ.-1 )
191 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
193 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
195 ELSE IF( n.LT.0 )
THEN
197 ELSE IF( lda.LT.max( 1, n ) )
THEN
202 nb = ilaenv( 1,
'CHETRD', uplo, n, -1, -1, -1 )
203 lwkopt = max( 1, ( nb+1 )*n )
204 work( 1 ) = sroundup_lwork(lwkopt)
206 IF( lwork.LT.max( 1, 2*n-1 ) .AND. .NOT.lquery )
211 CALL xerbla(
'CHEEV ', -info )
213 ELSE IF( lquery )
THEN
224 w( 1 ) = real( a( 1, 1 ) )
233 safmin = slamch(
'Safe minimum' )
234 eps = slamch(
'Precision' )
235 smlnum = safmin / eps
236 bignum = one / smlnum
237 rmin = sqrt( smlnum )
238 rmax = sqrt( bignum )
242 anrm = clanhe(
'M', uplo, n, a, lda, rwork )
244 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
247 ELSE IF( anrm.GT.rmax )
THEN
252 $
CALL clascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
259 llwork = lwork - indwrk + 1
260 CALL chetrd( uplo, n, a, lda, w, rwork( inde ), work( indtau ),
261 $ work( indwrk ), llwork, iinfo )
266 IF( .NOT.wantz )
THEN
267 CALL ssterf( n, w, rwork( inde ), info )
269 CALL cungtr( uplo, n, a, lda, work( indtau ), work( indwrk ),
272 CALL csteqr( jobz, n, w, rwork( inde ), a, lda,
273 $ rwork( indwrk ), info )
278 IF( iscale.EQ.1 )
THEN
284 CALL sscal( imax, one / sigma, w, 1 )
289 work( 1 ) = sroundup_lwork(lwkopt)
subroutine xerbla(srname, info)
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 chetrd(uplo, n, a, lda, d, e, tau, work, lwork, info)
CHETRD
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 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 cungtr(uplo, n, a, lda, tau, work, lwork, info)
CUNGTR