boostorg / histogram

Fast multi-dimensional generalized histogram with convenient interface for C++14
Boost Software License 1.0
313 stars 74 forks source link

Division support for weighted_sum #351

Closed HDembinski closed 2 years ago

HDembinski commented 2 years ago

Closes #345

This adds operator/= for weighted_sum, which is automatically picked up by histogram::operator/= and histogram::operator/ if it is implemented in the accumulator. The variance of the result is computed under the assumption that both histograms contain uncorrelated data.

This will not give the correct answer for efficiencies, where the numerator is a subset of the denominator. We will implement special efficiency accumulators (see #178) for this task.

HDembinski commented 2 years ago

@henryiii I cannot select you as reviewer, but let me know if you have any thoughts on this.

henryiii commented 2 years ago

Seems reasonable and looks good. You can only add "members" of a repo as reviews, but that's fine, tagging me as you did actually is a little better about notifying me than adding me as a reviewer anyway. This will be an easy addition to boost-histogram. "special efficiency accumulators" will be a bit more work to add to boost-histogram, but sounds very useful.

HDembinski commented 2 years ago

You can only add "members" of a repo as reviews

Not sure why you felt the need to explain that.

henryiii commented 2 years ago

Just because it's a GitHub limitation that I find slightly annoying - there are occasionally perfectly valid reasons to request someone who is not a member, like if you implement support for some library and you want the library's author to review it. In this case, though, tagging is ideal anyway.

And you know it but it is useful for completeness for anyone reading this in the future.

henryiii commented 2 years ago

I'll sync up boost-histogram and add this as soon as it's in master.

henryiii commented 2 years ago

(Ideally ping me when that happens! :) )