Fix rand test for MSVC.

MSVC's uniform random number generator is not quite as uniform as
others, requiring a slightly wider threshold on the histogram test.
After inspecting histograms for several runs, there's no obvious
bias -- just some bins end up having slightly more less elements
(often > 2% but less than 2.5%).
This commit is contained in:
Antonio Sanchez 2021-01-07 12:45:20 -08:00
parent e741b43668
commit 8d9cfba799

View File

@ -51,7 +51,7 @@ template<typename Scalar> void check_histogram(Scalar x, Scalar y, int bins)
Scalar r = check_in_range(x,y);
hist( int((int64(r)-int64(x))/divisor) )++;
}
VERIFY( (((hist.cast<double>()/double(f))-1.0).abs()<0.02).all() );
VERIFY( (((hist.cast<double>()/double(f))-1.0).abs()<0.025).all() );
}
EIGEN_DECLARE_TEST(rand)