# syevd¶

Computes all eigenvalues and, optionally, all eigenvectors of a real symmetric matrix using divide and conquer algorithm.

Description

syevd supports the following precisions.

T

float

double

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\lambda Z^T$$.

Here $$\Lambda$$ is a diagonal matrix whose diagonal elements are the eigenvalues $$\lambda_i$$, and $$Z$$ is the orthogonal matrix whose columns are the eigenvectors $$z_{i}$$. Thus,

$$A z_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.

## syevd (Buffer Version)¶

Syntax

namespace oneapi::mkl::lapack {
void syevd(sycl::queue &queue, jobz jobz, oneapi::mkl::uplo upper_lower, std::int64_t n, sycl::buffer<T,1> &a, std::int64_t lda, sycl::buffer<T,1> &w, 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 or job::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 or uplo::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 buffer a contains the matrix $$A$$. 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)$$.

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 matrix $$Z$$ which contains the eigenvectors of $$A$$.

w

Buffer, size at least $$n$$. Contains the eigenvalues of the matrix $$A$$ in ascending order.

Buffer holding scratchpad memory to be used by routine for storing intermediate results.

## syevd (USM Version)¶

Syntax

namespace oneapi::mkl::lapack {
sycl::event syevd(sycl::queue &queue, jobz jobz, oneapi::mkl::uplo upper_lower, std::int64_t n, T *a, std::int64_t lda, T *w, T *scratchpad, std::int64_t scratchpad_size, const std::vector<sycl::event> &events = {})
}


Input Parameters

queue

The queue where the routine should be executed.

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.

upper_lower

Must be uplo::upper or uplo::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 of a must be at least $$\max(1, n)$$.

lda

The leading dimension of a. Must be at least $$\max(1,n)$$.

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 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.