From: stevenj Date: Fri, 24 Aug 2007 13:37:27 +0000 (-0400) Subject: support both Jones and Gablonsky direct variants X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=de69e2fb0cc97a3aaec5225816c7c419d1c33832;p=nlopt.git support both Jones and Gablonsky direct variants darcs-hash:20070824133727-c8de0-7bc31c4491e8d18853f961ed48aba7c4c6c3ab77.gz --- diff --git a/README b/README index 5bc54fe..46b4a6a 100644 --- a/README +++ b/README @@ -15,4 +15,7 @@ link it with -lnlopt -lm. You may need to use the C++ compiler to link in order to include the C++ libraries (which are used internally by NLopt, even though it has a C API). +The minimization function, nlopt_minimize, is described in the man +page (api/nlopt_minimize.3, which is installed by 'make install'. + Interfaces for other languages may be added in the future. diff --git a/api/nlopt.c b/api/nlopt.c index 5de5282..2108929 100644 --- a/api/nlopt.c +++ b/api/nlopt.c @@ -6,6 +6,7 @@ static const char nlopt_algorithm_names[NLOPT_NUM_ALGORITHMS][128] = { "DIRECT (global)", + "DIRECT-L (global)", "Subplex (local)", "StoGO (global)", "Low-storage BFGS (LBFGS) (local)" @@ -74,11 +75,15 @@ nlopt_result nlopt_minimize( switch (algorithm) { case NLOPT_GLOBAL_DIRECT: + case NLOPT_GLOBAL_DIRECT_L: switch (direct_optimize(f_direct, &d, n, lb, ub, x, fmin, maxeval, 500, ftol_rel, ftol_abs, xtol_rel, xtol_rel, DIRECT_UNKNOWN_FGLOBAL, -1.0, - NULL, DIRECT_GABLONSKY)) { + NULL, + algorithm == NLOPT_GLOBAL_DIRECT + ? DIRECT_ORIGINAL + : DIRECT_GABLONSKY)) { case DIRECT_INVALID_BOUNDS: case DIRECT_MAXFEVAL_TOOBIG: case DIRECT_INVALID_ARGS: diff --git a/api/nlopt.h b/api/nlopt.h index 60c21a4..5676706 100644 --- a/api/nlopt.h +++ b/api/nlopt.h @@ -13,6 +13,7 @@ typedef double (*nlopt_func)(int n, const double *x, typedef enum { /* non-gradient algorithms */ NLOPT_GLOBAL_DIRECT = 0, + NLOPT_GLOBAL_DIRECT_L, NLOPT_LOCAL_SUBPLEX, /* gradient-based algorithms */ diff --git a/api/nlopt_minimize.3 b/api/nlopt_minimize.3 index 7e0aa17..e665d1c 100644 --- a/api/nlopt_minimize.3 +++ b/api/nlopt_minimize.3 @@ -28,6 +28,9 @@ nlopt_minimize \- Minimize a multivariate nonlinear function .BI " const double* " "xtol_abs" , .BI " int " "maxeval" , .BI " double " "maxtime" ); +.sp +You should link the resulting program with the linker flags +-lnlopt -lm on Unix. .fi .SH DESCRIPTION .BR nlopt_minimize () diff --git a/direct/userguide.pdf b/direct/userguide.pdf new file mode 100644 index 0000000..b046c16 Binary files /dev/null and b/direct/userguide.pdf differ diff --git a/direct/userguide.ps.gz b/direct/userguide.ps.gz deleted file mode 100644 index c3a1655..0000000 Binary files a/direct/userguide.ps.gz and /dev/null differ