syevd¶
Computes all eigenvalues and, optionally, all eigenvectors of a real symmetric matrix using divide and conquer algorithm.
syevd
supports the following precisions.
T
float
double
Description
The routine computes all the eigenvalues, and optionally all the
eigenvectors, of a real symmetric matrix A
. In other words, it
can compute the spectral factorization of A
as: A = Z*λ*ZT
.
Here Λ is a diagonal matrix whose diagonal elements are the
eigenvalues λi, and Z
is the orthogonal matrix whose
columns are the eigenvectors z
i. Thus,
A*zi = λi*zi
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.
syevd (BUFFER Version)¶
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 ofA
.If
upper_lower = job::lower
, a stores the lower triangular part ofA
.- n
The order of the matrix
A
(0≤n
).- a
The buffer a, size (
lda,*
). The buffer a contains the matrixA
. The second dimension of a must be at leastmax(1, n)
.- lda
The leading dimension of
a
. Must be at leastmax(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 syevd_scratchpad_size function.
Output Parameters
- a
If
jobz = job::vec
, then on exit this buffer is overwritten by the orthogonal matrixZ
which contains the eigenvectors ofA
.- 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
- onemkl::lapack::exception
Exception is thrown in case of problems happened during calculations. The
info
code of the problem can be obtained by get_info() method of exception object:If
info=-i
, thei
-th parameter had an illegal value.If
info=i
, andjobz = onemkl::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 = onemkl::job::vec
, then the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columnsinfo/(n+1)
throughmod(info,n+1)
.If
info
equals to value passed as scratchpad size, andget_detail()
returns non zero, then passed scratchpad is of insufficient size, and required size should not be less than value return byget_detail()
method of exception object.
syevd (USM Version)¶
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 ofA
.If
upper_lower = job::lower
, a stores the lower triangular part ofA
.- n
The order of the matrix
A
(0≤n
).- a
Pointer to array containing
A
, size (lda,*
). The second dimension ofa
must be at leastmax(1, n)
.- lda
The leading dimension of
a
. Must be at leastmax(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 syevd_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 orthogonal matrixZ
which contains the eigenvectors ofA
.- 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
- onemkl::lapack::exception
Exception is thrown in case of problems happened during calculations. The
info
code of the problem can be obtained by get_info() method of exception object:If
info=-i
, thei
-th parameter had an illegal value.If
info=i
, andjobz = onemkl::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 = onemkl::job::vec
, then the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columnsinfo/(n+1)
throughmod(info,n+1)
.If
info
equals to value passed as scratchpad size, andget_detail()
returns non zero, then passed scratchpad is of insufficient size, and required size should not be less than value return byget_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