Visible to Intel only — GUID: GUID-EDB6169F-861B-4779-80D8-D6E5D7EFED59
Visible to Intel only — GUID: GUID-EDB6169F-861B-4779-80D8-D6E5D7EFED59
sygvx
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 generalized symmetric-definite eigenproblem of the form
A*x = λ*B*x, A*B*x = λ*x, or B*A*x = λ*x .
Here A and B are assumed to be symmetric and B is also positive definite. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.
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 sygvx(sycl::queue &queue,
int64_t itype,
mkl::job jobz,
mkl::rangev range,
mkl::uplo uplo,
int64_t n,
sycl::buffer<T> &a,
int64_t lda,
sycl::buffer<T> &b,
int64_t ldb,
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)
}
sygvx supports the following precision and devices.
T |
Devices Supported |
---|---|
float |
CPU and GPU* |
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.
- itype
-
Must be 1 or 2 or 3. Specifies the problem type to be solved:
if itype= 1, the problem type is A*x = lambda*B*x;
if itype= 2, the problem type is A*B*x = lambda*x;
if itype= 3, the problem type is B*A*x = lambda*x.
- 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 and b store the upper triangular part of A and B.
If uplo = uplo::lower, a and b stores the lower triangular part of A and B.
- n
-
The order of the matrices A and B (0 ≤ n).
- a
-
Buffer holding the array of size a(lda,*) containing the upper or lower triangle of the symmetric 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).
- b
-
Buffer holding the array of size b(ldb,*) containing the upper or lower triangle of the symmetric matrix B, as specified by uplo.
The second dimension of b must be at least max(1, n).
- ldb
-
The leading dimension of b; 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
-
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 sygvx_scratchpad_size function.
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.
- b
-
On normal exit, the part of b containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = UT*U or B = L*LT.
- 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 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. |