pub fn dsyevj(
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,
) -> 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 symmetric (Hermitian) $n \times n$ matrix A.
The standard symmetric eigenvalue problem is $A Q = Q \Lambda$, where Λ is a real $n \times n$ diagonal matrix.
Q is an $n \times n$ unitary matrix.
The diagonal elements of Λ are the eigenvalues of A in ascending order.
syevj computes the same symmetric eigenvalue problem as syevd.
The difference is that syevd uses a QR algorithm and syevj uses the Jacobi method.
The Jacobi method gives GPUs better parallelism on small and medium-size matrices.
Callers can configure syevj to target a chosen accuracy.
syevj iteratively generates a sequence of unitary matrices that transform A toward $A = Q(W + E)Q^{H}$, where W is diagonal and E is symmetric with a zero diagonal.
During the iterations, the Frobenius norm of E decreases monotonically.
As E goes down to zero, W is the set of eigenvalues.
In practice, the Jacobi method stops when the off-diagonal residual is below the configured tolerance eps.
syevj has two parameters to control the accuracy.
The first parameter is the tolerance (eps).
The default value is machine accuracy, but SyevjInfo::set_tolerance can set an a priori tolerance.
The maximum-sweep parameter is the maximum number of sweeps, which controls the number of Jacobi iterations.
The default value is 100, but SyevjInfo::set_max_sweeps can set a different bound.
Experiments show that 15 sweeps are enough to converge to machine accuracy.
syevj stops when either the tolerance or the maximum number of sweeps is reached.
The Jacobi method has quadratic convergence, so the accuracy is not proportional to the number of sweeps. To guarantee a target accuracy, configure only the tolerance.
After syevj, callers can query the residual with SyevjInfo::residual and the number of executed sweeps with SyevjInfo::executed_sweeps.
However, the residual is the Frobenius norm of E, not the accuracy of each individual eigenvalue.
Provide workspace through workspace, just like ssyevd and dsyevd.
Use the corresponding *_buffer_size helper to query the required workspace length.
The workspace size in bytes is size_of::<T>() * lwork.
If the reported info value is -i, the ith parameter is invalid.
If info == n + 1, syevj did not converge within the given tolerance and maximum sweep count.
If the tolerance is too small, syevj may not converge.
Use a tolerance no smaller than machine accuracy.
If mode is EigenMode::Vector, A contains the orthonormal eigenvectors V.
§Errors
Returns an error if cuSOLVER has not been initialized, if the matrix dimensions, leading dimension, eigen mode, or fill mode are invalid, or if cuSOLVER reports an internal failure.