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