333 SUBROUTINE ssyevr( JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU,
334 $ abstol, m, w, z, ldz, isuppz, work, lwork,
335 $ iwork, liwork, info )
343 CHARACTER JOBZ, RANGE, UPLO
344 INTEGER IL, INFO, IU, LDA, LDZ, LIWORK, LWORK, M, N
348 INTEGER ISUPPZ( * ), IWORK( * )
349 REAL A( lda, * ), W( * ), WORK( * ), Z( ldz, * )
356 parameter ( zero = 0.0e+0, one = 1.0e+0, two = 2.0e+0 )
359 LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, TEST, VALEIG,
362 INTEGER I, IEEEOK, IINFO, IMAX, INDD, INDDD, INDE,
363 $ indee, indibl, indifl, indisp, indiwo, indtau,
364 $ indwk, indwkn, iscale, j, jj, liwmin,
365 $ llwork, llwrkn, lwkopt, lwmin, nb, nsplit
366 REAL ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
367 $ sigma, smlnum, tmp1, vll, vuu
373 EXTERNAL lsame, ilaenv, slamch, slansy
380 INTRINSIC max, min, sqrt
386 ieeeok = ilaenv( 10,
'SSYEVR',
'N', 1, 2, 3, 4 )
388 lower = lsame( uplo,
'L' )
389 wantz = lsame( jobz,
'V' )
390 alleig = lsame( range,
'A' )
391 valeig = lsame( range,
'V' )
392 indeig = lsame( range,
'I' )
394 lquery = ( ( lwork.EQ.-1 ) .OR. ( liwork.EQ.-1 ) )
396 lwmin = max( 1, 26*n )
397 liwmin = max( 1, 10*n )
400 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
402 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
404 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
406 ELSE IF( n.LT.0 )
THEN
408 ELSE IF( lda.LT.max( 1, n ) )
THEN
412 IF( n.GT.0 .AND. vu.LE.vl )
414 ELSE IF( indeig )
THEN
415 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
417 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
423 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
429 nb = ilaenv( 1,
'SSYTRD', uplo, n, -1, -1, -1 )
430 nb = max( nb, ilaenv( 1,
'SORMTR', uplo, n, -1, -1, -1 ) )
431 lwkopt = max( ( nb+1 )*n, lwmin )
435 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
437 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
443 CALL xerbla(
'SSYEVR', -info )
445 ELSE IF( lquery )
THEN
459 IF( alleig .OR. indeig )
THEN
463 IF( vl.LT.a( 1, 1 ) .AND. vu.GE.a( 1, 1 ) )
THEN
478 safmin = slamch(
'Safe minimum' )
479 eps = slamch(
'Precision' )
480 smlnum = safmin / eps
481 bignum = one / smlnum
482 rmin = sqrt( smlnum )
483 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
493 anrm = slansy(
'M', uplo, n, a, lda, work )
494 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
497 ELSE IF( anrm.GT.rmax )
THEN
501 IF( iscale.EQ.1 )
THEN
504 CALL sscal( n-j+1, sigma, a( j, j ), 1 )
508 CALL sscal( j, sigma, a( 1, j ), 1 )
512 $ abstll = abstol*sigma
539 llwork = lwork - indwk + 1
558 CALL ssytrd( uplo, n, a, lda, work( indd ), work( inde ),
559 $ work( indtau ), work( indwk ), llwork, iinfo )
566 IF( il.EQ.1 .AND. iu.EQ.n )
THEN
570 IF( ( alleig.OR.test ) .AND. ( ieeeok.EQ.1 ) )
THEN
571 IF( .NOT.wantz )
THEN
572 CALL scopy( n, work( indd ), 1, w, 1 )
573 CALL scopy( n-1, work( inde ), 1, work( indee ), 1 )
574 CALL ssterf( n, w, work( indee ), info )
576 CALL scopy( n-1, work( inde ), 1, work( indee ), 1 )
577 CALL scopy( n, work( indd ), 1, work( inddd ), 1 )
579 IF (abstol .LE. two*n*eps)
THEN
584 CALL sstemr( jobz,
'A', n, work( inddd ), work( indee ),
585 $ vl, vu, il, iu, m, w, z, ldz, n, isuppz,
586 $ tryrac, work( indwk ), lwork, iwork, liwork,
594 IF( wantz .AND. info.EQ.0 )
THEN
596 llwrkn = lwork - indwkn + 1
597 CALL sormtr(
'L', uplo,
'N', n, m, a, lda,
598 $ work( indtau ), z, ldz, work( indwkn ),
622 CALL sstebz( range, order, n, vll, vuu, il, iu, abstll,
623 $ work( indd ), work( inde ), m, nsplit, w,
624 $ iwork( indibl ), iwork( indisp ), work( indwk ),
625 $ iwork( indiwo ), info )
628 CALL sstein( n, work( indd ), work( inde ), m, w,
629 $ iwork( indibl ), iwork( indisp ), z, ldz,
630 $ work( indwk ), iwork( indiwo ), iwork( indifl ),
637 llwrkn = lwork - indwkn + 1
638 CALL sormtr(
'L', uplo,
'N', n, m, a, lda, work( indtau ), z,
639 $ ldz, work( indwkn ), llwrkn, iinfo )
646 IF( iscale.EQ.1 )
THEN
652 CALL sscal( imax, one / sigma, w, 1 )
665 IF( w( jj ).LT.tmp1 )
THEN
674 CALL sswap( n, z( 1, i ), 1, z( 1, j ), 1 )
subroutine sstebz(RANGE, ORDER, N, VL, VU, IL, IU, ABSTOL, D, E, M, NSPLIT, W, IBLOCK, ISPLIT, WORK, IWORK, INFO)
SSTEBZ
subroutine ssyevr(JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK, IWORK, LIWORK, INFO)
SSYEVR computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY matrices ...
subroutine sstein(N, D, E, M, W, IBLOCK, ISPLIT, Z, LDZ, WORK, IWORK, IFAIL, INFO)
SSTEIN
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine ssytrd(UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO)
SSYTRD
subroutine sscal(N, SA, SX, INCX)
SSCAL
subroutine sswap(N, SX, INCX, SY, INCY)
SSWAP
subroutine ssterf(N, D, E, INFO)
SSTERF
subroutine sstemr(JOBZ, RANGE, N, D, E, VL, VU, IL, IU, M, W, Z, LDZ, NZC, ISUPPZ, TRYRAC, WORK, LWORK, IWORK, LIWORK, INFO)
SSTEMR
subroutine sormtr(SIDE, UPLO, TRANS, M, N, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
SORMTR
subroutine scopy(N, SX, INCX, SY, INCY)
SCOPY