NAG AD Library
e05uc (nlp_multistart_sqp)

Settings help

AD Name Style:


AD Specification Language:

1 Purpose

e05uc is the AD Library version of the primal routine e05ucf. Based (in the C++ interface) on overload resolution, e05uc can be used for primal, tangent and adjoint evaluation. It supports tangents and adjoints of first order.

2 Specification

Fortran Interface
Integer, Intent (In) :: n, nclin, ncnln, lda, npts, ldx, nb, ldobjd, ldc, ldcjac, sdcjac, ldr, sdr, ldclda, listat
Integer, Intent (Inout) :: iopts(740), iuser(*), ifail
Integer, Intent (Out) :: iter(nb), istate(listat,nb), info(nb)
ADTYPE, Intent (In) :: a(lda,*), bl(n+nclin+ncnln), bu(n+nclin+ncnln)
ADTYPE, Intent (Inout) :: x(ldx,nb), objgrd(ldobjd,nb), c(ldc,nb), cjac(ldcjac,sdcjac,nb), r(ldr,sdr,nb), clamda(ldclda,nb), opts(485), ruser(*)
ADTYPE, Intent (Out) :: objf(nb)
Logical, Intent (In) :: repeat
Type (c_ptr), Intent (Inout) :: ad_handle
External :: confun, objfun, start
Corresponding to the overloaded C++ function, the Fortran interface provides five routines with names reflecting the type used for active real arguments. The actual subroutine and type names are formed by replacing AD and ADTYPE in the above as follows:
when ADTYPE is Real(kind=nag_wp) then AD is p0w
when ADTYPE is Type(nagad_a1w_w_rtype) then AD is a1w
when ADTYPE is Type(nagad_t1w_w_rtype) then AD is t1w
C++ Header Interface
#include <dco.hpp>
#include <nagad.h>
namespace nag {
namespace ad {
void e05uc ( void *&ad_handle, const Integer &n, const Integer &nclin, const Integer &ncnln, const ADTYPE a[], const Integer &lda, const ADTYPE bl[], const ADTYPE bu[],
void (NAG_CALL confun)(void *&ad_handle, Integer &mode, const Integer &ncnln, const Integer &n, const Integer &ldcjsl, const Integer needc[], const ADTYPE x[], ADTYPE c[], ADTYPE cjsl[], const Integer &nstate, Integer iuser[], ADTYPE ruser[]),
void (NAG_CALL objfun)(void *&ad_handle, Integer &mode, const Integer &n, const ADTYPE x[], ADTYPE &objf, ADTYPE objgrd[], const Integer &nstate, Integer iuser[], ADTYPE ruser[]),
const Integer &npts, ADTYPE x[], const Integer &ldx,
void (NAG_CALL start)(void *&ad_handle, const Integer &npts, ADTYPE quas[], const Integer &n, const logical &repeat, const ADTYPE bl[], const ADTYPE bu[], Integer iuser[], ADTYPE ruser[], Integer &mode),
const logical &repeat, const Integer &nb, ADTYPE objf[], ADTYPE objgrd[], const Integer &ldobjd, Integer iter[], ADTYPE c[], const Integer &ldc, ADTYPE cjac[], const Integer &ldcjac, const Integer &sdcjac, ADTYPE r[], const Integer &ldr, const Integer &sdr, ADTYPE clamda[], const Integer &ldclda, Integer istate[], const Integer &listat, Integer iopts[], ADTYPE opts[], const Integer &liuser, Integer iuser[], const Integer &lruser, ADTYPE ruser[], Integer info[], Integer &ifail)
}
}
The function is overloaded on ADTYPE which represents the type of active arguments. ADTYPE may be any of the following types:
double,
dco::ga1s<double>::type,
dco::gt1s<double>::type
Note: this function can be used with AD tools other than dco/c++. For details, please contact NAG.

3 Description

e05uc is the AD Library version of the primal routine e05ucf.
e05ucf is designed to find the global minimum of an arbitrary smooth function subject to constraints (which may include simple bounds on the variables, linear constraints and smooth nonlinear constraints) by generating a number of different starting points and performing a local search from each using sequential quadratic programming. For further information see Section 3 in the documentation for e05ucf.

4 References

