Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 7/13/2023
Public

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

Document Table of Contents

?stevr

Computes selected eigenvalues and, optionally, eigenvectors of a real symmetric tridiagonal matrix using the Relatively Robust Representations.

Syntax

lapack_int LAPACKE_sstevr (int matrix_layout, char jobz, char range, lapack_int n, float* d, float* e, float vl, float vu, lapack_int il, lapack_int iu, float abstol, lapack_int* m, float* w, float* z, lapack_int ldz, lapack_int* isuppz);

lapack_int LAPACKE_dstevr (int matrix_layout, char jobz, char range, lapack_int n, double* d, double* e, double vl, double vu, lapack_int il, lapack_int iu, double abstol, lapack_int* m, double* w, double* z, lapack_int ldz, lapack_int* isuppz);

Include Files

  • mkl.h

Description

The routine computes selected eigenvalues and, optionally, eigenvectors of a real symmetric tridiagonal matrix T. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.

Whenever possible, the routine calls stemr to compute the eigenspectrum using Relatively Robust Representations. stegr computes eigenvalues by the dqds algorithm, while orthogonal eigenvectors are computed from various "good" L*D*LT representations (also known as Relatively Robust Representations). Gram-Schmidt orthogonalization is avoided as far as possible. More specifically, the various steps of the algorithm are as follows. For the i-th unreduced block of T:

  1. Compute T - σi = Li*Di*LiT, such that Li*Di*LiT is a relatively robust representation.

  2. Compute the eigenvalues, λj, of Li*Di*LiT to high relative accuracy by the dqds algorithm.

  3. If there is a cluster of close eigenvalues, "choose" σi close to the cluster, and go to Step (a).

  4. Given the approximate eigenvalue λj of Li*Di*LiT, compute the corresponding eigenvector by forming a rank-revealing twisted factorization.

The desired accuracy of the output can be specified by the input parameter abstol.

The routine ?stevr calls stemr when the full spectrum is requested on machines which conform to the IEEE-754 floating point standard. ?stevr calls stebz and stein on non-IEEE machines and when partial spectrum requests are made.

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.

range

Must be 'A' or 'V' or 'I'.

If range = 'A', the routine computes all eigenvalues.

If range = 'V', the routine computes eigenvalues w[i]in the half-open interval:

vl<w[i]vu.

If range = 'I', the routine computes eigenvalues with indices il to iu.

For range = 'V'or 'I' and iu-il < n-1, sstebz/dstebz and sstein/dstein are called.

n

The order of the matrix T (n 0).

d, e

Arrays:

d contains the n diagonal elements of the tridiagonal matrix T.

The dimension of d must be at least max(1, n).

econtains the n-1 subdiagonal elements of A.

The dimension of e must be at least max(1, n-1). The n-th element of this array is used as workspace.

vl, vu

If range = 'V', the lower and upper bounds of the interval to be searched for eigenvalues.

Constraint: vl< vu.

If range = 'A' or 'I', vl and vu are not referenced.

il, iu

If range = 'I', the indices in ascending order of the smallest and largest eigenvalues to be returned.

Constraint: 1 iliun, if n > 0; il=1 and iu=0 if n = 0.

If range = 'A' or 'V', il and iu are not referenced.

abstol

The absolute error tolerance to which each eigenvalue/eigenvector is required.

If jobz = 'V', the eigenvalues and eigenvectors output have residual norms bounded by abstol, and the dot products between different eigenvectors are bounded by abstol. If abstol < n *eps*||T||, then n *eps*||T|| will be used in its place, where eps is the machine precision, and ||T|| is the 1-norm of the matrix T. The eigenvalues are computed to an accuracy of eps*||T|| irrespective of abstol.

If high relative accuracy is important, set abstol to ?lamch('S').

ldz

The leading dimension of the output array z.

Constraints:

ldz 1 if jobz = 'N';

ldz max(1, n) for column major layout and ldz max(1, m) for row major layout if jobz = 'V'.

Output Parameters

m

The total number of eigenvalues found,

0 mn. If range = 'A', m = n, if range = 'I', m = iu-il+1, and if range = 'V' the exact value of m is unknown..

w, z

Arrays:

w, size at least max(1, n).

The first m elements of w contain the selected eigenvalues of the matrix T in ascending order.

z(size at least max(1, ldz*m) for column major layout and max(1, ldz*n) for row major layout).

If jobz = 'V', then if info = 0, the first m columns of z contain the orthonormal eigenvectors of the matrix T corresponding to the selected eigenvalues, with the i-th column of z holding the eigenvector associated with w[i - 1].

If jobz = 'N', then z is not referenced.

d, e

On exit, these arrays may be multiplied by a constant factor chosen to avoid overflow or underflow in computing the eigenvalues.

isuppz

Array, size at least 2 *max(1, m).

The support of the eigenvectors in z, i.e., the indices indicating the nonzero elements in z. The i-th eigenvector is nonzero only in elements isuppz[2i - 2] through isuppz[2i - 1].

Implemented only for range = 'A' or 'I' and iu-il = n-1.

Return Values

This function returns a value info.

If info=0, the execution is successful.

If info = -i, the i-th parameter had an illegal value.

If info = i, an internal error has occurred.

Application Notes

Normal execution of the routine ?stegr may create NaNs and infinities and hence may abort due to a floating point exception in environments which do not handle NaNs and infinities in the IEEE standard default manner.