reduce.h
Go to the documentation of this file.
30 : public TT<int, std::tuple<Out<int, Value>, Out<int, Value>, Out<int, Value>, Out<OutKey, Value>>,
35 BinaryTreeReduce(Edge<int, Value> &in, Edge<OutKey, Value> &out, int root = 0, OutKey dest_key = OutKey(),
39 : baseT(edges(fuse(in, inout), inout_l, inout_r), edges(inout, inout_l, inout_r, out), "BinaryTreeReduce",
40 {"in|inout", "inout_l", "inout_r"}, {"inout", "inout_l", "inout_r", "out"}, world, [](int key) { return key; })
56 result = op_(op_(baseT::template get<1, Value &&>(indata), baseT::template get<0, Value &&>(indata)),
60 result = op_(baseT::template get<1, Value &&>(indata), baseT::template get<0, Value &&>(indata));
62 result = op_(baseT::template get<0, Value &&>(indata), baseT::template get<2, Value &&>(indata));
109 class Reduce : public TT<InKey, std::tuple<Out<OutKey, Value>>, Reduce<InKey, Value, Reducer, OutKey>, Value> {
111 using baseT = TT<InKey, std::tuple<Out<OutKey, Value>>, Reduce<InKey, Value, Reducer, OutKey>, Value>;
113 Reduce(Edge<InKey, Value> &in, Edge<OutKey, Value> &out, OutKey dest_key = OutKey(), std::size_t nitems = 1,
119 void op(const InKey &key, baseT::input_values_tuple_type &&indata, std::tuple<Out<OutKey, Value>> &outdata) {
a binary spanning tree of integers in the [0,size) interval
Definition: tree.h:17
std::pair< int, int > child_keys(const int parent_key) const
Definition: tree.h:40
void op(const int &key, typename baseT::input_values_tuple_type &&indata, std::tuple< Out< int, Value >, Out< int, Value >, Out< int, Value >, Out< OutKey, Value >> &outdata)
Definition: reduce.h:47
BinaryTreeReduce(Edge< int, Value > &in, Edge< OutKey, Value > &out, int root=0, OutKey dest_key=OutKey(), BinaryOp op=BinaryOp{}, World world=ttg::default_execution_context(), int max_key=-1, Edge< int, Value > inout=Edge< int, Value >{}, Edge< int, Value > inout_l=Edge< int, Value >{}, Edge< int, Value > inout_r=Edge< int, Value >{})
Definition: reduce.h:35
Definition: terminal.h:429
Definition: world.h:17
Definition: ttg.h:1184
std::tuple_element_t< i, input_terminals_type > * in()
Definition: ttg.h:4205
decltype(keymap) const & get_keymap() const
Definition: ttg.h:4338
TT ttT
Definition: ttg.h:1250
ttg::World get_world() const override final
Definition: ttg.h:1351
std::tuple_element_t< i, std::tuple< Out< int, Value >, Out< int, Value >, Out< int, Value >, Out< OutKey, Value > > > * out()
Definition: ttg.h:4212
auto fuse(const Edge< keyT, valuesT > &...args)
Fuse edges into one This allows receiving one data from either of the combined edges.
Definition: func.h:137
World default_execution_context()
Accesses the default backend's default execution context.
Definition: run.h:68