16 #ifndef GRPPI_MAPREDUCE_H
17 #define GRPPI_MAPREDUCE_H
49 template <
typename Execution,
typename ...InputIterators,
50 typename Identity,
typename Transformer,
typename Combiner,
53 std::tuple<InputIterators...> firsts, std::size_t size,
55 Transformer && transform_op, Combiner && combine_op)
57 static_assert(supports_map_reduce<Execution>(),
58 "map/reduce not supported on execution type");
59 return ex.map_reduce(firsts, size,
60 std::forward<Identity>(identity),
61 std::forward<Transformer>(transform_op),
62 std::forward<Combiner>(combine_op));
81 template <
typename Execution,
typename ...InputIterators,
typename InputIt,
82 typename Identity,
typename Transformer,
typename Combiner,
84 requires_iterator<InputIt> = 0>
86 std::tuple<InputIterators...> firsts, InputIt last,
88 Transformer && transform_op, Combiner && combine_op)
90 static_assert(supports_map_reduce<Execution>(),
91 "map/reduce not supported on execution type");
92 return ex.map_reduce(firsts,
93 std::distance(std::get<0>(firsts),last),
94 std::forward<Identity>(identity),
95 std::forward<Transformer>(transform_op),
96 std::forward<Combiner>(combine_op));
114 template <
typename Execution,
typename InputIterator,
typename Identity,
115 typename Transformer,
typename Combiner,
116 requires_iterator<InputIterator> = 0>
118 InputIterator first, InputIterator last,
119 Identity && identity,
120 Transformer && transform_op, Combiner && combine_op)
122 static_assert(supports_map_reduce<Execution>(),
123 "map/reduce not supported on execution type");
124 return ex.map_reduce(make_tuple(first), std::distance(first,last),
125 std::forward<Identity>(identity),
126 std::forward<Transformer>(transform_op),
127 std::forward<Combiner>(combine_op));
145 template <
typename Execution,
typename InputIterator,
typename Identity,
146 typename Transformer,
typename Combiner,
147 typename ... OtherInputIterators,
148 requires_iterator<InputIterator> = 0>
149 [[deprecated(
"This version of the interface is deprecated.\n"
150 "If you want to use multiple inputs, use a tuple instead.")]]
152 InputIterator first, InputIterator last,
153 Identity && identity,
154 Transformer && transform_op, Combiner && combine_op,
155 OtherInputIterators ... other_firsts)
157 static_assert(supports_map_reduce<Execution>(),
158 "map/reduce not supported on execution type");
159 return ex.map_reduce(make_tuple(first, other_firsts...),
160 std::distance(first,last),
161 std::forward<Identity>(identity),
162 std::forward<Transformer>(transform_op),
163 std::forward<Combiner>(combine_op));
auto map_reduce(const Execution &ex, std::tuple< InputIterators... > firsts, std::size_t size, Identity &&identity, Transformer &&transform_op, Combiner &&combine_op)
Invoke md_map-reduce on a data sequence.
Definition: mapreduce.h:52
Definition: callable_traits.h:21
std::enable_if_t< are_iterators< T... >, int > requires_iterators
Definition: iterator_traits.h:59