Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
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

?stegr2

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

Syntax

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

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

Description

?stegr2 computes selected eigenvalues and, optionally, eigenvectors of a real symmetric tridiagonal matrix T. It is invoked in the ScaLAPACK MRRR driver p?syevr and the corresponding Hermitian version either when only eigenvalues are to be computed, or when only a single processor is used (the sequential-like case).

?stegr2 has been adapted from LAPACK's ?stegr. Please note the following crucial changes.

  1. The calling sequence has two additional integer parameters, dol and dou, that should satisfy mdoudol1. ?stegr2only computes the eigenpairs corresponding to eigenvalues dol through dou in w. (That is, instead of computing the eigenpairs belonging to w(1) through w(m), only the eigenvectors belonging to eigenvalues w(dol) through w(dou) are computed. In this case, only the eigenvalues dol:dou are guaranteed to be fully accurate.

  2. m is not the number of eigenvalues specified by range, but is m = dou - dol + 1. This concerns the case where only eigenvalues are computed, but on more than one processor. Thus, in this case m refers to the number of eigenvalues computed on this processor.

  3. The arrays w and z might not contain all the wanted eigenpairs locally, instead this information is distributed over other processors.

Product and Performance Information

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.

Notice revision #20201201

Input Parameters

jobz

CHARACTER*1

= 'N': Compute eigenvalues only;

= 'V': Compute eigenvalues and eigenvectors.

range

CHARACTER*1

= 'A': all eigenvalues will be found.

= 'V': all eigenvalues in the half-open interval (vl,vu] will be found.

= 'I': the il-th through iu-th eigenvalues (of the entire matrix) will be found.

n

INTEGER

The order of the matrix. n 0.

d

REAL for sstegr2

DOUBLE PRECISION for dstegr2

Array of size n

On entry, the n diagonal elements of the tridiagonal matrix T. Overwritten on exit.

e

REAL for sstegr2

DOUBLE PRECISION for dstegr2

Array of size n

On entry, the (n-1) subdiagonal 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. Overwritten on exit.

vl

REAL for sstegr2

DOUBLE PRECISION for dstegr2

vu

REAL for sstegr2

DOUBLE PRECISION for dstegr2

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

Not referenced if range = 'A' or 'I'.

il, iu

INTEGER

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

1 iliun, if n > 0.

Not referenced if range = 'A' or 'V'.

ldz

INTEGER

The leading dimension of the array z. ldz 1, and if jobz = 'V', then ldz max(1,n).

nzc

INTEGER

The number of eigenvectors to be held in the array z, storing the matrix Z.

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

If range = 'V', then nzc the number of eigenvalues in (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 matrix Z that are needed to hold the eigenvectors. This value is returned as the first entry of the z array, and no error message related to nzc is issued.

lwork

INTEGER

The size of the array work. lwork max(1,18*n)

if jobz = 'V', and lwork max(1,12*n) if jobz = '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.

liwork

INTEGER

The size of the array iwork. liwork max(1,10*n) if the eigenvectors are desired, and liwork max(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.

dol, dou

INTEGER

From the eigenvalues w(1:m), only eigenvectors Z(:,dol) to Z(:,dou) are computed.

If dol > 1, then Z(:,dol-1-zoffset) is used and overwritten.

If dou < m, then Z(:,dou+1-zoffset) is used and overwritten.

zoffset

INTEGER

Offset for storing the eigenpairs when z is distributed in 1D-cyclic fashion

OUTPUT Parameters

m

INTEGER

Globally summed over all processors, m equals the total number of eigenvalues found. 0 mn. If range = 'A', m = n, and if range = 'I', m = iu-il+1. The local output equals m = dou - dol + 1.

w

REAL array of size n for sstegr2

DOUBLE PRECISION array of size n for dstegr2

Array of size n

The first m elements contain the selected eigenvalues in ascending order. Note that immediately after exiting this routine, only the eigenvalues from position dol:dou are reliable on this processor because the eigenvalue computation is done in parallel. Other processors will hold reliable information on other parts of the w array. This information is communicated in the ScaLAPACK driver.

z

REAL for sstegr2

DOUBLE PRECISION for dstegr2

Array of size (ldz, max(1,m) ).

If jobz = 'V', and if info = 0, then the first m columns of the matrix Z stored in z contain some of 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: the user 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 below.

isuppz

INTEGER array of size 2*max(1,m)

The support of the eigenvectors in z, i.e., 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 set if n>2.

work

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

iwork

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

info

INTEGER

On exit, info

= 0: successful exit

other:if info = -i, the i-th argument had an illegal value

if info = 10X, internal error in ?larre2,

if info = 20X, internal error in ?larrv.

Here, the digit X = ABS( iinfo ) < 10, where iinfo is the nonzero error code returned by ?larre2 or ?larrv, respectively.

See Also