scipy.linalg.lapack.dgesvdx#
- scipy.linalg.lapack.dgesvdx(a, compute_u=1, compute_vh=1, range='A', vl=0.0, vu=0.0, il=1, iu=min(m, n), lwork=..., overwrite_a=0) = <flapack function dgesvdx>#
Compute all or a selected subset of the singular values and, optionally, the singular vectors of a general matrix,
a = u @ diag(s) @ vt(LAPACKdgesvdx).- Parameters:
- andarray
Matrix of shape
(m, n).- compute_u{0, 1}, optional
If 1, left singular vectors are computed; if 0, they are not. Default is 1.
- compute_vh{0, 1}, optional
If 1, right singular vectors are computed; if 0, they are not. Default is 1.
- rangestr, optional
'A'for all singular values,'V'for those in the half-open interval(vl, vu],'I'for the il-th through iu-th largest. Default is'A'.- vlfloat, optional
Lower bound of the interval, at least 0; used only when range is
'V'. Default is 0.0.- vufloat, optional
Upper bound of the interval, greater than vl; used only when range is
'V'. Default is 0.0, so it must be given withrange='V'.- ilint, optional
Index of the first singular value to return, 1-based in descending order, so 1 is the largest; used only when range is
'I'. Default is 1.- iuint, optional
Index of the last singular value to return, 1-based in descending order; used only when range is
'I'. Default ismin(m, n).- lworkint, optional
Size of the workspace, passed to LAPACK as given. Default is
max(k * (3 * k + 20), 4 * k + max(m, n))withk = min(m, n), or 1 when a is empty. Usedgesvdx_lworkfor the optimal value. A size below what LAPACK needs givesinfo = -19.- overwrite_aint, optional
If nonzero, a may be overwritten in place. Default is 0.
- Returns:
- undarray
Left singular vectors as columns, shape
(m, min(m, n)); only the first ns columns are meaningful. A(1, 1)placeholder when compute_u is 0.- sndarray
Singular values in descending order, length
min(m, n); only the first ns entries are meaningful.- vtndarray
Right singular vectors as rows, shape
(min(m, n), n); only the first ns rows are meaningful. A(1, 1)placeholder when compute_vh is 0.- nsint
Number of singular values found:
min(m, n)forrange='A',iu - il + 1forrange='I'.- infoint
0 on success; if negative, the
-info-th argument had an illegal value; if positive, that many singular vectors failed to converge, or2 * min(m, n) + 1for an internal error in?bdsvdx.