After the handle has been initialized (e.g., handle_init has been called),
handle_set_nlnobj 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. If the objective function has already been defined, it will be overwritten and its Hessian (or the Hessian of the Lagrangian) will be removed. If handle_set_nlnobj is called with no nonzeroes in the sparsity pattern,
any existing objective function is removed, no new one is added and the problem will be solved as a feasible point problem.
This objective function will typically be used for nonlinear programming problems (NLP) of the kind:
The values of the nonlinear objective function and the nonzero values of its gradient (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 for handle_solve_ipopt). See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.
An object of either the derived class CommE04RA or its base class NoneCopyableComm can be supplied.
It is recommended that the derived class is used. If the base class is supplied it must
first be initialized via a call to opt::handle_init (e04ra).
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 is the current number of decision variables in the model.
If , the objective is assumed to be zero and the array idxfd will not be referenced.
, for ;
, for .
3: – OptionalE04RGInput/Output
Optional parameter container, derived from Optional.
The number of nonzero elements in the sparse gradient vector of the objective function.
6Exceptions and Warnings
Errors or warnings detected by the function:
All errors and warnings have an associated numeric error code field, errorid, stored either as a member of the thrown exception object (see errorid), or as a member of
opt.ifail, depending on how errors
and warnings are being handled (see Error Handling for more details).