1CLALSD(1) LAPACK routine (version 3.2) CLALSD(1)
2
3
4
6 CLALSD - uses the singular value decomposition of A to solve the least
7 squares problem of finding X to minimize the Euclidean norm of each
8 column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-
9 by-NRHS
10
12 SUBROUTINE CLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND, RANK,
13 WORK, RWORK, IWORK, INFO )
14
15 CHARACTER UPLO
16
17 INTEGER INFO, LDB, N, NRHS, RANK, SMLSIZ
18
19 REAL RCOND
20
21 INTEGER IWORK( * )
22
23 REAL D( * ), E( * ), RWORK( * )
24
25 COMPLEX B( LDB, * ), WORK( * )
26
28 CLALSD uses the singular value decomposition of A to solve the least
29 squares problem of finding X to minimize the Euclidean norm of each
30 column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-
31 by-NRHS. The solution X overwrites B. The singular values of A smaller
32 than RCOND times the largest singular value are treated as zero in
33 solving the least squares problem; in this case a minimum norm solution
34 is returned. The actual singular values are returned in D in ascending
35 order. This code makes very mild assumptions about floating point
36 arithmetic. It will work on machines with a guard digit in add/sub‐
37 tract, or on those binary machines without guard digits which subtract
38 like the Cray XMP, Cray YMP, Cray C 90, or Cray 2. It could conceiv‐
39 ably fail on hexadecimal or decimal machines without guard digits, but
40 we know of none.
41
43 UPLO (input) CHARACTER*1
44 = 'U': D and E define an upper bidiagonal matrix.
45 = 'L': D and E define a lower bidiagonal matrix. SMLSIZ
46 (input) INTEGER The maximum size of the subproblems at the bot‐
47 tom of the computation tree.
48
49 N (input) INTEGER
50 The dimension of the bidiagonal matrix. N >= 0.
51
52 NRHS (input) INTEGER
53 The number of columns of B. NRHS must be at least 1.
54
55 D (input/output) REAL array, dimension (N)
56 On entry D contains the main diagonal of the bidiagonal matrix.
57 On exit, if INFO = 0, D contains its singular values.
58
59 E (input/output) REAL array, dimension (N-1)
60 Contains the super-diagonal entries of the bidiagonal matrix.
61 On exit, E has been destroyed.
62
63 B (input/output) COMPLEX array, dimension (LDB,NRHS)
64 On input, B contains the right hand sides of the least squares
65 problem. On output, B contains the solution X.
66
67 LDB (input) INTEGER
68 The leading dimension of B in the calling subprogram. LDB must
69 be at least max(1,N).
70
71 RCOND (input) REAL
72 The singular values of A less than or equal to RCOND times the
73 largest singular value are treated as zero in solving the least
74 squares problem. If RCOND is negative, machine precision is used
75 instead. For example, if diag(S)*X=B were the least squares
76 problem, where diag(S) is a diagonal matrix of singular values,
77 the solution would be X(i) = B(i) / S(i) if S(i) is greater than
78 RCOND*max(S), and X(i) = 0 if S(i) is less than or equal to
79 RCOND*max(S).
80
81 RANK (output) INTEGER
82 The number of singular values of A greater than RCOND times the
83 largest singular value.
84
85 WORK (workspace) COMPLEX array, dimension (N * NRHS).
86
87 RWORK (workspace) REAL array, dimension at least
88 (9*N + 2*N*SMLSIZ + 8*N*NLVL + 3*SMLSIZ*NRHS + (SMLSIZ+1)**2),
89 where NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 )
90
91 IWORK (workspace) INTEGER array, dimension (3*N*NLVL + 11*N).
92
93 INFO (output) INTEGER
94 = 0: successful exit.
95 < 0: if INFO = -i, the i-th argument had an illegal value.
96 > 0: The algorithm failed to compute an singular value while
97 working on the submatrix lying in rows and columns INFO/(N+1)
98 through MOD(INFO,N+1).
99
101 Based on contributions by
102 Ming Gu and Ren-Cang Li, Computer Science Division, University of
103 California at Berkeley, USA
104 Osni Marques, LBNL/NERSC, USA
105
106
107
108 LAPACK routine (version 3.2) November 2008 CLALSD(1)