298 $ IL, IU, ABSTOL, M, W, Z, LDZ, WORK,
299 $ LWORK, IWORK, IFAIL, INFO )
308 CHARACTER JOBZ, RANGE, UPLO
309 INTEGER IL, INFO, IU, LDA, LDZ, LWORK, M, N
310 DOUBLE PRECISION ABSTOL, VL, VU
313 INTEGER IFAIL( * ), IWORK( * )
314 DOUBLE PRECISION A( LDA, * ), W( * ), WORK( * ), Z( LDZ, * )
320 DOUBLE PRECISION ZERO, ONE
321 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
324 LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, TEST, VALEIG,
327 INTEGER I, IINFO, IMAX, INDD, INDE, INDEE, INDIBL,
328 $ indisp, indiwo, indtau, indwkn, indwrk, iscale,
329 $ itmp1, j, jj, llwork, llwrkn,
330 $ nsplit, lwmin, lhtrd, lwtrd, kd, ib, indhous
331 DOUBLE PRECISION ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
332 $ SIGMA, SMLNUM, TMP1, VLL, VUU
337 DOUBLE PRECISION DLAMCH, DLANSY
338 EXTERNAL lsame, dlamch, dlansy, ilaenv2stage
346 INTRINSIC max, min, sqrt
352 lower = lsame( uplo,
'L' )
353 wantz = lsame( jobz,
'V' )
354 alleig = lsame( range,
'A' )
355 valeig = lsame( range,
'V' )
356 indeig = lsame( range,
'I' )
357 lquery = ( lwork.EQ.-1 )
360 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
362 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
364 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
366 ELSE IF( n.LT.0 )
THEN
368 ELSE IF( lda.LT.max( 1, n ) )
THEN
372 IF( n.GT.0 .AND. vu.LE.vl )
374 ELSE IF( indeig )
THEN
375 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
377 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
383 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
393 kd = ilaenv2stage( 1,
'DSYTRD_2STAGE', jobz,
395 ib = ilaenv2stage( 2,
'DSYTRD_2STAGE', jobz,
397 lhtrd = ilaenv2stage( 3,
'DSYTRD_2STAGE', jobz,
399 lwtrd = ilaenv2stage( 4,
'DSYTRD_2STAGE', jobz,
401 lwmin = max( 8*n, 3*n + lhtrd + lwtrd )
405 IF( lwork.LT.lwmin .AND. .NOT.lquery )
410 CALL xerbla(
'DSYEVX_2STAGE', -info )
412 ELSE IF( lquery )
THEN
424 IF( alleig .OR. indeig )
THEN
428 IF( vl.LT.a( 1, 1 ) .AND. vu.GE.a( 1, 1 ) )
THEN
440 safmin = dlamch(
'Safe minimum' )
441 eps = dlamch(
'Precision' )
442 smlnum = safmin / eps
443 bignum = one / smlnum
444 rmin = sqrt( smlnum )
445 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
455 anrm = dlansy(
'M', uplo, n, a, lda, work )
456 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
459 ELSE IF( anrm.GT.rmax )
THEN
463 IF( iscale.EQ.1 )
THEN
466 CALL dscal( n-j+1, sigma, a( j, j ), 1 )
470 CALL dscal( j, sigma, a( 1, j ), 1 )
474 $ abstll = abstol*sigma
487 indwrk = indhous + lhtrd
488 llwork = lwork - indwrk + 1
491 $ work( inde ), work( indtau ), work( indhous ),
492 $ lhtrd, work( indwrk ), llwork, iinfo )
500 IF( il.EQ.1 .AND. iu.EQ.n )
THEN
504 IF( ( alleig .OR. test ) .AND. ( abstol.LE.zero ) )
THEN
505 CALL dcopy( n, work( indd ), 1, w, 1 )
507 IF( .NOT.wantz )
THEN
508 CALL dcopy( n-1, work( inde ), 1, work( indee ), 1 )
509 CALL dsterf( n, w, work( indee ), info )
511 CALL dlacpy(
'A', n, n, a, lda, z, ldz )
512 CALL dorgtr( uplo, n, z, ldz, work( indtau ),
513 $ work( indwrk ), llwork, iinfo )
514 CALL dcopy( n-1, work( inde ), 1, work( indee ), 1 )
515 CALL dsteqr( jobz, n, w, work( indee ), z, ldz,
516 $ work( indwrk ), info )
540 CALL dstebz( range, order, n, vll, vuu, il, iu, abstll,
541 $ work( indd ), work( inde ), m, nsplit, w,
542 $ iwork( indibl ), iwork( indisp ), work( indwrk ),
543 $ iwork( indiwo ), info )
546 CALL dstein( n, work( indd ), work( inde ), m, w,
547 $ iwork( indibl ), iwork( indisp ), z, ldz,
548 $ work( indwrk ), iwork( indiwo ), ifail, info )
554 llwrkn = lwork - indwkn + 1
555 CALL dormtr(
'L', uplo,
'N', n, m, a, lda, work( indtau ), z,
556 $ ldz, work( indwkn ), llwrkn, iinfo )
562 IF( iscale.EQ.1 )
THEN
568 CALL dscal( imax, one / sigma, w, 1 )
579 IF( w( jj ).LT.tmp1 )
THEN
586 itmp1 = iwork( indibl+i-1 )
588 iwork( indibl+i-1 ) = iwork( indibl+j-1 )
590 iwork( indibl+j-1 ) = itmp1
591 CALL dswap( n, z( 1, i ), 1, z( 1, j ), 1 )
594 ifail( i ) = ifail( j )
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dsyevx_2stage(jobz, range, uplo, n, a, lda, vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, iwork, ifail, info)
DSYEVX_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 dscal(n, da, dx, incx)
DSCAL
subroutine dstebz(range, order, n, vl, vu, il, iu, abstol, d, e, m, nsplit, w, iblock, isplit, work, iwork, info)
DSTEBZ
subroutine dstein(n, d, e, m, w, iblock, isplit, z, ldz, work, iwork, ifail, info)
DSTEIN
subroutine dsteqr(compz, n, d, e, z, ldz, work, info)
DSTEQR
subroutine dsterf(n, d, e, info)
DSTERF
subroutine dswap(n, dx, incx, dy, incy)
DSWAP
subroutine dorgtr(uplo, n, a, lda, tau, work, lwork, info)
DORGTR
subroutine dormtr(side, uplo, trans, m, n, a, lda, tau, c, ldc, work, lwork, info)
DORMTR