129 SUBROUTINE dsyev( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, INFO )
137 INTEGER INFO, LDA, LWORK, N
140 DOUBLE PRECISION A( LDA, * ), W( * ), WORK( * )
146 DOUBLE PRECISION ZERO, ONE
147 parameter( zero = 0.0d0, one = 1.0d0 )
150 LOGICAL LOWER, LQUERY, WANTZ
151 INTEGER IINFO, IMAX, INDE, INDTAU, INDWRK, ISCALE,
153 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
159 DOUBLE PRECISION DLAMCH, DLANSY
160 EXTERNAL lsame, ilaenv, dlamch, dlansy
174 wantz = lsame( jobz,
'V' )
175 lower = lsame( uplo,
'L' )
176 lquery = ( lwork.EQ.-1 )
179 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
181 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
183 ELSE IF( n.LT.0 )
THEN
185 ELSE IF( lda.LT.max( 1, n ) )
THEN
190 nb = ilaenv( 1,
'DSYTRD', uplo, n, -1, -1, -1 )
191 lwkopt = max( 1, ( nb+2 )*n )
194 IF( lwork.LT.max( 1, 3*n-1 ) .AND. .NOT.lquery )
199 CALL xerbla(
'DSYEV ', -info )
201 ELSE IF( lquery )
THEN
221 safmin = dlamch(
'Safe minimum' )
222 eps = dlamch(
'Precision' )
223 smlnum = safmin / eps
224 bignum = one / smlnum
225 rmin = sqrt( smlnum )
226 rmax = sqrt( bignum )
230 anrm = dlansy(
'M', uplo, n, a, lda, work )
232 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
235 ELSE IF( anrm.GT.rmax )
THEN
240 $
CALL dlascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
247 llwork = lwork - indwrk + 1
248 CALL dsytrd( uplo, n, a, lda, w, work( inde ), work( indtau ),
249 $ work( indwrk ), llwork, iinfo )
254 IF( .NOT.wantz )
THEN
255 CALL dsterf( n, w, work( inde ), info )
257 CALL dorgtr( uplo, n, a, lda, work( indtau ),
260 CALL dsteqr( jobz, n, w, work( inde ), a, lda,
267 IF( iscale.EQ.1 )
THEN
273 CALL dscal( imax, one / sigma, w, 1 )
subroutine dsyev(jobz, uplo, n, a, lda, w, work, lwork, info)
DSYEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY matrices
subroutine dsytrd(uplo, n, a, lda, d, e, tau, work, lwork, info)
DSYTRD
subroutine dlascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
DLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.