Visible to Intel only — GUID: GUID-B4723515-A649-431A-B62B-9F4E0C376A39
Visible to Intel only — GUID: GUID-B4723515-A649-431A-B62B-9F4E0C376A39
heevx (USM Version)
Computes selected eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A. This routine belongs to the oneapi::mkl::lapack namespace.
Description
The routine computes selected eigenvalues, and optionally eigenvectors, of a complex Hermitian 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 {
sycl::event heevx(sycl::queue &queue,
mkl::job jobz,
mkl::rangev range,
mkl::uplo uplo,
int64_t n,
T *a,
int64_t lda,
RT vl,
RT vu,
int64_t il,
int64_t iu,
RT abstol,
int64_t *m,
RT *w,
T *z,
int64_t ldz,
T *scratchpad,
int64_t scratchpad_size,
const std::vector<sycl::event> &events = {})
}
heevx (USM version) supports the following precision and devices.
T |
RT |
Devices Supported |
---|---|---|
std::complex<float> |
float |
CPU and GPU* |
std::complex<double> |
double |
CPU and GPU^ |
*Interface support only; all computations are performed on the CPU.
^Hybrid support; some computations are performed on the CPU.
Input Parameters
- queue
-
Device queue where calculations will be performed.
- jobz
-
Must be job::novec or job::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::values or rangev::indices.
If range = rangev::all, then all the eigenvalues and eigenvectors (if requested by jobz parameters) are computed.
If range = rangev::values, then eigenvalues in the interval (vl, vu] and corresponding eigenvectors (if requested by jobz parameters) are computed.
If range = rangev::indices, then the il-th through iu-th eigenvalues and corresponding eigenvectors (if requested by jobz parameters) are computed.
- uplo
-
Must be uplo::upper or uplo::lower.
If uplo = uplo::upper, a stores the upper triangular part of A.
If uplo = uplo::lower, a stores the lower triangular part of A.
- n
-
The order of the matrix A (0 ≤ n).
- a
-
Pointer to the array of size a(lda,*) containing the upper or lower triangle of the Hermitian matrix A, as specified by uplo.
The second dimension of a must be at least max(1, 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. vl must be less than vu. Not referenced if range = rangev::all or range = rangev::indices.
- vu
-
If range = rangev::values, the upper bound of the interval to be searched for eigenvalues. vl must be less than vu. Not referenced if range = rangev::all or range = rangev::indices.
- il
-
If range = rangev::indices, the one-based index of the smallest eigenvalue to be returned. Must be 1 ≤ il ≤ iu ≤ n if n > 0 and il = 1 and iu = 0 if n = 0. Not referenced if range = rangev::all or range = rangev::values.
- iu
-
If range = rangev::indices, the one-based index of the largest eigenvalue to be returned. Must be 1 ≤ il ≤ iu ≤ n if n > 0 and il = 1 and iu = 0 if n = 0. Not referenced if range = rangev::all or range = 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 to abstol + eps * max( |a|,|b| ), where eps is the machine precision. If abstol is less than or equal to zero, then eps*|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
-
Pointer to 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 heevx_scratchpad_size function.
- events
-
List of events to wait for before starting computation. Defaults to empty list.
Output Parameters
- a
-
On exit the upper triangle (if uplo = uplo::upper) or the lower triangle (if uplo = uplo::lower) of A, including the diagonal, is destroyed.
- m
-
The total number of eigenvalues found, 0 ≤ m ≤ n.
- w
-
Pointer to array of size at least n. On normal exit, the first m elements contain the selected eigenvalues of the matrix A 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 the i-th column of Z holding the eigenvector associated with w(i). If jobz = job::novec, 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 = rangev::values, the exact value of m is not known in advance and an upper bound must be used.
Exceptions
Exception |
Description |
---|---|
mkl::lapack::exception |
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 info = -i, the i-th parameter had an illegal value. If info = i, and jobz = job::novec, then the algorithm failed to converge. If info = i, and jobz = job::vec, then the algorithm failed to compute an eigenvalue. If info is equal to the value passed as scratchpad size, and detail() returns non zero, then the passed scratchpad has an insufficient size, and the required size should not be less than the value returned by the detail() method of the exception object. |
Return Values
Output event to wait on to ensure computation is complete.