Dennis J E Jr and Moré J J (1977) Quasi-Newton methods, motivation and theory SIAM Rev. 19 46–89
Dennis J E Jr and Schnabel R B (1981) A new derivation of symmetric positive-definite secant updates nonlinear programming (eds O L Mangasarian, R R Meyer and S M Robinson) 4 167–199 Academic Press
Dennis J E Jr and Schnabel R B (1983) Numerical Methods for Unconstrained Optimization and Nonlinear Equations Prentice–Hall
Fletcher R (1987) Practical Methods of Optimization (2nd Edition) Wiley
Gill P E, Hammarling S, Murray W, Saunders M A and Wright M H (1986) Users' guide for LSSOL (Version 1.0) Report SOL 86-1 Department of Operations Research, Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1984) Users' guide for SOL/QPSOL version 3.2 Report SOL 84–5 Department of Operations Research, Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1986a) Some theoretical properties of an augmented Lagrangian merit function Report SOL 86–6R Department of Operations Research, Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1986b) Users' guide for NPSOL (Version 4.0): a Fortran package for nonlinear programming Report SOL 86-2 Department of Operations Research, Stanford University
Gill P E, Murray W and Wright M H (1981) Practical Optimization Academic Press
Powell M J D (1974) Introduction to constrained optimization Numerical Methods for Constrained Optimization (eds P E Gill and W Murray) 1–28 Academic Press
Powell M J D (1983) Variable metric methods in constrained optimization Mathematical Programming: the State of the Art (eds A Bachem, M Grötschel and B Korte) 288–311 Springer–Verlag

5 Arguments

In addition to the arguments present in the interface of the primal routine, e05uc includes some arguments specific to AD.
A brief summary of the AD specific arguments is given below. For the remainder, links are provided to the corresponding argument from the primal routine. A tooltip popup for all arguments can be found by hovering over the argument name in Section 2 and in this section.
1: ad_handle – Pointer to AD Data Input/Output
On entry: a handle to the AD configuration data object, as created by x10aa.
2: n – Integer Input
3: nclin – Integer Input
4: ncnln – Integer Input
5: a(lda, *) – ADTYPE array Input
6: lda – Integer Input
7: bl(n+nclin+ncnln) – ADTYPE array Input
8: bu(n+nclin+ncnln) – ADTYPE array Input
9: confun – Subroutine External Procedure
If a null pointer is used as the argument, then a NAG supplied routine will be used as the argument for this parameter (C++ only). For the Fortran interface, the NAG supplied routine e04ud_AD_m may be used as the actual argument for this parameter.
The specification of confun is:
Fortran Interface
Subroutine confun ( ad_handle, mode, ncnln, n, ldcjsl, needc, x, c, cjsl, nstate, iuser, ruser)
Integer, Intent (In) :: ncnln, n, ldcjsl, needc(ncnln), nstate
Integer, Intent (Inout) :: mode, iuser(*)
ADTYPE, Intent (In) :: x(n)
ADTYPE, Intent (Inout) :: cjsl(ldcjsl,n), ruser(*)
ADTYPE, Intent (Out) :: c(ncnln)
Type (c_ptr), Intent (Inout) :: ad_handle
C++ Header Interface
void confun ( void *&ad_handle, Integer &mode, const Integer &ncnln, const Integer &n, const Integer &ldcjsl, const Integer needc[], const ADTYPE x[], ADTYPE c[], ADTYPE cjsl[], const Integer &nstate, Integer iuser[], ADTYPE ruser[])
1: ad_handle – Pointer to AD Data Input/Output
On entry: a handle to the AD configuration data object.
2: mode – Integer Input/Output
3: ncnln – Integer Input
4: n – Integer Input
5: ldcjsl – Integer Input
6: needc – Integer array Input
7: xADTYPE array Input
8: cADTYPE array Output
9: cjslADTYPE array Input/Output
10: nstate – Integer Input
11: iuser – Integer array User Workspace
12: ruserADTYPE array User Workspace
10: objfun – Subroutine External Procedure
The specification of objfun is:
Fortran Interface
Subroutine objfun ( ad_handle, mode, n, x, objf, objgrd, nstate, iuser, ruser)
Integer, Intent (In) :: n, nstate
Integer, Intent (Inout) :: mode, iuser(*)
ADTYPE, Intent (In) :: x(n)
ADTYPE, Intent (Inout) :: objgrd(n), ruser(*)
ADTYPE, Intent (Out) :: objf
Type (c_ptr), Intent (Inout) :: ad_handle
C++ Header Interface
void objfun ( void *&ad_handle, Integer &mode, const Integer &n, const ADTYPE x[], ADTYPE &objf, ADTYPE objgrd[], const Integer &nstate, Integer iuser[], ADTYPE ruser[])
1: ad_handle – Pointer to AD Data Input/Output
On entry: a handle to the AD configuration data object.
2: mode – Integer Input/Output
3: n – Integer Input
4: xADTYPE array Input
5: objfADTYPE Output
6: objgrdADTYPE array Input/Output
7: nstate – Integer Input
8: iuser – Integer array User Workspace
9: ruserADTYPE array User Workspace
11: npts – Integer Input
12: x(ldx, nb) – ADTYPE array Output
13: ldx – Integer Input
14: start – Subroutine External Procedure
If a null pointer is used as the argument, then a NAG supplied routine will be used as the argument for this parameter (C++ only). For the Fortran interface, the NAG supplied routine e05uc_AD_z may be used as the actual argument for this parameter.
The specification of start is:
Fortran Interface
Subroutine start ( ad_handle, npts, quas, n, repeat, bl, bu, iuser, ruser, mode)
Integer, Intent (In) :: npts, n
Integer, Intent (Inout) :: iuser(*), mode
ADTYPE, Intent (In) :: bl(n), bu(n)
ADTYPE, Intent (Inout) :: quas(n,npts), ruser(*)
Logical, Intent (In) :: repeat
Type (c_ptr), Intent (Inout) :: ad_handle
C++ Header Interface
void start ( void *&ad_handle, const Integer &npts, ADTYPE quas[], const Integer &n, const logical &repeat, const ADTYPE bl[], const ADTYPE bu[], Integer iuser[], ADTYPE ruser[], Integer &mode)
1: ad_handle – Pointer to AD Data Input/Output
On entry: a handle to the AD configuration data object.
2: npts – Integer Input
3: quasADTYPE array Input/Output
4: n – Integer Input
5: repeat – logical Input
6: blADTYPE array Input
7: buADTYPE array Input
8: iuser – Integer array User Workspace
9: ruserADTYPE array User Workspace
10: mode – Integer Input/Output
15: repeat – logical Input
16: nb – Integer Input
17: objf(nb) – ADTYPE array Output
18: objgrd(ldobjd, nb) – ADTYPE array Output
19: ldobjd – Integer Input
20: iter(nb) – Integer array Output
21: c(ldc, nb) – ADTYPE array Output
22: ldc – Integer Input
23: cjac(ldcjac, sdcjac, nb) – ADTYPE array Output
24: ldcjac – Integer Input
25: sdcjac – Integer Input
26: r(ldr, sdr, nb) – ADTYPE array Output
27: ldr – Integer Input
28: sdr – Integer Input
29: clamda(ldclda, nb) – ADTYPE array Output
30: ldclda – Integer Input
31: istate(listat, nb) – Integer array Output
32: listat – Integer Input
33: iopts(740) – Integer array Communication Array
34: opts(485) – ADTYPE array Communication Array
35: liuser Input
User workspace dimension (C++ only), see x10af to specify the dimension from Fortran.
36: iuser(*) – Integer array User Workspace
37: lruser Input
User workspace dimension (C++ only), see x10ae to specify the dimension from Fortran.
38: ruser(*) – ADTYPE array User Workspace
39: info(nb) – Integer array Output
40: ifail – Integer Input/Output

