Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 12/16/2022
Public

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

Document Table of Contents

?stemr

Computes selected eigenvalues and eigenvectors of a real symmetric tridiagonal matrix.

Syntax

call sstemr(jobz, range, n, d, e, vl, vu, il, iu, m, w, z, ldz, nzc, isuppz, tryrac, work, lwork, iwork, liwork, info)

call dstemr(jobz, range, n, d, e, vl, vu, il, iu, m, w, z, ldz, nzc, isuppz, tryrac, work, lwork, iwork, liwork, info)

call cstemr(jobz, range, n, d, e, vl, vu, il, iu, m, w, z, ldz, nzc, isuppz, tryrac, work, lwork, iwork, liwork, info)

call zstemr(jobz, range, n, d, e, vl, vu, il, iu, m, w, z, ldz, nzc, isuppz, tryrac, work, lwork, iwork, liwork, info)

Include Files
  • mkl.fi, lapack.f90
Description

The routine computes selected eigenvalues and, optionally, eigenvectors of a real symmetric tridiagonal matrix T. Any such unreduced matrix has a well defined set of pairwise different real eigenvalues, the corresponding real eigenvectors are pairwise orthogonal.

The spectrum may be computed either completely or partially by specifying either an interval (vl,vu] or a range of indices il:iu for the desired eigenvalues.

Depending on the number of desired eigenvalues, these are computed either by bisection or the dqds algorithm. Numerically orthogonal eigenvectors are computed by the use of various suitable L*D*LT factorizations near clusters of close eigenvalues (referred to as RRRs, Relatively Robust Representations). An informal sketch of the algorithm follows.

For each unreduced block (submatrix) of T,

  1. Compute T - sigma*I = L*D*LT, so that L and D define all the wanted eigenvalues to high relative accuracy. This means that small relative changes in the entries of L and D cause only small relative changes in the eigenvalues and eigenvectors. The standard (unfactored) representation of the tridiagonal matrix T does not have this property in general.

  2. Compute the eigenvalues to suitable accuracy. If the eigenvectors are desired, the algorithm attains full accuracy of the computed eigenvalues only right before the corresponding vectors have to be computed, see steps c and d.

  3. For each cluster of close eigenvalues, select a new shift close to the cluster, find a new factorization, and refine the shifted eigenvalues to suitable accuracy.
  4. For each eigenvalue with a large enough relative separation compute the corresponding eigenvector by forming a rank revealing twisted factorization. Go back to step c for any clusters that remain.

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

For more details, see: [Dhillon04], [Dhillon04-02], [Dhillon97]

Input Parameters
jobz

CHARACTER*1. Must be 'N' or 'V'.

If jobz = 'N', then only eigenvalues are computed.

If jobz = 'V', then eigenvalues and eigenvectors are computed.

range

CHARACTER*1. Must be 'A' or 'V' or 'I'.

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

If range = 'V', the routine computes all eigenvalues in the half-open interval: (vl, vu].

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

n

INTEGER. The order of the matrix T (n0).

d

REAL for single precision flavors

DOUBLE PRECISION for double precision flavors.

Array, size (n).

Contains n diagonal elements of the tridiagonal matrix T.

e

REAL for single precision flavors

DOUBLE PRECISION for double precision flavors.

Array, size n.

Contains (n-1) off-diagonal elements of the tridiagonal matrix T in elements 1 to n-1 of e. e(n) need not be set on input, but is used internally as workspace.

vl, vu

REAL for single precision flavors

DOUBLE PRECISION for double precision flavors.

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

INTEGER.

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

Constraint: 1iliun, if n>0.

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

ldz

INTEGER. The leading dimension of the output array z.

if jobz = 'V', then ldz ≥ max(1, n) ;

ldz ≥ 1 otherwise.

nzc

INTEGER. The number of eigenvectors to be held in the array z.

If range = 'A', then nzc≥max(1, n);

If range = 'V', then nzc is greater than or equal to the number of eigenvalues in the half-open interval: (vl, vu].

If range = 'I', then nzciu-il+1.

If nzc = -1, then a workspace query is assumed; the routine calculates the number of columns of the array z that are needed to hold the eigenvectors.

This value is returned as the first entry of the array z, and no error message related to nzc is issued by the routine xerbla.

tryrac

LOGICAL.

If tryrac= .TRUE. is true, it indicates that the code should check whether the tridiagonal matrix defines its eigenvalues to high relative accuracy. If so, the code uses relative-accuracy preserving algorithms that might be (a bit) slower depending on the matrix. If the matrix does not define its eigenvalues to high relative accuracy, the code can uses possibly faster algorithms.

If tryrac= .FALSE. is not true, the code is not required to guarantee relatively accurate eigenvalues and can use the fastest possible techniques.

work

REAL for single precision flavors

DOUBLE PRECISION for double precision flavors.

Workspace array, size (lwork).

lwork

INTEGER.

The dimension of the array work,

lwork ≥ max(1, 18*n).

If lwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.

iwork

INTEGER.

Workspace array, size (liwork).

liwork

INTEGER.

The dimension of the array iwork.

lworkmax(1, 10*n) if the eigenvectors are desired, and lworkmax(1, 8*n) if only the eigenvalues are to be computed.

If liwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of the iwork array, returns this value as the first entry of the iwork array, and no error message related to liwork is issued by xerbla.

Output Parameters
d

On exit, the array d is overwritten.

e

On exit, the array e is overwritten.

m

INTEGER.

The total number of eigenvalues found, 0mn.

If range = 'A', then m=n, and if range = 'I', then m=iu-il+1.

w

REAL for single precision flavors

DOUBLE PRECISION for double precision flavors.

Array, size (n).

The first m elements contain the selected eigenvalues in ascending order.

z

REAL for sstemr

DOUBLE PRECISION for dstemr

COMPLEX for cstemr

DOUBLE COMPLEX for zstemr.

Array z(ldz,*), the second dimension of z must be at least max(1, m).

If jobz = 'V', and info = 0, then 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).

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

Note: you must ensure that at least max(1,m) columns are supplied in the array z ; if range = 'V', the exact value of m is not known in advance and can be computed with a workspace query by setting nzc=-1, see description of the parameter nzc.

isuppz

INTEGER.

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

The support of the eigenvectors in z, that is the indices indicating the nonzero elements in z. The i-th computed eigenvector is nonzero only in elements isuppz(2*i-1) through isuppz(2*i). This is relevant in the case when the matrix is split. isuppz is only accessed when jobz = 'V' and n>0.

tryrac

On exit, TRUE. tryrac is set to .FALSE. if the matrix does not define its eigenvalues to high relative accuracy.

work(1)

On exit, if info = 0, then work(1) returns the optimal (and minimal) size of lwork.

iwork(1)

On exit, if info = 0, then iwork(1) returns the optimal size of liwork.

info

INTEGER.

If = 0, the execution is successful.

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

If info = 1, internal error in ?larre occurred,

if info = 2, internal error in ?larrv occurred.