pub fn zgesvd(
ctx: &Context,
job_u: SvdMode,
job_vt: SvdMode,
m: usize,
n: usize,
a: MatrixMut<'_, Complex64>,
s: &mut DeviceMemory<f64>,
u: Option<MatrixMut<'_, Complex64>>,
vt: Option<MatrixMut<'_, Complex64>>,
workspace: &mut DeviceMemory<Complex64>,
rwork: Option<&mut DeviceMemory<f64>>,
dev_info: &mut DeviceMemory<i32>,
) -> 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 the singular value decomposition (SVD) of an $m \times n$ matrix A and the corresponding left and/or right singular vectors.
The SVD is written as $A = U \Sigma V^{H}$, where Σ is an
$m \times n$ matrix which is zero except for its min(m,n) diagonal
elements, U is an $m \times m$ unitary matrix, and V is an
$n \times n$ unitary matrix.
The diagonal elements of Σ are the singular values of A; they are real and non-negative, and are returned in descending order.
The first min(m,n) columns of U and V are the left and right singular vectors of A.
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.
If the reported dev_info value is -i, the ith parameter is invalid. If bdsqr did not converge, dev_info specifies how many superdiagonals of an intermediate bidiagonal form did not converge to zero.
rwork is a real workspace buffer with length min(m, n) - 1.
If dev_info > 0 and rwork is Some(_), it contains the unconverged superdiagonal elements of an upper bidiagonal matrix.
This is slightly different from LAPACK which puts unconverged superdiagonal elements in work if type is real; in rwork if type is complex.
Pass None for rwork when the unconverged superdiagonal elements are not needed.
-
gesvdonly supportsm >= n. -
Returns $V^{H}$, not
V.
§Errors
Returns an error if cuSOLVER has not been initialized, if the matrix dimensions or leading dimensions are invalid, if the current GPU architecture is unsupported, or if cuSOLVER reports an internal failure.