12 #ifndef THRILL_API_SUM_HEADER 13 #define THRILL_API_SUM_HEADER 21 template <
typename ValueType,
typename Stack>
22 template <
typename SumFunction>
32 "SumFunction has the wrong input type");
38 "SumFunction has the wrong input type");
44 "SumFunction has the wrong input type");
46 auto node = tlx::make_counting<SumNode>(
52 return node->result();
55 template <
typename ValueType,
typename Stack>
56 template <
typename SumFunction>
58 const SumFunction& sum_function,
const ValueType& initial_value)
const {
67 "SumFunction has the wrong input type");
73 "SumFunction has the wrong input type");
79 "SumFunction has the wrong input type");
81 auto node = tlx::make_counting<SumNode>(
82 *
this,
"Sum", initial_value,
true,
87 return node->result();
90 template <
typename ValueType,
typename Stack>
91 template <
typename SumFunction>
93 const SumFunction& sum_function,
const ValueType& initial_value)
const {
102 "SumFunction has the wrong input type");
108 "SumFunction has the wrong input type");
114 "SumFunction has the wrong input type");
116 auto node = tlx::make_counting<SumNode>(
117 *
this,
"Sum", initial_value,
true,
126 #endif // !THRILL_API_SUM_HEADER
common::FunctionTraits< Function > FunctionTraits
alias for convenience.
The return type class for all ActionFutures.
Future< ValueType > SumFuture(const SumFunction &sum_function=SumFunction(), const ValueType &initial_value=ValueType()) const
Sum is an ActionFuture, which computes the sum of all elements globally.
ValueType Sum(const SumFunction &sum_function=SumFunction()) const
Sum is an Action, which computes the sum of all elements globally.