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

◆ dstev()

void dstev ( char  jobz,
int  n,
double  d[],
double  e[],
int  ldz,
double  z[],
double  work[],
int *  info 
)

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

Purpose
This routine computes all eigenvalues and, optionally, eigenvectors of a real symmetric tridiagonal matrix A. If eigenvectors are desired, it uses a QL or QR method.
Parameters
[in]jobz= 'N': Compute eigenvalues only.
= 'V': Compute eigenvalues and eigenvectors.
[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] If info = 0, the eigenvalues in ascending order.
[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] The contents of e[] are destroyed.
[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 >= n)
jobz = 'V': If info = 0, z[][] contains the orthonormal eigenvectors of the matrix A, with the i-th row of z[][] holding the eigenvector associated with d[i].
jobz = 'N': z[][] is not referenced.
[out]work[]Array work[lwork] (lwork >= max(1, 2*n-2))
Work array.
If jobz = 'N', work[] is not referenced.
[out]info= 0: Successful exit
= -1: The argument jobz had an illegal value (jobz != 'V' nor 'N')
= -2: The argument n had an illegal value (n < 0)
= -5: The argument ldz had an illegal value (ldz too small)
= i > 0: The algorithm failed to converge; i off-diagonal elements of e[] did not converge to zero
Reference
LAPACK