1DLASD6(1) LAPACK auxiliary routine (version 3.1) DLASD6(1)
2
3
4
6 DLASD6 - the SVD of an updated upper bidiagonal matrix B obtained by
7 merging two smaller ones by appending a row
8
10 SUBROUTINE DLASD6( ICOMPQ, NL, NR, SQRE, D, VF, VL, ALPHA, BETA, IDXQ,
11 PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM, POLES,
12 DIFL, DIFR, Z, K, C, S, WORK, IWORK, INFO )
13
14 INTEGER GIVPTR, ICOMPQ, INFO, K, LDGCOL, LDGNUM, NL, NR,
15 SQRE
16
17 DOUBLE PRECISION ALPHA, BETA, C, S
18
19 INTEGER GIVCOL( LDGCOL, * ), IDXQ( * ), IWORK( * ), PERM( *
20 )
21
22 DOUBLE PRECISION D( * ), DIFL( * ), DIFR( * ), GIVNUM(
23 LDGNUM, * ), POLES( LDGNUM, * ), VF( * ), VL( * ),
24 WORK( * ), Z( * )
25
27 DLASD6 computes the SVD of an updated upper bidiagonal matrix B
28 obtained by merging two smaller ones by appending a row. This routine
29 is used only for the problem which requires all singular values and
30 optionally singular vector matrices in factored form. B is an N-by-M
31 matrix with N = NL + NR + 1 and M = N + SQRE. A related subroutine,
32 DLASD1, handles the case in which all singular values and singular vec‐
33 tors of the bidiagonal matrix are desired.
34
35 DLASD6 computes the SVD as follows:
36
37 ( D1(in) 0 0 0 )
38 B = U(in) * ( Z1' a Z2' b ) * VT(in)
39 ( 0 0 D2(in) 0 )
40
41 = U(out) * ( D(out) 0) * VT(out)
42
43 where Z' = (Z1' a Z2' b) = u' VT', and u is a vector of dimension M
44 with ALPHA and BETA in the NL+1 and NL+2 th entries and zeros else‐
45 where; and the entry b is empty if SQRE = 0.
46
47 The singular values of B can be computed using D1, D2, the first compo‐
48 nents of all the right singular vectors of the lower block, and the
49 last components of all the right singular vectors of the upper block.
50 These components are stored and updated in VF and VL, respectively, in
51 DLASD6. Hence U and VT are not explicitly referenced.
52
53 The singular values are stored in D. The algorithm consists of two
54 stages:
55
56 The first stage consists of deflating the size of the problem
57 when there are multiple singular values or if there is a zero
58 in the Z vector. For each such occurence the dimension of the
59 secular equation problem is reduced by one. This stage is
60 performed by the routine DLASD7.
61
62 The second stage consists of calculating the updated
63 singular values. This is done by finding the roots of the
64 secular equation via the routine DLASD4 (as called by DLASD8).
65 This routine also updates VF and VL and computes the distances
66 between the updated singular values and the old singular
67 values.
68
69 DLASD6 is called from DLASDA.
70
71
73 ICOMPQ (input) INTEGER Specifies whether singular vectors are to be
74 computed in factored form:
75 = 0: Compute singular values only.
76 = 1: Compute singular vectors in factored form as well.
77
78 NL (input) INTEGER
79 The row dimension of the upper block. NL >= 1.
80
81 NR (input) INTEGER
82 The row dimension of the lower block. NR >= 1.
83
84 SQRE (input) INTEGER
85 = 0: the lower block is an NR-by-NR square matrix.
86 = 1: the lower block is an NR-by-(NR+1) rectangular matrix.
87
88 The bidiagonal matrix has row dimension N = NL + NR + 1, and
89 column dimension M = N + SQRE.
90
91 D (input/output) DOUBLE PRECISION array, dimension ( NL+NR+1 ).
92 On entry D(1:NL,1:NL) contains the singular values of the
93 upper block, and D(NL+2:N) contains the singular values
94 of the lower block. On exit D(1:N) contains the singular values
95 of the modified matrix.
96
97 VF (input/output) DOUBLE PRECISION array, dimension ( M )
98 On entry, VF(1:NL+1) contains the first components of all
99 right singular vectors of the upper block; and VF(NL+2:M) con‐
100 tains the first components of all right singular vectors of the
101 lower block. On exit, VF contains the first components of all
102 right singular vectors of the bidiagonal matrix.
103
104 VL (input/output) DOUBLE PRECISION array, dimension ( M )
105 On entry, VL(1:NL+1) contains the last components of all
106 right singular vectors of the upper block; and VL(NL+2:M) con‐
107 tains the last components of all right singular vectors of the
108 lower block. On exit, VL contains the last components of all
109 right singular vectors of the bidiagonal matrix.
110
111 ALPHA (input/output) DOUBLE PRECISION
112 Contains the diagonal element associated with the added row.
113
114 BETA (input/output) DOUBLE PRECISION
115 Contains the off-diagonal element associated with the added row.
116
117 IDXQ (output) INTEGER array, dimension ( N )
118 This contains the permutation which will reintegrate the sub‐
119 problem just solved back into sorted order, i.e. D( IDXQ( I =
120 1, N ) ) will be in ascending order.
121
122 PERM (output) INTEGER array, dimension ( N )
123 The permutations (from deflation and sorting) to be applied to
124 each block. Not referenced if ICOMPQ = 0.
125
126 GIVPTR (output) INTEGER The number of Givens rotations which
127 took place in this subproblem. Not referenced if ICOMPQ = 0.
128
129 GIVCOL (output) INTEGER array, dimension ( LDGCOL, 2 ) Each pair
130 of numbers indicates a pair of columns to take place in a Givens
131 rotation. Not referenced if ICOMPQ = 0.
132
133 LDGCOL (input) INTEGER leading dimension of GIVCOL, must be at
134 least N.
135
136 GIVNUM (output) DOUBLE PRECISION array, dimension ( LDGNUM, 2 )
137 Each number indicates the C or S value to be used in the corre‐
138 sponding Givens rotation. Not referenced if ICOMPQ = 0.
139
140 LDGNUM (input) INTEGER The leading dimension of GIVNUM and
141 POLES, must be at least N.
142
143 POLES (output) DOUBLE PRECISION array, dimension ( LDGNUM, 2 )
144 On exit, POLES(1,*) is an array containing the new singular val‐
145 ues obtained from solving the secular equation, and POLES(2,*)
146 is an array containing the poles in the secular equation. Not
147 referenced if ICOMPQ = 0.
148
149 DIFL (output) DOUBLE PRECISION array, dimension ( N )
150 On exit, DIFL(I) is the distance between I-th updated (unde‐
151 flated) singular value and the I-th (undeflated) old singular
152 value.
153
154 DIFR (output) DOUBLE PRECISION array,
155 dimension ( LDGNUM, 2 ) if ICOMPQ = 1 and dimension ( N ) if
156 ICOMPQ = 0. On exit, DIFR(I, 1) is the distance between I-th
157 updated (undeflated) singular value and the I+1-th (undeflated)
158 old singular value.
159
160 If ICOMPQ = 1, DIFR(1:K,2) is an array containing the normaliz‐
161 ing factors for the right singular vector matrix.
162
163 See DLASD8 for details on DIFL and DIFR.
164
165 Z (output) DOUBLE PRECISION array, dimension ( M )
166 The first elements of this array contain the components of the
167 deflation-adjusted updating row vector.
168
169 K (output) INTEGER
170 Contains the dimension of the non-deflated matrix, This is the
171 order of the related secular equation. 1 <= K <=N.
172
173 C (output) DOUBLE PRECISION
174 C contains garbage if SQRE =0 and the C-value of a Givens rota‐
175 tion related to the right null space if SQRE = 1.
176
177 S (output) DOUBLE PRECISION
178 S contains garbage if SQRE =0 and the S-value of a Givens rota‐
179 tion related to the right null space if SQRE = 1.
180
181 WORK (workspace) DOUBLE PRECISION array, dimension ( 4 * M )
182
183 IWORK (workspace) INTEGER array, dimension ( 3 * N )
184
185 INFO (output) INTEGER
186 = 0: successful exit.
187 < 0: if INFO = -i, the i-th argument had an illegal value.
188 > 0: if INFO = 1, an singular value did not converge
189
191 Based on contributions by
192 Ming Gu and Huan Ren, Computer Science Division, University of
193 California at Berkeley, USA
194
195
196
197
198 LAPACK auxiliary routine (versionNo3v.e1m)ber 2006 DLASD6(1)