NAG FL Interface
e04rkf (handle_​set_​nlnconstr)

1 Purpose

e04rkf is a part of the NAG optimization modelling suite and defines the number of nonlinear constraints of the problem as well as the sparsity structure of their first derivatives.

2 Specification

Fortran Interface
Subroutine e04rkf ( handle, ncnln, bl, bu, nnzgd, irowgd, icolgd, ifail)
Integer, Intent (In) :: ncnln, nnzgd, irowgd(nnzgd), icolgd(nnzgd)
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: bl(ncnln), bu(ncnln)
Type (c_ptr), Intent (In) :: handle
C Header Interface
#include <nag.h>
void  e04rkf_ (void **handle, const Integer *ncnln, const double bl[], const double bu[], const Integer *nnzgd, const Integer irowgd[], const Integer icolgd[], Integer *ifail)
The routine may be called by the names e04rkf or nagf_opt_handle_set_nlnconstr.

3 Description

After the initialization routine e04raf has been called, e04rkf may be used to define the nonlinear constraints lggxug of the problem unless the nonlinear constraints have already been defined. This will typically be used for nonlinear programming problems (NLP) of the kind:
minimize xn fx   (a) subject to lggxug,   (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 gx, 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 routine 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 e04rkf.
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 e04stf).
See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.

4 References

None.

5 Arguments

1: handle Type (c_ptr) Input
On entry: the handle to the problem. It needs to be initialized by e04raf and must not be changed before the call to e04rkf.
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 bl, bu, nnzgd, irowgd and icolgd will not be referenced.
Constraint: ncnln0.
3: blncnln Real (Kind=nag_wp) array Input
4: buncnln Real (Kind=nag_wp) array 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 blj = buj=β , where β<bigbnd . To specify a nonexistent lower bound (i.e., lj = - ), set blj -bigbnd ; to specify a nonexistent upper bound, set buj bigbnd .
Constraints:
  • bljbuj, for j=1,2,,ncnln;
  • blj<bigbnd, for j=1,2,,ncnln;
  • buj>-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: irowgdnnzgd Integer array Input
7: icolgdnnzgd Integer array 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=irowgdl and j=icolgdl should be stored in gdxl in congrd in e04stf, for l=1,2,,nnzgd.
Constraints:
  • 1irowgdlncnln, for l=1,2,,nnzgd;
  • 1icolgdln, for l=1,2,,nnzgd.
8: ifail Integer Input/Output
On entry: ifail must be set to 0, -1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of -1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value -1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value -1 is recommended since useful values can be provided in some output arguments even when ifail0 on exit. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
The supplied handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been initialized by e04raf or it has been corrupted.
ifail=2
The Hessian of the nonlinear objective has already been defined, nonlinear constraints cannot be added.
The problem cannot be modified in this phase any more, the solver has already been called.
ifail=3
A set of nonlinear constraints has already been defined.
ifail=6
On entry, ncnln=value.
Constraint: ncnln0.
On entry, nnzgd=value.
Constraint: nnzgd>0.
ifail=8
On entry, i=value, icolgdi=value and n=value.
Constraint: 1icolgdin.
On entry, i=value, irowgdi=value and ncnln=value.
Constraint: 1irowgdincnln.
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.
ifail=10
On entry, j=value, blj=value, bigbnd=value.
Constraint: blj<bigbnd.
On entry, j=value, blj=value and buj=value.
Constraint: bljbuj.
On entry, j=value, buj=value, bigbnd=value.
Constraint: buj>-bigbnd.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

e04rkf is not threaded in any implementation.

9 Further Comments

None.

10 Example

See Section 10 in e04stf.