21 #ifndef GRPPI_MAPREDUCE_H 22 #define GRPPI_MAPREDUCE_H 54 template <
typename Execution,
typename ...InputIterators,
55 typename Identity,
typename Transformer,
typename Combiner,
58 std::tuple<InputIterators...> firsts, std::size_t size,
60 Transformer && transform_op, Combiner && combine_op)
62 static_assert(supports_map_reduce<Execution>(),
63 "map/reduce not supported on execution type");
64 return ex.map_reduce(firsts, size,
65 std::forward<Identity>(identity),
66 std::forward<Transformer>(transform_op),
67 std::forward<Combiner>(combine_op));
86 template <
typename Execution,
typename ...InputIterators,
typename InputIt,
87 typename Identity,
typename Transformer,
typename Combiner,
91 std::tuple<InputIterators...> firsts, InputIt last,
93 Transformer && transform_op, Combiner && combine_op)
95 static_assert(supports_map_reduce<Execution>(),
96 "map/reduce not supported on execution type");
97 return ex.map_reduce(firsts,
98 std::distance(std::get<0>(firsts),last),
99 std::forward<Identity>(identity),
100 std::forward<Transformer>(transform_op),
101 std::forward<Combiner>(combine_op));
119 template <
typename Execution,
typename InputIterator,
typename Identity,
120 typename Transformer,
typename Combiner,
123 InputIterator first, InputIterator last,
124 Identity && identity,
125 Transformer && transform_op, Combiner && combine_op)
127 static_assert(supports_map_reduce<Execution>(),
128 "map/reduce not supported on execution type");
129 return ex.map_reduce(make_tuple(first), std::distance(first,last),
130 std::forward<Identity>(identity),
131 std::forward<Transformer>(transform_op),
132 std::forward<Combiner>(combine_op));
150 template <
typename Execution,
typename InputIterator,
typename Identity,
151 typename Transformer,
typename Combiner,
152 typename ... OtherInputIterators,
153 requires_iterator<InputIterator> = 0>
154 [[deprecated(
"This version of the interface is deprecated.\n" 155 "If you want to use multiple inputs, use a tuple instead.")]]
157 InputIterator first, InputIterator last,
158 Identity && identity,
159 Transformer && transform_op, Combiner && combine_op,
160 OtherInputIterators ... other_firsts)
162 static_assert(supports_map_reduce<Execution>(),
163 "map/reduce not supported on execution type");
164 return ex.map_reduce(make_tuple(first, other_firsts...),
165 std::distance(first,last),
166 std::forward<Identity>(identity),
167 std::forward<Transformer>(transform_op),
168 std::forward<Combiner>(combine_op));
Definition: callable_traits.h:26
std::enable_if_t< are_iterators< T... >, int > requires_iterators
Definition: iterator_traits.h:64
auto map_reduce(const Execution &ex, std::tuple< InputIterators... > firsts, std::size_t size, Identity &&identity, Transformer &&transform_op, Combiner &&combine_op)
Invoke Map/reduce pattern on a data sequence.
Definition: mapreduce.h:57
std::enable_if_t< is_iterator< T >, int > requires_iterator
Definition: iterator_traits.h:58