5#define scdouble static_cast<double>
11 size_t desired_num_subsets)
13 std::vector<SubSetInfo> ss_infos;
14 const std::size_t div =
16 const std::size_t rem = num_items % desired_num_subsets;
18 for (
size_t i = 0; i < desired_num_subsets; ++i)
19 ss_infos.push_back({0, 0, div});
20 for (
size_t j = 0; j < rem; ++j)
21 ss_infos[j].ss_size += 1;
24 for (
size_t i = 0; i < desired_num_subsets; ++i)
26 ss_infos[i].ss_begin = check_sum;
27 check_sum += ss_infos[i].ss_size;
28 ss_infos[i].ss_end = check_sum - 1;
std::vector< SubSetInfo > MakeSubSets(size_t num_items, size_t desired_num_subsets)