naginterfaces.library.lapackeig.dgesvd

naginterfaces.library.lapackeig.dgesvd(jobu, jobvt, a)[source]

dgesvd computes the singular value decomposition (SVD) of a real matrix , optionally computing the left and/or right singular vectors.

For full information please refer to the NAG Library document for f08kb

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/f08/f08kbf.html

Parameters
jobustr, length 1

Specifies options for computing all or part of the matrix .

All columns of are returned in array .

The first columns of (the left singular vectors) are returned in the array .

The first columns of (the left singular vectors) are overwritten on the array .

No columns of (no left singular vectors) are computed.

jobvtstr, length 1

Specifies options for computing all or part of the matrix .

All rows of are returned in the array .

The first rows of (the right singular vectors) are returned in the array .

The first rows of (the right singular vectors) are overwritten on the array .

No rows of (no right singular vectors) are computed.

afloat, array-like, shape

The matrix .

Returns
afloat, ndarray, shape

If , is overwritten with the first columns of (the left singular vectors, stored column-wise).

If , is overwritten with the first rows of (the right singular vectors, stored row-wise).

If and , the contents of are destroyed.

sfloat, ndarray, shape

The singular values of , sorted so that .

ufloat, ndarray, shape

If , contains the orthogonal matrix .

If , contains the first columns of (the left singular vectors, stored column-wise).

If or , is not referenced.

vtfloat, ndarray, shape

If , contains the orthogonal matrix .

If , contains the first rows of (the right singular vectors, stored row-wise).

If or , is not referenced.

workbfloat, ndarray, shape

If > 0, contains the unconverged superdiagonal elements of an upper bidiagonal matrix whose diagonal is in (not necessarily sorted). satisfies , so it has the same singular values as , and singular vectors related by and .

Raises
NagValueError
(errno )

On entry, error in parameter .

Constraint: , , or .

(errno )

On entry, error in parameter .

Constraint: , , or .

(errno )

On entry, error in parameter .

Constraint: or .

(errno )

On entry, error in parameter .

Constraint: .

(errno )

On entry, error in parameter .

Constraint: .

(errno )

If dgesvd did not converge, specifies how many superdiagonals of an intermediate bidiagonal form did not converge to zero.

Notes

The SVD is written as

where is an matrix which is zero except for its diagonal elements, is an orthogonal matrix, and is an orthogonal matrix. The diagonal elements of are the singular values of ; they are real and non-negative, and are returned in descending order. The first columns of and are the left and right singular vectors of .

Note that the function returns , not .

References

Anderson, E, Bai, Z, Bischof, C, Blackford, S, Demmel, J, Dongarra, J J, Du Croz, J J, Greenbaum, A, Hammarling, S, McKenney, A and Sorensen, D, 1999, LAPACK Users’ Guide, (3rd Edition), SIAM, Philadelphia, https://www.netlib.org/lapack/lug

Golub, G H and Van Loan, C F, 1996, Matrix Computations, (3rd Edition), Johns Hopkins University Press, Baltimore