001:       SUBROUTINE DSTEGR( JOBZ, RANGE, N, D, E, VL, VU, IL, IU,
002:      $           ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK, IWORK,
003:      $           LIWORK, INFO )
004: 
005:       IMPLICIT NONE
006: *
007: *
008: *  -- LAPACK computational routine (version 3.2) --
009: *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
010: *     November 2006
011: *
012: *     .. Scalar Arguments ..
013:       CHARACTER          JOBZ, RANGE
014:       INTEGER            IL, INFO, IU, LDZ, LIWORK, LWORK, M, N
015:       DOUBLE PRECISION ABSTOL, VL, VU
016: *     ..
017: *     .. Array Arguments ..
018:       INTEGER            ISUPPZ( * ), IWORK( * )
019:       DOUBLE PRECISION   D( * ), E( * ), W( * ), WORK( * )
020:       DOUBLE PRECISION   Z( LDZ, * )
021: *     ..
022: *
023: *  Purpose
024: *  =======
025: *
026: *  DSTEGR computes selected eigenvalues and, optionally, eigenvectors
027: *  of a real symmetric tridiagonal matrix T. Any such unreduced matrix has
028: *  a well defined set of pairwise different real eigenvalues, the corresponding
029: *  real eigenvectors are pairwise orthogonal.
030: *
031: *  The spectrum may be computed either completely or partially by specifying
032: *  either an interval (VL,VU] or a range of indices IL:IU for the desired
033: *  eigenvalues.
034: *
035: *  DSTEGR is a compatability wrapper around the improved DSTEMR routine.
036: *  See DSTEMR for further details.
037: *
038: *  One important change is that the ABSTOL parameter no longer provides any
039: *  benefit and hence is no longer used.
040: *
041: *  Note : DSTEGR and DSTEMR work only on machines which follow
042: *  IEEE-754 floating-point standard in their handling of infinities and
043: *  NaNs.  Normal execution may create these exceptiona values and hence
044: *  may abort due to a floating point exception in environments which
045: *  do not conform to the IEEE-754 standard.
046: *
047: *  Arguments
048: *  =========
049: *
050: *  JOBZ    (input) CHARACTER*1
051: *          = 'N':  Compute eigenvalues only;
052: *          = 'V':  Compute eigenvalues and eigenvectors.
053: *
054: *  RANGE   (input) CHARACTER*1
055: *          = 'A': all eigenvalues will be found.
056: *          = 'V': all eigenvalues in the half-open interval (VL,VU]
057: *                 will be found.
058: *          = 'I': the IL-th through IU-th eigenvalues will be found.
059: *
060: *  N       (input) INTEGER
061: *          The order of the matrix.  N >= 0.
062: *
063: *  D       (input/output) DOUBLE PRECISION array, dimension (N)
064: *          On entry, the N diagonal elements of the tridiagonal matrix
065: *          T. On exit, D is overwritten.
066: *
067: *  E       (input/output) DOUBLE PRECISION array, dimension (N)
068: *          On entry, the (N-1) subdiagonal elements of the tridiagonal
069: *          matrix T in elements 1 to N-1 of E. E(N) need not be set on
070: *          input, but is used internally as workspace.
071: *          On exit, E is overwritten.
072: *
073: *  VL      (input) DOUBLE PRECISION
074: *  VU      (input) DOUBLE PRECISION
075: *          If RANGE='V', the lower and upper bounds of the interval to
076: *          be searched for eigenvalues. VL < VU.
077: *          Not referenced if RANGE = 'A' or 'I'.
078: *
079: *  IL      (input) INTEGER
080: *  IU      (input) INTEGER
081: *          If RANGE='I', the indices (in ascending order) of the
082: *          smallest and largest eigenvalues to be returned.
083: *          1 <= IL <= IU <= N, if N > 0.
084: *          Not referenced if RANGE = 'A' or 'V'.
085: *
086: *  ABSTOL  (input) DOUBLE PRECISION
087: *          Unused.  Was the absolute error tolerance for the
088: *          eigenvalues/eigenvectors in previous versions.
089: *
090: *  M       (output) INTEGER
091: *          The total number of eigenvalues found.  0 <= M <= N.
092: *          If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1.
093: *
094: *  W       (output) DOUBLE PRECISION array, dimension (N)
095: *          The first M elements contain the selected eigenvalues in
096: *          ascending order.
097: *
098: *  Z       (output) DOUBLE PRECISION array, dimension (LDZ, max(1,M) )
099: *          If JOBZ = 'V', and if INFO = 0, then the first M columns of Z
100: *          contain the orthonormal eigenvectors of the matrix T
101: *          corresponding to the selected eigenvalues, with the i-th
102: *          column of Z holding the eigenvector associated with W(i).
103: *          If JOBZ = 'N', then Z is not referenced.
104: *          Note: the user must ensure that at least max(1,M) columns are
105: *          supplied in the array Z; if RANGE = 'V', the exact value of M
106: *          is not known in advance and an upper bound must be used.
107: *          Supplying N columns is always safe.
108: *
109: *  LDZ     (input) INTEGER
110: *          The leading dimension of the array Z.  LDZ >= 1, and if
111: *          JOBZ = 'V', then LDZ >= max(1,N).
112: *
113: *  ISUPPZ  (output) INTEGER ARRAY, dimension ( 2*max(1,M) )
114: *          The support of the eigenvectors in Z, i.e., the indices
115: *          indicating the nonzero elements in Z. The i-th computed eigenvector
116: *          is nonzero only in elements ISUPPZ( 2*i-1 ) through
117: *          ISUPPZ( 2*i ). This is relevant in the case when the matrix
118: *          is split. ISUPPZ is only accessed when JOBZ is 'V' and N > 0.
119: *
120: *  WORK    (workspace/output) DOUBLE PRECISION array, dimension (LWORK)
121: *          On exit, if INFO = 0, WORK(1) returns the optimal
122: *          (and minimal) LWORK.
123: *
124: *  LWORK   (input) INTEGER
125: *          The dimension of the array WORK. LWORK >= max(1,18*N)
126: *          if JOBZ = 'V', and LWORK >= max(1,12*N) if JOBZ = 'N'.
127: *          If LWORK = -1, then a workspace query is assumed; the routine
128: *          only calculates the optimal size of the WORK array, returns
129: *          this value as the first entry of the WORK array, and no error
130: *          message related to LWORK is issued by XERBLA.
131: *
132: *  IWORK   (workspace/output) INTEGER array, dimension (LIWORK)
133: *          On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
134: *
135: *  LIWORK  (input) INTEGER
136: *          The dimension of the array IWORK.  LIWORK >= max(1,10*N)
137: *          if the eigenvectors are desired, and LIWORK >= max(1,8*N)
138: *          if only the eigenvalues are to be computed.
139: *          If LIWORK = -1, then a workspace query is assumed; the
140: *          routine only calculates the optimal size of the IWORK array,
141: *          returns this value as the first entry of the IWORK array, and
142: *          no error message related to LIWORK is issued by XERBLA.
143: *
144: *  INFO    (output) INTEGER
145: *          On exit, INFO
146: *          = 0:  successful exit
147: *          < 0:  if INFO = -i, the i-th argument had an illegal value
148: *          > 0:  if INFO = 1X, internal error in DLARRE,
149: *                if INFO = 2X, internal error in DLARRV.
150: *                Here, the digit X = ABS( IINFO ) < 10, where IINFO is
151: *                the nonzero error code returned by DLARRE or
152: *                DLARRV, respectively.
153: *
154: *  Further Details
155: *  ===============
156: *
157: *  Based on contributions by
158: *     Inderjit Dhillon, IBM Almaden, USA
159: *     Osni Marques, LBNL/NERSC, USA
160: *     Christof Voemel, LBNL/NERSC, USA
161: *
162: *  =====================================================================
163: *
164: *     .. Local Scalars ..
165:       LOGICAL TRYRAC
166: *     ..
167: *     .. External Subroutines ..
168:       EXTERNAL DSTEMR
169: *     ..
170: *     .. Executable Statements ..
171:       INFO = 0
172:       TRYRAC = .FALSE.
173: 
174:       CALL DSTEMR( JOBZ, RANGE, N, D, E, VL, VU, IL, IU,
175:      $                   M, W, Z, LDZ, N, ISUPPZ, TRYRAC, WORK, LWORK,
176:      $                   IWORK, LIWORK, INFO )
177: *
178: *     End of DSTEGR
179: *
180:       END
181: