pub fn svd<F>(
a: &ArrayView2<'_, F>,
fullmatrices: bool,
) -> LinalgResult<SVDDecomposition<F>>
Expand description
Performs singular value decomposition.
§Arguments
a
- Input matrixfull_matrices
- Whether to return full U and V^T matrices
§Returns
- SVD decomposition result
§Examples
use scirs2_core::ndarray::{array, ScalarOperand};
use scirs2_linalg::lapack::svd;
let a = array![[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]];
let svd_result = svd(&a.view(), false).unwrap();
// Check that A = U*diag(S)*V^T
// (implementation dependent, so not shown here)