chiark / gitweb /
added version number
authorstevenj <stevenj@alum.mit.edu>
Fri, 24 Aug 2007 16:54:54 +0000 (12:54 -0400)
committerstevenj <stevenj@alum.mit.edu>
Fri, 24 Aug 2007 16:54:54 +0000 (12:54 -0400)
darcs-hash:20070824165454-c8de0-f1414d354466a0339c3684d8c9343d62252c8479.gz

api/nlopt.c
api/nlopt.h
api/nlopt_minimize.3
configure.ac

index 8935286ff4a14667dcf032056b07d060f142cecf..e1c4e004555b838388bce784d40305be0f4185c2 100644 (file)
@@ -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";
index c480951e8ebd7c666916303536bd43d58c75da44..abbe1a4dde9705fdef0d8f0cdeb6281ae5f1942f 100644 (file)
@@ -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 */
index 2a062bf9e2daa955182718c1c91c06b1d95d2055..790b6f443aafcfc1b7496ca0fbf99b9555908849 100644 (file)
@@ -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
index c203bb46e4f8550f5635063ec6c1f277a655f6d4..377d96a425dac2ddd06284019b28408f4f297511 100644 (file)
@@ -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([