提交 7993645a 编写于 作者: S stevenj

support both randomized and deterministic versions of StoGO

darcs-hash:20070825040943-c8de0-dae271fcbf9097b206b94be55369be426b286935.gz
上级 1f67b072
......@@ -44,6 +44,7 @@ static const char nlopt_algorithm_names[NLOPT_NUM_ALGORITHMS][128] = {
"DIRECT-L (global)",
"Subplex (local)",
"StoGO (global)",
"StoGO with randomized search (global)",
"Low-storage BFGS (LBFGS) (local)"
};
......@@ -180,8 +181,11 @@ static nlopt_result nlopt_minimize_(
break;
case NLOPT_GLOBAL_STOGO:
case NLOPT_GLOBAL_STOGO_RANDOMIZED:
if (!stogo_minimize(n, f, f_data, x, fmin, lb, ub,
maxeval, maxtime))
maxeval, maxtime,
algorithm == NLOPT_GLOBAL_STOGO
? 0 : 2*n))
return NLOPT_FAILURE;
break;
......
......@@ -18,6 +18,7 @@ typedef enum {
/* gradient-based algorithms */
NLOPT_GLOBAL_STOGO,
NLOPT_GLOBAL_STOGO_RANDOMIZED,
NLOPT_LOCAL_LBFGS,
NLOPT_NUM_ALGORITHMS /* not an algorithm, just the number of them */
......
......@@ -201,8 +201,12 @@ as well as nonlinear constraints as described above).
Global optimization using the StoGO algorithm by Madsen et al. StoGO
exploits gradient information (which must be supplied by the
objective) for its local searches, and performs the global search by a
stochastic branch-and-bound technique. Only bound-constrained optimization
branch-and-bound technique. Only bound-constrained optimization
is supported.
.TP
.B NLOPT_GLOBAL_STOGO_RANDOMIZED
As above, but uses randomized starting points for the local searches
(which is sometimes better, often worse than the deterministic version).
.TP
.B NLOPT_LOCAL_LBFGS
Local gradient-based optimization using the low-storage BFGS (L-BFGS)
......
......@@ -30,12 +30,14 @@ int stogo_minimize(int n,
objective_func fgrad, void *data,
double *x, double *fmin,
const double *l, const double *u,
long int maxeval, double maxtime)
long int maxeval, double maxtime,
int nrandom)
{
GlobalParams params;
// FIXME: WTF do these parameters mean?
params.det_pnts=2*n+1; params.rnd_pnts=0;
params.rnd_pnts=nrandom;
params.det_pnts=2*n+1 - nrandom;
params.eps_cl=0.1; params.rshift=0.3;
params.mu=1.0E-4;
......
......@@ -37,6 +37,10 @@ typedef double (*objective_func)(int n, const double *x, double *grad,
maxtime: if nonzero, a maximum time (in seconds)
nrandom: number of randomized search points to use per box,
in addition to 2*n+1 deterministic search points
(0 for a deterministic algorithm).
Output:
fmin: the minimum value of the objective function found
......@@ -51,7 +55,8 @@ int stogo_minimize(int n,
objective_func fgrad, void *data,
double *x, double *fmin,
const double *l, const double *u,
long int maxeval, double maxtime);
long int maxeval, double maxtime,
int nrandom);
extern int stogo_verbose; /* set to nonzero for verbose output */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册