344 SUBROUTINE dsyevr( JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL,
346 $ ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK,
347 $ IWORK, LIWORK, INFO )
354 CHARACTER JOBZ, RANGE, UPLO
355 INTEGER IL, INFO, IU, LDA, LDZ, LIWORK, LWORK, M, N
356 DOUBLE PRECISION ABSTOL, VL, VU
359 INTEGER ISUPPZ( * ), IWORK( * )
360 DOUBLE PRECISION A( LDA, * ), W( * ), WORK( * ), Z( LDZ, * )
366 DOUBLE PRECISION ZERO, ONE, TWO
367 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
370 LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, VALEIG, WANTZ,
373 INTEGER I, IEEEOK, IINFO, IMAX, INDD, INDDD, INDE,
374 $ INDEE, INDIBL, INDIFL, INDISP, INDIWO, INDTAU,
375 $ indwk, indwkn, iscale, j, jj, liwmin,
376 $ llwork, llwrkn, lwkopt, lwmin, nb, nsplit
377 DOUBLE PRECISION ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
378 $ SIGMA, SMLNUM, TMP1, VLL, VUU
383 DOUBLE PRECISION DLAMCH, DLANSY
384 EXTERNAL lsame, ilaenv, dlamch, dlansy
392 INTRINSIC max, min, sqrt
398 ieeeok = ilaenv( 10,
'DSYEVR',
'N', 1, 2, 3, 4 )
400 lower = lsame( uplo,
'L' )
401 wantz = lsame( jobz,
'V' )
402 alleig = lsame( range,
'A' )
403 valeig = lsame( range,
'V' )
404 indeig = lsame( range,
'I' )
406 lquery = ( ( lwork.EQ.-1 ) .OR. ( liwork.EQ.-1 ) )
417 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
419 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
421 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
423 ELSE IF( n.LT.0 )
THEN
425 ELSE IF( lda.LT.max( 1, n ) )
THEN
429 IF( n.GT.0 .AND. vu.LE.vl )
431 ELSE IF( indeig )
THEN
432 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
434 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
440 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
442 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
444 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
450 nb = ilaenv( 1,
'DSYTRD', uplo, n, -1, -1, -1 )
451 nb = max( nb, ilaenv( 1,
'DORMTR', uplo, n, -1, -1, -1 ) )
452 lwkopt = max( ( nb+1 )*n, lwmin )
458 CALL xerbla(
'DSYEVR', -info )
460 ELSE IF( lquery )
THEN
474 IF( alleig .OR. indeig )
THEN
478 IF( vl.LT.a( 1, 1 ) .AND. vu.GE.a( 1, 1 ) )
THEN
493 safmin = dlamch(
'Safe minimum' )
494 eps = dlamch(
'Precision' )
495 smlnum = safmin / eps
496 bignum = one / smlnum
497 rmin = sqrt( smlnum )
498 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
508 anrm = dlansy(
'M', uplo, n, a, lda, work )
509 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
512 ELSE IF( anrm.GT.rmax )
THEN
516 IF( iscale.EQ.1 )
THEN
519 CALL dscal( n-j+1, sigma, a( j, j ), 1 )
523 CALL dscal( j, sigma, a( 1, j ), 1 )
527 $ abstll = abstol*sigma
554 llwork = lwork - indwk + 1
573 CALL dsytrd( uplo, n, a, lda, work( indd ), work( inde ),
574 $ work( indtau ), work( indwk ), llwork, iinfo )
579 IF( ( alleig .OR. ( indeig .AND. il.EQ.1 .AND. iu.EQ.n ) ) .AND.
581 IF( .NOT.wantz )
THEN
582 CALL dcopy( n, work( indd ), 1, w, 1 )
583 CALL dcopy( n-1, work( inde ), 1, work( indee ), 1 )
584 CALL dsterf( n, w, work( indee ), info )
586 CALL dcopy( n-1, work( inde ), 1, work( indee ), 1 )
587 CALL dcopy( n, work( indd ), 1, work( inddd ), 1 )
589 IF (abstol .LE. two*n*eps)
THEN
594 CALL dstemr( jobz,
'A', n, work( inddd ), work( indee ),
595 $ vl, vu, il, iu, m, w, z, ldz, n, isuppz,
596 $ tryrac, work( indwk ), lwork, iwork, liwork,
604 IF( wantz .AND. info.EQ.0 )
THEN
606 llwrkn = lwork - indwkn + 1
607 CALL dormtr(
'L', uplo,
'N', n, m, a, lda,
608 $ work( indtau ), z, ldz, work( indwkn ),
632 CALL dstebz( range, order, n, vll, vuu, il, iu, abstll,
633 $ work( indd ), work( inde ), m, nsplit, w,
634 $ iwork( indibl ), iwork( indisp ), work( indwk ),
635 $ iwork( indiwo ), info )
638 CALL dstein( n, work( indd ), work( inde ), m, w,
639 $ iwork( indibl ), iwork( indisp ), z, ldz,
640 $ work( indwk ), iwork( indiwo ), iwork( indifl ),
647 llwrkn = lwork - indwkn + 1
648 CALL dormtr(
'L', uplo,
'N', n, m, a, lda, work( indtau ),
650 $ ldz, work( indwkn ), llwrkn, iinfo )
657 IF( iscale.EQ.1 )
THEN
663 CALL dscal( imax, one / sigma, w, 1 )
676 IF( w( jj ).LT.tmp1 )
THEN
685 CALL dswap( n, z( 1, i ), 1, z( 1, j ), 1 )