pub fn ssyevj(
ctx: &Context,
mode: EigenMode,
fill_mode: FillMode,
n: usize,
a: &mut DeviceMemory<f32>,
lda: usize,
w: &mut DeviceMemory<f32>,
workspace: &mut DeviceMemory<f32>,
dev_info: &mut DeviceMemory<i32>,
params: &SyevjInfo,
) -> Result<()>Expand description
Use the matching buffer-size helper to calculate the workspace length before allocating 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 result as syevd, but uses the Jacobi method
instead of the QR algorithm.
The Jacobi method’s parallelism gives GPUs better performance on small and
medium-size matrices.
syevj can also be configured to approximate results up to 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 typically 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 accuracy is not proportional to the number of sweeps. To target a specific accuracy, configure 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.