From 7c04dc81d02360451af2385120861c2890accd65 Mon Sep 17 00:00:00 2001 From: paulduf <{ID}+{username}@users.noreply.github.com> Date: Sat, 12 Mar 2022 09:51:11 +0100 Subject: [PATCH] switch unused argument to boolean-like to shift only the constraints --- code-experiments/src/suite_cons_bbob_problems.c | 2 +- code-experiments/src/transform_vars_shift.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/code-experiments/src/suite_cons_bbob_problems.c b/code-experiments/src/suite_cons_bbob_problems.c index f06b856cb..6f6259175 100644 --- a/code-experiments/src/suite_cons_bbob_problems.c +++ b/code-experiments/src/suite_cons_bbob_problems.c @@ -461,7 +461,7 @@ static coco_problem_t *f_linear_slope_c_linear_cons_bbob_problem_allocate(const /* Apply a translation to the whole problem so that the constrained * minimum is no longer at the origin. */ - problem = transform_vars_shift(problem, xopt, 0); + problem = transform_vars_shift(problem, xopt, 1); /* Construct problem type */ coco_problem_set_type(problem, "%s_%s", problem_type_temp, diff --git a/code-experiments/src/transform_vars_shift.c b/code-experiments/src/transform_vars_shift.c index 6c67fffed..f5910595c 100644 --- a/code-experiments/src/transform_vars_shift.c +++ b/code-experiments/src/transform_vars_shift.c @@ -110,12 +110,10 @@ static void transform_vars_shift_free(void *thing) { */ static coco_problem_t *transform_vars_shift(coco_problem_t *inner_problem, const double *offset, - const int shift_bounds) { + const int shift_constraint_only) { transform_vars_shift_data_t *data; coco_problem_t *problem; size_t i; - if (shift_bounds) - coco_error("shift_bounds not implemented."); data = (transform_vars_shift_data_t *) coco_allocate_memory(sizeof(*data)); data->offset = coco_duplicate_vector(offset, inner_problem->number_of_variables); @@ -124,7 +122,7 @@ static coco_problem_t *transform_vars_shift(coco_problem_t *inner_problem, problem = coco_problem_transformed_allocate(inner_problem, data, transform_vars_shift_free, "transform_vars_shift"); - if (inner_problem->number_of_objectives > 0) + if (inner_problem->number_of_objectives > 0 && shift_constraint_only == 0) problem->evaluate_function = transform_vars_shift_evaluate_function; if (inner_problem->number_of_constraints > 0)