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++17
namespace bh = boost::histogram;
auto h = bh::make_histogram(bh::axis::integer(0, 2),
bh::dense_storage<bh::accumulators::Collector<>>());
// fill
h(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;
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