?pteqr
?pteqr
Computes all eigenvalues and (optionally) all eigenvectors of a real symmetric positive-definite tridiagonal matrix.
Syntax
lapack_int LAPACKE_spteqr
(
int
matrix_layout
,
char
compz
,
lapack_int
n
,
float*
d
,
float*
e
,
float*
z
,
lapack_int
ldz
);
lapack_int LAPACKE_dpteqr
(
int
matrix_layout
,
char
compz
,
lapack_int
n
,
double*
d
,
double*
e
,
double*
z
,
lapack_int
ldz
);
lapack_int LAPACKE_cpteqr
(
int
matrix_layout
,
char
compz
,
lapack_int
n
,
float*
d
,
float*
e
,
lapack_complex_float*
z
,
lapack_int
ldz
);
lapack_int LAPACKE_zpteqr
(
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 positive-definite 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
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 real symmetric (or complex Hermitian) positive-definite matrices . 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
QZ
)*Λ
*(QZ
)H
?pteqr
, 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' ) |
The routine first factorizes where and calls
T
as L*D*L
H
L
is a unit lower bidiagonal matrix, and D
is a diagonal matrix. Then it forms the bidiagonal matrix B
= L*D
1/2
?bdsqr
to compute the singular values of B
, which are the square roots of the eigenvalues of T
.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 ofcompz='V'A(and the arrayzmust contain the matrixQon entry).
- 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,compz='V'zmust contain the orthogonal matrix used in the reduction to tridiagonal form..
- ldz
- The leading dimension ofz. Constraints:ldz≥1 if;compz='N'ldz≥max(1,n) iforcompz='V''I'.
Output Parameters
- d
- Theneigenvalues in descending order, unless.info> 0See alsoinfo.
- e
- On exit, the array is overwritten.
- z
- If, contains aninfo= 0n-bynmatrix 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 leading minor of order
info
= i
i
(and hence T
itself) is not positive-definite. If , the algorithm for computing singular values failed to converge;
info
= n
+ i
i
off-diagonal elements have not converged to zero. If , the
info
= -i
i
-th parameter had an illegal value.Application Notes
If is an exact eigenvalue, and is the corresponding computed value, then
λ
i
μ
i
| - |
μ
i
λ
i
≤
c
(n
)*ε
*K
*λ
i
where , = .
c
(n
) is a modestly increasing function of n
, ε
is the machine precision, and K
= ||DTD
||2
*||(DTD
)-1
||2
D
is diagonal with d
i
i
t
i
i
-1/2
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
θ
(u
i
w
i
≤
c
(n
)ε
K
/ mini
≠
j
λ
i
λ
j
λ
i
λ
j
The total number of floating-point operations depends on how rapidly the algorithm converges.
Typically, it is about
30
if n
2
compz
= 'N'
6
(for complex flavors, n
3
12
) if n
3
compz
= 'V'
'I'
.