Dear all,
 
In the attached file you can find a patch which makes it possible to compile nlopt-2.4.2 for octave-4.0.
Nlopt was using a deprecated interface (“Octave_map”) which has been removed from octave-4.0.
That patch should also work with octave version <= 3.8.
 
Best regrads,
Nlopt-user
 
--- nlopt-2.4.2/octave/nlopt_optimize-oct.cc	2014-05-20 20:35:58.000000000 +0200
+++ nlopt-2.4.2-patched/octave/nlopt_optimize-oct.cc	2016-02-15 13:27:42.186430100 +0100
@@ -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 @@
   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 @@
   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 @@
 
 #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 @@
     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 @@
   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");
_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to