LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zheevr()

subroutine zheevr ( character jobz,
character range,
character uplo,
integer n,
complex*16, dimension( lda, * ) a,
integer lda,
double precision vl,
double precision vu,
integer il,
integer iu,
double precision abstol,
integer m,
double precision, dimension( * ) w,
complex*16, dimension( ldz, * ) z,
integer ldz,
integer, dimension( * ) isuppz,
complex*16, dimension( * ) work,
integer lwork,
double precision, dimension( * ) rwork,
integer lrwork,
integer, dimension( * ) iwork,
integer liwork,
integer info )

ZHEEVR computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices

Download ZHEEVR + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZHEEVR computes selected eigenvalues and, optionally, eigenvectors
!> of a complex Hermitian matrix A. Eigenvalues and eigenvectors can be
!> selected by specifying either a range of values or a range of indices
!> for the desired eigenvalues. Invocations with different choices for
!> these parameters may result in the computation of slightly different
!> eigenvalues and/or eigenvectors for the same matrix. The reason for
!> this behavior is that there exists a variety of algorithms (each
!> performing best for a particular set of options) with ZHEEVR
!> attempting to select the best based on the various parameters. In all
!> cases, the computed values are accurate within the limits of finite
!> precision arithmetic.
!>
!> ZHEEVR first reduces the matrix A to tridiagonal form T with a call
!> to ZHETRD.  Then, whenever possible, ZHEEVR calls ZSTEMR to compute
!> eigenspectrum using Relatively Robust Representations.  ZSTEMR
!> computes eigenvalues by the dqds algorithm, while orthogonal
!> eigenvectors are computed from various  L D L^T representations
!> (also known as Relatively Robust Representations). Gram-Schmidt
!> orthogonalization is avoided as far as possible. More specifically,
!> the various steps of the algorithm are as follows.
!>
!> For each unreduced block (submatrix) of T,
!>    (a) Compute T - sigma I  = L D L^T, so that L and D
!>        define all the wanted eigenvalues to high relative accuracy.
!>        This means that small relative changes in the entries of D and L
!>        cause only small relative changes in the eigenvalues and
!>        eigenvectors. The standard (unfactored) representation of the
!>        tridiagonal matrix T does not have this property in general.
!>    (b) Compute the eigenvalues to suitable accuracy.
!>        If the eigenvectors are desired, the algorithm attains full
!>        accuracy of the computed eigenvalues only right before
!>        the corresponding vectors have to be computed, see steps c) and d).
!>    (c) For each cluster of close eigenvalues, select a new
!>        shift close to the cluster, find a new factorization, and refine
!>        the shifted eigenvalues to suitable accuracy.
!>    (d) For each eigenvalue with a large enough relative separation compute
!>        the corresponding eigenvector by forming a rank revealing twisted
!>        factorization. Go back to (c) for any clusters that remain.
!>
!> The desired accuracy of the output can be specified by the input
!> parameter ABSTOL.
!>
!> For more details, see ZSTEMR's documentation and:
!> - Inderjit S. Dhillon and Beresford N. Parlett: 
!>   Linear Algebra and its Applications, 387(1), pp. 1-28, August 2004.
!> - Inderjit Dhillon and Beresford Parlett:  SIAM Journal on Matrix Analysis and Applications, Vol. 25,
!>   2004.  Also LAPACK Working Note 154.
!> - Inderjit Dhillon: ,
!>   Computer Science Division Technical Report No. UCB/CSD-97-971,
!>   UC Berkeley, May 1997.
!>
!>
!> Note 1 : ZHEEVR calls ZSTEMR when the full spectrum is requested
!> on machines which conform to the ieee-754 floating point standard.
!> ZHEEVR calls DSTEBZ and ZSTEIN on non-ieee machines and
!> when partial spectrum requests are made.
!>
!> Normal execution of ZSTEMR may create NaNs and infinities and
!> hence may abort due to a floating point exception in environments
!> which do not handle NaNs and infinities in the ieee standard default
!> manner.
!> 
Parameters
[in]JOBZ
!>          JOBZ is CHARACTER*1
!>          = 'N':  Compute eigenvalues only;
!>          = 'V':  Compute eigenvalues and eigenvectors.
!>
!>          This parameter influences the choice of the algorithm and
!>          may alter the computed values.
!> 
[in]RANGE
!>          RANGE is CHARACTER*1
!>          = 'A': all eigenvalues will be found.
!>          = 'V': all eigenvalues in the half-open interval (VL,VU]
!>                 will be found.
!>          = 'I': the IL-th through IU-th eigenvalues will be found.
!>          For RANGE = 'V' or 'I' and IU - IL < N - 1, DSTEBZ and
!>          ZSTEIN are called
!>
!>          This parameter influences the choice of the algorithm and
!>          may alter the computed values.
!> 
[in]UPLO
!>          UPLO is CHARACTER*1
!>          = 'U':  Upper triangle of A is stored;
!>          = 'L':  Lower triangle of A is stored.
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in,out]A
!>          A is COMPLEX*16 array, dimension (LDA, N)
!>          On entry, the Hermitian matrix A.  If UPLO = 'U', the
!>          leading N-by-N upper triangular part of A contains the
!>          upper triangular part of the matrix A.  If UPLO = 'L',
!>          the leading N-by-N lower triangular part of A contains
!>          the lower triangular part of the matrix A.
!>          On exit, the lower triangle (if UPLO='L') or the upper
!>          triangle (if UPLO='U') of A, including the diagonal, is
!>          destroyed.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[in]VL
!>          VL is DOUBLE PRECISION
!>          If RANGE='V', the lower bound of the interval to
!>          be searched for eigenvalues. VL < VU.
!>          Not referenced if RANGE = 'A' or 'I'.
!> 
[in]VU
!>          VU is DOUBLE PRECISION
!>          If RANGE='V', the upper bound of the interval to
!>          be searched for eigenvalues. VL < VU.
!>          Not referenced if RANGE = 'A' or 'I'.
!> 
[in]IL
!>          IL is INTEGER
!>          If RANGE='I', the index of the
!>          smallest eigenvalue to be returned.
!>          1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0.
!>          Not referenced if RANGE = 'A' or 'V'.
!> 
[in]IU
!>          IU is INTEGER
!>          If RANGE='I', the index of the
!>          largest eigenvalue to be returned.
!>          1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0.
!>          Not referenced if RANGE = 'A' or 'V'.
!> 
[in]ABSTOL
!>          ABSTOL is DOUBLE PRECISION
!>          The absolute error tolerance for the eigenvalues.
!>          An approximate eigenvalue is accepted as converged
!>          when it is determined to lie in an interval [a,b]
!>          of width less than or equal to
!>
!>                  ABSTOL + EPS *   max( |a|,|b| ) ,
!>
!>          where EPS is the machine precision.  If ABSTOL is less than
!>          or equal to zero, then  EPS*|T|  will be used in its place,
!>          where |T| is the 1-norm of the tridiagonal matrix obtained
!>          by reducing A to tridiagonal form.
!>
!>          See  by Demmel and
!>          Kahan, LAPACK Working Note #3.
!>
!>          If high relative accuracy is important, set ABSTOL to
!>          DLAMCH( 'Safe minimum' ).  Doing so will guarantee that
!>          eigenvalues are computed to high relative accuracy when
!>          possible in future releases.  The current code does not
!>          make any guarantees about high relative accuracy, but
!>          future releases will. See J. Barlow and J. Demmel,
!>          , LAPACK Working Note #7, for a discussion
!>          of which matrices define their eigenvalues to high relative
!>          accuracy.
!> 
[out]M
!>          M is INTEGER
!>          The total number of eigenvalues found.  0 <= M <= N.
!>          If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1.
!> 
[out]W
!>          W is DOUBLE PRECISION array, dimension (N)
!>          The first M elements contain the selected eigenvalues in
!>          ascending order.
!> 
[out]Z
!>          Z is COMPLEX*16 array, dimension (LDZ, max(1,M))
!>          If JOBZ = 'V', then if INFO = 0, the first M columns of Z
!>          contain the orthonormal eigenvectors of the matrix A
!>          corresponding to the selected eigenvalues, with the i-th
!>          column of Z holding the eigenvector associated with W(i).
!>          If JOBZ = 'N', then Z is not referenced.
!>          Note: the user must ensure that at least max(1,M) columns are
!>          supplied in the array Z; if RANGE = 'V', the exact value of M
!>          is not known in advance and an upper bound must be used.
!>          Supplying N columns is always safe.
!> 
[in]LDZ
!>          LDZ is INTEGER
!>          The leading dimension of the array Z.  LDZ >= 1, and if
!>          JOBZ = 'V', LDZ >= max(1,N).
!> 
[out]ISUPPZ
!>          ISUPPZ is INTEGER array, dimension ( 2*max(1,M) )
!>          The support of the eigenvectors in Z, i.e., the indices
!>          indicating the nonzero elements in Z. The i-th eigenvector
!>          is nonzero only in elements ISUPPZ( 2*i-1 ) through
!>          ISUPPZ( 2*i ). This is an output of ZSTEMR (tridiagonal
!>          matrix). The support of the eigenvectors of A is typically
!>          1:N because of the unitary transformations applied by ZUNMTR.
!>          Implemented only for RANGE = 'A' or 'I' and IU - IL = N - 1
!> 
[out]WORK
!>          WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
!>          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
!> 
[in]LWORK
!>          LWORK is INTEGER
!>          The length of the array WORK.
!>          If N <= 1, LWORK >= 1, else LWORK >= 2*N.
!>          For optimal efficiency, LWORK >= (NB+1)*N,
!>          where NB is the max of the blocksize for ZHETRD and for
!>          ZUNMTR as returned by ILAENV.
!>
!>          If LWORK = -1, then a workspace query is assumed; the routine
!>          only calculates the optimal sizes of the WORK, RWORK and
!>          IWORK arrays, returns these values as the first entries of
!>          the WORK, RWORK and IWORK arrays, and no error message
!>          related to LWORK or LRWORK or LIWORK is issued by XERBLA.
!> 
[out]RWORK
!>          RWORK is DOUBLE PRECISION array, dimension (MAX(1,LRWORK))
!>          On exit, if INFO = 0, RWORK(1) returns the optimal
!>          (and minimal) LRWORK.
!> 
[in]LRWORK
!>          LRWORK is INTEGER
!>          The length of the array RWORK.
!>          If N <= 1, LRWORK >= 1, else LRWORK >= 24*N.
!>
!>          If LRWORK = -1, then a workspace query is assumed; the
!>          routine only calculates the optimal sizes of the WORK, RWORK
!>          and IWORK arrays, returns these values as the first entries
!>          of the WORK, RWORK and IWORK arrays, and no error message
!>          related to LWORK or LRWORK or LIWORK is issued by XERBLA.
!> 
[out]IWORK
!>          IWORK is INTEGER array, dimension (MAX(1,LIWORK))
!>          On exit, if INFO = 0, IWORK(1) returns the optimal
!>          (and minimal) LIWORK.
!> 
[in]LIWORK
!>          LIWORK is INTEGER
!>          The dimension of the array IWORK.
!>          If N <= 1, LIWORK >= 1, else LIWORK >= 10*N.
!>
!>          If LIWORK = -1, then a workspace query is assumed; the
!>          routine only calculates the optimal sizes of the WORK, RWORK
!>          and IWORK arrays, returns these values as the first entries
!>          of the WORK, RWORK and IWORK arrays, and no error message
!>          related to LWORK or LRWORK or LIWORK is issued by XERBLA.
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!>          > 0:  Internal error
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
Inderjit Dhillon, IBM Almaden, USA
Osni Marques, LBNL/NERSC, USA
Ken Stanley, Computer Science Division, University of California at Berkeley, USA
Jason Riedy, Computer Science Division, University of California at Berkeley, USA

