|
|
◆ WDgglse()
| Function WDgglse |
( |
M As |
Long, |
|
|
N As |
Long, |
|
|
P As |
Long, |
|
|
A As |
Variant, |
|
|
B As |
Variant, |
|
|
C As |
Variant, |
|
|
D As |
Variant |
|
) |
| |
Linear equality-constrained least squares (LSE) problem
- Purpose
- WDgglse solves the linear equality-constrained least squares (LSE) problem:
minimize || c - Ax ||_2 subject to B*x = d
where A is an M x N matrix, B is a P x N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that P <= N <= M + P, and rank(B) = P and rank( (A) ) = N
( (B) )
These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized RQ factorization of the matrices (B, A) given by
- Returns
- N+2 x 1
| Column 1 |
| Rows 1 to N | Least squares solution vector x |
| Row N+1 | 2-norm of residual sum of squares |
| Row N+2 | Return code |
Return code
= 0: Successful exit
= 1: The least squares solution could not be computed. The upper triangular factor R associated with B in the generalized RQ factorization of the pair (B, A) is singular, so that rank(B) < P.
= 2: The least squares solution could not be computed. The N-P x N-P part of the upper trapezoidal factor T associated with A in the generalized RQ factorization of the pair (B, A) is singular, so that rank(A^T B^T)^T < N.
- Parameters
-
| [in] | M | Number of rows of the matrix A. (M >= 1) |
| [in] | N | Number of columns of the matrices A and B. (N >= 1) |
| [in] | P | Number of rows of the matrix B. (1 <= P <= N <= M + P) |
| [in] | A | (M x N) M x N coefficient matrix A of the least squares part of the LSE problem. |
| [in] | B | (P x N) P x N coefficient matrix B of the constrained equation. |
| [in] | C | (M) Right hand side vector c for the least squares part of the LSE problem. |
| [in] | D | (P) Right hand side vector d for the constrained equation. |
- Reference
- LAPACK
- Example
- Solve the linear equality-constrained least squares (LSE) problem, i.e. minimize || c - Ax ||_2 subject to B*x = d, where
( -1.06 0.48 -0.04 )
A = ( -1.19 0.73 -0.24 )
( 1.97 -0.89 0.56 )
( 0.68 -0.53 0.08 )
( -0.58 -0.79 0.82 )
B = ( 0.77 0.71 -0.55 )
( -1.36 -1.22 1.66 )
( 0.3884 )
c = ( 0.1120 )
( -0.3644 )
( -0.0002 )
( 1.8250 )
d = ( -1.7058 )
( 3.4904 )
|