1DLASD2(1) LAPACK auxiliary routine (version 3.1) DLASD2(1)
2
3
4
6 DLASD2 - the two sets of singular values together into a single sorted
7 set
8
10 SUBROUTINE DLASD2( NL, NR, SQRE, K, D, Z, ALPHA, BETA, U, LDU, VT,
11 LDVT, DSIGMA, U2, LDU2, VT2, LDVT2, IDXP, IDX, IDXC,
12 IDXQ, COLTYP, INFO )
13
14 INTEGER INFO, K, LDU, LDU2, LDVT, LDVT2, NL, NR, SQRE
15
16 DOUBLE PRECISION ALPHA, BETA
17
18 INTEGER COLTYP( * ), IDX( * ), IDXC( * ), IDXP( * ), IDXQ( *
19 )
20
21 DOUBLE PRECISION D( * ), DSIGMA( * ), U( LDU, * ), U2(
22 LDU2, * ), VT( LDVT, * ), VT2( LDVT2, * ), Z( * )
23
25 DLASD2 merges the two sets of singular values together into a single
26 sorted set. Then it tries to deflate the size of the problem. There
27 are two ways in which deflation can occur: when two or more singular
28 values are close together or if there is a tiny entry in the Z vector.
29 For each such occurrence the order of the related secular equation
30 problem is reduced by one.
31
32 DLASD2 is called from DLASD1.
33
34
36 NL (input) INTEGER
37 The row dimension of the upper block. NL >= 1.
38
39 NR (input) INTEGER
40 The row dimension of the lower block. NR >= 1.
41
42 SQRE (input) INTEGER
43 = 0: the lower block is an NR-by-NR square matrix.
44 = 1: the lower block is an NR-by-(NR+1) rectangular matrix.
45
46 The bidiagonal matrix has N = NL + NR + 1 rows and M = N + SQRE
47 >= N columns.
48
49 K (output) INTEGER
50 Contains the dimension of the non-deflated matrix, This is the
51 order of the related secular equation. 1 <= K <=N.
52
53 D (input/output) DOUBLE PRECISION array, dimension(N)
54 On entry D contains the singular values of the two submatrices
55 to be combined. On exit D contains the trailing (N-K) updated
56 singular values (those which were deflated) sorted into increas‐
57 ing order.
58
59 Z (output) DOUBLE PRECISION array, dimension(N)
60 On exit Z contains the updating row vector in the secular equa‐
61 tion.
62
63 ALPHA (input) DOUBLE PRECISION
64 Contains the diagonal element associated with the added row.
65
66 BETA (input) DOUBLE PRECISION
67 Contains the off-diagonal element associated with the added row.
68
69 U (input/output) DOUBLE PRECISION array, dimension(LDU,N)
70 On entry U contains the left singular vectors of two submatrices
71 in the two square blocks with corners at (1,1), (NL, NL), and
72 (NL+2, NL+2), (N,N). On exit U contains the trailing (N-K)
73 updated left singular vectors (those which were deflated) in its
74 last N-K columns.
75
76 LDU (input) INTEGER
77 The leading dimension of the array U. LDU >= N.
78
79 VT (input/output) DOUBLE PRECISION array, dimension(LDVT,M)
80 On entry VT' contains the right singular vectors of two subma‐
81 trices in the two square blocks with corners at (1,1), (NL+1,
82 NL+1), and (NL+2, NL+2), (M,M). On exit VT' contains the trail‐
83 ing (N-K) updated right singular vectors (those which were
84 deflated) in its last N-K columns. In case SQRE =1, the last
85 row of VT spans the right null space.
86
87 LDVT (input) INTEGER
88 The leading dimension of the array VT. LDVT >= M.
89
90 DSIGMA (output) DOUBLE PRECISION array, dimension (N) Contains a
91 copy of the diagonal elements (K-1 singular values and one zero)
92 in the secular equation.
93
94 U2 (output) DOUBLE PRECISION array, dimension(LDU2,N)
95 Contains a copy of the first K-1 left singular vectors which
96 will be used by DLASD3 in a matrix multiply (DGEMM) to solve for
97 the new left singular vectors. U2 is arranged into four blocks.
98 The first block contains a column with 1 at NL+1 and zero every‐
99 where else; the second block contains non-zero entries only at
100 and above NL; the third contains non-zero entries only below
101 NL+1; and the fourth is dense.
102
103 LDU2 (input) INTEGER
104 The leading dimension of the array U2. LDU2 >= N.
105
106 VT2 (output) DOUBLE PRECISION array, dimension(LDVT2,N)
107 VT2' contains a copy of the first K right singular vectors which
108 will be used by DLASD3 in a matrix multiply (DGEMM) to solve for
109 the new right singular vectors. VT2 is arranged into three
110 blocks. The first block contains a row that corresponds to the
111 special 0 diagonal element in SIGMA; the second block contains
112 non-zeros only at and before NL +1; the third block contains
113 non-zeros only at and after NL +2.
114
115 LDVT2 (input) INTEGER
116 The leading dimension of the array VT2. LDVT2 >= M.
117
118 IDXP (workspace) INTEGER array dimension(N)
119 This will contain the permutation used to place deflated values
120 of D at the end of the array. On output IDXP(2:K)
121 points to the nondeflated D-values and IDXP(K+1:N) points to the
122 deflated singular values.
123
124 IDX (workspace) INTEGER array dimension(N)
125 This will contain the permutation used to sort the contents of D
126 into ascending order.
127
128 IDXC (output) INTEGER array dimension(N)
129 This will contain the permutation used to arrange the columns of
130 the deflated U matrix into three groups: the first group con‐
131 tains non-zero entries only at and above NL, the second contains
132 non-zero entries only below NL+2, and the third is dense.
133
134 IDXQ (input/output) INTEGER array dimension(N)
135 This contains the permutation which separately sorts the two
136 sub-problems in D into ascending order. Note that entries in
137 the first hlaf of this permutation must first be moved one posi‐
138 tion backward; and entries in the second half must first have
139 NL+1 added to their values.
140
141 COLTYP (workspace/output) INTEGER array dimension(N) As
142 workspace, this will contain a label which will indicate which
143 of the following types a column in the U2 matrix or a row in the
144 VT2 matrix is:
145 1 : non-zero in the upper half only
146 2 : non-zero in the lower half only
147 3 : dense
148 4 : deflated
149
150 On exit, it is an array of dimension 4, with COLTYP(I) being the
151 dimension of the I-th type columns.
152
153 INFO (output) INTEGER
154 = 0: successful exit.
155 < 0: if INFO = -i, the i-th argument had an illegal value.
156
158 Based on contributions by
159 Ming Gu and Huan Ren, Computer Science Division, University of
160 California at Berkeley, USA
161
162
163
164
165 LAPACK auxiliary routine (versionNo3v.e1m)ber 2006 DLASD2(1)