LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dstevd ( character  JOBZ,
integer  N,
double precision, dimension( * )  D,
double precision, dimension( * )  E,
double precision, dimension( ldz, * )  Z,
integer  LDZ,
double precision, dimension( * )  WORK,
integer  LWORK,
integer, dimension( * )  IWORK,
integer  LIWORK,
integer  INFO 
)

DSTEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices

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

Purpose:
 DSTEVD computes all eigenvalues and, optionally, eigenvectors of a
 real symmetric tridiagonal matrix. If eigenvectors are desired, it
 uses a divide and conquer algorithm.

 The divide and conquer algorithm makes very mild assumptions about
 floating point arithmetic. It will work on machines with a guard
 digit in add/subtract, or on those binary machines without guard
 digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
 Cray-2. It could conceivably fail on hexadecimal or decimal machines
 without guard digits, but we know of none.
Parameters
[in]JOBZ
          JOBZ is CHARACTER*1
          = 'N':  Compute eigenvalues only;
          = 'V':  Compute eigenvalues and eigenvectors.
[in]N
          N is INTEGER
          The order of the matrix.  N >= 0.
[in,out]D
          D is DOUBLE PRECISION array, dimension (N)
          On entry, the n diagonal elements of the tridiagonal matrix
          A.
          On exit, if INFO = 0, the eigenvalues in ascending order.
[in,out]E
          E is DOUBLE PRECISION array, dimension (N-1)
          On entry, the (n-1) subdiagonal elements of the tridiagonal
          matrix A, stored in elements 1 to N-1 of E.
          On exit, the contents of E are destroyed.
[out]Z
          Z is DOUBLE PRECISION array, dimension (LDZ, N)
          If JOBZ = 'V', then if INFO = 0, Z contains the orthonormal
          eigenvectors of the matrix A, with the i-th column of Z
          holding the eigenvector associated with D(i).
          If JOBZ = 'N', then Z is not referenced.
[in]LDZ
          LDZ is INTEGER
          The leading dimension of the array Z.  LDZ >= 1, and if
          JOBZ = 'V', LDZ >= max(1,N).
[out]WORK
          WORK is DOUBLE PRECISION array,
                                         dimension (LWORK)
          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
[in]LWORK
          LWORK is INTEGER
          The dimension of the array WORK.
          If JOBZ  = 'N' or N <= 1 then LWORK must be at least 1.
          If JOBZ  = 'V' and N > 1 then LWORK must be at least
                         ( 1 + 4*N + N**2 ).

          If LWORK = -1, then a workspace query is assumed; the routine
          only calculates the optimal sizes of the WORK and IWORK
          arrays, returns these values as the first entries of the WORK
          and IWORK arrays, and no error message related to LWORK 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 LIWORK.
[in]LIWORK
          LIWORK is INTEGER
          The dimension of the array IWORK.
          If JOBZ  = 'N' or N <= 1 then LIWORK must be at least 1.
          If JOBZ  = 'V' and N > 1 then LIWORK must be at least 3+5*N.

          If LIWORK = -1, then a workspace query is assumed; the
          routine only calculates the optimal sizes of the WORK and
          IWORK arrays, returns these values as the first entries of
          the WORK and IWORK arrays, and no error message related to
          LWORK 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:  if INFO = i, the algorithm failed to converge; i
                off-diagonal elements of E did not converge to zero.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 165 of file dstevd.f.

