Skip to main content

dsyevj_batched

Function dsyevj_batched 

Source
pub fn dsyevj_batched(
    ctx: &Context,
    mode: EigenMode,
    fill_mode: FillMode,
    n: usize,
    a: &mut DeviceMemory<f64>,
    lda: usize,
    w: &mut DeviceMemory<f64>,
    workspace: &mut DeviceMemory<f64>,
    dev_info: &mut DeviceMemory<i32>,
    params: &SyevjInfo,
    batch_count: usize,
) -> Result<()>
Expand description

Use the matching buffer-size helper to calculate the sizes needed for pre-allocated workspace.

The S and D data types are real valued single and double precision, respectively.

The C and Z data types are complex valued single and double precision, respectively.

Computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices

where $\Lambda_{j}$ is a real $n \times n$ diagonal matrix. $Q_j$ is an $n \times n$ unitary matrix. The diagonal elements of $\Lambda_j$ are the eigenvalues of $A_j$ in either ascending order or non-sorting order.

syevj_batched performs syevj on each matrix. It requires that all matrices are of the same size n and are packed contiguously,

Each matrix is column-major with leading dimension lda, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\cdot j\ +\ lda\cdot n\cdot k\rbrack}$.

The W parameter also contains the eigenvalues of each matrix contiguously,

The formula for random access of W is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\cdot k\rbrack}$.

Except for tolerance and maximum sweeps, syevj_batched can either sort the eigenvalues in ascending order (default) or choose as-is (without sorting) with SyevjInfo::set_sort_eigenvalues. If several tiny matrices are packed into diagonal blocks of one matrix, the non-sorting option can separate the spectra of those tiny matrices.

syevj_batched cannot report residual and executed sweeps through SyevjInfo::residual and SyevjInfo::executed_sweeps. Calling either accessor returns Status::NotSupported. Compute the residual explicitly when needed.

Provide workspace through workspace. Use the corresponding *_buffer_size helper to query the required workspace length. The workspace size in bytes is size_of::<T>() * lwork.

dev_info has one entry per batch item. If the call returns Status::InvalidValue, dev_info[0] == -i indicates that the ith parameter is invalid. Otherwise, dev_info[i] == n + 1 indicates that syevj_batched did not converge on the ith matrix within the given tolerance and maximum sweep count.

If mode is EigenMode::Vector, $A_j$ contains the orthonormal eigenvectors $V_j$.

ยงErrors

Returns an error if cuSOLVER has not been initialized, if the matrix dimensions, leading dimension, eigen mode, fill mode, or batch size are invalid, or if cuSOLVER reports an internal failure.