From 4a63ac8c27b7778f24d832da33a44dbe121005a2 Mon Sep 17 00:00:00 2001 From: stevenj Date: Fri, 9 Jul 2010 12:56:46 -0400 Subject: [PATCH] add missing %catches statements for recent C++ API additions, especially the add_*constraint functions; thanks to Dmitrey Kroshko for the bug report darcs-hash:20100709165646-c8de0-f7dab6f3bc3dc7900a26674a3ba6f98bdb78a3ef.gz --- swig/nlopt-exceptions.i | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/swig/nlopt-exceptions.i b/swig/nlopt-exceptions.i index e7693da..0eb1942 100644 --- a/swig/nlopt-exceptions.i +++ b/swig/nlopt-exceptions.i @@ -21,12 +21,22 @@ %catches(std::bad_alloc,std::invalid_argument) nlopt::opt::set_max_objective(func f, void *f_data); %catches(std::bad_alloc,std::invalid_argument) nlopt::opt::set_max_objective(vfunc vf, void *f_data); +%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::set_min_objective(func f, void *f_data, nlopt_munge md, nlopt_munge mc); +%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::set_max_objective(func f, void *f_data, nlopt_munge md, nlopt_munge mc); + %catches(std::invalid_argument) nlopt::opt::remove_inequality_constraints(); %catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_inequality_constraint(func f, void *f_data, double tol=0); %catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_inequality_constraint(vfunc vf, void *f_data, double tol=0); %catches(std::invalid_argument) nlopt::opt::remove_equality_constraints(); %catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_equality_constraint(func f, void *f_data, double tol=0); %catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_equality_constraint(vfunc vf, void *f_data, double tol=0); +%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_inequality_mconstraint(mfunc mf, void *f_data, const std::vector &tol); +%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_equality_mconstraint(mfunc mf, void *f_data, const std::vector &tol); + +%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_inequality_constraint(func f, void *f_data, nlopt_munge md, nlopt_munge mc, double tol=0); +%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_equality_constraint(func f, void *f_data, nlopt_munge md, nlopt_munge mc, double tol=0); +%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_inequality_mconstraint(mfunc mf, void *f_data, nlopt_munge md, nlopt_munge mc, const std::vector &tol); +%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::add_equality_mconstraint(mfunc mf, void *f_data, nlopt_munge md, nlopt_munge mc, const std::vector &tol); #define SET_EXCEPT(name, T) %catches(std::invalid_argument) nlopt::opt::set_##name(T val); #define GET_EXCEPT(name) %catches(std::invalid_argument) nlopt::opt::get_##name(); @@ -56,4 +66,4 @@ GETSETVEC_EXCEPT(initial_step) %catches(std::bad_alloc,std::invalid_argument) nlopt::opt::set_default_initial_step(const std::vector &x); %catches(std::invalid_argument) nlopt::opt::get_initial_step(const std::vector &x, std::vector &dx); -%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::get_initial_step(const std::vector &x); +%catches(std::bad_alloc,std::invalid_argument) nlopt::opt::get_initial_step_(const std::vector &x); -- 2.30.2