inline times2_iterator make_times2_iterator(std::size_t i)
{
    return make_transform_iterator(
               make_counting_iterator(i)
               , std::bind1st(std::multiplies<std::size_t>(), 2)
           );
}
Esempio n. 2
0
 shuffled_distribution(ProcessGroup const& pg, BaseDistribution const& base)
   : BaseDistribution(base)
   , n(num_processes(pg))
   , mapping_(make_counting_iterator(size_type(0)), make_counting_iterator(n))
   , reverse_mapping(mapping_)
 {}