?syevx
?syevx
Computes selected eigenvalues and, optionally, eigenvectors of a symmetric matrix.
Syntax
lapack_int
LAPACKE_ssyevx
(
int
matrix_layout
,
char
jobz
,
char
range
,
char
uplo
,
lapack_int
n
,
float
*
a
,
lapack_int
lda
,
float
vl
,
float
vu
,
lapack_int
il
,
lapack_int
iu
,
float
abstol
,
lapack_int
*
m
,
float
*
w
,
float
*
z
,
lapack_int
ldz
,
lapack_int
*
ifail
);
lapack_int
LAPACKE_dsyevx
(
int
matrix_layout
,
char
jobz
,
char
range
,
char
uplo
,
lapack_int
n
,
double
*
a
,
lapack_int
lda
,
double
vl
,
double
vu
,
lapack_int
il
,
lapack_int
iu
,
double
abstol
,
lapack_int
*
m
,
double
*
w
,
double
*
z
,
lapack_int
ldz
,
lapack_int
*
ifail
);
Include Files
- mkl.h
Description
The routine computes selected eigenvalues and, optionally, eigenvectors of a real symmetric matrix
A
. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.Note that for most cases of real symmetric eigenvalue problems the
default choice should be syevr function as its underlying algorithm is faster and uses less workspace.
?syevx
is faster for a few selected eigenvalues.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','V', or'I'.If, all eigenvalues will be found.range='A'If, all eigenvalues in the half-open interval (range='V'vl,vu] will be found.If, the eigenvalues with indicesrange='I'ilthroughiuwill be found.
- uplo
- Must be'U'or'L'.If,uplo='U'astores the upper triangular part ofA.If,uplo='L'astores the lower triangular part ofA.
- n
- The order of the matrixA().n≥0
- a
- a(size max(1,is an array containing either upper or lower triangular part of the symmetric matrixlda*n))A, as specified byuplo.
- lda
- The leading dimension of the arraya. Must be at least max(1,n) .
- vl,vu
- If, the lower and upper bounds of the interval to be searched for eigenvalues;range='V'vl≤vu. Not referenced iforrange='A''I'.
- il,iu
- If, the indices of the smallest and largest eigenvalues to be returned.range='I'Constraints:1, if≤il≤iu≤n;n> 0andil= 1, ifiu= 0.n= 0Not referenced iforrange='A''V'.
- abstol
- The absolute error tolerance for the eigenvalues.SeeApplication Notesfor more information.
- ldz
- The leading dimension of the output arrayz; .If, thenjobz='V'ldz≥max(1,n)for column major layout and.lda≥max(1,m) for row major layout
Output Parameters
- a
- On exit, the lower triangle (if) or the upper triangle (ifuplo='L') ofuplo='U'A, including the diagonal, is overwritten.
- m
- The total number of eigenvalues found;0.≤m≤nIf,range='A', and ifm=n,range='I'.m=iu-il+1
- w
- Array, size at least max(1,n). The firstmelements contain the selected eigenvalues of the matrixAin ascending order.
- z
- Arrayz(size max(1,contains eigenvectors.ldz*m) for column major layout and max(1,ldz*n) for row major layout)If, then ifjobz='V', the firstinfo= 0mcolumns ofzcontain the orthonormal eigenvectors of the matrixAcorresponding to the selected eigenvalues, with the i-th column ofzholding the eigenvector associated withw(i).If an eigenvector fails to converge, then that column ofzcontains the latest approximation to the eigenvector, and the index of the eigenvector is returned inifail.If, thenjobz='N'zis not referenced.Note: you must ensure that at least max(1,m) columns are supplied in the arrayz; if, the exact value ofrange='V'mis not known in advance and an upper bound must be used.
- ifail
- Array, size at least max(1,n).If, then ifjobz='V', the firstinfo= 0melements ofifailare zero; if, theninfo> 0ifailcontains the indices of the eigenvectors that failed to converge.If, thenjobz='V'ifailis not referenced.
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 , then
info
= i
i
eigenvectors failed to converge; their indices are stored in the array ifail
.Application Notes
An approximate eigenvalue is accepted as converged when it is determined to lie in an interval [a,b] of width less than or equal to , where
abstol
+ε
*max(|a|,|b|)ε
is the machine precision. If is used as tolerance, where ||
abstol
is less than or equal to zero, then ε
*||T
|}T
|| is the 1-norm of the tridiagonal matrix obtained by reducing A
to tridiagonal form. Eigenvalues are computed most accurately when abstol
is set to twice the underflow threshold 2*?lamch
('S'), not zero. If this routine returns with , indicating that some eigenvectors did not converge, try setting
info
> 0abstol
to 2*?lamch
('S').