379 $ IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK,
380 $ LWORK, IWORK, LIWORK, INFO )
389 CHARACTER JOBZ, RANGE, UPLO
390 INTEGER IL, INFO, IU, LDA, LDZ, LIWORK, LWORK, M, N
394 INTEGER ISUPPZ( * ), IWORK( * )
395 REAL A( LDA, * ), W( * ), WORK( * ), Z( LDZ, * )
402 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0, two = 2.0e+0 )
405 LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, VALEIG, WANTZ,
408 INTEGER I, IEEEOK, IINFO, IMAX, INDD, INDDD, INDE,
409 $ indee, indibl, indifl, indisp, indiwo, indtau,
410 $ indwk, indwkn, iscale, j, jj, liwmin,
411 $ llwork, llwrkn, lwmin, nsplit,
412 $ lhtrd, lwtrd, kd, ib, indhous
413 REAL ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
414 $ SIGMA, SMLNUM, TMP1, VLL, VUU
418 INTEGER ILAENV, ILAENV2STAGE
419 REAL SLAMCH, SLANSY, SROUNDUP_LWORK
420 EXTERNAL lsame, slamch, slansy, sroundup_lwork, ilaenv,
428 INTRINSIC max, min, sqrt
434 ieeeok = ilaenv( 10,
'SSYEVR',
'N', 1, 2, 3, 4 )
436 lower = lsame( uplo,
'L' )
437 wantz = lsame( jobz,
'V' )
438 alleig = lsame( range,
'A' )
439 valeig = lsame( range,
'V' )
440 indeig = lsame( range,
'I' )
442 lquery = ( ( lwork.EQ.-1 ) .OR. ( liwork.EQ.-1 ) )
444 kd = ilaenv2stage( 1,
'SSYTRD_2STAGE', jobz, n, -1, -1, -1 )
445 ib = ilaenv2stage( 2,
'SSYTRD_2STAGE', jobz, n, kd, -1, -1 )
446 lhtrd = ilaenv2stage( 3,
'SSYTRD_2STAGE', jobz, n, kd, ib, -1 )
447 lwtrd = ilaenv2stage( 4,
'SSYTRD_2STAGE', jobz, n, kd, ib, -1 )
448 lwmin = max( 26*n, 5*n + lhtrd + lwtrd )
449 liwmin = max( 1, 10*n )
452 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
454 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
456 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
458 ELSE IF( n.LT.0 )
THEN
460 ELSE IF( lda.LT.max( 1, n ) )
THEN
464 IF( n.GT.0 .AND. vu.LE.vl )
466 ELSE IF( indeig )
THEN
467 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
469 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
475 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
477 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
479 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
488 work( 1 ) = sroundup_lwork(lwmin)
493 CALL xerbla(
'SSYEVR_2STAGE', -info )
495 ELSE IF( lquery )
THEN
509 IF( alleig .OR. indeig )
THEN
513 IF( vl.LT.a( 1, 1 ) .AND. vu.GE.a( 1, 1 ) )
THEN
528 safmin = slamch(
'Safe minimum' )
529 eps = slamch(
'Precision' )
530 smlnum = safmin / eps
531 bignum = one / smlnum
532 rmin = sqrt( smlnum )
533 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
543 anrm = slansy(
'M', uplo, n, a, lda, work )
544 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
547 ELSE IF( anrm.GT.rmax )
THEN
551 IF( iscale.EQ.1 )
THEN
554 CALL sscal( n-j+1, sigma, a( j, j ), 1 )
558 CALL sscal( j, sigma, a( 1, j ), 1 )
562 $ abstll = abstol*sigma
590 indwk = indhous + lhtrd
591 llwork = lwork - indwk + 1
613 $ work( inde ), work( indtau ), work( indhous ),
614 $ lhtrd, work( indwk ), llwork, iinfo )
621 IF( il.EQ.1 .AND. iu.EQ.n )
THEN
625 IF( ( alleig.OR.test ) .AND. ( ieeeok.EQ.1 ) )
THEN
626 IF( .NOT.wantz )
THEN
627 CALL scopy( n, work( indd ), 1, w, 1 )
628 CALL scopy( n-1, work( inde ), 1, work( indee ), 1 )
629 CALL ssterf( n, w, work( indee ), info )
631 CALL scopy( n-1, work( inde ), 1, work( indee ), 1 )
632 CALL scopy( n, work( indd ), 1, work( inddd ), 1 )
634 IF (abstol .LE. two*n*eps)
THEN
639 CALL sstemr( jobz,
'A', n, work( inddd ), work( indee ),
640 $ vl, vu, il, iu, m, w, z, ldz, n, isuppz,
641 $ tryrac, work( indwk ), lwork, iwork, liwork,
649 IF( wantz .AND. info.EQ.0 )
THEN
651 llwrkn = lwork - indwkn + 1
652 CALL sormtr(
'L', uplo,
'N', n, m, a, lda,
653 $ work( indtau ), z, ldz, work( indwkn ),
677 CALL sstebz( range, order, n, vll, vuu, il, iu, abstll,
678 $ work( indd ), work( inde ), m, nsplit, w,
679 $ iwork( indibl ), iwork( indisp ), work( indwk ),
680 $ iwork( indiwo ), info )
683 CALL sstein( n, work( indd ), work( inde ), m, w,
684 $ iwork( indibl ), iwork( indisp ), z, ldz,
685 $ work( indwk ), iwork( indiwo ), iwork( indifl ),
692 llwrkn = lwork - indwkn + 1
693 CALL sormtr(
'L', uplo,
'N', n, m, a, lda, work( indtau ), z,
694 $ ldz, work( indwkn ), llwrkn, iinfo )
701 IF( iscale.EQ.1 )
THEN
707 CALL sscal( imax, one / sigma, w, 1 )
720 IF( w( jj ).LT.tmp1 )
THEN
729 CALL sswap( n, z( 1, i ), 1, z( 1, j ), 1 )
736 work( 1 ) = sroundup_lwork(lwmin)
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine ssyevr_2stage(jobz, range, uplo, n, a, lda, vl, vu, il, iu, abstol, m, w, z, ldz, isuppz, work, lwork, iwork, liwork, info)
SSYEVR_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY mat...
subroutine ssytrd_2stage(vect, uplo, n, a, lda, d, e, tau, hous2, lhous2, work, lwork, info)
SSYTRD_2STAGE
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sstebz(range, order, n, vl, vu, il, iu, abstol, d, e, m, nsplit, w, iblock, isplit, work, iwork, info)
SSTEBZ
subroutine sstein(n, d, e, m, w, iblock, isplit, z, ldz, work, iwork, ifail, info)
SSTEIN
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 ssterf(n, d, e, info)
SSTERF
subroutine sswap(n, sx, incx, sy, incy)
SSWAP
subroutine sormtr(side, uplo, trans, m, n, a, lda, tau, c, ldc, work, lwork, info)
SORMTR