<commit_before>#ifndef __NUMBBO_H__
#define __NUMBBO_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdlib.h> /* For size_t */
#include <stdint.h>

/**
 * Our very own pi constant. Simplifies the case, when the value of pi changes.
 */
static const double numbbo_pi = 3.14159265358979323846;

struct numbbo_problem;

typedef void (*numbbo_evaluate_function_t) (struct numbbo_problem *self, 
                                            double *x, 
                                            double *y);
typedef void (*numbbo_recommendation_function_t) (struct numbbo_problem *self,
                                                  double *x,
                                                  size_t number_of_solutions);

typedef void (*numbbo_free_function_t) (struct numbbo_problem *self);

/**
 * Description of a NUMBBO problem (instance)
 *
 * evaluate and free are opaque pointers which should not be called
 * directly. Instead they are used by the numbbo_* functions in
 * numbbo_generics.c. This indirection gives us the flexibility to add
 * generic checks or more sophisticated dispatch methods later on.
 *
 * Fields:
 *
 * number_of_parameters - Number of parameters expected by the
 *   function and contraints.
 *
 * number_of_objectives - Number of objectives.
 *
 * number_of_constraints - Number of constraints.
 *
 * lower_bounds, upper_bounds - Vector of length
 *   'number_of_parameters'. Lower/Upper bounds of parameter space.
 *
 * problem_name - Descriptive name for the test problem. May be NULL
 *   to indicate that no name is known.
 *
 * problem_id - Short name consisting of _only_ [a-z0-9], '-' and '_'
 *   that, when not NULL, must be unique. It can for example be used
 *   to generate valid directory names under which to store results.
 */
typedef struct numbbo_problem {
    numbbo_evaluate_function_t evaluate_function;
    numbbo_evaluate_function_t evaluate_constraint;
    numbbo_recommendation_function_t recommend_solutions;
    numbbo_free_function_t free_problem;
    size_t number_of_parameters;
    size_t number_of_objectives;
    size_t number_of_constraints;
    double *lower_bounds;
    double *upper_bounds;
    double *best_value;
    double *best_parameter;
    char *problem_name;
    char *problem_id;
} numbbo_problem_t;
<commit_msg>initial_solution function added to numbbo_problem<commit_after>#ifndef __NUMBBO_H__
#define __NUMBBO_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdlib.h> /* For size_t */
#include <stdint.h>

/**
 * Our very own pi constant. Simplifies the case, when the value of pi changes.
 */
static const double numbbo_pi = 3.14159265358979323846;

struct numbbo_problem;

typedef void (*numbbo_initial_solution_function_t) (struct numbbo_problem *self, 
                                                    double *y);
typedef void (*numbbo_evaluate_function_t) (struct numbbo_problem *self, 
                                            double *x, 
                                            double *y);
typedef void (*numbbo_recommendation_function_t) (struct numbbo_problem *self,
                                                  double *x,
                                                  size_t number_of_solutions);

typedef void (*numbbo_free_function_t) (struct numbbo_problem *self);

/**
 * Description of a NUMBBO problem (instance)
 *
 * evaluate and free are opaque pointers which should not be called
 * directly. Instead they are used by the numbbo_* functions in
 * numbbo_generics.c. This indirection gives us the flexibility to add
 * generic checks or more sophisticated dispatch methods later on.
 *
 * Fields:
 *
 * number_of_parameters - Number of parameters expected by the
 *   function and contraints.
 *
 * number_of_objectives - Number of objectives.
 *
 * number_of_constraints - Number of constraints.
 *
 * lower_bounds, upper_bounds - Vector of length
 *   'number_of_parameters'. Lower/Upper bounds of parameter space.
 *
 * problem_name - Descriptive name for the test problem. May be NULL
 *   to indicate that no name is known.
 *
 * problem_id - Short name consisting of _only_ [a-z0-9], '-' and '_'
 *   that, when not NULL, must be unique. It can for example be used
 *   to generate valid directory names under which to store results.
 */
typedef struct numbbo_problem {
    numbbo_initial_solution_function_t initial_solution;
    numbbo_evaluate_function_t evaluate_function;
    numbbo_evaluate_function_t evaluate_constraint;
    numbbo_recommendation_function_t recommend_solutions;
    numbbo_free_function_t free_problem;
    size_t number_of_parameters;
    size_t number_of_objectives;
    size_t number_of_constraints;
    double *lower_bounds;
    double *upper_bounds;
    double *best_value;
    double *best_parameter;
    char *problem_name;
    char *problem_id;
} numbbo_problem_t;

{'fraction_non_alphanumeric': 0.06568890725056807, 'fraction_numerical': 0.009502168973352614, 'mean_word_length': 2.9301948051948052, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4387356', 'n_tokens_mistral': 1468, 'n_tokens_neox': 1352, 'n_words': 444}