F08ZAF (DGGLSE) solves a real linear equality-constrained least squares problem.
SUBROUTINE F08ZAF ( |
M, N, P, A, LDA, B, LDB, C, D, X, WORK, LWORK, INFO) |
INTEGER |
M, N, P, LDA, LDB, LWORK, INFO |
REAL (KIND=nag_wp) |
A(LDA,*), B(LDB,*), C(M), D(P), X(N), WORK(max(1,LWORK)) |
|
F08ZAF (DGGLSE) solves the real linear equality-constrained least squares (LSE) problem
where
A is an
m by
n matrix,
B is a
p by
n matrix,
c is an
m element vector and
d is a
p element vector. It is assumed that
p≤n≤m+p,
rankB=p and
rankE=n, where
E=
A
B
. These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized
RQ factorization of the matrices
B and
A.
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999)
LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia
Anderson E, Bai Z and Dongarra J (1992) Generalized
QR factorization and its applications
Linear Algebra Appl. (Volume 162–164) 243–271
Eldèn L (1980) Perturbation theory for the least-squares problem with linear equality constraints
SIAM J. Numer. Anal. 17 338–350
- 1: M – INTEGERInput
On entry: m, the number of rows of the matrix A.
Constraint:
M≥0.
- 2: N – INTEGERInput
On entry: n, the number of columns of the matrices A and B.
Constraint:
N≥0.
- 3: P – INTEGERInput
On entry: p, the number of rows of the matrix B.
Constraint:
0≤P≤N≤M+P.
- 4: A(LDA,*) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
A
must be at least
max1,N.
On entry: the m by n matrix A.
On exit:
A is overwritten.
- 5: LDA – INTEGERInput
On entry: the first dimension of the array
A as declared in the (sub)program from which F08ZAF (DGGLSE) is called.
Constraint:
LDA≥max1,M.
- 6: B(LDB,*) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
B
must be at least
max1,N.
On entry: the p by n matrix B.
On exit:
B is overwritten.
- 7: LDB – INTEGERInput
On entry: the first dimension of the array
B as declared in the (sub)program from which F08ZAF (DGGLSE) is called.
Constraint:
LDB≥max1,P.
- 8: C(M) – REAL (KIND=nag_wp) arrayInput/Output
On entry: the right-hand side vector c for the least squares part of the LSE problem.
On exit: the residual sum of squares for the solution vector x is given by the sum of squares of elements CN-P+1,CN-P+2,…,CM; the remaining elements are overwritten.
- 9: D(P) – REAL (KIND=nag_wp) arrayInput/Output
On entry: the right-hand side vector d for the equality constraints.
On exit:
D is overwritten.
- 10: X(N) – REAL (KIND=nag_wp) arrayOutput
On exit: the solution vector x of the LSE problem.
- 11: WORK(max1,LWORK) – REAL (KIND=nag_wp) arrayWorkspace
On exit: if
INFO=0,
WORK1 contains the minimum value of
LWORK required for optimal performance.
- 12: LWORK – INTEGERInput
On entry: the dimension of the array
WORK as declared in the (sub)program from which F08ZAF (DGGLSE) is called.
If
LWORK=-1, a workspace query is assumed; the routine only calculates the optimal size of the
WORK array, returns this value as the first entry of the
WORK array, and no error message related to
LWORK is issued.
Suggested value:
for optimal performance, LWORK≥P+minM,N+maxM,N×nb, where nb is the optimal block size.
Constraint:
LWORK≥ max1,M+N+P or LWORK=-1.
- 13: INFO – INTEGEROutput
On exit:
INFO=0 unless the routine detects an error (see
Section 6).
For an error analysis, see
Anderson et al. (1992) and
Eldèn (1980). See also Section 4.6 of
Anderson et al. (1999).
E04NCF/E04NCA may also be used to solve LSE problems. It differs from F08ZAF (DGGLSE) in that it uses an iterative (rather than direct) method, and that it allows general upper and lower bounds to be specified for the variables
x and the linear constraints
Bx.
This example solves the least squares problem
where
and