LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
zheevr.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine zheevr (JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO)
  ZHEEVR computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices More...
 

Function/Subroutine Documentation

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.

 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 "good" 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 DSTEMR's documentation and:
 - Inderjit S. Dhillon and Beresford N. Parlett: "Multiple representations
   to compute orthogonal eigenvectors of symmetric tridiagonal matrices,"
   Linear Algebra and its Applications, 387(1), pp. 1-28, August 2004.
 - Inderjit Dhillon and Beresford Parlett: "Orthogonal Eigenvectors and
   Relative Gaps," SIAM Journal on Matrix Analysis and Applications, Vol. 25,
   2004.  Also LAPACK Working Note 154.
 - Inderjit Dhillon: "A new O(n^2) algorithm for the symmetric
   tridiagonal eigenvalue/eigenvector problem",
   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.
[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
[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
[in]VU
          VU is DOUBLE PRECISION
          If RANGE='V', the lower and upper bounds of the interval to
          be searched for eigenvalues. VL < VU.
          Not referenced if RANGE = 'A' or 'I'.
[in]IL
          IL is INTEGER
[in]IU
          IU is INTEGER
          If RANGE='I', the indices (in ascending order) of the
          smallest and largest eigenvalues 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 "Computing Small Singular Values of Bidiagonal Matrices
          with Guaranteed High Relative Accuracy," 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
          furutre releases will. See J. Barlow and J. Demmel,
          "Computing Accurate Eigensystems of Scaled Diagonally
          Dominant Matrices", 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.
[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 ).
          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.  LWORK >= max(1,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.  LRWORK >= max(1,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.  LIWORK >= max(1,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.
Date
September 2012
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 350 of file zheevr.f.

350 *
351 * -- LAPACK driver routine (version 3.4.2) --
352 * -- LAPACK is a software package provided by Univ. of Tennessee, --
353 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
354 * September 2012
355 *
356 * .. Scalar Arguments ..
357  CHARACTER jobz, range, uplo
358  INTEGER il, info, iu, lda, ldz, liwork, lrwork, lwork,
359  $ m, n
360  DOUBLE PRECISION abstol, vl, vu
361 * ..
362 * .. Array Arguments ..
363  INTEGER isuppz( * ), iwork( * )
364  DOUBLE PRECISION rwork( * ), w( * )
365  COMPLEX*16 a( lda, * ), work( * ), z( ldz, * )
366 * ..
367 *
368 * =====================================================================
369 *
370 * .. Parameters ..
371  DOUBLE PRECISION zero, one, two
372  parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
373 * ..
374 * .. Local Scalars ..
375  LOGICAL alleig, indeig, lower, lquery, test, valeig,
376  $ wantz, tryrac
377  CHARACTER order
378  INTEGER i, ieeeok, iinfo, imax, indibl, indifl, indisp,
379  $ indiwo, indrd, indrdd, indre, indree, indrwk,
380  $ indtau, indwk, indwkn, iscale, itmp1, j, jj,
381  $ liwmin, llwork, llrwork, llwrkn, lrwmin,
382  $ lwkopt, lwmin, nb, nsplit
383  DOUBLE PRECISION abstll, anrm, bignum, eps, rmax, rmin, safmin,
384  $ sigma, smlnum, tmp1, vll, vuu
385 * ..
386 * .. External Functions ..
387  LOGICAL lsame
388  INTEGER ilaenv
389  DOUBLE PRECISION dlamch, zlansy
390  EXTERNAL lsame, ilaenv, dlamch, zlansy
391 * ..
392 * .. External Subroutines ..
393  EXTERNAL dcopy, dscal, dstebz, dsterf, xerbla, zdscal,
395 * ..
396 * .. Intrinsic Functions ..
397  INTRINSIC dble, max, min, sqrt
398 * ..
399 * .. Executable Statements ..
400 *
401 * Test the input parameters.
402 *
403  ieeeok = ilaenv( 10, 'ZHEEVR', 'N', 1, 2, 3, 4 )
404 *
405  lower = lsame( uplo, 'L' )
406  wantz = lsame( jobz, 'V' )
407  alleig = lsame( range, 'A' )
408  valeig = lsame( range, 'V' )
409  indeig = lsame( range, 'I' )
410 *
411  lquery = ( ( lwork.EQ.-1 ) .OR. ( lrwork.EQ.-1 ) .OR.
412  $ ( liwork.EQ.-1 ) )
413 *
414  lrwmin = max( 1, 24*n )
415  liwmin = max( 1, 10*n )
416  lwmin = max( 1, 2*n )
417 *
418  info = 0
419  IF( .NOT.( wantz .OR. lsame( jobz, 'N' ) ) ) THEN
420  info = -1
421  ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) ) THEN
422  info = -2
423  ELSE IF( .NOT.( lower .OR. lsame( uplo, 'U' ) ) ) THEN
424  info = -3
425  ELSE IF( n.LT.0 ) THEN
426  info = -4
427  ELSE IF( lda.LT.max( 1, n ) ) THEN
428  info = -6
429  ELSE
430  IF( valeig ) THEN
431  IF( n.GT.0 .AND. vu.LE.vl )
432  $ info = -8
433  ELSE IF( indeig ) THEN
434  IF( il.LT.1 .OR. il.GT.max( 1, n ) ) THEN
435  info = -9
436  ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n ) THEN
437  info = -10
438  END IF
439  END IF
440  END IF
441  IF( info.EQ.0 ) THEN
442  IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) ) THEN
443  info = -15
444  END IF
445  END IF
446 *
447  IF( info.EQ.0 ) THEN
448  nb = ilaenv( 1, 'ZHETRD', uplo, n, -1, -1, -1 )
449  nb = max( nb, ilaenv( 1, 'ZUNMTR', uplo, n, -1, -1, -1 ) )
450  lwkopt = max( ( nb+1 )*n, lwmin )
451  work( 1 ) = lwkopt
452  rwork( 1 ) = lrwmin
453  iwork( 1 ) = liwmin
454 *
455  IF( lwork.LT.lwmin .AND. .NOT.lquery ) THEN
456  info = -18
457  ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery ) THEN
458  info = -20
459  ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery ) THEN
460  info = -22
461  END IF
462  END IF
463 *
464  IF( info.NE.0 ) THEN
465  CALL xerbla( 'ZHEEVR', -info )
466  RETURN
467  ELSE IF( lquery ) THEN
468  RETURN
469  END IF
470 *
471 * Quick return if possible
472 *
473  m = 0
474  IF( n.EQ.0 ) THEN
475  work( 1 ) = 1
476  RETURN
477  END IF
478 *
479  IF( n.EQ.1 ) THEN
480  work( 1 ) = 2
481  IF( alleig .OR. indeig ) THEN
482  m = 1
483  w( 1 ) = dble( a( 1, 1 ) )
484  ELSE
485  IF( vl.LT.dble( a( 1, 1 ) ) .AND. vu.GE.dble( a( 1, 1 ) ) )
486  $ THEN
487  m = 1
488  w( 1 ) = dble( a( 1, 1 ) )
489  END IF
490  END IF
491  IF( wantz ) THEN
492  z( 1, 1 ) = one
493  isuppz( 1 ) = 1
494  isuppz( 2 ) = 1
495  END IF
496  RETURN
497  END IF
498 *
499 * Get machine constants.
500 *
501  safmin = dlamch( 'Safe minimum' )
502  eps = dlamch( 'Precision' )
503  smlnum = safmin / eps
504  bignum = one / smlnum
505  rmin = sqrt( smlnum )
506  rmax = min( sqrt( bignum ), one / sqrt( sqrt( safmin ) ) )
507 *
508 * Scale matrix to allowable range, if necessary.
509 *
510  iscale = 0
511  abstll = abstol
512  IF (valeig) THEN
513  vll = vl
514  vuu = vu
515  END IF
516  anrm = zlansy( 'M', uplo, n, a, lda, rwork )
517  IF( anrm.GT.zero .AND. anrm.LT.rmin ) THEN
518  iscale = 1
519  sigma = rmin / anrm
520  ELSE IF( anrm.GT.rmax ) THEN
521  iscale = 1
522  sigma = rmax / anrm
523  END IF
524  IF( iscale.EQ.1 ) THEN
525  IF( lower ) THEN
526  DO 10 j = 1, n
527  CALL zdscal( n-j+1, sigma, a( j, j ), 1 )
528  10 CONTINUE
529  ELSE
530  DO 20 j = 1, n
531  CALL zdscal( j, sigma, a( 1, j ), 1 )
532  20 CONTINUE
533  END IF
534  IF( abstol.GT.0 )
535  $ abstll = abstol*sigma
536  IF( valeig ) THEN
537  vll = vl*sigma
538  vuu = vu*sigma
539  END IF
540  END IF
541 
542 * Initialize indices into workspaces. Note: The IWORK indices are
543 * used only if DSTERF or ZSTEMR fail.
544 
545 * WORK(INDTAU:INDTAU+N-1) stores the complex scalar factors of the
546 * elementary reflectors used in ZHETRD.
547  indtau = 1
548 * INDWK is the starting offset of the remaining complex workspace,
549 * and LLWORK is the remaining complex workspace size.
550  indwk = indtau + n
551  llwork = lwork - indwk + 1
552 
553 * RWORK(INDRD:INDRD+N-1) stores the real tridiagonal's diagonal
554 * entries.
555  indrd = 1
556 * RWORK(INDRE:INDRE+N-1) stores the off-diagonal entries of the
557 * tridiagonal matrix from ZHETRD.
558  indre = indrd + n
559 * RWORK(INDRDD:INDRDD+N-1) is a copy of the diagonal entries over
560 * -written by ZSTEMR (the DSTERF path copies the diagonal to W).
561  indrdd = indre + n
562 * RWORK(INDREE:INDREE+N-1) is a copy of the off-diagonal entries over
563 * -written while computing the eigenvalues in DSTERF and ZSTEMR.
564  indree = indrdd + n
565 * INDRWK is the starting offset of the left-over real workspace, and
566 * LLRWORK is the remaining workspace size.
567  indrwk = indree + n
568  llrwork = lrwork - indrwk + 1
569 
570 * IWORK(INDIBL:INDIBL+M-1) corresponds to IBLOCK in DSTEBZ and
571 * stores the block indices of each of the M<=N eigenvalues.
572  indibl = 1
573 * IWORK(INDISP:INDISP+NSPLIT-1) corresponds to ISPLIT in DSTEBZ and
574 * stores the starting and finishing indices of each block.
575  indisp = indibl + n
576 * IWORK(INDIFL:INDIFL+N-1) stores the indices of eigenvectors
577 * that corresponding to eigenvectors that fail to converge in
578 * DSTEIN. This information is discarded; if any fail, the driver
579 * returns INFO > 0.
580  indifl = indisp + n
581 * INDIWO is the offset of the remaining integer workspace.
582  indiwo = indifl + n
583 
584 *
585 * Call ZHETRD to reduce Hermitian matrix to tridiagonal form.
586 *
587  CALL zhetrd( uplo, n, a, lda, rwork( indrd ), rwork( indre ),
588  $ work( indtau ), work( indwk ), llwork, iinfo )
589 *
590 * If all eigenvalues are desired
591 * then call DSTERF or ZSTEMR and ZUNMTR.
592 *
593  test = .false.
594  IF( indeig ) THEN
595  IF( il.EQ.1 .AND. iu.EQ.n ) THEN
596  test = .true.
597  END IF
598  END IF
599  IF( ( alleig.OR.test ) .AND. ( ieeeok.EQ.1 ) ) THEN
600  IF( .NOT.wantz ) THEN
601  CALL dcopy( n, rwork( indrd ), 1, w, 1 )
602  CALL dcopy( n-1, rwork( indre ), 1, rwork( indree ), 1 )
603  CALL dsterf( n, w, rwork( indree ), info )
604  ELSE
605  CALL dcopy( n-1, rwork( indre ), 1, rwork( indree ), 1 )
606  CALL dcopy( n, rwork( indrd ), 1, rwork( indrdd ), 1 )
607 *
608  IF (abstol .LE. two*n*eps) THEN
609  tryrac = .true.
610  ELSE
611  tryrac = .false.
612  END IF
613  CALL zstemr( jobz, 'A', n, rwork( indrdd ),
614  $ rwork( indree ), vl, vu, il, iu, m, w,
615  $ z, ldz, n, isuppz, tryrac,
616  $ rwork( indrwk ), llrwork,
617  $ iwork, liwork, info )
618 *
619 * Apply unitary matrix used in reduction to tridiagonal
620 * form to eigenvectors returned by ZSTEIN.
621 *
622  IF( wantz .AND. info.EQ.0 ) THEN
623  indwkn = indwk
624  llwrkn = lwork - indwkn + 1
625  CALL zunmtr( 'L', uplo, 'N', n, m, a, lda,
626  $ work( indtau ), z, ldz, work( indwkn ),
627  $ llwrkn, iinfo )
628  END IF
629  END IF
630 *
631 *
632  IF( info.EQ.0 ) THEN
633  m = n
634  GO TO 30
635  END IF
636  info = 0
637  END IF
638 *
639 * Otherwise, call DSTEBZ and, if eigenvectors are desired, ZSTEIN.
640 * Also call DSTEBZ and ZSTEIN if ZSTEMR fails.
641 *
642  IF( wantz ) THEN
643  order = 'B'
644  ELSE
645  order = 'E'
646  END IF
647 
648  CALL dstebz( range, order, n, vll, vuu, il, iu, abstll,
649  $ rwork( indrd ), rwork( indre ), m, nsplit, w,
650  $ iwork( indibl ), iwork( indisp ), rwork( indrwk ),
651  $ iwork( indiwo ), info )
652 *
653  IF( wantz ) THEN
654  CALL zstein( n, rwork( indrd ), rwork( indre ), m, w,
655  $ iwork( indibl ), iwork( indisp ), z, ldz,
656  $ rwork( indrwk ), iwork( indiwo ), iwork( indifl ),
657  $ info )
658 *
659 * Apply unitary matrix used in reduction to tridiagonal
660 * form to eigenvectors returned by ZSTEIN.
661 *
662  indwkn = indwk
663  llwrkn = lwork - indwkn + 1
664  CALL zunmtr( 'L', uplo, 'N', n, m, a, lda, work( indtau ), z,
665  $ ldz, work( indwkn ), llwrkn, iinfo )
666  END IF
667 *
668 * If matrix was scaled, then rescale eigenvalues appropriately.
669 *
670  30 CONTINUE
671  IF( iscale.EQ.1 ) THEN
672  IF( info.EQ.0 ) THEN
673  imax = m
674  ELSE
675  imax = info - 1
676  END IF
677  CALL dscal( imax, one / sigma, w, 1 )
678  END IF
679 *
680 * If eigenvalues are not in order, then sort them, along with
681 * eigenvectors.
682 *
683  IF( wantz ) THEN
684  DO 50 j = 1, m - 1
685  i = 0
686  tmp1 = w( j )
687  DO 40 jj = j + 1, m
688  IF( w( jj ).LT.tmp1 ) THEN
689  i = jj
690  tmp1 = w( jj )
691  END IF
692  40 CONTINUE
693 *
694  IF( i.NE.0 ) THEN
695  itmp1 = iwork( indibl+i-1 )
696  w( i ) = w( j )
697  iwork( indibl+i-1 ) = iwork( indibl+j-1 )
698  w( j ) = tmp1
699  iwork( indibl+j-1 ) = itmp1
700  CALL zswap( n, z( 1, i ), 1, z( 1, j ), 1 )
701  END IF
702  50 CONTINUE
703  END IF
704 *
705 * Set WORK(1) to optimal workspace size.
706 *
707  work( 1 ) = lwkopt
708  rwork( 1 ) = lrwmin
709  iwork( 1 ) = liwmin
710 *
711  RETURN
712 *
713 * End of ZHEEVR
714 *
subroutine zswap(N, ZX, INCX, ZY, INCY)
ZSWAP
Definition: zswap.f:52
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, or the element of largest absolute value of a complex symmetric matrix.
Definition: zlansy.f:125
subroutine zdscal(N, DA, ZX, INCX)
ZDSCAL
Definition: zdscal.f:54
subroutine zstein(N, D, E, M, W, IBLOCK, ISPLIT, Z, LDZ, WORK, IWORK, IFAIL, INFO)
ZSTEIN
Definition: zstein.f:184
subroutine dsterf(N, D, E, INFO)
DSTERF
Definition: dsterf.f:88
subroutine dcopy(N, DX, INCX, DY, INCY)
DCOPY
Definition: dcopy.f:53
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine zhetrd(UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO)
ZHETRD
Definition: zhetrd.f:194
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine dscal(N, DA, DX, INCX)
DSCAL
Definition: dscal.f:55
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:331
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
integer function ilaenv(ISPEC, NAME, OPTS, N1, N2, N3, N4)
Definition: tstiee.f:83
subroutine dstebz(RANGE, ORDER, N, VL, VU, IL, IU, ABSTOL, D, E, M, NSPLIT, W, IBLOCK, ISPLIT, WORK, IWORK, INFO)
DSTEBZ
Definition: dstebz.f:265
subroutine zunmtr(SIDE, UPLO, TRANS, M, N, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
ZUNMTR
Definition: zunmtr.f:173

Here is the call graph for this function:

Here is the caller graph for this function: