?gesdd
?gesdd
Computes the singular value decomposition of a general rectangular matrix using a divide and conquer method.
Syntax
lapack_int LAPACKE_sgesdd
(
int
matrix_layout
,
char
jobz
,
lapack_int
m
,
lapack_int
n
,
float*
a
,
lapack_int
lda
,
float*
s
,
float*
u
,
lapack_int
ldu
,
float*
vt
,
lapack_int
ldvt
);
lapack_int LAPACKE_dgesdd
(
int
matrix_layout
,
char
jobz
,
lapack_int
m
,
lapack_int
n
,
double*
a
,
lapack_int
lda
,
double*
s
,
double*
u
,
lapack_int
ldu
,
double*
vt
,
lapack_int
ldvt
);
lapack_int LAPACKE_cgesdd
(
int
matrix_layout
,
char
jobz
,
lapack_int
m
,
lapack_int
n
,
lapack_complex_float*
a
,
lapack_int
lda
,
float*
s
,
lapack_complex_float*
u
,
lapack_int
ldu
,
lapack_complex_float*
vt
,
lapack_int
ldvt
);
lapack_int LAPACKE_zgesdd
(
int
matrix_layout
,
char
jobz
,
lapack_int
m
,
lapack_int
n
,
lapack_complex_double*
a
,
lapack_int
lda
,
double*
s
,
lapack_complex_double*
u
,
lapack_int
ldu
,
lapack_complex_double*
vt
,
lapack_int
ldvt
);
Include Files
- mkl.h
Description
The routine computes the singular value decomposition (SVD) of a real/complex
m
-by-n
matrix A
, optionally computing the left and/or right singular vectors. If singular vectors are desired, it uses a divide-and-conquer algorithm. The SVD is written
A
= U
*Σ
*V
T
A
= U
*Σ
*V
H
where
Σ
is an m
-by-n
matrix which is zero except for its min(m
,n
) diagonal elements, U
is an m
-by-m
orthogonal/unitary matrix, and V
is an n
-by-n
orthogonal/unitary matrix. The diagonal elements of Σ
are the singular values of A
; they are real and non-negative, and are returned in descending order. The first min(m
, n
) columns of U
and V
are the left and right singular vectors of A
. Note that the routine returns
vt
=
V
T
(for real flavors)
or vt
=V
H
(for complex flavors), not V
.Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- jobz
- Must be'A','S','O', or'N'.Specifies options for computing all or part of the matricesUandV.If, alljobz='A'mcolumns ofUand allnrows ofVTorVHare returned in the arraysuandvt;if, the first min(jobz='S'm,n) columns ofUand the first min(m,n) rows ofVTorVHare returned in the arraysuandvt;if, thenjobz='O'ifm≥n, the firstncolumns ofUare overwritten in the arrayaand all rows ofVTorVHare returned in the arrayvt;ifm<n, all columns ofUare returned in the arrayuand the firstmrows ofVTorVHare overwritten in the arraya;if, no columns ofjobz='N'Uor rows ofVTorVHare computed.
- m
- The number of rows of the matrixA().m≥0
- n
- The number of columns inA(n≥0).
- a
- a(size max(1,is an array containing thelda*n) for column major layout and max(1,lda*m) for row major layout)m-by-nmatrixA.
- lda
- The leading dimension of the arraya. Must be at least max(1,m)for column major layout and at least max(1,.n) for row major layout
- ldu,ldvt
- The leading dimensions of the output arraysuandvt, respectively.The minimum size oflduisjobzm≥nm<n'N'11'A'mm'S'mfor column major layout;nfor row major layoutm'O'1mThe minimum size ofldvtisjobzm≥nm<n'N'11'A'nn'S'nmfor column major layout;nfor row major layout'O'n1
Output Parameters
- a
- On exit:If, then ifjobz='O'm≥n,ais overwritten with the firstncolumns ofU(the left singular vectors, stored columnwise). Ifm<n,ais overwritten with the firstmrows ofV(the right singular vectors, stored rowwise);TIfjobz≠'O', the contents ofaare destroyed.
- s
- Array, size at least max(1, min(m,n)). Contains the singular values ofAsorted so that.s(i)≥s(i+1)
- u,vt
- Arrays:Arrayuis of size:jobzm≥nm<n'N'11'A'max(1,ldu*m)max(1,ldu*m)'S'max(1,ldu*n) for column major layout; max(1,ldu*m) for row major layoutmax(1,ldu*m)'O'1max(1,ldu*m)Iforjobz='A'andjobz='O'm<n,ucontains them-by-morthogonal/unitary matrixU.If,jobz='S'ucontains the first min(m,n) columns ofU(the left singular vectors, stored columnwise).Ifandjobz='O'm≥n, or,jobz='N'uis not referenced.Arrayvtis of size:jobzm≥nm<n'N'11'A'max(1,ldvt*n)max(1,ldvt*n)'S'max(1,ldvt*n)max(1,ldvt*n) for column major layout; max(1,ldvt*m) for row major layout;'O'max(1,ldvt*n)1Iforjobz='A'andjobz='O'm≥n,vtcontains then-by-northogonal/unitary matrixV.TIf,jobz='S'vtcontains the first min(m,n) rows ofV(the right singular vectors, stored rowwise).TIfandjobz='O', orm<n,jobz='N'vtis not referenced.
Return Values
This function returns a value
info
.If , the execution is successful.
info
=0If , the
info
= -i
i
-th parameter had an illegal value.If , then
info
= i
?bdsdc
did not converge, updating process failed.