331 SUBROUTINE dsyevr( JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU,
332 $ abstol, m, w, z, ldz, isuppz, work, lwork,
333 $ iwork, liwork, info )
341 CHARACTER JOBZ, RANGE, UPLO
342 INTEGER IL, INFO, IU, LDA, LDZ, LIWORK, LWORK, M, N
343 DOUBLE PRECISION ABSTOL, VL, VU
346 INTEGER ISUPPZ( * ), IWORK( * )
347 DOUBLE PRECISION A( lda, * ), W( * ), WORK( * ), Z( ldz, * )
353 DOUBLE PRECISION ZERO, ONE, TWO
354 parameter ( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
357 LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, VALEIG, WANTZ,
360 INTEGER I, IEEEOK, IINFO, IMAX, INDD, INDDD, INDE,
361 $ indee, indibl, indifl, indisp, indiwo, indtau,
362 $ indwk, indwkn, iscale, j, jj, liwmin,
363 $ llwork, llwrkn, lwkopt, lwmin, nb, nsplit
364 DOUBLE PRECISION ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
365 $ sigma, smlnum, tmp1, vll, vuu
370 DOUBLE PRECISION DLAMCH, DLANSY
371 EXTERNAL lsame, ilaenv, dlamch, dlansy
378 INTRINSIC max, min, sqrt
384 ieeeok = ilaenv( 10,
'DSYEVR',
'N', 1, 2, 3, 4 )
386 lower = lsame( uplo,
'L' )
387 wantz = lsame( jobz,
'V' )
388 alleig = lsame( range,
'A' )
389 valeig = lsame( range,
'V' )
390 indeig = lsame( range,
'I' )
392 lquery = ( ( lwork.EQ.-1 ) .OR. ( liwork.EQ.-1 ) )
394 lwmin = max( 1, 26*n )
395 liwmin = max( 1, 10*n )
398 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
400 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
402 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
404 ELSE IF( n.LT.0 )
THEN
406 ELSE IF( lda.LT.max( 1, n ) )
THEN
410 IF( n.GT.0 .AND. vu.LE.vl )
412 ELSE IF( indeig )
THEN
413 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
415 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
421 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
423 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
425 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
431 nb = ilaenv( 1,
'DSYTRD', uplo, n, -1, -1, -1 )
432 nb = max( nb, ilaenv( 1,
'DORMTR', uplo, n, -1, -1, -1 ) )
433 lwkopt = max( ( nb+1 )*n, lwmin )
439 CALL xerbla(
'DSYEVR', -info )
441 ELSE IF( lquery )
THEN
455 IF( alleig .OR. indeig )
THEN
459 IF( vl.LT.a( 1, 1 ) .AND. vu.GE.a( 1, 1 ) )
THEN
474 safmin = dlamch(
'Safe minimum' )
475 eps = dlamch(
'Precision' )
476 smlnum = safmin / eps
477 bignum = one / smlnum
478 rmin = sqrt( smlnum )
479 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
489 anrm = dlansy(
'M', uplo, n, a, lda, work )
490 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
493 ELSE IF( anrm.GT.rmax )
THEN
497 IF( iscale.EQ.1 )
THEN
500 CALL dscal( n-j+1, sigma, a( j, j ), 1 )
504 CALL dscal( j, sigma, a( 1, j ), 1 )
508 $ abstll = abstol*sigma
535 llwork = lwork - indwk + 1
554 CALL dsytrd( uplo, n, a, lda, work( indd ), work( inde ),
555 $ work( indtau ), work( indwk ), llwork, iinfo )
560 IF( ( alleig .OR. ( indeig .AND. il.EQ.1 .AND. iu.EQ.n ) ) .AND.
562 IF( .NOT.wantz )
THEN
563 CALL dcopy( n, work( indd ), 1, w, 1 )
564 CALL dcopy( n-1, work( inde ), 1, work( indee ), 1 )
565 CALL dsterf( n, w, work( indee ), info )
567 CALL dcopy( n-1, work( inde ), 1, work( indee ), 1 )
568 CALL dcopy( n, work( indd ), 1, work( inddd ), 1 )
570 IF (abstol .LE. two*n*eps)
THEN
575 CALL dstemr( jobz,
'A', n, work( inddd ), work( indee ),
576 $ vl, vu, il, iu, m, w, z, ldz, n, isuppz,
577 $ tryrac, work( indwk ), lwork, iwork, liwork,
585 IF( wantz .AND. info.EQ.0 )
THEN
587 llwrkn = lwork - indwkn + 1
588 CALL dormtr(
'L', uplo,
'N', n, m, a, lda,
589 $ work( indtau ), z, ldz, work( indwkn ),
613 CALL dstebz( range, order, n, vll, vuu, il, iu, abstll,
614 $ work( indd ), work( inde ), m, nsplit, w,
615 $ iwork( indibl ), iwork( indisp ), work( indwk ),
616 $ iwork( indiwo ), info )
619 CALL dstein( n, work( indd ), work( inde ), m, w,
620 $ iwork( indibl ), iwork( indisp ), z, ldz,
621 $ work( indwk ), iwork( indiwo ), iwork( indifl ),
628 llwrkn = lwork - indwkn + 1
629 CALL dormtr(
'L', uplo,
'N', n, m, a, lda, work( indtau ), z,
630 $ ldz, work( indwkn ), llwrkn, iinfo )
637 IF( iscale.EQ.1 )
THEN
643 CALL dscal( imax, one / sigma, w, 1 )
656 IF( w( jj ).LT.tmp1 )
THEN
665 CALL dswap( n, z( 1, i ), 1, z( 1, j ), 1 )
subroutine dsterf(N, D, E, INFO)
DSTERF
subroutine dstebz(RANGE, ORDER, N, VL, VU, IL, IU, ABSTOL, D, E, M, NSPLIT, W, IBLOCK, ISPLIT, WORK, IWORK, INFO)
DSTEBZ
subroutine dcopy(N, DX, INCX, DY, INCY)
DCOPY
subroutine dsytrd(UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO)
DSYTRD
subroutine dsyevr(JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK, IWORK, LIWORK, INFO)
DSYEVR computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY matrices ...
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine dswap(N, DX, INCX, DY, INCY)
DSWAP
subroutine dormtr(SIDE, UPLO, TRANS, M, N, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
DORMTR
subroutine dscal(N, DA, DX, INCX)
DSCAL
subroutine dstemr(JOBZ, RANGE, N, D, E, VL, VU, IL, IU, M, W, Z, LDZ, NZC, ISUPPZ, TRYRAC, WORK, LWORK, IWORK, LIWORK, INFO)
DSTEMR
subroutine dstein(N, D, E, M, W, IBLOCK, ISPLIT, Z, LDZ, WORK, IWORK, IFAIL, INFO)
DSTEIN