1CGESDD(1) LAPACK driver routine (version 3.2) CGESDD(1)
2
3
4
6 CGESDD - computes the singular value decomposition (SVD) of a complex
7 M-by-N matrix A, optionally computing the left and/or right singular
8 vectors, by using divide-and-conquer method
9
11 SUBROUTINE CGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK,
12 LWORK, RWORK, IWORK, INFO )
13
14 CHARACTER JOBZ
15
16 INTEGER INFO, LDA, LDU, LDVT, LWORK, M, N
17
18 INTEGER IWORK( * )
19
20 REAL RWORK( * ), S( * )
21
22 COMPLEX A( LDA, * ), U( LDU, * ), VT( LDVT, * ), WORK( * )
23
25 CGESDD computes the singular value decomposition (SVD) of a complex M-
26 by-N matrix A, optionally computing the left and/or right singular vec‐
27 tors, by using divide-and-conquer method. The SVD is written
28 A = U * SIGMA * conjugate-transpose(V)
29 where SIGMA is an M-by-N matrix which is zero except for its min(m,n)
30 diagonal elements, U is an M-by-M unitary matrix, and V is an N-by-N
31 unitary matrix. The diagonal elements of SIGMA are the singular values
32 of A; they are real and non-negative, and are returned in descending
33 order. The first min(m,n) columns of U and V are the left and right
34 singular vectors of A.
35 Note that the routine returns VT = V**H, not V.
36 The divide and conquer algorithm makes very mild assumptions about
37 floating point arithmetic. It will work on machines with a guard digit
38 in add/subtract, or on those binary machines without guard digits which
39 subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could
40 conceivably fail on hexadecimal or decimal machines without guard dig‐
41 its, but we know of none.
42
44 JOBZ (input) CHARACTER*1
45 Specifies options for computing all or part of the matrix U:
46 = 'A': all M columns of U and all N rows of V**H are returned
47 in the arrays U and VT; = 'S': the first min(M,N) columns of U
48 and the first min(M,N) rows of V**H are returned in the arrays
49 U and VT; = 'O': If M >= N, the first N columns of U are over‐
50 written in the array A and all rows of V**H are returned in the
51 array VT; otherwise, all columns of U are returned in the array
52 U and the first M rows of V**H are overwritten in the array A;
53 = 'N': no columns of U or rows of V**H are computed.
54
55 M (input) INTEGER
56 The number of rows of the input matrix A. M >= 0.
57
58 N (input) INTEGER
59 The number of columns of the input matrix A. N >= 0.
60
61 A (input/output) COMPLEX array, dimension (LDA,N)
62 On entry, the M-by-N matrix A. On exit, if JOBZ = 'O', A is
63 overwritten with the first N columns of U (the left singular
64 vectors, stored columnwise) if M >= N; A is overwritten with
65 the first M rows of V**H (the right singular vectors, stored
66 rowwise) otherwise. if JOBZ .ne. 'O', the contents of A are
67 destroyed.
68
69 LDA (input) INTEGER
70 The leading dimension of the array A. LDA >= max(1,M).
71
72 S (output) REAL array, dimension (min(M,N))
73 The singular values of A, sorted so that S(i) >= S(i+1).
74
75 U (output) COMPLEX array, dimension (LDU,UCOL)
76 UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M < N; UCOL = min(M,N)
77 if JOBZ = 'S'. If JOBZ = 'A' or JOBZ = 'O' and M < N, U con‐
78 tains the M-by-M unitary matrix U; if JOBZ = 'S', U contains
79 the first min(M,N) columns of U (the left singular vectors,
80 stored columnwise); if JOBZ = 'O' and M >= N, or JOBZ = 'N', U
81 is not referenced.
82
83 LDU (input) INTEGER
84 The leading dimension of the array U. LDU >= 1; if JOBZ = 'S'
85 or 'A' or JOBZ = 'O' and M < N, LDU >= M.
86
87 VT (output) COMPLEX array, dimension (LDVT,N)
88 If JOBZ = 'A' or JOBZ = 'O' and M >= N, VT contains the N-by-N
89 unitary matrix V**H; if JOBZ = 'S', VT contains the first
90 min(M,N) rows of V**H (the right singular vectors, stored row‐
91 wise); if JOBZ = 'O' and M < N, or JOBZ = 'N', VT is not refer‐
92 enced.
93
94 LDVT (input) INTEGER
95 The leading dimension of the array VT. LDVT >= 1; if JOBZ =
96 'A' or JOBZ = 'O' and M >= N, LDVT >= N; if JOBZ = 'S', LDVT >=
97 min(M,N).
98
99 WORK (workspace/output) COMPLEX array, dimension (MAX(1,LWORK))
100 On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
101
102 LWORK (input) INTEGER
103 The dimension of the array WORK. LWORK >= 1. if JOBZ = 'N',
104 LWORK >= 2*min(M,N)+max(M,N). if JOBZ = 'O', LWORK >=
105 2*min(M,N)*min(M,N)+2*min(M,N)+max(M,N). if JOBZ = 'S' or 'A',
106 LWORK >= min(M,N)*min(M,N)+2*min(M,N)+max(M,N). For good per‐
107 formance, LWORK should generally be larger. If LWORK = -1, a
108 workspace query is assumed. The optimal size for the WORK
109 array is calculated and stored in WORK(1), and no other work
110 except argument checking is performed.
111
112 RWORK (workspace) REAL array, dimension (MAX(1,LRWORK))
113 If JOBZ = 'N', LRWORK >= 5*min(M,N). Otherwise, LRWORK >=
114 5*min(M,N)*min(M,N) + 7*min(M,N)
115
116 IWORK (workspace) INTEGER array, dimension (8*min(M,N))
117
118 INFO (output) INTEGER
119 = 0: successful exit.
120 < 0: if INFO = -i, the i-th argument had an illegal value.
121 > 0: The updating process of SBDSDC did not converge.
122
124 Based on contributions by
125 Ming Gu and Huan Ren, Computer Science Division, University of
126 California at Berkeley, USA
127
128
129
130 LAPACK driver routine (version 3.N2o)vember 2008 CGESDD(1)