2
0
mirror of https://github.com/boostorg/random.git synced 2026-02-09 11:22:21 +00:00

Fix inspection failures for the Random library

[SVN r60359]
This commit is contained in:
Steven Watanabe
2010-03-08 17:55:21 +00:00
parent a0be67a5fb
commit ccc442d6c8
20 changed files with 175 additions and 53 deletions

View File

@@ -44,45 +44,45 @@
*/
// own run
bool check(unsigned long x, const boost::mt11213b&) { return x == 3809585648U; }
bool check_(unsigned long x, const boost::mt11213b&) { return x == 3809585648U; }
// validation by experiment from mt19937.c
bool check(unsigned long x, const boost::mt19937&) { return x == 4123659995U; }
bool check_(unsigned long x, const boost::mt19937&) { return x == 4123659995U; }
// validation values from the publications
bool check(int x, const boost::minstd_rand0&) { return x == 1043618065; }
bool check_(int x, const boost::minstd_rand0&) { return x == 1043618065; }
// validation values from the publications
bool check(int x, const boost::minstd_rand&) { return x == 399268537; }
bool check_(int x, const boost::minstd_rand&) { return x == 399268537; }
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
// by experiment from lrand48()
bool check(unsigned long x, const boost::rand48&) { return x == 1993516219; }
bool check_(unsigned long x, const boost::rand48&) { return x == 1993516219; }
#endif
// ????
bool check(unsigned long x, const boost::taus88&) { return x == 3535848941U; }
bool check_(unsigned long x, const boost::taus88&) { return x == 3535848941U; }
// ????
bool check(int x, const boost::ecuyer1988&) { return x == 2060321752; }
bool check_(int x, const boost::ecuyer1988&) { return x == 2060321752; }
// validation by experiment from Harry Erwin's generator.h (private e-mail)
bool check(unsigned int x, const boost::kreutzer1986&) { return x == 139726; }
bool check_(unsigned int x, const boost::kreutzer1986&) { return x == 139726; }
bool check(double x, const boost::lagged_fibonacci607&) { return std::abs(x-0.401269) < 1e-5; }
bool check_(double x, const boost::lagged_fibonacci607&) { return std::abs(x-0.401269) < 1e-5; }
// principal operation validated with CLHEP, values by experiment
bool check(unsigned long x, const boost::ranlux3&) { return x == 5957620; }
bool check(unsigned long x, const boost::ranlux4&) { return x == 8587295; }
bool check_(unsigned long x, const boost::ranlux3&) { return x == 5957620; }
bool check_(unsigned long x, const boost::ranlux4&) { return x == 8587295; }
bool check(float x, const boost::ranlux3_01&)
bool check_(float x, const boost::ranlux3_01&)
{ return std::abs(x-5957620/std::pow(2.0f,24)) < 1e-6; }
bool check(float x, const boost::ranlux4_01&)
bool check_(float x, const boost::ranlux4_01&)
{ return std::abs(x-8587295/std::pow(2.0f,24)) < 1e-6; }
bool check(double x, const boost::ranlux64_3_01&)
bool check_(double x, const boost::ranlux64_3_01&)
{ return std::abs(x-0.838413) < 1e-6; }
bool check(double x, const boost::ranlux64_4_01&)
bool check_(double x, const boost::ranlux64_4_01&)
{ return std::abs(x-0.59839) < 1e-6; }
template<class PRNG>
@@ -94,7 +94,7 @@ void validate(const std::string & name, const PRNG &)
rng();
typename PRNG::result_type val = rng();
// make sure the validation function is a static member
bool result = check(val, rng);
bool result = check_(val, rng);
// allow for a simple eyeball check for MSVC instantiation brokenness
// (if the numbers for all generators are the same, it's obviously broken)