coco_internal.h
Go to the documentation of this file.
1 
8 #ifndef __COCO_INTERNAL__
9 #define __COCO_INTERNAL__
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /***********************************************************************************************************/
22 typedef void (*coco_data_free_function_t)(void *data);
23 
29 typedef void (*coco_problem_free_function_t)(coco_problem_t *problem);
30 
37 typedef void (*coco_evaluate_function_t)(coco_problem_t *problem, const double *x, double *y);
38 
44 typedef void (*coco_recommend_function_t)(coco_problem_t *problem, const double *x);
45 
52 typedef coco_problem_t *(*coco_logger_allocate_function_t)(coco_observer_t *observer,
53  coco_problem_t *problem);
59 typedef void (*coco_logger_free_function_t)(void *logger);
60 
66 typedef coco_problem_t *(*coco_get_problem_function_t)(const size_t function,
67  const size_t dimension,
68  const size_t instance);
69 
83 typedef struct {
85  void *data;
89 
96 typedef struct {
100 
106 typedef struct {
107  size_t count;
108  char **keys;
110 
111 
112 /***********************************************************************************************************/
113 
123 
141  double *best_value;
142  double *nadir_value;
143  double *best_parameter;
145  char *problem_name;
146  char *problem_id;
147  char *problem_type;
149  size_t evaluations;
152  /* Convenience fields for output generation */
153  /* If at some point in time these arrays are changed to pointers, checks need to be added in the code to make sure
154  * they are not NULL.*/
155 
156  double final_target_delta[1];
157  double best_observed_fvalue[1];
158  size_t best_observed_evaluation[1];
160  /* Fields depending on the containing benchmark suite */
161 
167  void *data;
169  void *versatile_data; /* Wassim: *< @brief pointer to eventual additional data that need to be accessed all along the transforamtions*/
170 };
171 
180 
181  int is_active;
197  void *data;
202 };
203 
212 struct coco_suite_s {
213 
214  char *suite_name;
217  size_t *dimensions;
220  size_t *functions;
224  size_t *instances;
231  void *data;
235 };
236 
237 static void bbob_evaluate_gradient(coco_problem_t *problem, const double *x, double *y);
238 
241 
242 #ifdef __cplusplus
243 }
244 #endif
245 #endif
246 
The option keys data type.
Definition: coco_internal.h:106
size_t number_of_constraints
Number of constraints.
Definition: coco_internal.h:133
coco_problem_t *(* coco_logger_allocate_function_t)(coco_observer_t *observer, coco_problem_t *problem)
The allocate logger function type.
Definition: coco_internal.h:52
char * default_instances
The instances contained in the suite by default.
Definition: coco_internal.h:223
coco_evaluate_function_t evaluate_function
The function for evaluating the problem.
Definition: coco_internal.h:124
char * observer_name
Name of the observer for identification purposes.
Definition: coco_internal.h:182
char * suite_name
Name of the suite.
Definition: coco_internal.h:214
double x[COCO_LONG_LAG]
Definition: coco_random.c:23
void(* coco_logger_free_function_t)(void *logger)
The free logger function type.
Definition: coco_internal.h:59
int precision_x
Output precision for decision variables.
Definition: coco_internal.h:193
size_t number_of_functions
Number of functions contained in the suite.
Definition: coco_internal.h:219
double * initial_solution
Initial feasible solution.
Definition: coco_internal.h:140
size_t suite_dep_function
Suite-depending function.
Definition: coco_internal.h:164
coco_problem_t * problem2
Pointer to the second problem (objective)
Definition: coco_internal.h:98
long current_dimension_idx
The dimension index of the currently tackled problem.
Definition: coco_internal.h:227
size_t number_of_integer_variables
Number of integer variables (if > 0, all integer variables come before any continuous ones)...
Definition: coco_internal.h:137
coco_evaluate_function_t evaluate_gradient
The function for evaluating the constraints.
Definition: coco_internal.h:126
coco_data_free_function_t data_free_function
The function for freeing this suite.
Definition: coco_internal.h:233
coco_data_free_function_t data_free_function
Function to free the contents of data.
Definition: coco_internal.h:87
void(* coco_problem_free_function_t)(coco_problem_t *problem)
The problem free function type.
Definition: coco_internal.h:29
int log_discrete_as_int
Whether to output discrete variables in int or double format.
Definition: coco_internal.h:196
char * result_folder
Name of the result folder.
Definition: coco_internal.h:183
void(* coco_evaluate_function_t)(coco_problem_t *problem, const double *x, double *y)
The evaluate function type.
Definition: coco_internal.h:37
coco_logger_allocate_function_t logger_allocate_function
The function for allocating the logger.
Definition: coco_internal.h:200
The COCO observer structure.
Definition: coco_internal.h:179
int precision_f
Output precision for function values.
Definition: coco_internal.h:194
double * best_parameter
Optimal decision vector (defined only when unique)
Definition: coco_internal.h:143
coco_recommend_function_t recommend_solution
The function for recommending a solution.
Definition: coco_internal.h:127
size_t * functions
The functions contained in the suite.
Definition: coco_internal.h:220
int is_active
Whether the observer is active (the logger will log some output).
Definition: coco_internal.h:181
void * data
Void pointer that can be used to point to data specific to a suite.
Definition: coco_internal.h:231
size_t * dimensions
The dimensions contained in the suite.
Definition: coco_internal.h:217
size_t number_target_triggers
The number of targets between each 10**i and 10**(i+1).
Definition: coco_internal.h:186
size_t number_of_instances
Number of instances contained in the suite.
Definition: coco_internal.h:222
char * problem_id
Problem ID (unique in the containing suite)
Definition: coco_internal.h:146
coco_problem_t * current_problem
Pointer to the currently tackled problem.
Definition: coco_internal.h:226
The COCO suite structure.
Definition: coco_internal.h:212
coco_suite_t * suite
Pointer to the containing suite (NULL if not given)
Definition: coco_internal.h:162
coco_problem_t * problem1
Pointer to the first problem (objective)
Definition: coco_internal.h:97
char * problem_name
Problem name.
Definition: coco_internal.h:145
size_t count
Number of option keys.
Definition: coco_internal.h:107
static void bbob_evaluate_gradient(coco_problem_t *problem, const double *x, double *y)
size_t evaluations
Number of objective function evaluations performed on the problem.
Definition: coco_internal.h:149
The COCO problem structure.
Definition: coco_internal.h:122
double target_precision
The minimal precision used for targets.
Definition: coco_internal.h:188
void bbob_biobj_problem_best_parameter_print(const coco_problem_t *problem)
Definition: coco_problem.c:618
long current_function_idx
The function index of the currently tackled problem.
Definition: coco_internal.h:228
char * problem_type
Problem type.
Definition: coco_internal.h:147
size_t number_of_variables
Number of variables expected by the function, i.e. problem dimension.
Definition: coco_internal.h:130
size_t evaluations_constraints
Number of constraint function evaluations performed on the problem.
Definition: coco_internal.h:150
size_t number_of_dimensions
Number of dimensions contained in the suite.
Definition: coco_internal.h:216
char ** keys
Pointer to option keys.
Definition: coco_internal.h:108
void * data
Void pointer that can be used to point to data specific to an observer.
Definition: coco_internal.h:197
size_t suite_dep_instance
Suite-depending instance.
Definition: coco_internal.h:165
char * algorithm_info
Additional information on the algorithm to be used in logger output.
Definition: coco_internal.h:185
double * smallest_values_of_interest
The lower bounds of the ROI in the decision space.
Definition: coco_internal.h:135
coco_problem_free_function_t problem_free_function
The function for freeing this problem.
Definition: coco_internal.h:128
void(* coco_data_free_function_t)(void *data)
The data free function type.
Definition: coco_internal.h:22
void * versatile_data
Definition: coco_internal.h:169
void * data
Pointer to data, which enables further wrapping of the problem.
Definition: coco_internal.h:85
coco_data_free_function_t data_free_function
The function for freeing this observer.
Definition: coco_internal.h:199
size_t * instances
The instances contained in the suite.
Definition: coco_internal.h:224
char * base_evaluation_triggers
The "base evaluations" used to evaluations that trigger logging.
Definition: coco_internal.h:191
coco_problem_t * inner_problem
Pointer to the inner problem.
Definition: coco_internal.h:84
double * nadir_value
The nadir point (defined when number_of_objectives > 1)
Definition: coco_internal.h:142
void * data
Pointer to a data instance.
Definition: coco_internal.h:167
double * largest_values_of_interest
The upper bounds of the ROI in the decision space.
Definition: coco_internal.h:136
size_t number_of_objectives
Number of objectives.
Definition: coco_internal.h:132
double * best_value
Optimal (smallest) function value.
Definition: coco_internal.h:141
The transformed COCO problem data type.
Definition: coco_internal.h:83
void bbob_problem_best_parameter_print(const coco_problem_t *problem)
Definition: coco_problem.c:605
char * algorithm_name
Name of the algorithm to be used in logger output.
Definition: coco_internal.h:184
int precision_g
Output precision for constraint values.
Definition: coco_internal.h:195
long current_instance_idx
The instance index of the currently tackled problem.
Definition: coco_internal.h:229
size_t number_evaluation_triggers
The number of triggers between each 10**i and 10**(i+1) evaluation number.
Definition: coco_internal.h:189
coco_logger_free_function_t logger_free_function
The function for freeing the logger.
Definition: coco_internal.h:201
The stacked COCO problem data type.
Definition: coco_internal.h:96
coco_evaluate_function_t evaluate_constraint
The function for evaluating the constraints.
Definition: coco_internal.h:125
size_t suite_dep_index
Suite-depending problem index (starting from 0)
Definition: coco_internal.h:163
void(* coco_recommend_function_t)(coco_problem_t *problem, const double *x)
The recommend solutions function type.
Definition: coco_internal.h:44