sygvd
Computes all eigenvalues and, optionally, eigenvectors of a real
generalized symmetric definite eigenproblem using a divide and conquer
method. This routine belongs to the
oneapi::mkl::lapack
namespace.Description
The routine computes all the eigenvalues, and optionally, the
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.It uses a divide and conquer algorithm.
API
Syntax
namespace oneapi::mkl::lapack {
void sygvd(cl::sycl::queue &queue,
std::int64_t itype,
mkl::job jobz,
mkl::uplo uplo,
std::int64_t n,
cl::sycl::buffer<T> &a,
std::int64_t lda,
cl::sycl::buffer<T> &b,
std::int64_t ldb,
cl::sycl::buffer<T> &w,
cl::sycl::buffer<T> &scratchpad,
std::int64_t scratchpad_size)
}
sygvd
supports the following precisions and devices:T | Devices supported |
---|---|
float | Host, CPU, GPU |
double | Host, CPU, GPU |
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 isA*x = lambda*B*x;if itype= 2, the problem type isA*B*x = lambda*x;if itype= 3, the problem type isB*A*x = lambda*x.
- jobz
- Must bejob::novecorjob::vec.Ifjobz = job::novec, then only eigenvalues are computed.Ifjobz = job::vec, then eigenvalues and eigenvectors are computed.
- uplo
- Must beuplo::upperoruplo::lower.Ifuplo = uplo::upper, a and b store the upper triangular part ofAandB.Ifuplo = uplo::lower, a and b stores the lower triangular part ofAandB.
- n
- The order of the matricesAandB(0≤n).
- a
- Buffer holding the array of sizea(lda,*)containing the upper or lower triangle of the symmetric matrixA, as specified by uplo.The second dimension of a must be at leastmax(1, n).
- lda
- The leading dimension of a; at leastmax(1,n).
- b
- Buffer holding the array of sizeb(ldb,*)containing the upper or lower triangle of the symmetric matrixB, as specified by uplo.The second dimension of b must be at leastmax(1, n).
- ldb
- The leading dimension of b; at leastmax(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 typeT. Size should not be less than the value returned by the sygvd_scratchpad_size function.
Output Parameters
- a
- On exit, ifjobz = job::vec, then ifinfo = 0,acontains the matrixZof eigenvectors. The eigenvectors are normalized as follows:if itype= 1or2,ZT*B*Z = I;if itype= 3,ZT*inv(B)*Z = I;Ifjobz = job::novec, then on exit the upper triangle (ifuplo = uplo::upper) or the lower triangle (ifuplo = uplo::lower) ofA, including the diagonal, is destroyed.
- b
- On exit, ifinfo≤n, the part of b containing the matrix is overwritten by the triangular factorUorLfrom the Cholesky factorizationB=UT*UorB = L*LT.
- w
- Buffer, size at leastn. Ifinfo = 0, contains the eigenvalues of the matrixAin ascending order. See alsoinfo.
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. For info ≤ n : If info = i , and jobz = job::novec , then the algorithm failed to converge; i indicates the number of off-diagonal elements of an intermediate tridiagonal form which did not converge to zero.If info = i , and jobz = job:vec , then the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns info/(n+1) through mod(info,n+1) . For info > n : If info = n + i , for 1 ≤ i ≤ n , then the leading minor of order i of B is not positive-definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed.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. |