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