From 4ee442558b66b1abacf64d25d74f46cdae998221 Mon Sep 17 00:00:00 2001 From: stevenj Date: Sat, 20 Nov 2010 13:37:59 -0500 Subject: [PATCH] rename subspace_dim to vector_storage, since not necessarily a subspace (and can be > n) darcs-hash:20101120183759-c8de0-48667b8ad265694082acd9cc926b02c5746941e0.gz --- api/f77funcs_.h | 2 +- api/nlopt-in.hpp | 2 +- api/nlopt-internal.h | 2 +- api/nlopt.h | 4 ++-- api/optimize.c | 6 +++--- api/options.c | 4 ++-- octave/nlopt_optimize-mex.c | 2 +- octave/nlopt_optimize-oct.cc | 2 +- swig/nlopt-exceptions.i | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api/f77funcs_.h b/api/f77funcs_.h index 9a2dd94..a8b612b 100644 --- a/api/f77funcs_.h +++ b/api/f77funcs_.h @@ -157,7 +157,7 @@ void F77_(nlo_force_stop,NLO_FORCE_STOP)(int *ret, nlopt_opt *opt) { F77_SET(local_optimizer, LOCAL_OPTIMIZER, nlopt_opt) F77_GETSET(population, POPULATION, unsigned) -F77_GETSET(subspace_dim, SUBSPACE_DIM, unsigned) +F77_GETSET(vector_storage, SUBSPACE_DIM, unsigned) F77_SETA(default_initial_step, DEFAULT_INITIAL_STEP, double) F77_SETA(initial_step, INITIAL_STEP, double) diff --git a/api/nlopt-in.hpp b/api/nlopt-in.hpp index 09215fd..ac98b13 100644 --- a/api/nlopt-in.hpp +++ b/api/nlopt-in.hpp @@ -476,7 +476,7 @@ namespace nlopt { } NLOPT_GETSET(unsigned, population) - NLOPT_GETSET(unsigned, subspace_dim) + NLOPT_GETSET(unsigned, vector_storage) NLOPT_GETSET_VEC(initial_step) void set_default_initial_step(const std::vector &x) { diff --git a/api/nlopt-internal.h b/api/nlopt-internal.h index 388d4e5..4f7c344 100644 --- a/api/nlopt-internal.h +++ b/api/nlopt-internal.h @@ -69,7 +69,7 @@ struct nlopt_opt_s { nlopt_opt local_opt; /* local optimizer */ unsigned stochastic_population; /* population size for stochastic algs */ double *dx; /* initial step sizes (length n) for nonderivative algs */ - unsigned subspace_dim; /* max subspace dimension (0 for default) */ + unsigned vector_storage; /* max subspace dimension (0 for default) */ double *work; /* algorithm-specific workspace during optimization */ }; diff --git a/api/nlopt.h b/api/nlopt.h index 5f09f2a..bff57ab 100644 --- a/api/nlopt.h +++ b/api/nlopt.h @@ -268,8 +268,8 @@ NLOPT_EXTERN(nlopt_result) nlopt_set_local_optimizer(nlopt_opt opt, NLOPT_EXTERN(nlopt_result) nlopt_set_population(nlopt_opt opt, unsigned pop); NLOPT_EXTERN(unsigned) nlopt_get_population(const nlopt_opt opt); -NLOPT_EXTERN(nlopt_result) nlopt_set_subspace_dim(nlopt_opt opt, unsigned dim); -NLOPT_EXTERN(unsigned) nlopt_get_subspace_dim(const nlopt_opt opt); +NLOPT_EXTERN(nlopt_result) nlopt_set_vector_storage(nlopt_opt opt, unsigned dim); +NLOPT_EXTERN(unsigned) nlopt_get_vector_storage(const nlopt_opt opt); NLOPT_EXTERN(nlopt_result) nlopt_set_default_initial_step(nlopt_opt opt, const double *x); diff --git a/api/optimize.c b/api/optimize.c index 8c8612c..e36d9e3 100644 --- a/api/optimize.c +++ b/api/optimize.c @@ -350,12 +350,12 @@ static nlopt_result nlopt_optimize_(nlopt_opt opt, double *x, double *minf) case NLOPT_LD_LBFGS: return luksan_plis(ni, f, f_data, lb, ub, x, minf, - &stop, opt->subspace_dim); + &stop, opt->vector_storage); case NLOPT_LD_VAR1: case NLOPT_LD_VAR2: return luksan_plip(ni, f, f_data, lb, ub, x, minf, - &stop, opt->subspace_dim, + &stop, opt->vector_storage, algorithm == NLOPT_LD_VAR1 ? 1 : 2); case NLOPT_LD_TNEWTON: @@ -363,7 +363,7 @@ static nlopt_result nlopt_optimize_(nlopt_opt opt, double *x, double *minf) case NLOPT_LD_TNEWTON_PRECOND: case NLOPT_LD_TNEWTON_PRECOND_RESTART: return luksan_pnet(ni, f, f_data, lb, ub, x, minf, - &stop, opt->subspace_dim, + &stop, opt->vector_storage, 1 + (algorithm - NLOPT_LD_TNEWTON) % 2, 1 + (algorithm - NLOPT_LD_TNEWTON) / 2); diff --git a/api/options.c b/api/options.c index 19df40d..e3709fd 100644 --- a/api/options.c +++ b/api/options.c @@ -88,7 +88,7 @@ nlopt_opt NLOPT_STDCALL nlopt_create(nlopt_algorithm algorithm, unsigned n) opt->local_opt = NULL; opt->stochastic_population = 0; - opt->subspace_dim = 0; + opt->vector_storage = 0; opt->dx = NULL; opt->work = NULL; @@ -589,7 +589,7 @@ NLOPT_STDCALL nlopt_set_local_optimizer(nlopt_opt opt, /*************************************************************************/ GETSET(population, unsigned, stochastic_population) -GETSET(subspace_dim, unsigned, subspace_dim) +GETSET(vector_storage, unsigned, vector_storage) /*************************************************************************/ diff --git a/octave/nlopt_optimize-mex.c b/octave/nlopt_optimize-mex.c index 40af901..925625c 100644 --- a/octave/nlopt_optimize-mex.c +++ b/octave/nlopt_optimize-mex.c @@ -151,7 +151,7 @@ nlopt_opt make_opt(const mxArray *opts, unsigned n) nlopt_set_maxtime(opt, struct_val_default(opts, "maxtime", 0.0)); nlopt_set_population(opt, struct_val_default(opts, "population", 0)); - nlopt_set_subspace_dim(opt, struct_val_default(opts, "subspace_dim", 0)); + nlopt_set_vector_storage(opt, struct_val_default(opts, "vector_storage", 0)); if (struct_arrval(opts, "initial_step", n, NULL)) nlopt_set_initial_step(opt, diff --git a/octave/nlopt_optimize-oct.cc b/octave/nlopt_optimize-oct.cc index 9e11c49..1f24dde 100644 --- a/octave/nlopt_optimize-oct.cc +++ b/octave/nlopt_optimize-oct.cc @@ -177,7 +177,7 @@ nlopt_opt make_opt(Octave_map &opts, int n) nlopt_set_maxtime(opt, struct_val_default(opts, "maxtime", 0.0)); nlopt_set_population(opt, struct_val_default(opts, "population", 0)); - nlopt_set_subspace_dim(opt, struct_val_default(opts, "subspace_dim", 0)); + nlopt_set_vector_storage(opt, struct_val_default(opts, "vector_storage", 0)); if (opts.contains("initial_step")) { Matrix zeros(1, n, 0.0); diff --git a/swig/nlopt-exceptions.i b/swig/nlopt-exceptions.i index 6dac57a..625914a 100644 --- a/swig/nlopt-exceptions.i +++ b/swig/nlopt-exceptions.i @@ -62,7 +62,7 @@ GETSET_EXCEPT(force_stop, int) %catches(std::bad_alloc,std::invalid_argument) nlopt::opt::set_local_optimizer(const opt &lo); GETSET_EXCEPT(population, unsigned) -GETSET_EXCEPT(subspace_dim, unsigned) +GETSET_EXCEPT(vector_storage, unsigned) GETSETVEC_EXCEPT(initial_step) %catches(std::bad_alloc,std::invalid_argument) nlopt::opt::set_default_initial_step(const std::vector &x); -- 2.30.2