NAG AD Library
e05jb (bnd_mcs_solve)

Settings help

AD Name Style:


AD Specification Language:

1 Purpose

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

2 Specification

Fortran Interface
Subroutine e05jb_AD_f ( ad_handle, n, objfun, ibound, iinit, bl, bu, sdlist, list, numpts, initpt, monit, x, obj, comm, lcomm, iuser, ruser, ifail)
Integer, Intent (In) :: n, ibound, iinit, sdlist, lcomm
Integer, Intent (Inout) :: numpts(n), initpt(n), iuser(*), ifail
ADTYPE, Intent (Inout) :: bl(n), bu(n), list(n,sdlist), comm(lcomm), ruser(*)
ADTYPE, Intent (Out) :: x(n), obj
Type (c_ptr), Intent (Inout) :: ad_handle
External :: objfun, monit
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 e05jb ( void *&ad_handle, const Integer &n,
void (NAG_CALL objfun)(void *&ad_handle, const Integer &n, const ADTYPE x[], ADTYPE &f, const Integer &nstate, Integer iuser[], ADTYPE ruser[], Integer &inform),
const Integer &ibound, const Integer &iinit, ADTYPE bl[], ADTYPE bu[], const Integer &sdlist, ADTYPE list[], Integer numpts[], Integer initpt[],
void (NAG_CALL monit)(void *&ad_handle, const Integer &n, const Integer &ncall, const ADTYPE xbest[], const Integer icount[], const Integer &ninit, const ADTYPE list[], const Integer numpts[], const Integer initpt[], const Integer &nbaskt, const ADTYPE xbaskt[], const ADTYPE boxl[], const ADTYPE boxu[], const Integer &nstate, Integer iuser[], ADTYPE ruser[], Integer &inform),
ADTYPE x[], ADTYPE &obj, ADTYPE comm[], const Integer &lcomm, const Integer &liuser, Integer iuser[], const Integer &lruser, ADTYPE ruser[], 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

e05jb is the AD Library version of the primal routine e05jbf.
e05jbf is designed to find the global minimum or maximum of an arbitrary function, subject to simple bound-constraints using a multi-level coordinate search method. Derivatives are not required, but convergence is only guaranteed if the objective function is continuous in a neighbourhood of a global optimum. It is not intended for large problems.
The initialization routine e05jaf must have been called before calling e05jbf. For further information see Section 3 in the documentation for e05jbf.

4 References

Huyer W and Neumaier A (1999) Global optimization by multi-level coordinate search Journal of Global Optimization 14 331–355

5 Arguments

In addition to the arguments present in the interface of the primal routine, e05jb 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: objfun – Subroutine External Procedure
The specification of objfun is:
Fortran Interface
Subroutine objfun ( ad_handle, n, x, f, nstate, iuser, ruser, inform)
Integer, Intent (In) :: n, nstate
Integer, Intent (Inout) :: iuser(*)
Integer, Intent (Out) :: inform
ADTYPE, Intent (In) :: x(n)
ADTYPE, Intent (Inout) :: ruser(*)
ADTYPE, Intent (Out) :: f
Type (c_ptr), Intent (Inout) :: ad_handle
C++ Header Interface
void objfun ( void *&ad_handle, const Integer &n, const ADTYPE x[], ADTYPE &f, const Integer &nstate, Integer iuser[], ADTYPE ruser[], Integer &inform)
1: ad_handle – Pointer to AD Data Input/Output
On entry: a handle to the AD configuration data object.
2: n – Integer Input
3: xADTYPE array Input
4: fADTYPE Output
5: nstate – Integer Input
6: iuser – Integer array User Workspace
7: ruserADTYPE array User Workspace
8: inform – Integer Output
4: ibound – Integer Input
5: iinit – Integer Input
6: bl(n) – ADTYPE array Input/Output
7: bu(n) – ADTYPE array Input/Output
8: sdlist – Integer Input
9: list(n, sdlist) – ADTYPE array Input/Output
10: numpts(n) – Integer array Input/Output
11: initpt(n) – Integer array Input/Output
12: monit – 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 e05jb_AD_k may be used as the actual argument for this parameter.
The specification of monit is:
Fortran Interface
Integer, Intent (In) :: n, ncall, icount(6), ninit, numpts(n), initpt(n), nbaskt, nstate
Integer, Intent (Inout) :: iuser(*)
Integer, Intent (Out) :: inform
ADTYPE, Intent (In) :: xbest(n), list(n,ninit), xbaskt(n,nbaskt), boxl(n), boxu(n)
ADTYPE, Intent (Inout) :: ruser(*)
Type (c_ptr), Intent (Inout) :: ad_handle
C++ Header Interface
void monit ( void *&ad_handle, const Integer &n, const Integer &ncall, const ADTYPE xbest[], const Integer icount[], const Integer &ninit, const ADTYPE list[], const Integer numpts[], const Integer initpt[], const Integer &nbaskt, const ADTYPE xbaskt[], const ADTYPE boxl[], const ADTYPE boxu[], const Integer &nstate, Integer iuser[], ADTYPE ruser[], Integer &inform)
1: ad_handle – Pointer to AD Data Input/Output
On entry: a handle to the AD configuration data object.
2: n – Integer Input
3: ncall – Integer Input
4: xbestADTYPE array Input
5: icount – Integer array Input
6: ninit – Integer Input
7: listADTYPE array Input
8: numpts – Integer array Input
9: initpt – Integer array Input
10: nbaskt – Integer Input
11: xbasktADTYPE array Input
12: boxlADTYPE array Input
13: boxuADTYPE array Input
14: nstate – Integer Input
15: iuser – Integer array User Workspace
16: ruserADTYPE array User Workspace
17: inform – Integer Output
13: x(n) – ADTYPE array Output
14: objADTYPE Output
15: comm(lcomm) – ADTYPE array Communication Array
16: lcomm – Integer Input
17: liuser Input
User workspace dimension (C++ only), see x10af to specify the dimension from Fortran.
18: iuser(*) – Integer array User Workspace
19: lruser Input
User workspace dimension (C++ only), see x10ae to specify the dimension from Fortran.
20: ruser(*) – ADTYPE array User Workspace
21: ifail – Integer Input/Output

6 Error Indicators and Warnings

e05jb preserves all error codes from e05jbf 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

e05jb is not threaded in any implementation.

9 Further Comments

None.

10 Example

A NAG AD Library example is not yet available, please refer to the NAG AD Library Introduction for information on calling routines from the AD Library.