1DGELSY(1) LAPACK driver routine (version 3.1) DGELSY(1)
2
3
4
6 DGELSY - the minimum-norm solution to a real linear least squares prob‐
7 lem
8
10 SUBROUTINE DGELSY( M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK, WORK,
11 LWORK, INFO )
12
13 INTEGER INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
14
15 DOUBLE PRECISION RCOND
16
17 INTEGER JPVT( * )
18
19 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), WORK( * )
20
22 DGELSY computes the minimum-norm solution to a real linear least
23 squares problem:
24 minimize || A * X - B ||
25 using a complete orthogonal factorization of A. A is an M-by-N matrix
26 which may be rank-deficient.
27
28 Several right hand side vectors b and solution vectors x can be handled
29 in a single call; they are stored as the columns of the M-by-NRHS right
30 hand side matrix B and the N-by-NRHS solution matrix X.
31
32 The routine first computes a QR factorization with column pivoting:
33 A * P = Q * [ R11 R12 ]
34 [ 0 R22 ]
35 with R11 defined as the largest leading submatrix whose estimated con‐
36 dition number is less than 1/RCOND. The order of R11, RANK, is the
37 effective rank of A.
38
39 Then, R22 is considered to be negligible, and R12 is annihilated by
40 orthogonal transformations from the right, arriving at the complete
41 orthogonal factorization:
42 A * P = Q * [ T11 0 ] * Z
43 [ 0 0 ]
44 The minimum-norm solution is then
45 X = P * Z' [ inv(T11)*Q1'*B ]
46 [ 0 ]
47 where Q1 consists of the first RANK columns of Q.
48
49 This routine is basically identical to the original xGELSX except three
50 differences:
51 o The call to the subroutine xGEQPF has been substituted by the
52 the call to the subroutine xGEQP3. This subroutine is a Blas-3
53 version of the QR factorization with column pivoting.
54 o Matrix B (the right hand side) is updated with Blas-3.
55 o The permutation of matrix B (the right hand side) is faster and
56 more simple.
57
58
60 M (input) INTEGER
61 The number of rows of the matrix A. M >= 0.
62
63 N (input) INTEGER
64 The number of columns of the matrix A. N >= 0.
65
66 NRHS (input) INTEGER
67 The number of right hand sides, i.e., the number of columns of
68 matrices B and X. NRHS >= 0.
69
70 A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
71 On entry, the M-by-N matrix A. On exit, A has been overwritten
72 by details of its complete orthogonal factorization.
73
74 LDA (input) INTEGER
75 The leading dimension of the array A. LDA >= max(1,M).
76
77 B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
78 On entry, the M-by-NRHS right hand side matrix B. On exit, the
79 N-by-NRHS solution matrix X.
80
81 LDB (input) INTEGER
82 The leading dimension of the array B. LDB >= max(1,M,N).
83
84 JPVT (input/output) INTEGER array, dimension (N)
85 On entry, if JPVT(i) .ne. 0, the i-th column of A is permuted
86 to the front of AP, otherwise column i is a free column. On
87 exit, if JPVT(i) = k, then the i-th column of AP was the k-th
88 column of A.
89
90 RCOND (input) DOUBLE PRECISION
91 RCOND is used to determine the effective rank of A, which is
92 defined as the order of the largest leading triangular subma‐
93 trix R11 in the QR factorization with pivoting of A, whose
94 estimated condition number < 1/RCOND.
95
96 RANK (output) INTEGER
97 The effective rank of A, i.e., the order of the submatrix R11.
98 This is the same as the order of the submatrix T11 in the com‐
99 plete orthogonal factorization of A.
100
101 WORK (workspace/output) DOUBLE PRECISION array, dimension
102 (MAX(1,LWORK))
103 On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
104
105 LWORK (input) INTEGER
106 The dimension of the array WORK. The unblocked strategy
107 requires that: LWORK >= MAX( MN+3*N+1, 2*MN+NRHS ), where MN =
108 min( M, N ). The block algorithm requires that: LWORK >= MAX(
109 MN+2*N+NB*(N+1), 2*MN+NB*NRHS ), where NB is an upper bound on
110 the blocksize returned by ILAENV for the routines DGEQP3,
111 DTZRZF, STZRQF, DORMQR, and DORMRZ.
112
113 If LWORK = -1, then a workspace query is assumed; the routine
114 only calculates the optimal size of the WORK array, returns
115 this value as the first entry of the WORK array, and no error
116 message related to LWORK is issued by XERBLA.
117
118 INFO (output) INTEGER
119 = 0: successful exit
120 < 0: If INFO = -i, the i-th argument had an illegal value.
121
123 Based on contributions by
124 A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
125 E. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
126 G. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
127
128
129
130
131 LAPACK driver routine (version 3.N1o)vember 2006 DGELSY(1)