dnl -----------------------------------------------------------------------
-AC_OUTPUT([
+AC_CONFIG_FILES([
Makefile
nlopt.pc
api/Makefile
+++ /dev/null
-Description: update configure script
-Author: Christophe Trophime <christophe.trophime@lncmi.cnrs.fr>
-Forwarded: no
-
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -408,7 +408,7 @@
-
- dnl -----------------------------------------------------------------------
-
--AC_CONFIG_FILES([
-+AC_OUTPUT([
- Makefile
- nlopt.pc
- api/Makefile
+++ /dev/null
-Description: Fix FTBFS against Octave 4.0
- Replace Octave_map by octave_map.
-Origin: upstream, https://github.com/stevengj/nlopt/commit/131148eb02b770da0e5c1049b4e82c78e4a50fa2
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792826
-Reviewed-by: Sébastien Villemot <sebastien@debian.org>
-Last-Update: 2015-07-20
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-diff --git a/octave/nlopt_optimize-oct.cc b/octave/nlopt_optimize-oct.cc
-index 4e08421..a66da8e 100644
---- a/octave/nlopt_optimize-oct.cc
-+++ b/octave/nlopt_optimize-oct.cc
-@@ -29,7 +29,7 @@
- #include "nlopt.h"
- #include "nlopt_optimize_usage.h"
-
--static int struct_val_default(Octave_map &m, const std::string& k,
-+static int struct_val_default(octave_map &m, const std::string& k,
- int dflt)
- {
- if (m.contains(k)) {
-@@ -39,7 +39,7 @@ static int struct_val_default(Octave_map &m, const std::string& k,
- return dflt;
- }
-
--static double struct_val_default(Octave_map &m, const std::string& k,
-+static double struct_val_default(octave_map &m, const std::string& k,
- double dflt)
- {
- if (m.contains(k)) {
-@@ -49,7 +49,7 @@ static double struct_val_default(Octave_map &m, const std::string& k,
- return dflt;
- }
-
--static Matrix struct_val_default(Octave_map &m, const std::string& k,
-+static Matrix struct_val_default(octave_map &m, const std::string& k,
- Matrix &dflt)
- {
- if (m.contains(k)) {
-@@ -140,7 +140,7 @@ static double user_function1(unsigned n, const double *x,
-
- #define CHECK1(cond, msg) if (!(cond)) { fprintf(stderr, msg "\n\n"); nlopt_destroy(opt); nlopt_destroy(local_opt); return NULL; }
-
--nlopt_opt make_opt(Octave_map &opts, int n)
-+nlopt_opt make_opt(octave_map &opts, int n)
- {
- nlopt_opt opt = NULL, local_opt = NULL;
-
-@@ -195,7 +195,7 @@ nlopt_opt make_opt(Octave_map &opts, int n)
- CHECK1(opts.contents("local_optimizer").length() == 1
- && (opts.contents("local_optimizer"))(0).is_map(),
- "opt.local_optimizer must be a structure");
-- Octave_map local_opts = (opts.contents("local_optimizer"))(0).map_value();
-+ octave_map local_opts = (opts.contents("local_optimizer"))(0).map_value();
- CHECK1((local_opt = make_opt(local_opts, n)),
- "error initializing local optimizer");
- nlopt_set_local_optimizer(opt, local_opt);
-@@ -216,7 +216,7 @@ DEFUN_DLD(nlopt_optimize, args, nargout, NLOPT_OPTIMIZE_USAGE)
- CHECK(args.length() == 2 && nargout <= 3, "wrong number of args");
-
- CHECK(args(0).is_map(), "opt must be structure")
-- Octave_map opts = args(0).map_value();
-+ octave_map opts = args(0).map_value();
-
- CHECK(args(1).is_real_matrix() || args(1).is_real_scalar(),
- "x must be real vector");
+++ /dev/null
-Description: Fix FTBFS against Octave 4.4
-Origin: backport, https://github.com/stevengj/nlopt/commit/1fcbcbf2fe8e34234e016cc43a6c41d3e8453e1f
-Reviewed-by: Sébastien Villemot <sebastien@debian.org>
-Last-Update: 2018-06-11
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/octave/nlopt_optimize-oct.cc
-+++ b/octave/nlopt_optimize-oct.cc
-@@ -23,6 +23,7 @@
- #include <octave/oct.h>
- #include <octave/oct-map.h>
- #include <octave/ov.h>
-+#include <octave/parse.h>
- #include <math.h>
- #include <stdio.h>
-
-@@ -79,7 +80,12 @@ static double user_function(unsigned n,
- for (unsigned i = 0; i < n; ++i)
- xm(i) = x[i];
- args(0) = xm;
-- octave_value_list res = data->f->do_multi_index_op(gradient ? 2 : 1, args);
-+ octave_value_list res
-+#if (OCTAVE_MAJOR_VERSION == 4 && OCTAVE_MINOR_VERSION > 2)
-+ = octave::feval(data->f, args, gradient ? 2 : 1);
-+#else
-+ = data->f->do_multi_index_op(gradient ? 2 : 1, args);
-+#endif
- if (res.length() < (gradient ? 2 : 1))
- gripe_user_supplied_eval("nlopt_optimize");
- else if (!res(0).is_real_scalar()
-@@ -116,7 +122,12 @@ static double user_function1(unsigned n,
- for (unsigned i = 0; i < n; ++i)
- xm(i) = x[i];
- args(0) = xm;
-- octave_value_list res = f->do_multi_index_op(gradient ? 2 : 1, args);
-+ octave_value_list res
-+#if (OCTAVE_MAJOR_VERSION == 4 && OCTAVE_MINOR_VERSION > 2)
-+ = octave::feval(f, args, gradient ? 2 : 1);
-+#else
-+ = f->do_multi_index_op(gradient ? 2 : 1, args);
-+#endif
- if (res.length() < (gradient ? 2 : 1))
- gripe_user_supplied_eval("nlopt_optimize");
- else if (!res(0).is_real_scalar()
+++ /dev/null
-configure.patch
-spelling-fixes.patch
-octave-4.0.patch
-octave4.4.patch
+++ /dev/null
-Descriptions: spelling fixes to make lintian happy
-Author: Sergey B Kirpichev
-Forwarded: no
-
----
- direct/DIRect.c | 20 ++++++++++----------
- swig/nlopt-python.cpp | 2 +-
- swig/numpy.i | 2 +-
- 3 files changed, 12 insertions(+), 12 deletions(-)
-
---- a/swig/nlopt-python.cpp
-+++ b/swig/nlopt-python.cpp
-@@ -4895,7 +4895,7 @@ SWIG_AsVal_unsigned_SS_int (PyObject * o
- if (PyInstance_Check(py_obj)) return "instance" ;
- #endif
-
-- return "unkown type";
-+ return "unknown type";
- }
-
- /* Given a NumPy typecode, return a string describing the type.
---- a/swig/numpy.i
-+++ b/swig/numpy.i
-@@ -89,7 +89,7 @@
- if (PyInstance_Check(py_obj)) return "instance" ;
- %#endif
-
-- return "unkown type";
-+ return "unknown type";
- }
-
- /* Given a NumPy typecode, return a string describing the type.
---- a/direct/DIRect.c
-+++ b/direct/DIRect.c
-@@ -162,17 +162,17 @@
- /* | for the function within the hyper-box. | */
- /* | | */
- /* | minf -- The value of the function at x. | */
--/* | Ierror -- Error flag. If Ierror is lower 0, an error has occured. The| */
--/* | values of Ierror mean | */
-+/* | Ierror -- Error flag. If Ierror is lower 0, an error has occurred. | */
-+/* | The values of Ierror mean | */
- /* | Fatal errors : | */
- /* | -1 u(i) <= l(i) for some i. | */
- /* | -2 maxf is too large. | */
- /* | -3 Initialization in DIRpreprc failed. | */
- /* | -4 Error in DIRSamplepoints, that is there was an error | */
- /* | in the creation of the sample points. | */
--/* | -5 Error in DIRSamplef, that is an error occured while | */
-+/* | -5 Error in DIRSamplef, that is an error occurred while | */
- /* | the function was sampled. | */
--/* | -6 Error in DIRDoubleInsert, that is an error occured | */
-+/* | -6 Error in DIRDoubleInsert, that is an error occurred | */
- /* | DIRECT tried to add all hyperrectangles with the same| */
- /* | size and function value at the center. Either | */
- /* | increase maxdiv or use our modification (Jones = 1). | */
-@@ -355,7 +355,7 @@
- algmethod, &MAXFUNC, &MAXDEEP, fglobal, fglper, ierror, &epsfix, &
- iepschange, volper, sigmaper);
- /* +-----------------------------------------------------------------------+ */
--/* | If an error has occured while writing the header (we do some checking | */
-+/* | If an error has occurred while writing the header (we do some checking| */
- /* | of variables there), return to the main program. | */
- /* +-----------------------------------------------------------------------+ */
- if (*ierror < 0) {
-@@ -383,7 +383,7 @@
- direct_dirinitlist_(anchor, &ifree, point, f, &MAXFUNC, &MAXDEEP);
- /* +-----------------------------------------------------------------------+ */
- /* | Call the routine to initialise the mapping of x from the n-dimensional| */
--/* | unit cube to the hypercube given by u and l. If an error occured, | */
-+/* | unit cube to the hypercube given by u and l. If an error occurred, | */
- /* | give out a error message and return to the main program with the error| */
- /* | flag set. | */
- /* | JG 07/16/01 Changed call to remove unused data. | */
-@@ -413,12 +413,12 @@
- if (*ierror < 0) {
- if (*ierror == -4) {
- if (logfile)
-- fprintf(logfile, "WARNING: Error occured in routine DIRsamplepoints.\n");
-+ fprintf(logfile, "WARNING: Error occurred in routine DIRsamplepoints.\n");
- goto cleanup;
- }
- if (*ierror == -5) {
- if (logfile)
-- fprintf(logfile, "WARNING: Error occured in routine DIRsamplef..\n");
-+ fprintf(logfile, "WARNING: Error occurred in routine DIRsamplef..\n");
- goto cleanup;
- }
- if (*ierror == -102) goto L100;
-@@ -535,7 +535,7 @@
- MAXDEEP, &oops);
- if (oops > 0) {
- if (logfile)
-- fprintf(logfile, "WARNING: Error occured in routine DIRsamplepoints.\n");
-+ fprintf(logfile, "WARNING: Error occurred in routine DIRsamplepoints.\n");
- *ierror = -4;
- goto cleanup;
- }
-@@ -558,7 +558,7 @@
- }
- if (oops > 0) {
- if (logfile)
-- fprintf(logfile, "WARNING: Error occured in routine DIRsamplef.\n");
-+ fprintf(logfile, "WARNING: Error occurred in routine DIRsamplef.\n");
- *ierror = -5;
- goto cleanup;
- }
/* | for the function within the hyper-box. | */
/* | | */
/* | minf -- The value of the function at x. | */
-/* | Ierror -- Error flag. If Ierror is lower 0, an error has occurred. | */
-/* | The values of Ierror mean | */
+/* | Ierror -- Error flag. If Ierror is lower 0, an error has occured. The| */
+/* | values of Ierror mean | */
/* | Fatal errors : | */
/* | -1 u(i) <= l(i) for some i. | */
/* | -2 maxf is too large. | */
/* | -3 Initialization in DIRpreprc failed. | */
/* | -4 Error in DIRSamplepoints, that is there was an error | */
/* | in the creation of the sample points. | */
-/* | -5 Error in DIRSamplef, that is an error occurred while | */
+/* | -5 Error in DIRSamplef, that is an error occured while | */
/* | the function was sampled. | */
-/* | -6 Error in DIRDoubleInsert, that is an error occurred | */
+/* | -6 Error in DIRDoubleInsert, that is an error occured | */
/* | DIRECT tried to add all hyperrectangles with the same| */
/* | size and function value at the center. Either | */
/* | increase maxdiv or use our modification (Jones = 1). | */
algmethod, &MAXFUNC, &MAXDEEP, fglobal, fglper, ierror, &epsfix, &
iepschange, volper, sigmaper);
/* +-----------------------------------------------------------------------+ */
-/* | If an error has occurred while writing the header (we do some checking| */
+/* | If an error has occured while writing the header (we do some checking | */
/* | of variables there), return to the main program. | */
/* +-----------------------------------------------------------------------+ */
if (*ierror < 0) {
direct_dirinitlist_(anchor, &ifree, point, f, &MAXFUNC, &MAXDEEP);
/* +-----------------------------------------------------------------------+ */
/* | Call the routine to initialise the mapping of x from the n-dimensional| */
-/* | unit cube to the hypercube given by u and l. If an error occurred, | */
+/* | unit cube to the hypercube given by u and l. If an error occured, | */
/* | give out a error message and return to the main program with the error| */
/* | flag set. | */
/* | JG 07/16/01 Changed call to remove unused data. | */
if (*ierror < 0) {
if (*ierror == -4) {
if (logfile)
- fprintf(logfile, "WARNING: Error occurred in routine DIRsamplepoints.\n");
+ fprintf(logfile, "WARNING: Error occured in routine DIRsamplepoints.\n");
goto cleanup;
}
if (*ierror == -5) {
if (logfile)
- fprintf(logfile, "WARNING: Error occurred in routine DIRsamplef..\n");
+ fprintf(logfile, "WARNING: Error occured in routine DIRsamplef..\n");
goto cleanup;
}
if (*ierror == -102) goto L100;
MAXDEEP, &oops);
if (oops > 0) {
if (logfile)
- fprintf(logfile, "WARNING: Error occurred in routine DIRsamplepoints.\n");
+ fprintf(logfile, "WARNING: Error occured in routine DIRsamplepoints.\n");
*ierror = -4;
goto cleanup;
}
}
if (oops > 0) {
if (logfile)
- fprintf(logfile, "WARNING: Error occurred in routine DIRsamplef.\n");
+ fprintf(logfile, "WARNING: Error occured in routine DIRsamplef.\n");
*ierror = -5;
goto cleanup;
}
#include <octave/oct.h>
#include <octave/oct-map.h>
#include <octave/ov.h>
-#include <octave/parse.h>
#include <math.h>
#include <stdio.h>
#include "nlopt.h"
#include "nlopt_optimize_usage.h"
-static int struct_val_default(octave_map &m, const std::string& k,
+static int struct_val_default(Octave_map &m, const std::string& k,
int dflt)
{
if (m.contains(k)) {
return dflt;
}
-static double struct_val_default(octave_map &m, const std::string& k,
+static double struct_val_default(Octave_map &m, const std::string& k,
double dflt)
{
if (m.contains(k)) {
return dflt;
}
-static Matrix struct_val_default(octave_map &m, const std::string& k,
+static Matrix struct_val_default(Octave_map &m, const std::string& k,
Matrix &dflt)
{
if (m.contains(k)) {
for (unsigned i = 0; i < n; ++i)
xm(i) = x[i];
args(0) = xm;
- octave_value_list res
-#if (OCTAVE_MAJOR_VERSION == 4 && OCTAVE_MINOR_VERSION > 2)
- = octave::feval(data->f, args, gradient ? 2 : 1);
-#else
- = data->f->do_multi_index_op(gradient ? 2 : 1, args);
-#endif
+ octave_value_list res = data->f->do_multi_index_op(gradient ? 2 : 1, args);
if (res.length() < (gradient ? 2 : 1))
gripe_user_supplied_eval("nlopt_optimize");
else if (!res(0).is_real_scalar()
for (unsigned i = 0; i < n; ++i)
xm(i) = x[i];
args(0) = xm;
- octave_value_list res
-#if (OCTAVE_MAJOR_VERSION == 4 && OCTAVE_MINOR_VERSION > 2)
- = octave::feval(f, args, gradient ? 2 : 1);
-#else
- = f->do_multi_index_op(gradient ? 2 : 1, args);
-#endif
+ octave_value_list res = f->do_multi_index_op(gradient ? 2 : 1, args);
if (res.length() < (gradient ? 2 : 1))
gripe_user_supplied_eval("nlopt_optimize");
else if (!res(0).is_real_scalar()
#define CHECK1(cond, msg) if (!(cond)) { fprintf(stderr, msg "\n\n"); nlopt_destroy(opt); nlopt_destroy(local_opt); return NULL; }
-nlopt_opt make_opt(octave_map &opts, int n)
+nlopt_opt make_opt(Octave_map &opts, int n)
{
nlopt_opt opt = NULL, local_opt = NULL;
CHECK1(opts.contents("local_optimizer").length() == 1
&& (opts.contents("local_optimizer"))(0).is_map(),
"opt.local_optimizer must be a structure");
- octave_map local_opts = (opts.contents("local_optimizer"))(0).map_value();
+ Octave_map local_opts = (opts.contents("local_optimizer"))(0).map_value();
CHECK1((local_opt = make_opt(local_opts, n)),
"error initializing local optimizer");
nlopt_set_local_optimizer(opt, local_opt);
CHECK(args.length() == 2 && nargout <= 3, "wrong number of args");
CHECK(args(0).is_map(), "opt must be structure")
- octave_map opts = args(0).map_value();
+ Octave_map opts = args(0).map_value();
CHECK(args(1).is_real_matrix() || args(1).is_real_scalar(),
"x must be real vector");
if (PyInstance_Check(py_obj)) return "instance" ;
#endif
- return "unknown type";
+ return "unkown type";
}
/* Given a NumPy typecode, return a string describing the type.
if (PyInstance_Check(py_obj)) return "instance" ;
%#endif
- return "unknown type";
+ return "unkown type";
}
/* Given a NumPy typecode, return a string describing the type.