1 /* A C-callable front-end to the StoGO global-optimization library.
2 -- Steven G. Johnson */
7 #include "nlopt-util.h"
13 typedef double (*objective_func)(unsigned n, const double *x, double *grad,
16 /* search for the global minimum of the function fgrad(n, x, grad, data)
17 inside a simple n-dimensional hyperrectangle.
21 n: dimension of search space (number of decision variables)
23 fgrad: the objective function of the form fgrad(n, x, grad, data),
24 returning the objective function at x, where
25 n: dimension of search space
26 x: pointer to array of length n, point to evaluate
27 grad: if non-NULL, an array of length n which
28 should on return be the gradient d(fgrad)/dx
29 [ if NULL, grad should be ignored ]
30 data: arbitrary data pointer, whose value is the
31 data argument of stogo_minimize
33 data: arbitrary pointer to any auxiliary data needed by fgrad
35 l, u: arrays of length n giving the lower and upper bounds of the
38 maxeval: if nonzero, a maximum number of fgrad evaluations
39 maxtime: if nonzero, a maximum time (in seconds)
40 -- REPLACED in NLopt by nlopt_stopping *stop
42 nrandom: number of randomized search points to use per box,
43 in addition to 2*n+1 deterministic search points
44 (0 for a deterministic algorithm).
48 minf: the minimum value of the objective function found
50 x: pointer to array of length n, giving the location of the minimum
52 Return value: 0 if no minimum found, 1 otherwise.
56 int stogo_minimize(int n,
57 objective_func fgrad, void *data,
58 double *x, double *minf,
59 const double *l, const double *u,
63 long int maxeval, double maxtime,
67 extern int stogo_verbose; /* set to nonzero for verbose output */