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