boostorg / histogram

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

Fuzzy testing of index and value of regular axis #339

Open HDembinski opened 3 years ago

HDembinski commented 3 years ago

While we cannot avoid round-off error in the index and value methods of the regular axis, we want these two to be exact inverses of each other. In other words, this should succeed for all values of nbin, start, stop.

auto a = regular(nbin, start, stop);
for (int i =0; i < nbin; ++i)
   assert(a.index(a.value(i)) == i);

This needs to verified with fuzzy testing.