6 Error Indicators and Warnings

e05uc preserves all error codes from e05ucf and in addition can return:
ifail=-89
An unexpected AD error has been triggered by this routine. Please contact NAG.
See Section 4.8.2 in the NAG AD Library Introduction for further information.
ifail=-199
The routine was called using a mode that has not yet been implemented.
ifail=-443
On entry: ad_handle is nullptr.
This check is only made if the overloaded C++ interface is used with arguments not of type double.
ifail=-444
A C++ exception was thrown.
The error message will show the details of the C++ exception text.
ifail=-899
Dynamic memory allocation failed for AD.
See Section 4.8.1 in the NAG AD Library Introduction for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

e05uc is not threaded in any implementation.

9 Further Comments

None.

10 Example

The following examples are variants of the example for e05ucf, modified to demonstrate calling the NAG AD Library.
Description of the primal example.
This example finds the global minimum of the two-dimensional Schwefel function:
minimize xR2 f = j=1 2 xj sin(|xj|)  
subject to the constraints:
−10000<3.0 x1 - 2.0 x2 <10.0 , -1.0 < x12 - x22 + 3.0 x1 x2 < 500000.0 , -0.9 < cos( (x1/200) 2 +(x2/100)) < 0.9 , −500 x1 500 , −500 x2 500 .  

10.1 Adjoint modes

Language Source File Data Results
Fortran e05uc_a1w_fe.f90 e05uc_a1w_fe.d e05uc_a1w_fe.r
C++ e05uc_a1w_hcppe.cpp e05uc_a1w_hcppe.d e05uc_a1w_hcppe.r

10.2 Tangent modes

Language Source File Data Results
Fortran e05uc_t1w_fe.f90 e05uc_t1w_fe.d e05uc_t1w_fe.r
C++ e05uc_t1w_hcppe.cpp e05uc_t1w_hcppe.d e05uc_t1w_hcppe.r

10.3 Passive mode

Language Source File Data Results
Fortran e05uc_p0w_fe.f90 e05uc_p0w_fe.d e05uc_p0w_fe.r
C++ e05uc_p0w_hcppe.cpp e05uc_p0w_hcppe.d e05uc_p0w_hcppe.r