|
|
◆ _dgglse()
| void _dgglse |
( |
int |
m, |
|
|
int |
n, |
|
|
int |
p, |
|
|
int |
lda, |
|
|
double |
a[], |
|
|
int |
ldb, |
|
|
double |
b[], |
|
|
double |
c[], |
|
|
double |
d[], |
|
|
double |
x[], |
|
|
double |
work[], |
|
|
int |
lwork, |
|
|
int * |
info |
|
) |
| |
Linear equality-constrained least squares (LSE) problem
- Purpose
- This routine 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
- Parameters
-
| [in] | m | Number of rows of the matrix A. (m >= 0) |
| [in] | n | Number of columns of the matrices A and B. (n >= 0) (If n = 0, returns without computation) |
| [in] | p | Number of rows of the matrix B. (0 <= p <= n <= m + p) |
| [in] | lda | Leading dimension of the two dimensional array a[][]. (lda >= max(1, m)) |
| [in,out] | a[][] | Array a[la][lda] (la >= n)
[in] m x n matrix A.
[out] The elements on and above the diagonal of the array contain the min(m, n) x n upper trapezoidal matrix T. |
| [in] | ldb | Leading dimension of the two dimensional array b[][]. (ldb >= max(1, p)) |
| [in,out] | b[][] | Array b[lb][ldb] (lb >= n)
[in] p x n matrix B.
[out] The upper triangle of the subarray b[n-p to n-1][0 to p-1] contains the p x p upper triangular matrix R. |
| [in,out] | c[] | Array c[lc] (lc >= m)
[in] The right hand side vector for the least squares part of the LSE problem.
[out] The residual sum of squares for the solution is given by the sum of squares of elements n-p to m-1 of the array c[]. |
| [in,out] | d[] | Array d[ld] (ld >= p)
[in] The right hand side vector for the constrained equation.
[out] d[] is destroyed. |
| [out] | x[] | Array x[lx] (lx >= n)
Solution of the LSE problem. |
| [out] | work[] | Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork. |
| [in] | lwork | The dimension of the array work[]. (lwork >= max(1, m+n+p))
For optimum performance, lwork >= max(1, p + min(m, n) + max(m, n)*nb), where nb is the upper bound for the optimal block sizes.
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] array, and returns the value in work[0]. |
| [out] | info | = 0: Successful exit
= -1: The argument m had an illegal value (m < 0)
= -2: The argument n had an illegal value (n < 0)
= -3: The argument p had an illegal value (p < 0 or p > n or p < n - m)
= -4: The argument lda had an illegal value (lda < max(1, m))
= -6: The argument ldb had an illegal value (ldb < max(1, p))
= -12: The argument lwork had an illegal value (lwork too small)
= 1: 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. The least squares solution could not be computed.
= 2: 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. The least squares solution could not be computed. |
- Reference
- LAPACK
|