1 Description: Fix FTBFS against Octave 4.4
2 Origin: backport, https://github.com/stevengj/nlopt/commit/1fcbcbf2fe8e34234e016cc43a6c41d3e8453e1f
3 Reviewed-by: Sébastien Villemot <sebastien@debian.org>
4 Last-Update: 2018-06-11
6 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
7 --- a/octave/nlopt_optimize-oct.cc
8 +++ b/octave/nlopt_optimize-oct.cc
10 #include <octave/oct.h>
11 #include <octave/oct-map.h>
12 #include <octave/ov.h>
13 +#include <octave/parse.h>
17 @@ -79,7 +80,12 @@ static double user_function(unsigned n,
18 for (unsigned i = 0; i < n; ++i)
21 - octave_value_list res = data->f->do_multi_index_op(gradient ? 2 : 1, args);
22 + octave_value_list res
23 +#if (OCTAVE_MAJOR_VERSION == 4 && OCTAVE_MINOR_VERSION > 2)
24 + = octave::feval(data->f, args, gradient ? 2 : 1);
26 + = data->f->do_multi_index_op(gradient ? 2 : 1, args);
28 if (res.length() < (gradient ? 2 : 1))
29 gripe_user_supplied_eval("nlopt_optimize");
30 else if (!res(0).is_real_scalar()
31 @@ -116,7 +122,12 @@ static double user_function1(unsigned n,
32 for (unsigned i = 0; i < n; ++i)
35 - octave_value_list res = f->do_multi_index_op(gradient ? 2 : 1, args);
36 + octave_value_list res
37 +#if (OCTAVE_MAJOR_VERSION == 4 && OCTAVE_MINOR_VERSION > 2)
38 + = octave::feval(f, args, gradient ? 2 : 1);
40 + = f->do_multi_index_op(gradient ? 2 : 1, args);
42 if (res.length() < (gradient ? 2 : 1))
43 gripe_user_supplied_eval("nlopt_optimize");
44 else if (!res(0).is_real_scalar()