Developer Reference for Intel® oneAPI Math Kernel Library for C
?steqr
Computes all eigenvalues and eigenvectors of a symmetric or Hermitian matrix reduced to tridiagonal form (QR algorithm).
Syntax
lapack_int LAPACKE_ssteqr ( intmatrix_layout , charcompz , lapack_intn , float*d , float*e , float*z , lapack_intldz );
lapack_int LAPACKE_dsteqr ( intmatrix_layout , charcompz , lapack_intn , double*d , double*e , double*z , lapack_intldz );
lapack_int LAPACKE_csteqr ( intmatrix_layout , charcompz , lapack_intn , float*d , float*e , lapack_complex_float*z , lapack_intldz );
lapack_int LAPACKE_zsteqr ( intmatrix_layout , charcompz , lapack_intn , double*d , double*e , lapack_complex_double*z , lapack_intldz );
Include Files
mkl.h
Description
ssteqr dsteqr csteqr zsteqr rsteqr steqr
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: T = Z*Λ*Z^{T} . Here Λ is a diagonal matrix whose diagonal elements are the eigenvalues λ i ; Z is an orthogonal matrix whose columns are eigenvectors. Thus,
T*z_{i} = λ_{i}*z_{i} for i = 1, 2, ..., n .
The routine normalizes the eigenvectors so that ||z_{i}||_{2} = 1 .
You can also use the routine for computing the eigenvalues and eigenvectors of an arbitrary real symmetric (or complex Hermitian) matrix A reduced to tridiagonal form T : A = Q*T*Q^{H} . In this case, the spectral factorization is as follows: A = Q*T*Q^{H} = (Q*Z)*Λ*(Q*Z)^{H} . Before calling ?steqr , you must reduce A to tridiagonal form and generate the explicit matrix Q by calling the following routines:
for real matrices: |
for complex matrices: |
|
|---|---|---|
full storage |
?sytrd , ?orgtr |
?hetrd , ?ungtr |
packed storage |
?sptrd , ?opgtr |
?hptrd , ?upgtr |
band storage |
?sbtrd(vect = ‘V’ ) |
?hbtrd(vect = ‘V’ ) |
If you need eigenvalues only, it ‘ s more efficient to call sterf . If T is positive-definite, pteqr can compute small eigenvalues more accurately than ?steqr .
To solve the problem by a single call, use one of the divide and conquer routines stevd , syevd , spevd , or sbevd for real symmetric matrices or heevd , hpevd , or hbevd for complex Hermitian matrices.
Input Parameters
- matrix_layout
-
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
compz
Must be ‘N’ or ‘I’ or ‘V’ .
If compz = 'N' , the routine computes eigenvalues only. If compz = 'I' , the routine computes the eigenvalues and eigenvectors of the tridiagonal matrix T . If compz = 'V' , the routine computes the 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.
n
The order of the matrix T ( n≥ 0 ).
- d , e , work
-
REAL for single-precision flavors DOUBLE PRECISION for double-precision flavors. Arrays:
d contains the diagonal elements of T .
The size of d must be at least max(1, n ).
e contains the off-diagonal elements of T .
The size of e must be at least max(1, n -1).
work is a workspace array.
The size of work must be: at least 1 if compz = 'N' ; at least max(1, 2* n -2) if compz = 'V' or ‘I’ .
- z
-
REAL for ssteqr DOUBLE PRECISION for dsteqr COMPLEX for csteqr DOUBLE COMPLEX for zsteqr .
Array, size max(1, ldz * n ) .
If compz = 'N' or ‘I’ , z need not be set. If vect = 'V' , z must contain the orthogonal matrix used in the reduction to tridiagonal form. The second dimension of z must be: at least 1 if compz = 'N' ; at least max(1, n ) if compz = 'V' or ‘I’ . work ( lwork ) is a workspace array.
ldz
The leading dimension of z . Constraints:
ldz≥ 1 if compz = 'N' ; ldz≥ max(1, n) if compz = 'V' or ‘I’ .
Output Parameters
- d
-
The n eigenvalues in ascending order, unless info > 0. See also info .
- e
-
On exit, the array is overwritten; see info .
- z
-
If info = 0 , contains the n -by- n matrix the columns of which are orthonormal eigenvectors (the i -th column corresponds to the i -th eigenvalue).
Return Values
This function returns a value info .
If info=0 , the execution is successful.
If info = i , the algorithm failed to find all the eigenvalues after 30 n iterations: i off-diagonal elements have not converged to zero. On exit, d and e contain, respectively, the diagonal and off-diagonal elements of a tridiagonal matrix orthogonally similar to T .
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}|\) .
The total number of floating-point operations depends on how rapidly the algorithm converges. Typically, it is about
\(24n^{2} if compz = 'N';\)
\(7n^{3}\) (for complex flavors, \(14n^{3}\) ) if compz = 'V' or ‘I’ .