165 *
166 * -- LAPACK driver routine (version 3.4.0) --
167 * -- LAPACK is a software package provided by Univ. of Tennessee, --
168 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
169 * November 2011
170 *
171 * .. Scalar Arguments ..
172  CHARACTER jobz
173  INTEGER info, ldz, liwork, lwork, n
174 * ..
175 * .. Array Arguments ..
176  INTEGER iwork( * )
177  DOUBLE PRECISION d( * ), e( * ), work( * ), z( ldz, * )
178 * ..
179 *
180 * =====================================================================
181 *
182 * .. Parameters ..
183  DOUBLE PRECISION zero, one
184  parameter ( zero = 0.0d0, one = 1.0d0 )
185 * ..
186 * .. Local Scalars ..
187  LOGICAL lquery, wantz
188  INTEGER iscale, liwmin, lwmin
189  DOUBLE PRECISION bignum, eps, rmax, rmin, safmin, sigma, smlnum,
190  $ tnrm
191 * ..
192 * .. External Functions ..
193  LOGICAL lsame
194  DOUBLE PRECISION dlamch, dlanst
195  EXTERNAL lsame, dlamch, dlanst
196 * ..
197 * .. External Subroutines ..
198  EXTERNAL dscal, dstedc, dsterf, xerbla
199 * ..
200 * .. Intrinsic Functions ..
201  INTRINSIC sqrt
202 * ..
203 * .. Executable Statements ..
204 *
205 * Test the input parameters.
206 *
207  wantz = lsame( jobz, 'V' )
208  lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
209 *
210  info = 0
211  liwmin = 1
212  lwmin = 1
213  IF( n.GT.1 .AND. wantz ) THEN
214  lwmin = 1 + 4*n + n**2
215  liwmin = 3 + 5*n
216  END IF
217 *
218  IF( .NOT.( wantz .OR. lsame( jobz, 'N' ) ) ) THEN
219  info = -1
220  ELSE IF( n.LT.0 ) THEN
221  info = -2
222  ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) ) THEN
223  info = -6
224  END IF
225 *
226  IF( info.EQ.0 ) THEN
227  work( 1 ) = lwmin
228  iwork( 1 ) = liwmin
229 *
230  IF( lwork.LT.lwmin .AND. .NOT.lquery ) THEN
231  info = -8
232  ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery ) THEN
233  info = -10
234  END IF
235  END IF
236 *
237  IF( info.NE.0 ) THEN
238  CALL xerbla( 'DSTEVD', -info )
239  RETURN
240  ELSE IF( lquery ) THEN
241  RETURN
242  END IF
243 *
244 * Quick return if possible
245 *
246  IF( n.EQ.0 )
247  $ RETURN
248 *
249  IF( n.EQ.1 ) THEN
250  IF( wantz )
251  $ z( 1, 1 ) = one
252  RETURN
253  END IF
254 *
255 * Get machine constants.
256 *
257  safmin = dlamch( 'Safe minimum' )
258  eps = dlamch( 'Precision' )
259  smlnum = safmin / eps
260  bignum = one / smlnum
261  rmin = sqrt( smlnum )
262  rmax = sqrt( bignum )
263 *
264 * Scale matrix to allowable range, if necessary.
265 *
266  iscale = 0
267  tnrm = dlanst( 'M', n, d, e )
268  IF( tnrm.GT.zero .AND. tnrm.LT.rmin ) THEN
269  iscale = 1
270  sigma = rmin / tnrm
271  ELSE IF( tnrm.GT.rmax ) THEN
272  iscale = 1
273  sigma = rmax / tnrm
274  END IF
275  IF( iscale.EQ.1 ) THEN
276  CALL dscal( n, sigma, d, 1 )
277  CALL dscal( n-1, sigma, e( 1 ), 1 )
278  END IF
279 *
280 * For eigenvalues only, call DSTERF. For eigenvalues and
281 * eigenvectors, call DSTEDC.
282 *
283  IF( .NOT.wantz ) THEN
284  CALL dsterf( n, d, e, info )
285  ELSE
286  CALL dstedc( 'I', n, d, e, z, ldz, work, lwork, iwork, liwork,
287  $ info )
288  END IF
289 *
290 * If matrix was scaled, then rescale eigenvalues appropriately.
291 *
292  IF( iscale.EQ.1 )
293  $ CALL dscal( n, one / sigma, d, 1 )
294 *
295  work( 1 ) = lwmin
296  iwork( 1 ) = liwmin
297 *
298  RETURN
299 *
300 * End of DSTEVD
301 *
subroutine dsterf(N, D, E, INFO)
DSTERF
Definition: dsterf.f:88
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine dscal(N, DA, DX, INCX)
DSCAL
Definition: dscal.f:55
subroutine dstedc(COMPZ, N, D, E, Z, LDZ, WORK, LWORK, IWORK, LIWORK, INFO)
DSTEDC
Definition: dstedc.f:191
double precision function dlanst(NORM, N, D, E)
DLANST returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric tridiagonal matrix.
Definition: dlanst.f:102
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: