From: stevenj Date: Fri, 24 Aug 2007 16:54:54 +0000 (-0400) Subject: added version number X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ffd7b6e8741390fa455b904c7ebb24fe8cb9b75d;p=nlopt.git added version number darcs-hash:20070824165454-c8de0-f1414d354466a0339c3684d8c9343d62252c8479.gz --- diff --git a/api/nlopt.c b/api/nlopt.c index 8935286..e1c4e00 100644 --- a/api/nlopt.c +++ b/api/nlopt.c @@ -13,6 +13,13 @@ static const char nlopt_algorithm_names[NLOPT_NUM_ALGORITHMS][128] = { "Low-storage BFGS (LBFGS) (local)" }; +void nlopt_version(int *major, int *minor, int *bugfix) +{ + *major = MAJOR_VERSION; + *minor = MINOR_VERSION; + *bugfix = BUGFIX_VERSION; +} + const char *nlopt_algorithm_name(nlopt_algorithm a) { if (a < 0 || a >= NLOPT_NUM_ALGORITHMS) return "UNKNOWN"; diff --git a/api/nlopt.h b/api/nlopt.h index c480951..abbe1a4 100644 --- a/api/nlopt.h +++ b/api/nlopt.h @@ -51,6 +51,8 @@ extern nlopt_result nlopt_minimize( extern void nlopt_srand(unsigned long seed); extern void nlopt_srand_time(void); +extern void nlopt_version(int *major, int *minor, int *bugfix); + #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ diff --git a/api/nlopt_minimize.3 b/api/nlopt_minimize.3 index 2a062bf..790b6f4 100644 --- a/api/nlopt_minimize.3 +++ b/api/nlopt_minimize.3 @@ -174,14 +174,14 @@ can take on any of the following values: .B NLOPT_GLOBAL_DIRECT Perform a global derivative-free optimization using the DIRECT search algorithm by Jones et al. Supports arbitrary nonlinear constraints as -described above. +described above, but does not support unconstrained optimization. .TP .B NLOPT_GLOBAL_DIRECT_L Perform a global derivative-free optimization using the DIRECT-L search algorithm by Gablonsky et al., a modified version of the DIRECT -algorithm that is more suited to functions with few local minima. See -direct/README. Supports arbitrary nonlinear constraints as described -above. +algorithm that is more suited to functions with modest numbers of +local minima. Supports arbitrary nonlinear constraints as described +above, but does not support unconstrained optimization. .TP .B NLOPT_LOCAL_SUBPLEX Perform a local derivative-free optimization, starting at @@ -201,11 +201,27 @@ 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. This stochastic +stochastic branch-and-bound technique. Only bound-constrained optimization +is supported. +.TP +.B NLOPT_LOCAL_LBFGS +Local gradient-based optimization using the low-storage BFGS (L-BFGS) +algorithm. (The objective function must supply the gradient.) +Unconstrained optimization is supported in addition to simple bound +constraints (see above). .SH RETURN VALUE The value returned is one of the following enumerated constants. (Positive return values indicate successful termination, while negative return values indicate an error condition.) +.SH PSEUDORANDOM NUMBERS +For stochastic optimization algorithms, we use pseudorandom numbers generated +by the Mersenne Twister algorithm, based on code from Makoto Matsumoto. +By default, the seed for the random numbers is generated from the system +time, so that they will be different each time you run the program. If +you want to use deterministic random numbers, you can set the seed by +calling: +.sp +.BI " void nlopt_srand(unsigned long " "seed" ); .SH BUGS Currently the NLopt library is in pre-alpha stage. Most algorithms currently do not support all termination conditions: the only diff --git a/configure.ac b/configure.ac index c203bb4..377d96a 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,13 @@ if test $ac_cv_prog_gcc = yes; then fi fi +vers=`echo ${VERSION}.0.0 | cut -d. -f1` +AC_DEFINE_UNQUOTED(MAJOR_VERSION, $vers, [Major version number.]) +vers=`echo ${VERSION}.0.0 | cut -d. -f2` +AC_DEFINE_UNQUOTED(MINOR_VERSION, $vers, [Minor version number.]) +vers=`echo ${VERSION}.0.0 | cut -d. -f3` +AC_DEFINE_UNQUOTED(BUGFIX_VERSION, $vers, [Bugfix version number.]) + dnl ----------------------------------------------------------------------- AC_CONFIG_FILES([