mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-26 06:44:27 +08:00
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:
parent
e741b43668
commit
8d9cfba799
@ -51,7 +51,7 @@ template<typename Scalar> void check_histogram(Scalar x, Scalar y, int bins)
|
|||||||
Scalar r = check_in_range(x,y);
|
Scalar r = check_in_range(x,y);
|
||||||
hist( int((int64(r)-int64(x))/divisor) )++;
|
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)
|
EIGEN_DECLARE_TEST(rand)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user