From 15c7cf4fb33e8d0d92a4aa2b581780df32dc7af8 Mon Sep 17 00:00:00 2001 From: Debian Science Maintainers Date: Mon, 16 Jul 2018 07:02:26 +0100 Subject: [PATCH] octave4.4 Gbp-Pq: Name octave4.4.patch --- octave/nlopt_optimize-oct.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/octave/nlopt_optimize-oct.cc b/octave/nlopt_optimize-oct.cc index a66da8e..536ec97 100644 --- a/octave/nlopt_optimize-oct.cc +++ b/octave/nlopt_optimize-oct.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -79,7 +80,12 @@ static double user_function(unsigned n, const double *x, 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, const double *x, 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() -- 2.30.2