XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ dstevr()

void dstevr ( char  jobz,
char  range,
int  n,
double  d[],
double  e[],
double  vl,
double  vu,
int  il,
int  iu,
double  abstol,
int *  m,
double  w[],
int  ldz,
double  z[],
int  isuppz[],
double  work[],
int  lwork,
int  iwork[],
int  liwork,
int *  info 
)

(MRRR driver) Eigenvalues and eigenvectors of a symmetric tridiagonal matrix

Purpose
This routine computes selected eigenvalues and, optionally, eigenvectors of a real symmetric tridiagonal matrix T. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.

Whenever possible, this routine calls dstemr to compute the eigenspectrum using RRR (Relatively Robust Representations). dstemr computes eigenvalues by the dqds algorithm, while orthogonal eigenvectors are computed from various "good" L D L^T representations (also known as RRR).

Parameters
[in]jobz= 'N': Compute eigenvalues only.
= 'V': Compute eigenvalues and eigenvectors.
[in]range= '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 dstein are called.
[in]nOrder of the matrix A. (n >= 0) (If n = 0, returns without computation)
[in,out]d[]Array d[ld] (ld >= n)
[in] n diagonal elements of the symmetric tridiagonal matrix A.
[out] d[] may be multiplied by a constant factor chosen to avoid over/underflow in computing the eigenvalues.
[in,out]e[]Array e[le] (le >= n - 1)
[in] n - 1 subdiagonal elements of the symmetric tridiagonal matrix A stored in elements 0 to n - 2 of e[].
[out] e[] may be multiplied by a constant factor chosen to avoid over/underflow in computing the eigenvalues.
[in]vlrange = 'V': The lower bound of the interval to be searched for eigenvalues. (vl < vu)
range = 'A' or 'I': Not referenced.
[in]vurange = 'V': The upper bound of the interval to be searched for eigenvalues. (vl < vu)
range = 'A' or 'I': Not referenced.
[in]ilrange = '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)
range = 'A' or 'V': Not referenced.
[in]iurange = 'I': The index of the largest eigenvalues to be returned. (1 <= il <= iu <= n, if n > 0; il = 1 and iu = 0 if n = 0)
range = 'A' or 'V': Not referenced.
[in]abstolThe 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('S'). 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, "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]mThe total number of eigenvalues found. (0 <= m <= n)
If range = 'A', m = n, and if range = 'I', m = iu - il + 1.
[out]w[]Array w[lw] (lw >= n)
The first m elements contain the selected eigenvalues in ascending order.
[in]ldzLeading dimension of the two dimensional array z[][]. (ldz >= 1 (jobz = 'N'), ldz >= max(1, n) (jobz = 'V'))
[out]z[][]Array z[lz][ldz] (lz >= max(1, m))
jobz = 'V': If info = 0, the first m rows of z[][] contain the orthonormal eigenvectors of the matrix A corresponding to the selected eigenvalues, with the i-th row of z[][] holding the eigenvector associated with w[i].
Note: The user must ensure that at least max(1, m) rows 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.
[out]isuppz[]Array isuppz[lisuppz] (lisuppz >= 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-1)+1].
Implemented only for range = 'A' or 'I' and iu - il = n - 1.
[out]work[]Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe size of work[]. (lwork >= max(1, 20*n))
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] and iwork[] arrays, and returns these values in work[0] and iwork[0].
[out]iwork[]Array iwork[liwork]
Integer work array.
On exit, if info = 0, iwork[0] returns the optimal liwork.
[in]liworkThe size of iwork[]. (liwork >= max(1, 10*n))
If liwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] and iwork[] arrays, and returns these values in work[0] and iwork[0].
[out]info= 0: Successful exit
= -1: The argument jobz had an illegal value (jobz != 'V' nor 'N')
= -2: The argument range had an illegal value. (range != 'A', 'V' nor 'I')
= -3: The argument n had an illegal value (n < 0)
= -7: The argument vu had an illegal value. (vu <= vl)
= -8: The argument il had an illegal value. (il < 1 or il > n)
= -9: The argument iu had an illegal value. (iu < min(n, il) or iu > n)
= -13: The argument ldz had an illegal value (ldz too small)
= -17: The argument lwork had an illegal value. (lwork too small)
= -19: The argument liwork had an illegal value. (liwork too small)
= > 0: Internal error.
Reference
LAPACK