-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Description
I would like an empty(coverage) function or method for histograms, something like this:
bh::empty(hist, bh::coverage::all);
// OR
hist. empty(bh::coverage::all);It could look something like this:
template<class histogram_t>
bool empty(const histogram_t &h, bh::coverage cov) {
using value_type = typename histogram_t::value_type;
value_type zero = value_type();
for(auto&& ind : bh::indexed(h, cov)) {
if(*ind != zero) {
return false;
}
}
return true;
}This should be faster than sum if the histogram is filled, and would be useful for checking to see if an item fell into the histogram (inner), or for checking to see if this was filled yet (all).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels