NAG FL Interface
e04rlf (handle_​set_​nlnhess)

1 Purpose

e04rlf is a part of the NAG optimization modelling suite and defines the structure of the Hessians of the nonlinear objective and constraints, on assumption that they are present in the problem. Alternatively, it may be used to define the Hessian of the Lagrangian.

2 Specification

Fortran Interface
Subroutine e04rlf ( handle, idf, nnzh, irowh, icolh, ifail)
Integer, Intent (In) :: idf, nnzh, irowh(nnzh), icolh(nnzh)
Integer, Intent (Inout) :: ifail
Type (c_ptr), Intent (In) :: handle
C Header Interface
#include <nag.h>
void  e04rlf_ (void **handle, const Integer *idf, const Integer *nnzh, const Integer irowh[], const Integer icolh[], Integer *ifail)
The routine may be called by the names e04rlf or nagf_opt_handle_set_nlnhess.

3 Description

After the initialization routine e04raf has been called and an objective function f or nonlinear constraint function gi has been registered with e04rgf and e04rkf, e04rlf can be used to define the sparsity structure of the Hessians, H, of those functions (i.e., the second partial derivatives with respect to the decision variables) or a linear combination of them, called the Lagrangian.
Each of the symmetric n×n Hessian matrices will have its own sparsity structure, in general. These structures can be given in separate e04rlf calls, or merged together in the Lagrangian and given in one call.
The nonzero values of the Hessians at particular points in the decision variable space will be communicated to the NLP solver by user-supplied functions (e.g., hess for e04stf).
Some NLP solvers (e.g., e04stf) expect either all of the Hessians (for objective and nonlinear constraints) to be supplied or none and they will terminate with an error indicator if only some but not all of the Hessians have been introduced by e04rlf.
Some NLP solvers (e.g., e04stf, again) will automatically switch to using internal approximations for the Hessians if none have been introduced by e04rlf. This usually results in a slower convergence (more iterations to the solution) and might even result in no solution being attainable within the ordinary tolerances.
See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.

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 before the call to e04rlf.
2: idf Integer Input
On entry: specifies the quantities for which a sparsity structure is provided in nnzh, irowh and icolh.
The sparsity structure of the Hessian of the Lagrangian is provided.
The sparsity structure of the Hessian of the objective function is provided.
The sparsity structure of the Hessian of the idfth constraint function is provided.
The value of idf will also determine how an NLP solver will call the user-supplied subroutines that evaluate these nonzeros at particular points of the decision variable space, i.e., whether the solver will expect the nonzero values of the objective and constraint Hessians in separate calls or merged in the Lagrangian Hessian, in one call. See, for example, hess of e04stf.
Constraint: -1idfncnln.
Note: ncnln, the number of nonlinear constraints registered with the handle.
3: nnzh Integer Input
On entry: the number of nonzero elements in the upper triangle of the matrix H.
Constraint: nnzh>0.
4: irowhnnzh Integer array Input
5: icolhnnzh Integer array Input
On entry: arrays irowh and icolh store the nonzeros of the upper triangle of the matrix H in coordinate storage (CS) format (see Section 2.1.1 in the F11 Chapter Introduction). irowh specifies one-based row indices, icolh specifies one-based column indices and specifies the values of the nonzero elements in such a way that hij=Hl where i=irowhl and j=icolhl, for l=1,2,,nnzh. No particular order is expected, but elements should not repeat.
Constraint: 1irowhlicolhln, for l=1,2,,nnzh.
6: 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:
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.
Neither nonlinear objective nor nonlinear constraints are present. The structure of the Hessian cannot be defined.
No nonlinear objective has been defined, its Hessian cannot be set.
The problem cannot be modified in this phase any more, the solver has already been called.
On entry, idf=value.
The structure of the Hessian of nonlinear function linked to the given idf has already been defined.
The structure of the Hessian of the Lagrangian has already been defined.
The structure of the individual Hessians has already been defined, the Hessian of the Lagrangian cannot be defined.
On entry, nnzh=value.
Constraint: nnzh>0.
On entry, idf=value.
Constraint: valueidfvalue.
On entry, i=value, icolhi=value and n=value.
Constraint: 1icolhin.
On entry, i=value, irowhi=value and icolhi=value.
Constraint: irowhiicolhi (elements within the upper triangle).
On entry, i=value, irowhi=value and n=value.
Constraint: 1irowhin.
On entry, more than one element of structural matrix H has row index value and column index value.
Constraint: each element of structural matrix H must have a unique row and column index.
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.
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.
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

e04rlf is not threaded in any implementation.

9 Further Comments


10 Example

See Section 10 in e04stf.