Definition at line 369 of file zheevr.f.

373*
374* -- LAPACK driver routine --
375* -- LAPACK is a software package provided by Univ. of Tennessee, --
376* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
377*
378* .. Scalar Arguments ..
379 CHARACTER JOBZ, RANGE, UPLO
380 INTEGER IL, INFO, IU, LDA, LDZ, LIWORK, LRWORK, LWORK,
381 $ M, N
382 DOUBLE PRECISION ABSTOL, VL, VU
383* ..
384* .. Array Arguments ..
385 INTEGER ISUPPZ( * ), IWORK( * )
386 DOUBLE PRECISION RWORK( * ), W( * )
387 COMPLEX*16 A( LDA, * ), WORK( * ), Z( LDZ, * )
388* ..
389*
390* =====================================================================
391*
392* .. Parameters ..
393 DOUBLE PRECISION ZERO, ONE, TWO
394 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
395* ..
396* .. Local Scalars ..
397 LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, TEST, VALEIG,
398 $ WANTZ, TRYRAC
399 CHARACTER ORDER
400 INTEGER I, IEEEOK, IINFO, IMAX, INDIBL, INDIFL, INDISP,
401 $ INDIWO, INDRD, INDRDD, INDRE, INDREE, INDRWK,
402 $ INDTAU, INDWK, INDWKN, ISCALE, ITMP1, J, JJ,
403 $ LIWMIN, LLWORK, LLRWORK, LLWRKN, LRWMIN,
404 $ LWKOPT, LWMIN, NB, NSPLIT
405 DOUBLE PRECISION ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
406 $ SIGMA, SMLNUM, TMP1, VLL, VUU
407* ..
408* .. External Functions ..
409 LOGICAL LSAME
410 INTEGER ILAENV
411 DOUBLE PRECISION DLAMCH, ZLANSY
412 EXTERNAL lsame, ilaenv, dlamch, zlansy
413* ..
414* .. External Subroutines ..
415 EXTERNAL dcopy, dscal, dstebz, dsterf, xerbla,
416 $ zdscal,
418* ..
419* .. Intrinsic Functions ..
420 INTRINSIC dble, max, min, sqrt
421* ..
422* .. Executable Statements ..
423*
424* Test the input parameters.
425*
426 ieeeok = ilaenv( 10, 'ZHEEVR', 'N', 1, 2, 3, 4 )
427*
428 lower = lsame( uplo, 'L' )
429 wantz = lsame( jobz, 'V' )
430 alleig = lsame( range, 'A' )
431 valeig = lsame( range, 'V' )
432 indeig = lsame( range, 'I' )
433*
434 lquery = ( ( lwork.EQ.-1 ) .OR. ( lrwork.EQ.-1 ) .OR.
435 $ ( liwork.EQ.-1 ) )
436*
437 IF( n.LE.1 ) THEN
438 lwmin = 1
439 lrwmin = 1
440 liwmin = 1
441 ELSE
442 lwmin = 2*n
443 lrwmin = 24*n
444 liwmin = 10*n
445 END IF
446*
447 info = 0
448 IF( .NOT.( wantz .OR. lsame( jobz, 'N' ) ) ) THEN
449 info = -1
450 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) ) THEN
451 info = -2
452 ELSE IF( .NOT.( lower .OR. lsame( uplo, 'U' ) ) ) THEN
453 info = -3
454 ELSE IF( n.LT.0 ) THEN
455 info = -4
456 ELSE IF( lda.LT.max( 1, n ) ) THEN
457 info = -6
458 ELSE
459 IF( valeig ) THEN
460 IF( n.GT.0 .AND. vu.LE.vl )
461 $ info = -8
462 ELSE IF( indeig ) THEN
463 IF( il.LT.1 .OR. il.GT.max( 1, n ) ) THEN
464 info = -9
465 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n ) THEN
466 info = -10
467 END IF
468 END IF
469 END IF
470 IF( info.EQ.0 ) THEN
471 IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) ) THEN
472 info = -15
473 END IF
474 END IF
475*
476 IF( info.EQ.0 ) THEN
477 nb = ilaenv( 1, 'ZHETRD', uplo, n, -1, -1, -1 )
478 nb = max( nb, ilaenv( 1, 'ZUNMTR', uplo, n, -1, -1, -1 ) )
479 lwkopt = max( ( nb+1 )*n, lwmin )
480 work( 1 ) = lwkopt
481 rwork( 1 ) = real( lrwmin )
482 iwork( 1 ) = liwmin
483*
484 IF( lwork.LT.lwmin .AND. .NOT.lquery ) THEN
485 info = -18
486 ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery ) THEN
487 info = -20
488 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery ) THEN
489 info = -22
490 END IF
491 END IF
492*
493 IF( info.NE.0 ) THEN
494 CALL xerbla( 'ZHEEVR', -info )
495 RETURN
496 ELSE IF( lquery ) THEN
497 RETURN
498 END IF
499*
500* Quick return if possible
501*
502 m = 0
503 IF( n.EQ.0 ) THEN
504 work( 1 ) = 1
505 RETURN
506 END IF
507*
508 IF( n.EQ.1 ) THEN
509 work( 1 ) = 1
510 IF( alleig .OR. indeig ) THEN
511 m = 1
512 w( 1 ) = dble( a( 1, 1 ) )
513 ELSE
514 IF( vl.LT.dble( a( 1, 1 ) ) .AND. vu.GE.dble( a( 1, 1 ) ) )
515 $ THEN
516 m = 1
517 w( 1 ) = dble( a( 1, 1 ) )
518 END IF
519 END IF
520 IF( wantz ) THEN
521 z( 1, 1 ) = one
522 isuppz( 1 ) = 1
523 isuppz( 2 ) = 1
524 END IF
525 RETURN
526 END IF
527*
528* Get machine constants.
529*
530 safmin = dlamch( 'Safe minimum' )
531 eps = dlamch( 'Precision' )
532 smlnum = safmin / eps
533 bignum = one / smlnum
534 rmin = sqrt( smlnum )
535 rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
536*
537* Scale matrix to allowable range, if necessary.
538*
539 iscale = 0
540 abstll = abstol
541 IF (valeig) THEN
542 vll = vl
543 vuu = vu
544 END IF
545 anrm = zlansy( 'M', uplo, n, a, lda, rwork )
546 IF( anrm.GT.zero .AND. anrm.LT.rmin ) THEN
547 iscale = 1
548 sigma = rmin / anrm
549 ELSE IF( anrm.GT.rmax ) THEN
550 iscale = 1
551 sigma = rmax / anrm
552 END IF
553 IF( iscale.EQ.1 ) THEN
554 IF( lower ) THEN
555 DO 10 j = 1, n
556 CALL zdscal( n-j+1, sigma, a( j, j ), 1 )
557 10 CONTINUE
558 ELSE
559 DO 20 j = 1, n
560 CALL zdscal( j, sigma, a( 1, j ), 1 )
561 20 CONTINUE
562 END IF
563 IF( abstol.GT.0 )
564 $ abstll = abstol*sigma
565 IF( valeig ) THEN
566 vll = vl*sigma
567 vuu = vu*sigma
568 END IF
569 END IF
570
571* Initialize indices into workspaces. Note: The IWORK indices are
572* used only if DSTERF or ZSTEMR fail.
573
574* WORK(INDTAU:INDTAU+N-1) stores the complex scalar factors of the
575* elementary reflectors used in ZHETRD.
576 indtau = 1
577* INDWK is the starting offset of the remaining complex workspace,
578* and LLWORK is the remaining complex workspace size.
579 indwk = indtau + n
580 llwork = lwork - indwk + 1
581
582* RWORK(INDRD:INDRD+N-1) stores the real tridiagonal's diagonal
583* entries.
584 indrd = 1
585* RWORK(INDRE:INDRE+N-1) stores the off-diagonal entries of the
586* tridiagonal matrix from ZHETRD.
587 indre = indrd + n
588* RWORK(INDRDD:INDRDD+N-1) is a copy of the diagonal entries over
589* -written by ZSTEMR (the DSTERF path copies the diagonal to W).
590 indrdd = indre + n
591* RWORK(INDREE:INDREE+N-1) is a copy of the off-diagonal entries over
592* -written while computing the eigenvalues in DSTERF and ZSTEMR.
593 indree = indrdd + n
594* INDRWK is the starting offset of the left-over real workspace, and
595* LLRWORK is the remaining workspace size.
596 indrwk = indree + n
597 llrwork = lrwork - indrwk + 1
598
599* IWORK(INDIBL:INDIBL+M-1) corresponds to IBLOCK in DSTEBZ and
600* stores the block indices of each of the M<=N eigenvalues.
601 indibl = 1
602* IWORK(INDISP:INDISP+NSPLIT-1) corresponds to ISPLIT in DSTEBZ and
603* stores the starting and finishing indices of each block.
604 indisp = indibl + n
605* IWORK(INDIFL:INDIFL+N-1) stores the indices of eigenvectors
606* that corresponding to eigenvectors that fail to converge in
607* DSTEIN. This information is discarded; if any fail, the driver
608* returns INFO > 0.
609 indifl = indisp + n
610* INDIWO is the offset of the remaining integer workspace.
611 indiwo = indifl + n
612
613*
614* Call ZHETRD to reduce Hermitian matrix to tridiagonal form.
615*
616 CALL zhetrd( uplo, n, a, lda, rwork( indrd ), rwork( indre ),
617 $ work( indtau ), work( indwk ), llwork, iinfo )
618*
619* If all eigenvalues are desired
620* then call DSTERF or ZSTEMR and ZUNMTR.
621*
622 test = .false.
623 IF( indeig ) THEN
624 IF( il.EQ.1 .AND. iu.EQ.n ) THEN
625 test = .true.
626 END IF
627 END IF
628 IF( ( alleig.OR.test ) .AND. ( ieeeok.EQ.1 ) ) THEN
629 IF( .NOT.wantz ) THEN
630 CALL dcopy( n, rwork( indrd ), 1, w, 1 )
631 CALL dcopy( n-1, rwork( indre ), 1, rwork( indree ), 1 )
632 CALL dsterf( n, w, rwork( indree ), info )
633 ELSE
634 CALL dcopy( n-1, rwork( indre ), 1, rwork( indree ), 1 )
635 CALL dcopy( n, rwork( indrd ), 1, rwork( indrdd ), 1 )
636*
637 IF (abstol .LE. two*n*eps) THEN
638 tryrac = .true.
639 ELSE
640 tryrac = .false.
641 END IF
642 CALL zstemr( jobz, 'A', n, rwork( indrdd ),
643 $ rwork( indree ), vl, vu, il, iu, m, w,
644 $ z, ldz, n, isuppz, tryrac,
645 $ rwork( indrwk ), llrwork,
646 $ iwork, liwork, info )
647*
648* Apply unitary matrix used in reduction to tridiagonal
649* form to eigenvectors returned by ZSTEMR.
650*
651 IF( wantz .AND. info.EQ.0 ) THEN
652 indwkn = indwk
653 llwrkn = lwork - indwkn + 1
654 CALL zunmtr( 'L', uplo, 'N', n, m, a, lda,
655 $ work( indtau ), z, ldz, work( indwkn ),
656 $ llwrkn, iinfo )
657 END IF
658 END IF
659*
660*
661 IF( info.EQ.0 ) THEN
662 m = n
663 GO TO 30
664 END IF
665 info = 0
666 END IF
667*
668* Otherwise, call DSTEBZ and, if eigenvectors are desired, ZSTEIN.
669* Also call DSTEBZ and ZSTEIN if ZSTEMR fails.
670*
671 IF( wantz ) THEN
672 order = 'B'
673 ELSE
674 order = 'E'
675 END IF
676
677 CALL dstebz( range, order, n, vll, vuu, il, iu, abstll,
678 $ rwork( indrd ), rwork( indre ), m, nsplit, w,
679 $ iwork( indibl ), iwork( indisp ), rwork( indrwk ),
680 $ iwork( indiwo ), info )
681*
682 IF( wantz ) THEN
683 CALL zstein( n, rwork( indrd ), rwork( indre ), m, w,
684 $ iwork( indibl ), iwork( indisp ), z, ldz,
685 $ rwork( indrwk ), iwork( indiwo ), iwork( indifl ),
686 $ info )
687*
688* Apply unitary matrix used in reduction to tridiagonal
689* form to eigenvectors returned by ZSTEIN.
690*
691 indwkn = indwk
692 llwrkn = lwork - indwkn + 1
693 CALL zunmtr( 'L', uplo, 'N', n, m, a, lda, work( indtau ),
694 $ z,
695 $ ldz, work( indwkn ), llwrkn, iinfo )
696 END IF
697*
698* If matrix was scaled, then rescale eigenvalues appropriately.
699*
700 30 CONTINUE
701 IF( iscale.EQ.1 ) THEN
702 IF( info.EQ.0 ) THEN
703 imax = m
704 ELSE
705 imax = info - 1
706 END IF
707 CALL dscal( imax, one / sigma, w, 1 )
708 END IF
709*
710* If eigenvalues are not in order, then sort them, along with
711* eigenvectors.
712*
713 IF( wantz ) THEN
714 DO 50 j = 1, m - 1
715 i = 0
716 tmp1 = w( j )
717 DO 40 jj = j + 1, m
718 IF( w( jj ).LT.tmp1 ) THEN
719 i = jj
720 tmp1 = w( jj )
721 END IF
722 40 CONTINUE
723*
724 IF( i.NE.0 ) THEN
725 itmp1 = iwork( indibl+i-1 )
726 w( i ) = w( j )
727 iwork( indibl+i-1 ) = iwork( indibl+j-1 )
728 w( j ) = tmp1
729 iwork( indibl+j-1 ) = itmp1
730 CALL zswap( n, z( 1, i ), 1, z( 1, j ), 1 )
731 END IF
732 50 CONTINUE
733 END IF
734*
735* Set WORK(1) to optimal workspace size.
736*
737 work( 1 ) = lwkopt
738 rwork( 1 ) = real( lrwmin )
739 iwork( 1 ) = liwmin
740*
741 RETURN
742*
743* End of ZHEEVR
744*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
Definition dcopy.f:82
subroutine zhetrd(uplo, n, a, lda, d, e, tau, work, lwork, info)
ZHETRD
Definition zhetrd.f:191
integer function ilaenv(ispec, name, opts, n1, n2, n3, n4)
ILAENV
Definition ilaenv.f:160
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
double precision function zlansy(norm, uplo, n, a, lda, work)
ZLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition zlansy.f:121
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine dscal(n, da, dx, incx)
DSCAL
Definition dscal.f:79
subroutine zdscal(n, da, zx, incx)
ZDSCAL
Definition zdscal.f:78
subroutine dstebz(range, order, n, vl, vu, il, iu, abstol, d, e, m, nsplit, w, iblock, isplit, work, iwork, info)
DSTEBZ
Definition dstebz.f:272
subroutine zstein(n, d, e, m, w, iblock, isplit, z, ldz, work, iwork, ifail, info)
ZSTEIN
Definition zstein.f:180
subroutine zstemr(jobz, range, n, d, e, vl, vu, il, iu, m, w, z, ldz, nzc, isuppz, tryrac, work, lwork, iwork, liwork, info)
ZSTEMR
Definition zstemr.f:337
subroutine dsterf(n, d, e, info)
DSTERF
Definition dsterf.f:84
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
Definition zswap.f:81
subroutine zunmtr(side, uplo, trans, m, n, a, lda, tau, c, ldc, work, lwork, info)
ZUNMTR
Definition zunmtr.f:170
Here is the call graph for this function:
Here is the caller graph for this function: