pub unsafe extern "C" fn coco_suite_encode_problem_index(
suite: *const coco_suite_t,
function_idx: usize,
dimension_idx: usize,
instance_idx: usize,
) -> usize
Expand description
@name Encoding/decoding problem index
General schema for encoding/decoding a problem index. Note that the index depends on the number of instances a suite is defined with (it should be called a suite-instance-depending index…). Also, while functions, instances and dimensions start from 1, function_idx, instance_idx and dimension_idx as well as suite_dep_index start from 0!
Showing an example with 2 dimensions (2, 3), 5 instances (6, 7, 8, 9, 10) and 2 functions (1, 2):
\verbatim index | instance | function | dimension ——+–––––+–––––+———– 0 | 6 | 1 | 2 1 | 7 | 1 | 2 2 | 8 | 1 | 2 3 | 9 | 1 | 2 4 | 10 | 1 | 2 5 | 6 | 2 | 2 6 | 7 | 2 | 2 7 | 8 | 2 | 2 8 | 9 | 2 | 2 9 | 10 | 2 | 2 10 | 6 | 1 | 3 11 | 7 | 1 | 3 12 | 8 | 1 | 3 13 | 9 | 1 | 3 14 | 10 | 1 | 3 15 | 6 | 2 | 2 16 | 7 | 2 | 3 17 | 8 | 2 | 3 18 | 9 | 2 | 3 19 | 10 | 2 | 3
index | instance_idx | function_idx | dimension_idx ——+–––––––+–––––––+————— 0 | 0 | 0 | 0 1 | 1 | 0 | 0 2 | 2 | 0 | 0 3 | 3 | 0 | 0 4 | 4 | 0 | 0 5 | 0 | 1 | 0 6 | 1 | 1 | 0 7 | 2 | 1 | 0 8 | 3 | 1 | 0 9 | 4 | 1 | 0 10 | 0 | 0 | 1 11 | 1 | 0 | 1 12 | 2 | 0 | 1 13 | 3 | 0 | 1 14 | 4 | 0 | 1 15 | 0 | 1 | 1 16 | 1 | 1 | 1 17 | 2 | 1 | 1 18 | 3 | 1 | 1 19 | 4 | 1 | 1 \endverbatim / /@{*/ / @brief Computes the index of the problem in the suite that corresponds to the given function, dimension and instance indices.