Developer Reference for Intel® oneAPI Math Kernel Library for C
?stevd
Computes all eigenvalues and, optionally, all eigenvectors of a real symmetric tridiagonal matrix using divide and conquer algorithm.
Syntax
lapack_intLAPACKE_sstevd ( intmatrix_layout , charjobz , lapack_intn , float*d , float*e , float*z , lapack_intldz );
lapack_intLAPACKE_dstevd ( intmatrix_layout , charjobz , lapack_intn , double*d , double*e , double*z , lapack_intldz );
Include Files
mkl.h
Description
sstevd dstevd stevd
The routine computes all the eigenvalues, and optionally all the eigenvectors, of a real symmetric tridiagonal matrix T . In other words, the routine can compute the spectral factorization of T as: T = Z*Λ*Z^{T} .
Here Λ is a diagonal matrix whose diagonal elements are the eigenvalues λ i , and Z is the orthogonal matrix whose columns are the eigenvectors zi . Thus,
T*z_{i} = λ_{i}*z_{i} for i = 1, 2, ..., n .
If the eigenvectors are requested, then this routine uses a divide and conquer algorithm to compute eigenvalues and eigenvectors. However, if only eigenvalues are required, then it uses the Pal-Walker-Kahan variant of the QL or QR algorithm.
There is no complex analogue of this routine.
Input Parameters
- matrix_layout
-
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
jobz
Must be ‘N’ or ‘V’ .
If jobz = 'N' , then only eigenvalues are computed. If jobz = 'V' , then eigenvalues and eigenvectors are computed.
n
The order of the matrix T ( n ≥ 0 ).
- d , e , work
-
REAL for sstevd DOUBLE PRECISION for dstevd . Arrays: d(*) contains the n diagonal elements of the tridiagonal matrix T . The dimension of d must be at least max(1, n ). e(*) contains the n -1 off-diagonal elements of T . The dimension of e must be at least max(1, n ). The n- th element of this array is used as workspace. work (*) is a workspace array. The dimension of work must be at least lwork .
ldz
The leading dimension of the output array z . Constraints:
ldz≥ 1 if job = 'N' ; ldz≥ max(1, n) if job = 'V' .
lwork
The dimension of the array work . Constraints: if jobz = 'N' or n ≤ 1 , then lwork ≥ 1 ; if jobz = 'V' and n > 1 , then lwork ≥n^{2 }+ 4*n + 1 . If lwork = -1 , then a workspace query is assumed; the routine only calculates the required 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 . See Application Notes for details.
iwork
Workspace array, its dimension max(1, liwork) .
liwork
The dimension of the array iwork . Constraints: if jobz = 'N' or n ≤ 1 , then liwork ≥ 1 ; if jobz = 'V' and n > 1 , then liwork ≥ 5*n+3 . If liwork = -1 , then a workspace query is assumed; the routine only calculates the required 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 . See Application Notes for details.
Output Parameters
- d
-
On exit, if info = 0 , contains the eigenvalues of the matrix T in ascending order. See also info .
- z
-
REAL for sstevd DOUBLE PRECISION for dstevd
Array, size max(1, ldz * n ) if jobz = 'V' and 1 if jobz = 'N' .
The second dimension of z must be: at least 1 if jobz = 'N' ; at least max(1, n ) if jobz = 'V' . If jobz = 'V' , then this array is overwritten by the orthogonal matrix Z which contains the eigenvectors of T . If jobz = 'N' , then z is not referenced.
- e
-
On exit, this array is overwritten with intermediate results.
- work(1)
-
On exit, if lwork > 0 , then work(1) returns the required minimal size of lwork .
- iwork(1)
-
On exit, if liwork > 0 , then iwork(1) returns the required minimal size of liwork .
Return Values
This function returns a value info .
If info=0 , the execution is successful.
If info = i , then the algorithm failed to converge; i indicates the number of elements of an intermediate tridiagonal form which did not converge to zero.
If info = -i , the i -th parameter had an illegal value.
LAPACK 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.
Application Notes
The computed eigenvalues and eigenvectors are exact for a matrix \(T+E\) such that \(||E||_{2} = O(\varepsilon) ||T||_{2}\) , where \(\varepsilon\) is the machine precision.
If λ i is an exact eigenvalue, and μ i is the corresponding computed value, then
\(|\mu_{i} - \lambda_{i}| \leq c(n) \varepsilon ||T||_{2}\)
where c(n) is a modestly increasing function of n .
If zi is the corresponding exact eigenvector, and wi is the corresponding computed vector, then the angle \(\theta(z_{i}, w_{i})\) between them is bounded as follows:
\(\theta(z_{i}, w_{i}) \leq c(n) \varepsilon ||T||_{2} / min _{i\neq j}|\lambda_{i} - \lambda_{j}|\) .
Thus the accuracy of a computed eigenvector depends on the gap between its eigenvalue and all the other eigenvalues.