From 8d9cfba799ce3462c12568a36392e0abf36fc62d Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Thu, 7 Jan 2021 12:45:20 -0800 Subject: 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%). --- test/rand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/rand.cpp') diff --git a/test/rand.cpp b/test/rand.cpp index 1b5c058ab..dd4e73909 100644 --- a/test/rand.cpp +++ b/test/rand.cpp @@ -51,7 +51,7 @@ template 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(f))-1.0).abs()<0.02).all() ); + VERIFY( (((hist.cast()/double(f))-1.0).abs()<0.025).all() ); } EIGEN_DECLARE_TEST(rand) -- cgit v1.2.3