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