naginterfaces.library.lapackeig.zgesdd¶
- naginterfaces.library.lapackeig.zgesdd(jobz, a)[source]¶
zgesdd
computes the singular value decomposition (SVD) of a complex matrix , optionally computing the left and/or right singular vectors, by using a divide-and-conquer method.For full information please refer to the NAG Library document for f08kr
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/f08/f08krf.html
- Parameters
- jobzstr, length 1
Specifies options for computing all or part of the matrix .
All columns of and all rows of are returned in the arrays and .
The first columns of and the first rows of are returned in the arrays and .
If , the first columns of are overwritten on the array and all rows of are returned in the array . Otherwise, all columns of are returned in the array and the first rows of are overwritten in the array .
No columns of or rows of are computed.
- acomplex, array-like, shape
The matrix .
- Returns
- acomplex, 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) otherwise.
If , the contents of are destroyed.
- sfloat, ndarray, shape
The singular values of , sorted so that .
- ucomplex, ndarray, shape
If or and , contains the unitary matrix .
If , contains the first columns of (the left singular vectors, stored column-wise).
If and , or , is not referenced.
- vtcomplex, ndarray, shape
If or and , contains the unitary matrix .
If , contains the first rows of (the right singular vectors, stored row-wise).
If and , or , is not referenced.
- Raises
- NagValueError
- (errno )
On entry, error in parameter .
Constraint: , , or .
- (errno )
On entry, error in parameter .
Constraint: .
- (errno )
On entry, error in parameter .
Constraint: .
- (errno )
zgesdd
did not converge, the updating process failed.
- Notes
The SVD is written as
where is an matrix which is zero except for its diagonal elements, is an unitary matrix, and is an unitary 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