heevd#
Computes all eigenvalues and, optionally, all eigenvectors of a complex Hermitian matrix using divide and conquer algorithm.
Description
heevd
supports the following precisions.
T
std::complex<float>
std::complex<double>
The routine computes all the eigenvalues, and optionally all the eigenvectors, of a complex Hermitian matrix \(A\). In other words, it can compute the spectral factorization of \(A\) as: \(A = Z\Lambda Z^H\).
Here \(\Lambda\) is a real diagonal matrix whose diagonal elements are the eigenvalues \(\lambda_i\), and \(Z\) is the (complex) unitary matrix whose columns are the eigenvectors \(z_{i}\). Thus,
\(Az_i = \lambda_i z_i\) for \(i = 1, 2, ..., n\).
If the eigenvectors are requested, then this routine uses a divide and conquer algorithm to compute eigenvalues and eigenvectors. However, if only eigenvalues are required, then it uses the Pal-Walker-Kahan variant of the QL or QR algorithm.
heevd (Buffer Version)#
Syntax
namespace oneapi::math::lapack {
void heevd(cl::sycl::queue &queue, oneapi::math::job jobz, oneapi::math::uplo upper_lower, std::int64_t n, butter<T,1> &a, std::int64_t lda, cl::sycl::buffer<realT,1> &w, cl::sycl::buffer<T,1> &scratchpad, std::int64_t scratchpad_size)
}
Input Parameters
- queue
The queue where the routine should be executed.
- jobz
Must be
job::novec
orjob::vec
.If
jobz = job::novec
, then only eigenvalues are computed.If
jobz = job::vec
, then eigenvalues and eigenvectors are computed.- upper_lower
Must be
uplo::upper
oruplo::lower
.If
upper_lower = job::upper
, a stores the upper triangular part of \(A\).If
upper_lower = job::lower
, a stores the lower triangular part of \(A\).- n
The order of the matrix \(A\) (\(0 \le n\)).
- a
The buffer
a
, size (lda,*
). The buffera
contains the matrix \(A\). The second dimension ofa
must be at least \(\max(1, n)\).- lda
The leading dimension of
a
. Must be at least \(\max(1,n)\).- 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 heevd_scratchpad_size function.
Output Parameters
- a
If
jobz = job::vec
, then on exit this buffer is overwritten by the unitary matrix \(Z\) which contains the eigenvectors of \(A\).- w
Buffer, size at least n. Contains the eigenvalues of the matrix \(A\) in ascending order.
- scratchpad
Buffer holding scratchpad memory to be used by routine for storing intermediate results.
Throws
This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.
oneapi::math::device_bad_alloc
oneapi::math::unsupported_device
oneapi::math::lapack::invalid_argument
oneapi::math::lapack::computation_error
Exception is thrown in case of problems during calculations. The
info
code of the problem can be obtained by info() method of exception object:If
info=-i
, the \(i\)-th parameter had an illegal value.If
info=i
, andjobz = oneapi::math::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
, andjobz = oneapi::math::job::vec
, then the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns \(\text{info}/(n+1)\) through \(\text{mod}(\text{info},n+1)\).If
info
equals to value passed as scratchpad size, and detail() returns non zero, then passed scratchpad is of insufficient size, and required size should not be less than value return by detail() method of exception object.
heevd (USM Version)#
Syntax
namespace oneapi::math::lapack {
cl::sycl::event heevd(cl::sycl::queue &queue, oneapi::math::job jobz, oneapi::math::uplo upper_lower, std::int64_t n, butter<T,1> &a, std::int64_t lda, RealT *w, T *scratchpad, std::int64_t scratchpad_size, const std::vector<cl::sycl::event> &events = {})
}
Input Parameters
- queue
The queue where the routine should be executed.
- jobz
Must be
job::novec
orjob::vec
.If
jobz = job::novec
, then only eigenvalues are computed.If
jobz = job::vec
, then eigenvalues and eigenvectors are computed.- upper_lower
Must be
uplo::upper
oruplo::lower
.If
upper_lower = job::upper
, a stores the upper triangular part of \(A\).If
upper_lower = job::lower
, a stores the lower triangular part of \(A\).- n
The order of the matrix \(A\) (\(0 \le n\)).
- a
Pointer to array containing \(A\), size (
lda,*
).The second dimension ofa
must be at least \(\max(1, n)\).- lda
The leading dimension of
a
. Must be at least \(\max(1,n)\).- 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 heevd_scratchpad_size function.- events
List of events to wait for before starting computation. Defaults to empty list.
Output Parameters
- a
If
jobz = job::vec
, then on exit this array is overwritten by the unitary matrix \(Z\) which contains the eigenvectors of \(A\).- w
Pointer to array of size at least \(n\). Contains the eigenvalues of the matrix \(A\) in ascending order.
- scratchpad
Pointer to scratchpad memory to be used by routine for storing intermediate results.
Throws
This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.
oneapi::math::device_bad_alloc
oneapi::math::unsupported_device
oneapi::math::lapack::invalid_argument
oneapi::math::lapack::computation_error
Exception is thrown in case of problems during calculations. The
info
code of the problem can be obtained by info() method of exception object:If
info=-i
, the \(i\)-th parameter had an illegal value.If
info=i
, andjobz = oneapi::math::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
, andjobz = oneapi::math::job::vec
, then the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns \(\text{info}/(n+1)\) through \(\text{mod}(\text{info},n+1)\).If
info
equals to value passed as scratchpad size, and detail() returns non zero, then passed scratchpad is of insufficient size, and required size should not be less than value return by detail() method of exception object.
Return Values
Output event to wait on to ensure computation is complete.
Parent topic: LAPACK Singular Value and Eigenvalue Problem Routines