nag_zgglse (f08znc) solves a complex linear equality-constrained least squares problem.
nag_zgglse (f08znc) solves the complex linear equality-constrained least squares (LSE) problem
where
is an
by
matrix,
is a
by
matrix,
is an
element vector and
is a
element vector. It is assumed that
,
and
, where
. These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized
factorization of the matrices
and
.
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
Eldèn L (1980) Perturbation theory for the least-squares problem with linear equality constraints SIAM J. Numer. Anal. 17 338–350
- 1:
order – Nag_OrderTypeInput
-
On entry: the
order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by
. See
Section 3.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint:
or Nag_ColMajor.
- 2:
m – IntegerInput
-
On entry:
, the number of rows of the matrix .
Constraint:
.
- 3:
n – IntegerInput
-
On entry: , the number of columns of the matrices and .
Constraint:
.
- 4:
p – IntegerInput
-
On entry:
, the number of rows of the matrix .
Constraint:
.
- 5:
a[] – ComplexInput/Output
-
Note: the dimension,
dim, of the array
a
must be at least
- when
;
- when
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: the by matrix .
On exit:
a is overwritten.
- 6:
pda – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
a.
Constraints:
- if ,
;
- if , .
- 7:
b[] – ComplexInput/Output
-
Note: the dimension,
dim, of the array
b
must be at least
- when
;
- when
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: the by matrix .
On exit:
b is overwritten.
- 8:
pdb – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
b.
Constraints:
- if ,
;
- if , .
- 9:
c[m] – ComplexInput/Output
On entry: the right-hand side vector for the least squares part of the LSE problem.
On exit: the residual sum of squares for the solution vector is given by the sum of squares of elements ; the remaining elements are overwritten.
- 10:
d[p] – ComplexInput/Output
On entry: the right-hand side vector for the equality constraints.
On exit:
d is overwritten.
- 11:
x[n] – ComplexOutput
On exit: the solution vector of the LSE problem.
- 12:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
- NE_ALLOC_FAIL
Dynamic memory allocation failed.
- NE_BAD_PARAM
On entry, argument had an illegal value.
- NE_INT
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
- NE_INT_3
On entry, , and .
Constraint: .
- NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
- NE_SINGULAR
The by part of the upper trapezoidal factor associated with in the generalised factorization of the pair is singular, so that the rank of the matrix () comprising the rows of and is less than ; the least squares solutions could not be computed.
The upper triangular factor associated with in the generalized factorization of the pair is singular, so that ; the least squares solution could not be computed.
For an error analysis, see
Anderson et al. (1992) and
Eldèn (1980). See also Section 4.6 of
Anderson et al. (1999).
This example solves the least squares problem
where
and
and