Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?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 T. In other words, the routine can compute the spectral factorization: T = Z*Λ*ZT. Here Λ is a diagonal matrix whose diagonal elements are the eigenvalues λi; Z is an orthogonal matrix whose columns are eigenvectors. Thus,

T*zi = λi*zi for i = 1, 2, ..., n.

The routine normalizes the eigenvectors so that ||zi||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*QH. In this case, the spectral factorization is as follows: A = Q*T*QH = (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

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).

z

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.

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 30n 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.

Application Notes

The computed eigenvalues and eigenvectors are exact for a matrix T+E such that ||E||2 = O(ε)*||T||2, where ε is the machine precision.

If λi is an exact eigenvalue, and μi is the corresponding computed value, then

|μi - λi| c(n)*ε*||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 θ(zi, wi) between them is bounded as follows:

θ(zi, wi) c(n)*ε*||T||2 / minij|λi - λj|.

The total number of floating-point operations depends on how rapidly the algorithm converges. Typically, it is about

24n2 if compz = 'N';

7n3 (for complex flavors, 14n3) if compz = 'V' or 'I'.