From f58984eac37269d13d80fce02e9bc6e7a054140c Mon Sep 17 00:00:00 2001 From: stevenj Date: Sun, 4 Apr 2010 21:34:43 -0400 Subject: [PATCH] more nlopt_opt introspection darcs-hash:20100405013443-c8de0-811bb252f87584b2af1919a53eab9566096b5829.gz --- api/nlopt.h | 3 +++ api/options.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/api/nlopt.h b/api/nlopt.h index 3a91177..6d19f14 100644 --- a/api/nlopt.h +++ b/api/nlopt.h @@ -174,6 +174,9 @@ NLOPT_EXTERN nlopt_result nlopt_optimize(nlopt_opt opt, double *x, NLOPT_EXTERN nlopt_result nlopt_set_min_objective(nlopt_opt opt, nlopt_func f, void *f_data); +NLOPT_EXTERN nlopt_algorithm nlopt_get_algorithm(const nlopt_opt opt); +NLOPT_EXTERN int nlopt_get_dimension(const nlopt_opt opt); + /* constraints: */ NLOPT_EXTERN nlopt_result nlopt_set_lower_bounds(nlopt_opt opt, diff --git a/api/options.c b/api/options.c index 6474c44..50fcfa4 100644 --- a/api/options.c +++ b/api/options.c @@ -344,6 +344,11 @@ GETSET(maxtime, double, maxtime) /*************************************************************************/ +GET(algorithm, nlopt_algorithm, algorithm) +GET(dimension, int, n) + +/*************************************************************************/ + nlopt_result nlopt_set_local_optimizer(nlopt_opt opt, const nlopt_opt local_opt) { -- 2.30.2