You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple accumulator that just fills a std::vector with the samples passed to it. The user can then run any kind of statistical estimation on the sample. It is a very inefficient accumulator, but sometimes that's acceptable and the flexibility it offers is more important than the performance.
Pseudo-code
// C++17namespacebh= boost::histogram;
auto h = bh::make_histogram(bh::axis::integer(0, 2),
bh::dense_storage<bh::accumulators::Collector<>>());
// fillh(0, 1);
h(0, 2);
h(0, 3);
h(1, 4);
h(1, 5);
for (auto x: h.at(0))
std::cout << x << std::endl;
Prints: 1 2 3
The text was updated successfully, but these errors were encountered:
I think this would be a very nice feature since this is basically a groupby. I have submitted a simple PR. I am using collector instead of Collector for consistency with the other accumulators.
A simple accumulator that just fills a
std::vector
with the samples passed to it. The user can then run any kind of statistical estimation on the sample. It is a very inefficient accumulator, but sometimes that's acceptable and the flexibility it offers is more important than the performance.Pseudo-code
Prints: 1 2 3
The text was updated successfully, but these errors were encountered: