syevx#
Computes selected eigenvalues and, optionally, eigenvectors
of a real symmetric matrix A. This routine belongs to the
oneapi::mkl::lapack namespace.
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.
In other words, it can compute selected eigenpairs (λ, z)
of A such that A*z = z*λ.
The routine computes selected eigenvalues with the bisection algorithm.
If the eigenvectors are requested, then this routine uses a combination of modified twisted factorization algorithm based on Inderjit Dhillon and Beresford Parlett’s work and the inverse iteration algorithm followed by Gram-Schmidt orthogonalization.
API#
Syntax#
namespace oneapi::mkl::lapack {
void syevx(sycl::queue &queue,
mkl::job jobz,
mkl::rangev range,
mkl::uplo uplo,
int64_t n,
sycl::buffer<T> &a,
int64_t lda,
T vl,
T vu,
int64_t il,
int64_t iu,
T abstol,
sycl::buffer<int64_t> &m,
sycl::buffer<T> &w,
sycl::buffer<T> &z,
int64_t ldz,
sycl::buffer<T> &scratchpad,
int64_t scratchpad_size)
}
syevx supports the following precision and devices.
T |
Devices Supported |
|---|---|
|
CPU and GPU* |
|
CPU and GPU* |
*Interface support only; all computations are performed on the CPU.
Input Parameters#
- queue
Device queue where calculations will be performed.
- jobz
Must be
job::novecorjob::vec.If
jobz = job::novec, then only eigenvalues are computed.If
jobz = job::vec, then eigenvalues and eigenvectors are computed.- range
Must be
rangev::all,rangev::valuesorrangev::indices.If
range = rangev::all, then all the eigenvalues and eigenvectors (if requested byjobzparameters) are computed.If
range = rangev::values, then eigenvalues in the interval(vl, vu]and corresponding eigenvectors (if requested byjobzparameters) are computed.If
range = rangev::indices, then theil-th throughiu-th eigenvalues and corresponding eigenvectors (if requested byjobzparameters) are computed.- uplo
Must be
uplo::upperoruplo::lower.If
uplo = uplo::upper, a stores the upper triangular part ofA.If
uplo = uplo::lower, a stores the lower triangular part ofA.- n
The order of the matrix
A(0 ≤ n).- a
Buffer holding the array containing the upper or lower triangle of the symmetric matrix
A, as specified by uplo. The size ofamust be at leastlda*n.- lda
The leading dimension of a. Must be at least
max(1,n).- vl
If
range = rangev::values, the lower bound of the interval to be searched for eigenvalues.vlmust be less thanvu. Not referenced ifrange = rangev::allorrange = rangev::indices.- vu
If
range = rangev::values, the upper bound of the interval to be searched for eigenvalues.vlmust be less thanvu. Not referenced ifrange = rangev::allorrange = rangev::indices.- il
If
range = rangev::indices, the one-based index of the smallest eigenvalue to be returned. Must be1 ≤ il ≤ iu ≤ nifn > 0andil = 1andiu = 0ifn = 0. Not referenced ifrange = rangev::allorrange = rangev::values.- iu
If
range = rangev::indices, the one-based index of the largest eigenvalue to be returned. Must be1 ≤ il ≤ iu ≤ nifn > 0andil = 1andiu = 0ifn = 0. Not referenced ifrange = rangev::allorrange = rangev::values.- abstol
The absolute error tolerance for the eigenvalues. An approximate eigenvalue is accepted as converged when it is determined to lie in an interval
[a,b]of width less than or equal toabstol + eps * max( |a|,|b| ), whereepsis the machine precision. Ifabstolis less than or equal to zero, theneps*|T|will be used in its place, where|T|is the 1-norm of the tridiagonal matrix obtained by reducing A to tridiagonal form.- ldz
The leading dimension of z. Must be at least
max(1,n).- scratchpad
Buffer holding scratchpad memory to be used by the routine for storing intermediate results.
- scratchpad_size
Size of scratchpad memory as a number of floating point elements of type
T. Size should not be less than the value returned by the syevx_scratchpad_size function.
Output Parameters#
- a
On exit the upper triangle (if
uplo = uplo::upper) or the lower triangle (ifuplo = uplo::lower) ofA, including the diagonal, is destroyed.- m
The total number of eigenvalues found,
0 ≤ m ≤ n.- w
Buffer holding array of size at least n. On normal exit, the first m elements contain the selected eigenvalues in ascending order.
- z
If
jobz = job::vec, then on normal exit the first m columns of Z contain the orthonormal eigenvectors of the matrix A corresponding to the selected eigenvalues, with thei-th column of Z holding the eigenvector associated withw(i). Ifjobz = job::novec, then Z is not referenced. Note: the user must ensure that at leastmax(1, m)columns are supplied in the array Z; ifrange = rangev::values, the exact value of m is not known in advance and an upper bound must be used.
Exceptions#
Exception |
Description |
|---|---|
|
This exception is thrown when problems occur during calculations. You can obtain the info code of the problem using the info() method of the exception object: If If If If |