?stemr
?stemr
Computes selected eigenvalues and eigenvectors of a real symmetric tridiagonal matrix.
Syntax
lapack_int LAPACKE_sstemr
(
int
matrix_layout
,
char
jobz
,
char
range
,
lapack_int
n
,
const float*
d
,
float*
e
,
float
vl
,
float
vu
,
lapack_int
il
,
lapack_int
iu
,
lapack_int*
m
,
float*
w
,
float*
z
,
lapack_int
ldz
,
lapack_int
nzc
,
lapack_int*
isuppz
,
lapack_logical*
tryrac
);
lapack_int LAPACKE_dstemr
(
int
matrix_layout
,
char
jobz
,
char
range
,
lapack_int
n
,
const double*
d
,
double*
e
,
double
vl
,
double
vu
,
lapack_int
il
,
lapack_int
iu
,
lapack_int*
m
,
double*
w
,
double*
z
,
lapack_int
ldz
,
lapack_int
nzc
,
lapack_int*
isuppz
,
lapack_logical*
tryrac
);
lapack_int LAPACKE_cstemr
(
int
matrix_layout
,
char
jobz
,
char
range
,
lapack_int
n
,
const float*
d
,
float*
e
,
float
vl
,
float
vu
,
lapack_int
il
,
lapack_int
iu
,
lapack_int*
m
,
float*
w
,
lapack_complex_float*
z
,
lapack_int
ldz
,
lapack_int
nzc
,
lapack_int*
isuppz
,
lapack_logical*
tryrac
);
lapack_int LAPACKE_zstemr
(
int
matrix_layout
,
char
jobz
,
char
range
,
lapack_int
n
,
const double*
d
,
double*
e
,
double
vl
,
double
vu
,
lapack_int
il
,
lapack_int
iu
,
lapack_int*
m
,
double*
w
,
lapack_complex_double*
z
,
lapack_int
ldz
,
lapack_int
nzc
,
lapack_int*
isuppz
,
lapack_logical*
tryrac
);
Include Files
- mkl.h
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 factorizations near clusters of close eigenvalues (referred to as RRRs, Relatively Robust Representations). An informal sketch of the algorithm follows.
dqds
algorithm. Numerically orthogonal eigenvectors are computed by the use of various suitable L*D*L
T
For each unreduced block (submatrix) of
T
,- Compute, so thatT- sigma*I=L*D*LTLandDdefine all the wanted eigenvalues to high relative accuracy. This means that small relative changes in the entries ofLandDcause only small relative changes in the eigenvalues and eigenvectors. The standard (unfactored) representation of the tridiagonal matrixTdoes not have this property in general.
- 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.
- 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.
- 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.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, then only eigenvalues are computed.jobz='N'If, then eigenvalues and eigenvectors are computed.jobz='V'
- range
- Must be'A'or'V'or'I'.If, the routine computes all eigenvalues.range='A'If, the routine computes all eigenvalues in the half-open interval:range='V'(.vl,vu]If, the routine computes eigenvalues with indicesrange='I'iltoiu.
- n
- The order of the matrixT().n≥0
- d
- Array,size.nContainsndiagonal elements of the tridiagonal matrixT.
- e
- Array, sizen.Contains(off-diagonal elements of the tridiagonal matrixn-1)Tin elementsof0ton-2.eneed not be set on input, but is used internally as workspace.e[n- 1]
- vl,vu
- If, the lower and upper bounds of the interval to be searched for eigenvalues. Constraint:range='V'.vl<vuIforrange='A''I',vlandvuare not referenced.
- il,iu
- If, the indices in ascending order of the smallest and largest eigenvalues to be returned.range='I'Constraint:1, if≤il≤iu≤n.n>0Iforrange='A''V',ilandiuare not referenced.
- ldz
- The leading dimension of the output arrayz.if, thenjobz='V'ldz≥ max(1,n)for column major layout and;ldz≥max(1,m) for row major layoutotherwise.ldz≥ 1
- nzc
- The number of eigenvectors to be held in the arrayz.If, thenrange='A';nzc≥max(1,n)If, thenrange='V'is greater than or equal to the number of eigenvalues in the half-open interval:nzc(.vl,vu]If, thenrange='I'.nzc≥iu-il+1Ifnzc= -1, then a workspace query is assumed; the routine calculates the number of columns of the arrayzthat are needed to hold the eigenvectors.This value is returned as the first entry of the arrayz, and no error message related tonzcis issued by the routinexerbla.
- tryrac
- Ifis 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.tryracIfis not true, the code is not required to guarantee relatively accurate eigenvalues and can use the fastest possible techniques.tryrac
Output Parameters
- d
- On exit, the arraydis overwritten.
- e
- On exit, the arrayeis overwritten.
- m
- The total number of eigenvalues found,0.≤m≤nIf, thenrange='A', and ifm=n, thenrange='I'.m=iu-il+1
- w
- Array,size.nThe firstmelements contain the selected eigenvalues in ascending order.
- z
- Arrayz(size max(1,.ldz*m) for column major layout and max(1,ldz*n) for row major layout)If, andjobz='V', then the firstinfo= 0mcolumns ofzcontain the orthonormal eigenvectors of the matrixTcorresponding to the selected eigenvalues, with thei-th column ofzholding the eigenvector associated with.w(i)If, thenjobz='N'zis not referenced.Note: the exact value ofmis not known in advance and can be computed with a workspace query by setting, see description of the parameternzc=-1nzc.
- isuppz
- Array, size (2*max(1,).m)The support of the eigenvectors inz, that is the indices indicating the nonzero elements inz. Thei-th computed eigenvector is nonzero only in elementsthroughisuppz[2*i - 2]. This is relevant in the case when the matrix is split.isuppz[2*i - 1]isuppzis only accessed whenandjobz='V'n>0.
- tryrac
- On exit,, set to true.tryracis set tofalseif the matrix does not define its eigenvalues to high relative accuracy.
Return Values
This function returns a value
info
.If , the execution is successful.
info
= 0If , the
info
= -i
i
-th parameter had an illegal value.If , an internal error occurred.
info
> 0