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

?stegr

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

Syntax

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

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

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

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

call rstegr(d, e, w [,z] [,vl] [,vu] [,il] [,iu] [,m] [,isuppz] [,abstol] [,info])

call stegr(d, e, w [,z] [,vl] [,vu] [,il] [,iu] [,m] [,isuppz] [,abstol] [,info])

Include Files

  • mkl.fi, lapack.f90

Description

The routine computes selected eigenvalues and, optionally, eigenvectors of a real symmetric tridiagonal matrix T.

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.

?stegr is a compatibility wrapper around the improved stemr routine. See its description for further details.

Note that the abstol parameter no longer provides any benefit and hence is no longer used.

See also auxiliary lasq2lasq5, lasq6, used by this routine.

Input Parameters

jobz

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

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

If job = '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 eigenvalues w(i) in the half-open interval:

vl<w(i)vu.

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

n

INTEGER. The order of the matrix T (n 0).

d, e, work

REAL for single precision flavors

DOUBLE PRECISION for double precision flavors.

Arrays:

d(*) contains the diagonal elements of T.

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

e(*) contains the subdiagonal elements of T in elements 1 to n-1; e(n) need not be set on input, but it is used as a workspace.

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

work(lwork) is a workspace array.

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: 1 iliun, if n > 0.

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

abstol

REAL for single precision flavors

DOUBLE PRECISION for double precision flavors.

Unused. Was the absolute error tolerance for the eigenvalues/eigenvectors in previous versions.

ldz

INTEGER. The leading dimension of the output array z. Constraints:

ldz 1 if jobz = 'N';

ldz max(1, n) if jobz = 'V'.

lwork

INTEGER.

The dimension 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 by xerbla. See Application Notes below for details.

iwork

INTEGER.

Workspace array, size (liwork).

liwork

INTEGER.

The dimension 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 by xerbla. See Application Notes below for details.

Output Parameters

d, e

On exit, d and e are overwritten.

m

INTEGER. The total number of eigenvalues found,

0 mn.

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

w

REAL for single precision flavors

DOUBLE PRECISION for double precision flavors.

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

The selected eigenvalues in ascending order, stored in w(1) to w(m).

z

REAL for sstegr

DOUBLE PRECISION for dstegr

COMPLEX for cstegr

DOUBLE COMPLEX for zstegr.

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

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

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

Note: if range = 'V', the exact value of m is not known in advance and an upper bound must be used. Using n = m is always safe.

isuppz

INTEGER.

Array, size at least (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.

work(1)

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

iwork(1)

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

info

INTEGER.

If info = 0, the execution is successful.

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

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

If info = 2x, internal error in ?larrv occurred. Here the digit x = abs(iinfo) < 10, where iinfo is the non-zero error code returned by ?larre or ?larrv, respectively.

LAPACK 95 Interface Notes

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or restorable arguments, see LAPACK 95 Interface Conventions.

Specific details for the routine stegr interface are the following:

d

Holds the vector of length n.

e

Holds the vector of length n.

w

Holds the vector of length n.

z

Holds the matrix Z of size (n,m).

isuppz

Holds the vector of length (2*m).

vl

Default value for this argument is vl = - HUGE (vl) where HUGE(a) means the largest machine number of the same precision as argument a.

vu

Default value for this argument is vu = HUGE (vl).

il

Default value for this argument is il = 1.

iu

Default value for this argument is iu = n.

abstol

Default value for this argument is abstol = 0.0_WP.

jobz

Restored based on the presence of the argument z as follows:

jobz = 'V', if z is present,

jobz = 'N', if z is omitted.

range

Restored based on the presence of arguments vl, vu, il, iu as follows:

range = 'V', if one of or both vl and vu are present,

range = 'I', if one of or both il and iu are present,

range = 'A', if none of vl, vu, il, iu is present,

Note that there will be an error condition if one of or both vl and vu are present and at the same time one of or both il and iu are present.

Note that two variants of Fortran 95 interface for stegr routine are needed because of an ambiguous choice between real and complex cases appear when z is omitted. Thus, the name rstegr is used in real cases (single or double precision), and the name stegr is used in complex cases (single or double precision).

Application Notes

?stegr works only on machines which follow IEEE-754 floating-point standard in their handling of infinities and NaNs. Normal execution of ?stegr may create NaNs and infinities and hence may abort due to a floating point exception in environments which do not conform to the IEEE-754 standard.

If it is not clear how much workspace to supply, use a generous value of lwork (or liwork) for the first run, or set lwork = -1 (liwork = -1).

If lwork (or liwork) has any of admissible sizes, which is no less than the minimal value described, then the routine completes the task, though probably not so fast as with a recommended workspace, and provides the recommended workspace in the first element of the corresponding array (work, iwork) on exit. Use this value (work(1), iwork(1)) for subsequent runs.

If lwork = -1 (liwork = -1), then the routine returns immediately and provides the recommended workspace in the first element of the corresponding array (work, iwork). This operation is called a workspace query.

Note that if lwork (liwork) is less than the minimal required value and is not equal to -1, then the routine returns immediately with an error exit and does not provide any information on the recommended workspace.