183 SUBROUTINE dsyev_2stage( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK,
195 INTEGER INFO, LDA, LWORK, N
198 DOUBLE PRECISION A( lda, * ), W( * ), WORK( * )
204 DOUBLE PRECISION ZERO, ONE
205 parameter ( zero = 0.0d0, one = 1.0d0 )
208 LOGICAL LOWER, LQUERY, WANTZ
209 INTEGER IINFO, IMAX, INDE, INDTAU, INDWRK, ISCALE,
210 $ llwork, lwmin, lhtrd, lwtrd, kd, ib, indhous
211 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
217 DOUBLE PRECISION DLAMCH, DLANSY
218 EXTERNAL lsame, ilaenv, dlamch, dlansy
231 wantz = lsame( jobz,
'V' )
232 lower = lsame( uplo,
'L' )
233 lquery = ( lwork.EQ.-1 )
236 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
238 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
240 ELSE IF( n.LT.0 )
THEN
242 ELSE IF( lda.LT.max( 1, n ) )
THEN
247 kd = ilaenv( 17,
'DSYTRD_2STAGE', jobz, n, -1, -1, -1 )
248 ib = ilaenv( 18,
'DSYTRD_2STAGE', jobz, n, kd, -1, -1 )
249 lhtrd = ilaenv( 19,
'DSYTRD_2STAGE', jobz, n, kd, ib, -1 )
250 lwtrd = ilaenv( 20,
'DSYTRD_2STAGE', jobz, n, kd, ib, -1 )
251 lwmin = 2*n + lhtrd + lwtrd
254 IF( lwork.LT.lwmin .AND. .NOT.lquery )
259 CALL xerbla(
'DSYEV_2STAGE ', -info )
261 ELSE IF( lquery )
THEN
281 safmin = dlamch(
'Safe minimum' )
282 eps = dlamch(
'Precision' )
283 smlnum = safmin / eps
284 bignum = one / smlnum
285 rmin = sqrt( smlnum )
286 rmax = sqrt( bignum )
290 anrm = dlansy(
'M', uplo, n, a, lda, work )
292 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
295 ELSE IF( anrm.GT.rmax )
THEN
300 $
CALL dlascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
307 indwrk = indhous + lhtrd
308 llwork = lwork - indwrk + 1
311 $ work( indtau ), work( indhous ), lhtrd,
312 $ work( indwrk ), llwork, iinfo )
317 IF( .NOT.wantz )
THEN
318 CALL dsterf( n, w, work( inde ), info )
323 CALL dorgtr( uplo, n, a, lda, work( indtau ), work( indwrk ),
325 CALL dsteqr( jobz, n, w, work( inde ), a, lda, work( indtau ),
331 IF( iscale.EQ.1 )
THEN
337 CALL dscal( imax, one / sigma, w, 1 )
subroutine dsteqr(COMPZ, N, D, E, Z, LDZ, WORK, INFO)
DSTEQR
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.
subroutine dsterf(N, D, E, INFO)
DSTERF
subroutine dsyev_2stage(JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, INFO)
DSYEV_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY mat...
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine dscal(N, DA, DX, INCX)
DSCAL
subroutine dorgtr(UPLO, N, A, LDA, TAU, WORK, LWORK, INFO)
DORGTR
subroutine dsytrd_2stage(VECT, UPLO, N, A, LDA, D, E, TAU, HOUS2, LHOUS2, WORK, LWORK, INFO)
DSYTRD_2STAGE