1SLALS0(1) LAPACK routine (version 3.1) SLALS0(1)
2
3
4
6 SLALS0 - back the multiplying factors of either the left or the right
7 singular vector matrix of a diagonal matrix appended by a row to the
8 right hand side matrix B in solving the least squares problem using the
9 divide-and-conquer SVD approach
10
12 SUBROUTINE SLALS0( ICOMPQ, NL, NR, SQRE, NRHS, B, LDB, BX, LDBX, PERM,
13 GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM, POLES, DIFL,
14 DIFR, Z, K, C, S, WORK, INFO )
15
16 INTEGER GIVPTR, ICOMPQ, INFO, K, LDB, LDBX, LDGCOL, LDGNUM,
17 NL, NR, NRHS, SQRE
18
19 REAL C, S
20
21 INTEGER GIVCOL( LDGCOL, * ), PERM( * )
22
23 REAL B( LDB, * ), BX( LDBX, * ), DIFL( * ), DIFR( LDGNUM,
24 * ), GIVNUM( LDGNUM, * ), POLES( LDGNUM, * ), WORK(
25 * ), Z( * )
26
28 SLALS0 applies back the multiplying factors of either the left or the
29 right singular vector matrix of a diagonal matrix appended by a row to
30 the right hand side matrix B in solving the least squares problem using
31 the divide-and-conquer SVD approach.
32
33 For the left singular vector matrix, three types of orthogonal matrices
34 are involved:
35
36 (1L) Givens rotations: the number of such rotations is GIVPTR; the
37 pairs of columns/rows they were applied to are stored in GIVCOL;
38 and the C- and S-values of these rotations are stored in GIVNUM.
39
40 (2L) Permutation. The (NL+1)-st row of B is to be moved to the first
41 row, and for J=2:N, PERM(J)-th row of B is to be moved to the
42 J-th row.
43
44 (3L) The left singular vector matrix of the remaining matrix.
45
46 For the right singular vector matrix, four types of orthogonal matrices
47 are involved:
48
49 (1R) The right singular vector matrix of the remaining matrix.
50
51 (2R) If SQRE = 1, one extra Givens rotation to generate the right
52 null space.
53
54 (3R) The inverse transformation of (2L).
55
56 (4R) The inverse transformation of (1L).
57
58
60 ICOMPQ (input) INTEGER Specifies whether singular vectors are to be
61 computed in factored form:
62 = 0: Left singular vector matrix.
63 = 1: Right singular vector matrix.
64
65 NL (input) INTEGER
66 The row dimension of the upper block. NL >= 1.
67
68 NR (input) INTEGER
69 The row dimension of the lower block. NR >= 1.
70
71 SQRE (input) INTEGER
72 = 0: the lower block is an NR-by-NR square matrix.
73 = 1: the lower block is an NR-by-(NR+1) rectangular matrix.
74
75 The bidiagonal matrix has row dimension N = NL + NR + 1, and
76 column dimension M = N + SQRE.
77
78 NRHS (input) INTEGER
79 The number of columns of B and BX. NRHS must be at least 1.
80
81 B (input/output) REAL array, dimension ( LDB, NRHS )
82 On input, B contains the right hand sides of the least squares
83 problem in rows 1 through M. On output, B contains the solution
84 X in rows 1 through N.
85
86 LDB (input) INTEGER
87 The leading dimension of B. LDB must be at least max(1,MAX( M, N
88 ) ).
89
90 BX (workspace) REAL array, dimension ( LDBX, NRHS )
91
92 LDBX (input) INTEGER
93 The leading dimension of BX.
94
95 PERM (input) INTEGER array, dimension ( N )
96 The permutations (from deflation and sorting) applied to the two
97 blocks.
98
99 GIVPTR (input) INTEGER The number of Givens rotations which took
100 place in this subproblem.
101
102 GIVCOL (input) INTEGER array, dimension ( LDGCOL, 2 ) Each pair
103 of numbers indicates a pair of rows/columns involved in a Givens
104 rotation.
105
106 LDGCOL (input) INTEGER The leading dimension of GIVCOL, must be
107 at least N.
108
109 GIVNUM (input) REAL array, dimension ( LDGNUM, 2 ) Each number
110 indicates the C or S value used in the corresponding Givens
111 rotation.
112
113 LDGNUM (input) INTEGER The leading dimension of arrays DIFR,
114 POLES and GIVNUM, must be at least K.
115
116 POLES (input) REAL array, dimension ( LDGNUM, 2 )
117 On entry, POLES(1:K, 1) contains the new singular values
118 obtained from solving the secular equation, and POLES(1:K, 2) is
119 an array containing the poles in the secular equation.
120
121 DIFL (input) REAL array, dimension ( K ).
122 On entry, DIFL(I) is the distance between I-th updated (unde‐
123 flated) singular value and the I-th (undeflated) old singular
124 value.
125
126 DIFR (input) REAL array, dimension ( LDGNUM, 2 ).
127 On entry, DIFR(I, 1) contains the distances between I-th updated
128 (undeflated) singular value and the I+1-th (undeflated) old sin‐
129 gular value. And DIFR(I, 2) is the normalizing factor for the I-
130 th right singular vector.
131
132 Z (input) REAL array, dimension ( K )
133 Contain the components of the deflation-adjusted updating row
134 vector.
135
136 K (input) INTEGER
137 Contains the dimension of the non-deflated matrix, This is the
138 order of the related secular equation. 1 <= K <=N.
139
140 C (input) REAL
141 C contains garbage if SQRE =0 and the C-value of a Givens rota‐
142 tion related to the right null space if SQRE = 1.
143
144 S (input) REAL
145 S contains garbage if SQRE =0 and the S-value of a Givens rota‐
146 tion related to the right null space if SQRE = 1.
147
148 WORK (workspace) REAL array, dimension ( K )
149
150 INFO (output) INTEGER
151 = 0: successful exit.
152 < 0: if INFO = -i, the i-th argument had an illegal value.
153
155 Based on contributions by
156 Ming Gu and Ren-Cang Li, Computer Science Division, University of
157 California at Berkeley, USA
158 Osni Marques, LBNL/NERSC, USA
159
160
161
162
163 LAPACK routine (version 3.1) November 2006 SLALS0(1)