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

◆ dstedc()

void dstedc ( char  compz,
int  n,
double  d[],
double  e[],
int  ldz,
double  z[],
double  work[],
int  lwork,
int  iwork[],
int  liwork,
int *  info 
)

Eigenvalues and eigenvectors of a symmetric tridiagonal matrix (Divide and conquer method)

Purpose
This routine computes all eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal matrix using the divide and conquer method. The eigenvectors of a full or band real symmetric matrix can also be found if dsytrd or dsptrd or dsbtrd has been used to reduce this matrix to tridiagonal form.
Parameters
[in]compz= 'N': Compute eigenvalues only.
= 'I': Compute eigenvalues and eigenvectors of the tridiagonal matrix.
= 'V': Compute eigenvalues and eigenvectors of the original symmetric matrix. On entry, z[][] must contain the orthogonal matrix used to reduce the original matrix to tridiagonal form.
[in]nOrder of the matrix. (n >= 0) (If n = 0, returns without computation)
[in,out]d[]Array d[ld] (ld >= n)
[in] The diagonal elements of the tridiagonal matrix.
[out] If info = 0, the eigenvalues in ascending order.
[in,out]e[]Array e[le] (le >= n - 1)
[in] The (n-1) subdiagonal elements of the tridiagonal matrix.
[out] e[] has been destroyed.
[in]ldzLeading dimension of the two dimensional array z[][]. (ldz >= 1 if compz = 'N', ldz >= max(1, n) if compz = 'V' or 'I')
[in,out]z[][]Array z[lz][ldz] (lz >= n)
[in] If compz = 'V', then z[][] contains the orthogonal matrix used in the reduction to tridiagonal form.
[out] If info = 0, then if compz = 'V', z[][] contains the orthonormal eigenvectors of the original symmetric matrix, and if compz = 'I', z[][] contains the orthonormal eigenvectors of the symmetric tridiagonal matrix. If compz = 'N', then z[][] is not referenced.
[out]work[]Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe size of work[]. (lwork >= 1 if compz = 'N' or n <= 1, lwork >= 1 + 3*n + 2*n*lg(n) + 4*n^2 if compz = 'V' and n > 1 (where lg(n) = smallest integer k such that 2^k >= n), lwork >= 1 + 4*n + n^2 if compz = 'I' and n > 1)
Note that for compz = 'I' or 'V', then if n is less than or equal to the minimum divide size, usually 25, then lwork need only be max(1, 2*(n - 1)).
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] array, and returns the value in work[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 >= 1 if compz = 'N' or n <= 1, liwork >= 6 + 6*n + 5*n*lg(n) if compz = 'V' and n > 1 (where lg(n) = smallest integer k such that 2^k >= n), liwork >= 3 + 5*n if compz = 'I' and n > 1)
Note that for compz = 'I' or 'V', then if n is less than or equal to the minimum divide size, usually 25, then liwork need only be 1.
If liwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the iwork[] array, and returns the value in iwork[0].
[out]info= 0: Successful exit.
= -1: The argument compz an illegal value. (compz != 'N', 'I' nor 'V')
= -2: The argument n had an illegal value. (n < 0)
= -5: The argument ldz had an illegal value. (ldz < 1 or (compz = 'V' or 'I' and ldz < max(1, n)))
= -8: The argument lwork had an illegal value. (lwork too small)
= -10: The argument liwork had an illegal value. (liwork too small)
= i > 0: The algorithm has failed to compute an eigenvalue while working on the submatrix lying in rows and columns i/(n + 1) through mod(i, n + 1).
Reference
LAPACK