?steqr
?steqr
Computes all eigenvalues and eigenvectors of a symmetric or Hermitian matrix reduced to tridiagonal form (QR algorithm).
Syntax
lapack_int LAPACKE_ssteqr
(
int
matrix_layout
,
char
compz
,
lapack_int
n
,
float*
d
,
float*
e
,
float*
z
,
lapack_int
ldz
);
lapack_int LAPACKE_dsteqr
(
int
matrix_layout
,
char
compz
,
lapack_int
n
,
double*
d
,
double*
e
,
double*
z
,
lapack_int
ldz
);
lapack_int LAPACKE_csteqr
(
int
matrix_layout
,
char
compz
,
lapack_int
n
,
float*
d
,
float*
e
,
lapack_complex_float*
z
,
lapack_int
ldz
);
lapack_int LAPACKE_zsteqr
(
int
matrix_layout
,
char
compz
,
lapack_int
n
,
double*
d
,
double*
e
,
lapack_complex_double*
z
,
lapack_int
ldz
);
Include Files
- mkl.h
Description
The routine computes all the eigenvalues and (optionally) all the eigenvectors of a real symmetric tridiagonal matrix . Here ;
T
. In other words, the routine can compute the spectral factorization: T
= Z
*Λ
*Z
T
Λ
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
i
= 1, 2, ..., n
The routine normalizes the eigenvectors so that
||z||
.i
2
= 1You can also use the routine for computing the eigenvalues and eigenvectors of an arbitrary real symmetric (or complex Hermitian) matrix . In this case, the spectral factorization is as follows: = (. Before calling
A
reduced to tridiagonal form T
: A
= Q*T*Q
H
A
= Q*T*Q
H
Q*Z
)*Λ
*(Q*Z
)H
?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' ) |
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, the routine computes eigenvalues only.compz='N'If, the routine computes the eigenvalues and eigenvectors of the tridiagonal matrixcompz='I'T.If, the routine computes the eigenvalues and eigenvectors of the original symmetric matrix. On entry,compz='V'zmust contain the orthogonal matrix used to reduce the original matrix to tridiagonal form.
- n
- The order of the matrixT().n≥0
- d,e
- Arrays:dcontains the diagonal elements ofT.The size ofdmust be at least max(1,n).econtains the off-diagonal elements ofT.The size ofemust be at least max(1,n-1).
- z
- Array, sizemax(1,.ldz*n)Iforcompz='N''I',zneed not be set.If,vect='V'zmust contain the orthogonal matrix used in the reduction to tridiagonal form.
- ldz
- The leading dimension ofz. Constraints:ifldz≥1;compz='N'ifldz≥max(1,n)orcompz='V''I'.
Output Parameters
- d
- Theneigenvalues in ascending order, unlessinfo> 0.See alsoinfo.
- e
- On exit, the array is overwritten; seeinfo.
- z
- If, contains theinfo= 0n-by-nmatrix the columns of which are orthonormal eigenvectors (thei-th column corresponds to thei-th eigenvalue).
Return Values
This function returns a value
info
.If , the execution is successful.
info
=0If , the algorithm failed to find all the eigenvalues after 30
info
= i
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 , the
info
= -i
i
-th parameter had an illegal value.Application Notes
The computed eigenvalues and eigenvectors are exact for a matrix such that
T
+E
||
, where E
||2
= O
(ε
)*||T
||2
ε
is the machine precision.If is an exact eigenvalue, and is the corresponding computed value, then
λ
i
μ
i
| - |
μ
i
λ
i
≤
c
(n
)*ε
*||T
||2
where is a modestly increasing function of
c
(n
)n
. If is the corresponding exact eigenvector, and is the corresponding computed vector, then the angle , ) between them is bounded as follows:
z
i
w
i
θ
(z
i
w
i
θ
(z
i
w
i
≤
c
(n
)*ε
*||T
||2
/ mini
≠
j
λ
i
λ
j
The total number of floating-point operations depends on how rapidly the algorithm converges. Typically, it is about
24;
n
2
if compz
= 'N'
7
(for complex flavors, n
3
14
) if n
3
compz
= 'V'
'I'
.