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