scipy.linalg.svdvals¶
-
scipy.linalg.
svdvals
(a, overwrite_a=False, check_finite=True)[source]¶ Compute singular values of a matrix.
Parameters: a : (M, N) array_like
Matrix to decompose.
overwrite_a : bool, optional
Whether to overwrite a; may improve performance. Default is False.
check_finite : bool, optional
Whether to check that the input matrix contains only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.
Returns: s : (min(M, N),) ndarray
The singular values, sorted in decreasing order.
Raises: LinAlgError
If SVD computation does not converge.
See also
Notes
svdvals(a)
only differs fromsvd(a, compute_uv=False)
by its handling of the edge case of emptya
, where it returns an empty sequence:>>> a = np.empty((0, 2)) >>> from scipy.linalg import svdvals >>> svdvals(a) array([], dtype=float64)