be more permissive to address the following failure:
test_weighted_shuffle.cc:36: Failure
The difference between float(w) / total_weight and float(f.front()) /
samples is 0.
010334432125091553, which exceeds epsilon, where
float(w) / total_weight evaluates to 0.
53763443231582642,
float(f.front()) / samples evaluates to 0.
52730000019073486, and
epsilon evaluates to 0.
0099999997764825821
Signed-off-by: Kefu Chai <kchai@redhat.com>
// verify that the probability that the nth choice is selected as the first
// one is the nth weight divided by the sum of all weights
const auto total_weight = std::accumulate(weights.begin(), weights.end(), 0);
- constexpr float epsilon = 0.01;
+ constexpr float epsilon = 0.02;
for (unsigned i = 0; i < choices.size(); i++) {
const auto& f = frequency[choices[i]];
const auto& w = weights[i];