13 #ifndef THRILL_API_HYPERLOGLOG_HEADER 14 #define THRILL_API_HYPERLOGLOG_HEADER 26 template <
size_t p,
typename ValueType>
30 static constexpr
bool debug =
false;
36 template <
typename ParentDIA>
38 :
Super(parent.ctx(), label, { parent.id() }, { parent.node() }) {
40 auto pre_op_fn = [
this](
const ValueType& input) {
44 auto lop_chain = parent.stack().push(pre_op_fn).fold();
45 parent.node()->AddChild(
this, lop_chain);
62 template <
typename ValueType,
typename Stack>
67 auto node = tlx::make_counting<HyperLogLogNode<p, ValueType> >(
68 *
this,
"HyperLogLog");
70 auto registers = node->result();
71 return registers.result();
77 #endif // !THRILL_API_HYPERLOGLOG_HEADER HyperLogLogNode(const ParentDIA &parent, const char *label)
net::FlowControlChannel & net
double HyperLogLog() const
Compute the approximate number of distinct elements in the DIA.
const core::HyperLogLogRegisters< p > & result() const final
Returns result of global sum.
const char * label() const
return label() of DIANode subclass as stored by StatsNode
T TLX_ATTRIBUTE_WARN_UNUSED_RESULT AllReduce(const T &value, const BinarySumOp &sum_op=BinarySumOp())
Reduces a value of a serializable type T over all workers given a certain reduce function.
core::HyperLogLogRegisters< p > registers_
static constexpr bool debug
void Execute() final
Executes the sum operation.
Context & context_
associated Context