E04RKF (PDF version)
E04 Chapter Contents
E04 Chapter Introduction
NAG Library Manual

NAG Library Routine Document


Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.


    1  Purpose
    7  Accuracy
    10  Example

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


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. Linear constraints ((1)(c)), which require no separate gradient information, can be introduced by E04RJF and Box constraints ((1)(d)) can be introduced by E04RHF.
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 of the solver E04STF. 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 E04RAF for more details.

4  References


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.
2:     NCNLN – INTEGERInput
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) arrayInput
4:     BUNCNLN – REAL (KIND=nag_wp) arrayInput
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 .
  • BLjBUj, for j=1,2,,NCNLN;
  • BLj<bigbnd, for j=1,2,,NCNLN;
  • BUj>-bigbnd, for j=1,2,,NCNLN.
5:     NNZGD – INTEGERInput
On entry: NNZGD gives the number of nonzeros in the Jacobian matrix.
Constraint: if NCNLN>0, NNZGD>0.
6:     IROWGDNNZGD – INTEGER arrayInput
7:     ICOLGDNNZGD – INTEGER arrayInput
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, for l=1,2,,NNZGD.
  • 1IROWGDlNCNLN, for l=1,2,,NNZGD;
  • 1ICOLGDln, for l=1,2,,NNZGD.
8:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, the recommended value is -1. 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:
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.
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.
A set of nonlinear constraints has already been defined.
On entry, NCNLN=value.
Constraint: NCNLN0.
On entry, NNZGD=value.
Constraint: NNZGD>0.
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.
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.
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7  Accuracy

Not applicable.

8  Parallelism and Performance

E04RKF is not threaded in any implementation.

9  Further Comments

9.1  Additional Licensor

Parts of the code for E04STF are distributed according to terms imposed by another licensor. Please refer to Library Licensors for further details.

10  Example

See Section 10 in E04STF.

E04RKF (PDF version)
E04 Chapter Contents
E04 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2016