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