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

NAG Library Routine Document

E04RGF

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.

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

E04RGF is a part of the NAG optimization modelling suite and declares the objective function of the problem as a nonlinear function with a particular gradient sparsity structure.

2  Specification

SUBROUTINE E04RGF ( HANDLE, NNZFD, IDXFD, IFAIL)
INTEGER  NNZFD, IDXFD(NNZFD), IFAIL
TYPE (C_PTR)  HANDLE

3  Description

After the initialization routine E04RAF has been called (and unless the objective function has been defined previously by E04REF, E04RFF or by E04RGF), E04RGF may be used to declare the objective function of the problem as a nonlinear function and define the sparsity pattern (list of nonzero elements) of its gradient. This objective function 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)
The values of the nonlinear objective function fx and the nonzero values of its gradient f xi (matching the sparsity pattern) evaluated at particular points in the decision variable space will be communicated to the NLP solver by user-supplied functions (e.g., OBJFUN and OBJGRD). See E04RAF for more details.

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.
2:     NNZFD – INTEGERInput
On entry: the number of nonzero elements in the sparse gradient vector of the objective function.
Constraint: NNZFD0.
3:     IDXFDNNZFD – INTEGER arrayInput
On entry: the one-based indices of the nonzero elements of the sparse gradient vector. The indices must be stored in ascending order. Note that n, the number of decision variables in the problem, was set in NVAR during the initialization of the handle by E04RAF.
If NNZFD=0, the objective is assumed to be zero and the array IDXFD will not be referenced.
Constraints:
  • 1IDXFDin, for i=1,2,,NNZFD;
  • IDXFDi<IDXFDi+1, for i=1,2,,NNZFD-1.
4:     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:
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 Hessians of nonlinear functions have already been defined, a nonlinear objective cannot be added.
The problem cannot be modified in this phase any more, the solver has already been called.
IFAIL=3
The objective function has already been defined.
IFAIL=6
On entry, NNZFD=value.
Constraint: NNZFD0.
IFAIL=7
On entry, i=value, IDXFDi=value and IDXFDi+1=value.
Constraint: IDXFDi<IDXFDi+1 (ascending order).
On entry, i=value, IDXFDi=value and n=value.
Constraint: 1IDXFDin.
IFAIL=-99
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.
IFAIL=-399
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.
IFAIL=-999
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

E04RGF 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.

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

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