<commit_before>#include "numbbo.h"

#include "numbbo_utilities.c"

/**
 * numbbo_allocate_problem(number_of_parameters):
 *
 * Allocate and pre-populate a new numbbo_problem_t for a problem with
 * ${number_of_parameters}.
 */
static numbbo_problem_t *numbbo_allocate_problem(const size_t number_of_parameters,
                                                 const size_t number_of_objectives,
                                                 const size_t number_of_constraints) {
    numbbo_problem_t *problem;  /* needs to be first in the definition */
    problem = (numbbo_problem_t *)numbbo_allocate_memory(sizeof(numbbo_problem_t));
    /* Initialize fields to sane/safe defaults */
    problem->evaluate_function = NULL;
    problem->evaluate_constraint = NULL;
    problem->recommend_solutions = NULL;
    problem->free_problem = NULL;
    problem->number_of_parameters = number_of_parameters;
    problem->number_of_objectives = number_of_objectives;
    problem->number_of_constraints = number_of_constraints;
    problem->lower_bounds = numbbo_allocate_vector(number_of_parameters);
    problem->upper_bounds = numbbo_allocate_vector(number_of_parameters);
    problem->best_parameter = numbbo_allocate_vector(number_of_parameters);
    problem->best_value = numbbo_allocate_vector(number_of_objectives);
    problem->problem_name = NULL;
    problem->problem_id = NULL;
    return problem;
}

/**
 * Generic wrapper for a transformed numbbo_problem_t. 
 */
typedef struct numbbo_transformed_problem {
    numbbo_problem_t problem;
    numbbo_problem_t *inner_problem;
    void *state;<commit_msg>moved comment to the right place<commit_after>#include "numbbo.h"

#include "numbbo_utilities.c"

/**
 * numbbo_allocate_problem(number_of_parameters):
 *
 * Allocate and pre-populate a new numbbo_problem_t for a problem with
 * ${number_of_parameters}.
 */
static numbbo_problem_t *numbbo_allocate_problem(const size_t number_of_parameters,
                                                 const size_t number_of_objectives,
                                                 const size_t number_of_constraints) {
    numbbo_problem_t *problem;
    problem = (numbbo_problem_t *)numbbo_allocate_memory(sizeof(numbbo_problem_t));
    /* Initialize fields to sane/safe defaults */
    problem->evaluate_function = NULL;
    problem->evaluate_constraint = NULL;
    problem->recommend_solutions = NULL;
    problem->free_problem = NULL;
    problem->number_of_parameters = number_of_parameters;
    problem->number_of_objectives = number_of_objectives;
    problem->number_of_constraints = number_of_constraints;
    problem->lower_bounds = numbbo_allocate_vector(number_of_parameters);
    problem->upper_bounds = numbbo_allocate_vector(number_of_parameters);
    problem->best_parameter = numbbo_allocate_vector(number_of_parameters);
    problem->best_value = numbbo_allocate_vector(number_of_objectives);
    problem->problem_name = NULL;
    problem->problem_id = NULL;
    return problem;
}

/**
 * Generic wrapper for a transformed numbbo_problem_t. 
 */
typedef struct numbbo_transformed_problem {
    numbbo_problem_t problem;  /* must be defined first to make inheritance / overload happen */
    numbbo_problem_t *inner_problem;
    void *state;
{'fraction_non_alphanumeric': 0.07942348972707758, 'fraction_numerical': 0.0, 'mean_word_length': 3.8254437869822486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2717681', 'n_tokens_mistral': 1022, 'n_tokens_neox': 938, 'n_words': 180}