aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/rand.cpp
diff options
context:
space:
mode:
authorGravatar Antonio Sanchez <cantonios@google.com>2021-01-07 12:45:20 -0800
committerGravatar Antonio Sanchez <cantonios@google.com>2021-01-07 12:48:40 -0800
commit8d9cfba799ce3462c12568a36392e0abf36fc62d (patch)
tree787bd55fc8d63ca9839bdcbcd42c0de616db191a /test/rand.cpp
parente741b436684da485a9abd6d46686a0be143296e0 (diff)
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%).
Diffstat (limited to 'test/rand.cpp')
-rw-r--r--test/rand.cpp2
1 files changed, 1 insertions, 1 deletions
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<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)