MCPcopy Create free account
hub / github.com/apache/arrow / CumulativeMean

Class CumulativeMean

cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:91–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89
90template <typename ArgType>
91struct CumulativeMean {
92 using OutType = DoubleType;
93 using ArgValue = typename GetViewType<ArgType>::T;
94 int64_t count = 0;
95 double sum = 0;
96
97 CumulativeMean() = default;
98
99 // start value is ignored for CumulativeMean
100 explicit CumulativeMean(const std::shared_ptr<Scalar> start) {}
101
102 double Call(KernelContext* ctx, ArgValue arg, Status* st) {
103 sum += static_cast<double>(arg);
104 ++count;
105 return sum / count;
106 }
107};
108
109// The driver kernel for all cumulative compute functions.
110// ArgType and OutType are the input and output types, which will

Callers 1

TESTFunction · 0.70

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.56