1DGELSS(1) LAPACK driver routine (version 3.2) DGELSS(1)
2
3
4
6 DGELSS - computes the minimum norm solution to a real linear least
7 squares problem
8
10 SUBROUTINE DGELSS( M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
11 LWORK, INFO )
12
13 INTEGER INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
14
15 DOUBLE PRECISION RCOND
16
17 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), S( * ), WORK( *
18 )
19
21 DGELSS computes the minimum norm solution to a real linear least
22 squares problem: Minimize 2-norm(| b - A*x |).
23 using the singular value decomposition (SVD) of A. A is an M-by-N
24 matrix which may be rank-deficient.
25 Several right hand side vectors b and solution vectors x can be handled
26 in a single call; they are stored as the columns of the M-by-NRHS right
27 hand side matrix B and the N-by-NRHS solution matrix X.
28 The effective rank of A is determined by treating as zero those singu‐
29 lar values which are less than RCOND times the largest singular value.
30
32 M (input) INTEGER
33 The number of rows of the matrix A. M >= 0.
34
35 N (input) INTEGER
36 The number of columns of the matrix A. N >= 0.
37
38 NRHS (input) INTEGER
39 The number of right hand sides, i.e., the number of columns of
40 the matrices B and X. NRHS >= 0.
41
42 A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
43 On entry, the M-by-N matrix A. On exit, the first min(m,n)
44 rows of A are overwritten with its right singular vectors,
45 stored rowwise.
46
47 LDA (input) INTEGER
48 The leading dimension of the array A. LDA >= max(1,M).
49
50 B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
51 On entry, the M-by-NRHS right hand side matrix B. On exit, B
52 is overwritten by the N-by-NRHS solution matrix X. If m >= n
53 and RANK = n, the residual sum-of-squares for the solution in
54 the i-th column is given by the sum of squares of elements
55 n+1:m in that column.
56
57 LDB (input) INTEGER
58 The leading dimension of the array B. LDB >= max(1,max(M,N)).
59
60 S (output) DOUBLE PRECISION array, dimension (min(M,N))
61 The singular values of A in decreasing order. The condition
62 number of A in the 2-norm = S(1)/S(min(m,n)).
63
64 RCOND (input) DOUBLE PRECISION
65 RCOND is used to determine the effective rank of A. Singular
66 values S(i) <= RCOND*S(1) are treated as zero. If RCOND < 0,
67 machine precision is used instead.
68
69 RANK (output) INTEGER
70 The effective rank of A, i.e., the number of singular values
71 which are greater than RCOND*S(1).
72
73 WORK (workspace/output) DOUBLE PRECISION array, dimension
74 (MAX(1,LWORK))
75 On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
76
77 LWORK (input) INTEGER
78 The dimension of the array WORK. LWORK >= 1, and also: LWORK >=
79 3*min(M,N) + max( 2*min(M,N), max(M,N), NRHS ) For good perfor‐
80 mance, LWORK should generally be larger. If LWORK = -1, then a
81 workspace query is assumed; the routine only calculates the
82 optimal size of the WORK array, returns this value as the first
83 entry of the WORK array, and no error message related to LWORK
84 is issued by XERBLA.
85
86 INFO (output) INTEGER
87 = 0: successful exit
88 < 0: if INFO = -i, the i-th argument had an illegal value.
89 > 0: the algorithm for computing the SVD failed to converge;
90 if INFO = i, i off-diagonal elements of an intermediate bidiag‐
91 onal form did not converge to zero.
92
93
94
95 LAPACK driver routine (version 3.N2o)vember 2008 DGELSS(1)