NAG CL Interface
e04rkc (handle_​set_​nlnconstr)

Settings help

CL Name Style:


1 Purpose

e04rkc is a part of the NAG optimization modelling suite and defines or overwrites nonlinear constraints in the model, their number as well as the sparsity structure of their first derivatives.

2 Specification

#include <nag.h>
void  e04rkc (void *handle, Integer ncnln, const double bl[], const double bu[], Integer nnzgd, const Integer irowgd[], const Integer icolgd[], NagError *fail)
The function may be called by the names: e04rkc or nag_opt_handle_set_nlnconstr.

3 Description

After the handle has been initialized (e.g., e04rac has been called), e04rkc may be used to define the nonlinear constraints lgg(x)ug of the problem. If the nonlinear constraints have already been defined, they will be overwritten and their Hessians (or the Hessian of the Lagrangian) will be removed. If e04rkc is called with mg=0, existing nonlinear constraints are removed and no new ones are added. This will typically be used for nonlinear programming problems (NLP) of the kind:
minimize xn f(x)   (a) subject to lgg(x)ug,   (b) lBBxuB,   (c) lxxux,   (d) (1)
where n is the number of the decision variables x, mg is the number of the nonlinear constraints (in (1)(b)) and g(x), lg and ug are mg-dimensional vectors.
Note that upper and lower bounds are specified for all the constraints. This form allows full generality in specifying various types of constraint. In particular, the jth constraint may be defined as an equality by setting lj=uj. If certain bounds are not present, the associated elements lj or uj may be set to special values that are treated as - or +. See the description of the optional parameter Infinite Bound Size which is common among all solvers in the suite. Its value is denoted as bigbnd further in this text. Note that the bounds are interpreted based on its value at the time of calling this function and any later alterations to Infinite Bound Size will not affect these constraints.
Since each nonlinear constraint is most likely to involve a small subset of the decision variables, the partial derivatives of the constraint functions with respect to those variables are best expressed as a sparse Jacobian matrix of mg rows and n columns. The row and column positions of all the nonzero derivatives must be registered with the handle through e04rkc. The values of the nonlinear constraint functions and their nonzero gradients at particular points in the decision variable space will be communicated to the NLP solver by user-supplied functions (e.g., confun and congrd for e04stc).
An individual set of bounds can be also modified by e04tdc. Note that it is also possible to temporarily disable and enable individual constraints in the model by calling e04tcc and e04tbc, respectively.
See Section 4.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.

4 References

None.

5 Arguments

1: handle void * Input
On entry: the handle to the problem. It needs to be initialized (e.g., by e04rac) and must not be changed between calls to the NAG optimization modelling suite.
2: ncnln Integer Input
On entry: mg, the number of nonlinear constraints (number of rows of the Jacobian matrix).
If ncnln=0, no nonlinear constraints will be defined and any existing nonlinear constraint will be removed from the model. In this case, bl, bu, nnzgd, irowgd and icolgd will not be referenced and may be NULL.
Constraint: ncnln0.
3: bl[ncnln] const double Input
4: bu[ncnln] const double Input
On entry: bl and bu define lower and upper bounds of the nonlinear constraints, lg and ug, respectively. To define the jth constraint as equality, set bl[j-1] = bu[j-1]=β , where |β|<bigbnd . To specify a nonexistent lower bound (i.e., lj = - ), set bl[j-1] -bigbnd ; to specify a nonexistent upper bound, set bu[j-1] bigbnd .
Constraints:
  • bl[j-1]bu[j-1], for j=1,2,,ncnln;
  • bl[j-1]<bigbnd, for j=1,2,,ncnln;
  • bu[j-1]>-bigbnd, for j=1,2,,ncnln.
5: nnzgd Integer Input
On entry: nnzgd gives the number of nonzeros in the Jacobian matrix.
Constraint: if ncnln>0, nnzgd>0.
6: irowgd[nnzgd] const Integer Input
7: icolgd[nnzgd] const Integer Input
On entry: arrays irowgd and icolgd store the sparsity structure (pattern) of the Jacobian matrix as nnzgd nonzeros in coordinate storage (CS) format (see Section 2.1.1 in the F11 Chapter Introduction). The matrix has dimensions ncnln×n. irowgd specifies one-based row indices and icolgd specifies one-based column indices. No particular order of elements is expected, but elements should not repeat and the same order should be used when the Jacobian is evaluated for the solver, e.g., the value of gi xj where i=irowgd[l-1] and j=icolgd[l-1] should be stored in gdx[l-1] in congrd in e04stc, for l=1,2,,nnzgd.
Constraints:
  • 1irowgd[l-1]ncnln, for l=1,2,,nnzgd;
  • 1icolgd[l-1]n, for l=1,2,,nnzgd.
8: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_BOUND
On entry, j=value, bl[j-1]=value, bigbnd=value.
Constraint: bl[j-1]<bigbnd.
On entry, j=value, bl[j-1]=value and bu[j-1]=value.
Constraint: bl[j-1]bu[j-1].
On entry, j=value, bu[j-1]=value, bigbnd=value.
Constraint: bu[j-1]>-bigbnd.
NE_HANDLE
The supplied handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been properly initialized or it has been corrupted.
NE_INT
On entry, ncnln=value.
Constraint: ncnln0.
On entry, nnzgd=value.
Constraint: nnzgd>0.
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.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_INVALID_CS
On entry, i=value, icolgd[i-1]=value and n=value.
Constraint: 1icolgd[i-1]n.
On entry, i=value, irowgd[i-1]=value and ncnln=value.
Constraint: 1irowgd[i-1]ncnln.
On entry, more than one element of structural Jacobian matrix has row index value and column index value.
Constraint: each element of structural Jacobian matrix must have a unique row and column index.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_PHASE
The problem cannot be modified right now, the solver is running.

7 Accuracy

Not applicable.

8 Parallelism and Performance

e04rkc is not threaded in any implementation.

9 Further Comments

9.1 Internal Changes

Internal changes have been made to this function as follows:
For details of all known issues which have been reported for the NAG Library please refer to the Known Issues.

10 Example

See e04stc.