220 $ IWORK, LIWORK, INFO )
230 INTEGER INFO, LDA, LIWORK, LWORK, N
234 DOUBLE PRECISION A( LDA, * ), W( * ), WORK( * )
240 DOUBLE PRECISION ZERO, ONE
241 parameter( zero = 0.0d+0, one = 1.0d+0 )
245 LOGICAL LOWER, LQUERY, WANTZ
246 INTEGER IINFO, INDE, INDTAU, INDWK2, INDWRK, ISCALE,
247 $ liwmin, llwork, llwrk2, lwmin,
248 $ lhtrd, lwtrd, kd, ib, indhous
249 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
255 DOUBLE PRECISION DLAMCH, DLANSY
256 EXTERNAL lsame, dlamch, dlansy, ilaenv2stage
269 wantz = lsame( jobz,
'V' )
270 lower = lsame( uplo,
'L' )
271 lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
274 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
276 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
278 ELSE IF( n.LT.0 )
THEN
280 ELSE IF( lda.LT.max( 1, n ) )
THEN
289 kd = ilaenv2stage( 1,
'DSYTRD_2STAGE', jobz,
291 ib = ilaenv2stage( 2,
'DSYTRD_2STAGE', jobz,
293 lhtrd = ilaenv2stage( 3,
'DSYTRD_2STAGE', jobz,
295 lwtrd = ilaenv2stage( 4,
'DSYTRD_2STAGE', jobz,
299 lwmin = 1 + 6*n + 2*n**2
302 lwmin = 2*n + 1 + lhtrd + lwtrd
308 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
310 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
316 CALL xerbla(
'DSYEVD_2STAGE', -info )
318 ELSE IF( lquery )
THEN
336 safmin = dlamch(
'Safe minimum' )
337 eps = dlamch(
'Precision' )
338 smlnum = safmin / eps
339 bignum = one / smlnum
340 rmin = sqrt( smlnum )
341 rmax = sqrt( bignum )
345 anrm = dlansy(
'M', uplo, n, a, lda, work )
347 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
350 ELSE IF( anrm.GT.rmax )
THEN
355 $
CALL dlascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
362 indwrk = indhous + lhtrd
363 llwork = lwork - indwrk + 1
364 indwk2 = indwrk + n*n
365 llwrk2 = lwork - indwk2 + 1
368 $ work( indtau ), work( indhous ), lhtrd,
369 $ work( indwrk ), llwork, iinfo )
376 IF( .NOT.wantz )
THEN
377 CALL dsterf( n, w, work( inde ), info )
382 CALL dstedc(
'I', n, w, work( inde ), work( indwrk ), n,
383 $ work( indwk2 ), llwrk2, iwork, liwork, info )
384 CALL dormtr(
'L', uplo,
'N', n, n, a, lda, work( indtau ),
385 $ work( indwrk ), n, work( indwk2 ), llwrk2, iinfo )
386 CALL dlacpy(
'A', n, n, work( indwrk ), n, a, lda )
392 $
CALL dscal( n, one / sigma, w, 1 )
subroutine xerbla(srname, info)
subroutine dsyevd_2stage(jobz, uplo, n, a, lda, w, work, lwork, iwork, liwork, info)
DSYEVD_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY mat...
subroutine dsytrd_2stage(vect, uplo, n, a, lda, d, e, tau, hous2, lhous2, work, lwork, info)
DSYTRD_2STAGE
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
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 dscal(n, da, dx, incx)
DSCAL
subroutine dstedc(compz, n, d, e, z, ldz, work, lwork, iwork, liwork, info)
DSTEDC
subroutine dsterf(n, d, e, info)
DSTERF
subroutine dormtr(side, uplo, trans, m, n, a, lda, tau, c, ldc, work, lwork, info)
DORMTR