|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69912 - in trunk: boost/random boost/random/detail libs/random/test
From: steven_at_[hidden]
Date: 2011-03-12 23:49:54
Author: steven_watanabe
Date: 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
New Revision: 69912
URL: http://svn.boost.org/trac/boost/changeset/69912
Log:
Make seeding more consistent and add some tests to lock down the algorithms.
Text files modified:
trunk/boost/random/additive_combine.hpp | 6
trunk/boost/random/detail/const_mod.hpp | 8 +
trunk/boost/random/detail/seed_impl.hpp | 226 +++++++++++++++++++++++++++++++++------
trunk/boost/random/discard_block.hpp | 6
trunk/boost/random/independent_bits.hpp | 37 ------
trunk/boost/random/inversive_congruential.hpp | 12 -
trunk/boost/random/lagged_fibonacci.hpp | 62 ++--------
trunk/boost/random/linear_congruential.hpp | 12 -
trunk/boost/random/linear_feedback_shift.hpp | 6
trunk/boost/random/mersenne_twister.hpp | 14 +
trunk/boost/random/shuffle_order.hpp | 6
trunk/boost/random/subtract_with_carry.hpp | 57 ++-------
trunk/boost/random/xor_combine.hpp | 4
trunk/libs/random/test/test_ecuyer1988.cpp | 7 +
trunk/libs/random/test/test_generator.ipp | 32 +++++
trunk/libs/random/test/test_hellekalek1995.cpp | 7 +
trunk/libs/random/test/test_independent_bits31.cpp | 7 +
trunk/libs/random/test/test_independent_bits32.cpp | 7 +
trunk/libs/random/test/test_knuth_b.cpp | 7 +
trunk/libs/random/test/test_kreutzer1986.cpp | 7 +
trunk/libs/random/test/test_lagged_fibonacci.cpp | 7 +
trunk/libs/random/test/test_lagged_fibonacci1279.cpp | 9 +
trunk/libs/random/test/test_lagged_fibonacci19937.cpp | 9 +
trunk/libs/random/test/test_lagged_fibonacci2281.cpp | 9 +
trunk/libs/random/test/test_lagged_fibonacci23209.cpp | 9 +
trunk/libs/random/test/test_lagged_fibonacci3217.cpp | 9 +
trunk/libs/random/test/test_lagged_fibonacci4423.cpp | 9 +
trunk/libs/random/test/test_lagged_fibonacci44497.cpp | 9 +
trunk/libs/random/test/test_lagged_fibonacci607.cpp | 9 +
trunk/libs/random/test/test_lagged_fibonacci9689.cpp | 9 +
trunk/libs/random/test/test_linear_feedback_shift.cpp | 9 +
trunk/libs/random/test/test_minstd_rand.cpp | 7 +
trunk/libs/random/test/test_minstd_rand0.cpp | 7 +
trunk/libs/random/test/test_mt11213b.cpp | 7 +
trunk/libs/random/test/test_mt19937.cpp | 7 +
trunk/libs/random/test/test_mt19937_64.cpp | 7 +
trunk/libs/random/test/test_rand48.cpp | 7 +
trunk/libs/random/test/test_ranlux24.cpp | 7 +
trunk/libs/random/test/test_ranlux24_base.cpp | 7 +
trunk/libs/random/test/test_ranlux3.cpp | 7 +
trunk/libs/random/test/test_ranlux3_01.cpp | 7 +
trunk/libs/random/test/test_ranlux4.cpp | 7 +
trunk/libs/random/test/test_ranlux48.cpp | 7 +
trunk/libs/random/test/test_ranlux48_base.cpp | 7 +
trunk/libs/random/test/test_ranlux4_01.cpp | 7 +
trunk/libs/random/test/test_ranlux64_3.cpp | 7 +
trunk/libs/random/test/test_ranlux64_3_01.cpp | 9 +
trunk/libs/random/test/test_ranlux64_4.cpp | 7 +
trunk/libs/random/test/test_ranlux64_4_01.cpp | 9 +
trunk/libs/random/test/test_taus88.cpp | 7 +
50 files changed, 543 insertions(+), 221 deletions(-)
Modified: trunk/boost/random/additive_combine.hpp
==============================================================================
--- trunk/boost/random/additive_combine.hpp (original)
+++ trunk/boost/random/additive_combine.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -193,11 +193,7 @@
/** Fills a range with random values */
template<class Iter>
void generate(Iter first, Iter last)
- {
- for(; first != last; ++first) {
- *first = (*this)();
- }
- }
+ { detail::generate_from_int(*this, first, last); }
#ifndef BOOST_NO_LONG_LONG
/** Advances the state of the generator by @c z. */
Modified: trunk/boost/random/detail/const_mod.hpp
==============================================================================
--- trunk/boost/random/detail/const_mod.hpp (original)
+++ trunk/boost/random/detail/const_mod.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -39,6 +39,14 @@
class const_mod
{
public:
+ static IntType apply(IntType x)
+ {
+ if(((unsigned_m() - 1) & unsigned_m()) == 0)
+ return (unsigned_type(x)) & (unsigned_m() - 1);
+ else
+ return x % m;
+ }
+
static IntType add(IntType x, IntType c)
{
if(((unsigned_m() - 1) & unsigned_m()) == 0)
Modified: trunk/boost/random/detail/seed_impl.hpp
==============================================================================
--- trunk/boost/random/detail/seed_impl.hpp (original)
+++ trunk/boost/random/detail/seed_impl.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,50 +13,58 @@
#ifndef BOOST_RANDOM_DETAIL_SEED_IMPL_HPP
#define BOOST_RANDOM_DETAIL_SEED_IMPL_HPP
+#include <stdexcept>
#include <boost/cstdint.hpp>
+#include <boost/config/no_tr1/cmath.hpp>
#include <boost/integer/integer_mask.hpp>
#include <boost/integer/static_log2.hpp>
#include <boost/type_traits/is_signed.hpp>
+#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/make_unsigned.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/int.hpp>
#include <boost/random/detail/const_mod.hpp>
+#include <boost/random/detail/integer_log2.hpp>
#include <boost/random/detail/signed_unsigned_tools.hpp>
namespace boost {
namespace random {
namespace detail {
-template<class Engine, int Bits, class Iter>
+template<class Engine, class Iter>
void generate_from_real(Engine& eng, Iter begin, Iter end)
{
+ using std::ldexp;
typedef typename Engine::result_type RealType;
+ const int Bits = Engine::precision();
int remaining_bits = 0;
- boost::uint32_t saved_bits;
+ boost::uint_least32_t saved_bits = 0;
+ RealType multiplier = ldexp(RealType(1), Bits);
RealType mult32 = 4294967296.0; // 2^32
- for(; begin != end; ++begin) {
- RealType val = eng();
+ while(true) {
+ RealType val = eng() * multiplier;
int available_bits = Bits;
if(available_bits < 32 - remaining_bits) {
- saved_bits |= boost::uint32_t(val * mult32) >> remaining_bits;
- remaining_bits += available_bits;
+ saved_bits |= boost::uint_least32_t(val) << remaining_bits;
+ remaining_bits += Bits;
} else {
if(remaining_bits != 0) {
- val *= boost::uint32_t(1) << (32 - remaining_bits);
- boost::uint32_t extra_bits = boost::uint32_t(val);
- val -= extra_bits;
- *begin++ = saved_bits | extra_bits;
- if(begin == end) break;
+ boost::uint_least32_t extra_bits = boost::uint_least32_t(val) & ((boost::uint_least32_t(1) << (32 - remaining_bits)) - 1);
+ val = ldexp(val, -(32 - remaining_bits));
+ *begin++ = saved_bits | (extra_bits << remaining_bits);
+ if(begin == end) return;
available_bits -= 32 - remaining_bits;
remaining_bits = 0;
}
for(; available_bits >= 32; available_bits -= 32) {
- val *= mult32;
- boost::uint32_t word = boost::uint32_t(val);
- val -= word;
+ boost::uint_least32_t word = boost::uint_least32_t(val);
+ val /= mult32;
*begin++ = word;
- if(begin == end) break;
+ if(begin == end) return;
}
remaining_bits = available_bits;
- saved_bits = boost::uint32_t(val * mult32);
+ saved_bits = static_cast<boost::uint_least32_t>(val);
}
}
}
@@ -67,60 +75,110 @@
typedef typename Engine::result_type IntType;
typedef typename boost::make_unsigned<IntType>::type unsigned_type;
int remaining_bits = 0;
- boost::uint32_t saved_bits;
+ boost::uint_least32_t saved_bits = 0;
unsigned_type range = boost::random::detail::subtract<IntType>()((eng.max)(), (eng.min)());
- int bits = 0;
- unsigned_type mask = 0;
- for(; bits < std::numeric_limits<unsigned_type>::digits; ++bits)
+
+ int bits =
+ (range == (std::numeric_limits<unsigned_type>::max)()) ?
+ std::numeric_limits<unsigned_type>::digits :
+ detail::integer_log2(range + 1);
+
{
- unsigned_type test = mask | (unsigned_type(1) << bits);
- if(test <= range) {
- mask = test;
- } else {
- break;
+ int discarded_bits = detail::integer_log2(static_cast<unsigned_type>(bits));
+ unsigned_type excess = (range + 1) >> (bits - discarded_bits);
+ if(excess != 0) {
+ int extra_bits = detail::integer_log2((excess - 1) ^ excess);
+ bits = bits - discarded_bits + extra_bits;
}
}
- for(; begin != end; ++begin) {
+
+ unsigned_type mask = (static_cast<unsigned_type>(2) << (bits - 1)) - 1;
+ unsigned_type limit = ((range + 1) & ~mask) - 1;
+
+ while(true) {
unsigned_type val;
do {
val = boost::random::detail::subtract<IntType>()(eng(), (eng.min)());
- } while(val > mask);
+ } while(val > limit);
+ val &= mask;
int available_bits = bits;
if(available_bits < 32 - remaining_bits) {
- saved_bits |= boost::uint32_t(val) << remaining_bits;
+ saved_bits |= boost::uint_least32_t(val) << remaining_bits;
remaining_bits += bits;
} else {
if(remaining_bits != 0) {
- boost::uint32_t extra_bits = boost::uint32_t(val) & ((boost::uint32_t(1) << (32 - remaining_bits)) - 1);
+ boost::uint_least32_t extra_bits = boost::uint_least32_t(val) & ((boost::uint_least32_t(1) << (32 - remaining_bits)) - 1);
val >>= 32 - remaining_bits;
*begin++ = saved_bits | (extra_bits << remaining_bits);
- if(begin == end) break;
+ if(begin == end) return;
available_bits -= 32 - remaining_bits;
remaining_bits = 0;
}
for(; available_bits >= 32; available_bits -= 32) {
- boost::uint32_t word = boost::uint32_t(val);
+ boost::uint_least32_t word = boost::uint_least32_t(val);
val >>= 32;
*begin++ = word;
- if(begin == end) break;
+ if(begin == end) return;
}
remaining_bits = available_bits;
- saved_bits = static_cast<boost::uint32_t>(val);
+ saved_bits = static_cast<boost::uint_least32_t>(val);
}
}
}
+template<class Engine, class Iter>
+void generate_impl(Engine& eng, Iter first, Iter last, boost::mpl::true_)
+{
+ return detail::generate_from_int(eng, first, last);
+}
+
+template<class Engine, class Iter>
+void generate_impl(Engine& eng, Iter first, Iter last, boost::mpl::false_)
+{
+ return detail::generate_from_real(eng, first, last);
+}
+
+template<class Engine, class Iter>
+void generate(Engine& eng, Iter first, Iter last)
+{
+ return detail::generate_impl(eng, first, last, boost::is_integral<typename Engine::result_type>());
+}
+
+
+
template<class IntType, IntType m, class SeedSeq>
IntType seed_one_int(SeedSeq& seq)
{
- static const int log = ::boost::static_log2<m>::value;
+ static const int log = ::boost::mpl::if_c<(m == 0),
+ ::boost::mpl::int_<(::std::numeric_limits<IntType>::digits)>,
+ ::boost::static_log2<m> >::type::value;
static const int k =
- (log + ((~(static_cast<IntType>(1) << log) & m)? 32 : 31)) / 32;
- boost::uint_least32_t array[log / 32 + 4];
+ (log + ((~(static_cast<IntType>(2) << (log - 1)) & m)? 32 : 31)) / 32;
+ ::boost::uint_least32_t array[log / 32 + 4];
seq.generate(&array[0], &array[0] + k + 3);
IntType s = 0;
for(int j = 0; j < k; ++j) {
- IntType digit = IntType(array[j+3]) % m;
+ IntType digit = const_mod<IntType, m>::apply(IntType(array[j+3]));
+ IntType mult = IntType(1) << 32*j;
+ s = const_mod<IntType, m>::mult_add(mult, digit, s);
+ }
+ return s;
+}
+
+template<class IntType, IntType m, class Iter>
+IntType get_one_int(Iter& first, Iter last)
+{
+ static const int log = ::boost::mpl::if_c<(m == 0),
+ ::boost::mpl::int_<(::std::numeric_limits<IntType>::digits)>,
+ ::boost::static_log2<m> >::type::value;
+ static const int k =
+ (log + ((~(static_cast<IntType>(2) << (log - 1)) & m)? 32 : 31)) / 32;
+ IntType s = 0;
+ for(int j = 0; j < k; ++j) {
+ if(first == last) {
+ throw ::std::invalid_argument("Not enough elements in call to seed.");
+ }
+ IntType digit = const_mod<IntType, m>::apply(IntType(*first++));
IntType mult = IntType(1) << 32*j;
s = const_mod<IntType, m>::mult_add(mult, digit, s);
}
@@ -161,6 +219,100 @@
seed_array_int_impl<w>(seq, x, boost::is_signed<IntType>());
}
+template<int w, std::size_t n, class Iter, class UIntType>
+void fill_array_int_impl(Iter& first, Iter last, UIntType (&x)[n])
+{
+ for(std::size_t j = 0; j < n; j++) {
+ UIntType val = 0;
+ for(std::size_t k = 0; k < (w+31)/32; ++k) {
+ if(first == last) {
+ throw std::invalid_argument("Not enough elements in call to seed.");
+ }
+ val += static_cast<UIntType>(*first++) << 32*k;
+ }
+ x[j] = val & ::boost::low_bits_mask_t<w>::sig_bits;
+ }
+}
+
+template<int w, std::size_t n, class Iter, class IntType>
+inline void fill_array_int_impl(Iter& first, Iter last, IntType (&x)[n], boost::mpl::true_)
+{
+ typedef typename boost::make_unsigned<IntType>::type unsigned_array[n];
+ fill_array_int_impl<w>(first, last, reinterpret_cast<unsigned_array&>(x));
+}
+
+template<int w, std::size_t n, class Iter, class IntType>
+inline void fill_array_int_impl(Iter& first, Iter last, IntType (&x)[n], boost::mpl::false_)
+{
+ fill_array_int_impl<w>(first, last, x);
+}
+
+template<int w, std::size_t n, class Iter, class IntType>
+inline void fill_array_int(Iter& first, Iter last, IntType (&x)[n])
+{
+ fill_array_int_impl<w>(first, last, x, boost::is_signed<IntType>());
+}
+
+template<int w, std::size_t n, class RealType>
+void seed_array_real_impl(const boost::uint_least32_t* storage, RealType (&x)[n])
+{
+ using std::pow;
+ boost::uint_least32_t mask = ~((~boost::uint_least32_t(0)) << (w%32));
+ RealType two32 = 4294967296.0;
+ const RealType divisor = pow(RealType(2), -w);
+ unsigned int j;
+ for(j = 0; j < n; ++j) {
+ RealType val = RealType(0);
+ RealType mult = divisor;
+ for(int k = 0; k < w/32; ++k) {
+ val += *storage++ * mult;
+ mult *= two32;
+ }
+ if(mask != 0) {
+ val += (*storage++ & mask) * mult;
+ }
+ BOOST_ASSERT(val >= 0);
+ BOOST_ASSERT(val < 1);
+ x[j] = val;
+ }
+}
+
+template<int w, std::size_t n, class SeedSeq, class RealType>
+void seed_array_real(SeedSeq& seq, RealType (&x)[n])
+{
+ using std::pow;
+ boost::uint_least32_t storage[((w+31)/32) * n];
+ seq.generate(&storage[0], &storage[0] + ((w+31)/32) * n);
+ seed_array_real_impl<w>(storage, x);
+}
+
+template<int w, std::size_t n, class Iter, class RealType>
+void fill_array_real(Iter& first, Iter last, RealType (&x)[n])
+{
+ using std::pow;
+ boost::uint_least32_t mask = ~((~boost::uint_least32_t(0)) << (w%32));
+ RealType two32 = 4294967296.0;
+ const RealType divisor = pow(RealType(2), -w);
+ unsigned int j;
+ for(j = 0; j < n; ++j) {
+ RealType val = RealType(0);
+ RealType mult = divisor;
+ for(int k = 0; k < w/32; ++k, ++first) {
+ if(first == last) throw std::invalid_argument("Not enough elements in call to seed.");
+ val += *first * mult;
+ mult *= two32;
+ }
+ if(mask != 0) {
+ if(first == last) throw std::invalid_argument("Not enough elements in call to seed.");
+ val += (*first & mask) * mult;
+ ++first;
+ }
+ BOOST_ASSERT(val >= 0);
+ BOOST_ASSERT(val < 1);
+ x[j] = val;
+ }
+}
+
}
}
}
Modified: trunk/boost/random/discard_block.hpp
==============================================================================
--- trunk/boost/random/discard_block.hpp (original)
+++ trunk/boost/random/discard_block.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -124,11 +124,7 @@
template<class It>
void generate(It first, It last)
- {
- for(; first != last; ++first) {
- *first = (*this)();
- }
- }
+ { detail::generate(*this, first, last); }
/**
* Returns the smallest value that the generator can produce.
Modified: trunk/boost/random/independent_bits.hpp
==============================================================================
--- trunk/boost/random/independent_bits.hpp (original)
+++ trunk/boost/random/independent_bits.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -20,9 +20,9 @@
#include <boost/limits.hpp>
#include <boost/config.hpp>
#include <boost/integer/integer_mask.hpp>
-#include <boost/pending/integer_log2.hpp>
#include <boost/type_traits/make_unsigned.hpp>
#include <boost/random/detail/config.hpp>
+#include <boost/random/detail/integer_log2.hpp>
#include <boost/random/detail/operators.hpp>
#include <boost/random/detail/seed.hpp>
#include <boost/random/detail/seed_impl.hpp>
@@ -31,41 +31,6 @@
namespace boost {
namespace random {
-namespace detail {
-
-template<int Shift>
-struct integer_log2_impl
-{
- template<class T>
- static int apply(T t, int accum)
- {
- int update = ((t >> Shift) != 0) * Shift;
- return integer_log2_impl<Shift / 2>::apply(t >> update, accum + update);
- }
-};
-
-template<>
-struct integer_log2_impl<1>
-{
- template<class T>
- static int apply(T t, int accum)
- {
- return int(t >> 1) + accum;
- }
-};
-
-template<class T>
-inline int integer_log2(T t)
-{
- return integer_log2_impl<
- ::boost::detail::max_pow2_less<
- ::std::numeric_limits<T>::digits, 4
- >::value
- >::apply(t, 0);
-}
-
-}
-
/**
* An instantiation of class template @c independent_bits_engine
* model a \pseudo_random_number_generator. It generates random
Modified: trunk/boost/random/inversive_congruential.hpp
==============================================================================
--- trunk/boost/random/inversive_congruential.hpp (original)
+++ trunk/boost/random/inversive_congruential.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -153,11 +153,7 @@
* @c first and @c last must be input iterators.
*/
template<class It> void seed(It& first, It last)
- {
- if(first == last)
- throw std::invalid_argument("inversive_congruential::seed");
- seed(*first++);
- }
+ { seed(detail::get_one_int<IntType, modulus>(first, last)); }
/** Returns the next output of the generator. */
IntType operator()()
@@ -170,11 +166,7 @@
/** Fills a range with random values */
template<class Iter>
void generate(Iter first, Iter last)
- {
- for(; first != last; ++first) {
- *first = (*this)();
- }
- }
+ { detail::generate_from_int(*this, first, last); }
#ifndef BOOST_NO_LONG_LONG
/** Advances the state of the generator by @c z. */
Modified: trunk/boost/random/lagged_fibonacci.hpp
==============================================================================
--- trunk/boost/random/lagged_fibonacci.hpp (original)
+++ trunk/boost/random/lagged_fibonacci.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -30,6 +30,7 @@
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/seed.hpp>
#include <boost/random/detail/operators.hpp>
+#include <boost/random/detail/generator_seed_seq.hpp>
namespace boost {
namespace random {
@@ -87,10 +88,9 @@
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(lagged_fibonacci_engine,
uint32_t, value)
{
- minstd_rand0 gen(value);
- for(unsigned int j = 0; j < long_lag; ++j)
- x[j] = gen() & low_bits_mask_t<w>::sig_bits;
- i = long_lag;
+ minstd_rand0 intgen(value);
+ detail::generator_seed_seq<minstd_rand0> gen(intgen);
+ seed(gen);
}
/**
@@ -98,10 +98,8 @@
*/
BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(lagged_fibonacci_engine, SeedSeq, seq)
{
- boost::uint32_t temp[long_lag];
- seq.generate(&temp[0], &temp[0] + long_lag);
- boost::uint32_t* iter = temp;
- seed(iter, iter + long_lag);
+ detail::seed_array_int<w>(seq, x);
+ i = long_lag;
}
/**
@@ -112,13 +110,8 @@
template<class It>
void seed(It& first, It last)
{
- // word size could be smaller than the seed values
- unsigned int j;
- for(j = 0; j < long_lag && first != last; ++j, ++first)
- x[j] = *first & low_bits_mask_t<w>::sig_bits;
+ detail::fill_array_int<w>(first, last, x);
i = long_lag;
- if(first == last && j < long_lag)
- throw std::invalid_argument("lagged_fibonacci::seed");
}
/** Returns the next value of the generator. */
@@ -132,11 +125,7 @@
/** Fills a range with random values */
template<class Iter>
void generate(Iter first, Iter last)
- {
- for(; first != last; ++first) {
- *first = (*this)();
- }
- }
+ { detail::generate_from_int(*this, first, last); }
#ifndef BOOST_NO_LONG_LONG
/** Advances the state of the generator by @c z. */
@@ -300,10 +289,8 @@
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(lagged_fibonacci_01_engine, uint32_t, value)
{
minstd_rand0 intgen(value);
- uniform_01<RealType> dist;
- for(unsigned j = 0; j < long_lag; ++j)
- x[j] = dist(intgen);
- i = long_lag;
+ detail::generator_seed_seq<minstd_rand0> gen(intgen);
+ seed(gen);
}
/**
@@ -312,11 +299,7 @@
*/
BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(lagged_fibonacci_01_engine, SeedSeq, seq)
{
- static const int words = (w+31)/32 * long_lag;
- boost::uint32_t buffer[words];
- seq.generate(&buffer[0], &buffer[0] + words);
- boost::uint32_t* iter = buffer;
- seed(iter, iter + words);
+ detail::seed_array_real<w>(seq, x);
i = long_lag;
}
@@ -328,23 +311,8 @@
template<class It>
void seed(It& first, It last)
{
- using std::fmod;
- using std::pow;
- unsigned long mask = ~((~0u) << (w%32)); // now lowest w bits set
- RealType two32 = pow(RealType(2), 32);
- unsigned int j;
- for(j = 0; j < long_lag && first != last; ++j) {
- x[j] = RealType(0);
- for(int k = 0; k < w/32 && first != last; ++k, ++first)
- x[j] += *first / pow(two32,k+1);
- if(first != last && mask != 0) {
- x[j] += fmod((*first & mask) / modulus(), RealType(1));
- ++first;
- }
- }
+ detail::fill_array_real<w>(first, last, x);
i = long_lag;
- if(first == last && j < long_lag)
- throw std::invalid_argument("lagged_fibonacci_01::seed");
}
/** Returns the smallest value that the generator can produce. */
@@ -373,11 +341,7 @@
/** Fills a range with random values */
template<class Iter>
void generate(Iter first, Iter last)
- {
- for(; first != last; ++first) {
- *first = static_cast<boost::uint32_t>((*this)() * modulus());
- }
- }
+ { return detail::generate_from_real(*this, first, last); }
#ifndef BOOST_NO_LONG_LONG
/** Advances the state of the generator by @c z. */
Modified: trunk/boost/random/linear_congruential.hpp
==============================================================================
--- trunk/boost/random/linear_congruential.hpp (original)
+++ trunk/boost/random/linear_congruential.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -159,11 +159,7 @@
*/
template<class It>
void seed(It& first, It last)
- {
- if(first == last)
- throw std::invalid_argument("linear_congruential::seed");
- seed(*first++);
- }
+ { seed(detail::get_one_int<IntType, m>(first, last)); }
/**
* Returns the smallest value that the @c linear_congruential_engine
@@ -188,11 +184,7 @@
/** Fills a range with random values */
template<class Iter>
void generate(Iter first, Iter last)
- {
- for(; first != last; ++first) {
- *first = (*this)();
- }
- }
+ { detail::generate_from_int(*this, first, last); }
#ifndef BOOST_NO_LONG_LONG
/** Advances the state of the generator by @c z. */
Modified: trunk/boost/random/linear_feedback_shift.hpp
==============================================================================
--- trunk/boost/random/linear_feedback_shift.hpp (original)
+++ trunk/boost/random/linear_feedback_shift.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -101,7 +101,7 @@
*/
BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(linear_feedback_shift_engine,
SeedSeq, seq)
- { seed(detail::seed_one_int<UIntType, low_bits_mask_t<w>::sig_bits>(seq)); }
+ { seed(detail::seed_one_int<UIntType, (UIntType(2) << (w - 1))>(seq)); }
/**
* Seeds a @c linear_feedback_shift_engine with values
@@ -109,9 +109,7 @@
*/
template<class It> void seed(It& first, It last)
{
- if(first == last)
- throw std::invalid_argument("linear_feedback_shift::seed");
- seed(*first++);
+ seed(detail::get_one_int<UIntType, (UIntType(2) << (w - 1))>(first, last));
}
/** Returns the next value of the generator. */
Modified: trunk/boost/random/mersenne_twister.hpp
==============================================================================
--- trunk/boost/random/mersenne_twister.hpp (original)
+++ trunk/boost/random/mersenne_twister.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -170,12 +170,16 @@
template<class It>
void seed(It& first, It last)
{
- std::size_t j;
- for(j = 0; j < n && first != last; ++j, ++first)
- x[j] = *first;
+ detail::fill_array_int<w>(first, last, x);
i = n;
- if(first == last && j < n)
- throw std::invalid_argument("mersenne_twister_engine::seed");
+
+ // fix up the state if it's all zeroes.
+ if((x[0] & (~static_cast<UIntType>(0) << r)) == 0) {
+ for(std::size_t j = 1; i < n; ++j) {
+ if(x[j] != 0) return;
+ }
+ x[0] = static_cast<UIntType>(1) << (w-1);
+ }
}
/** Returns the smallest value that the generator can produce. */
Modified: trunk/boost/random/shuffle_order.hpp
==============================================================================
--- trunk/boost/random/shuffle_order.hpp (original)
+++ trunk/boost/random/shuffle_order.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -192,11 +192,7 @@
/** Fills a range with pseudo-random values. */
template<class Iter>
void generate(Iter first, Iter last)
- {
- for(; first != last; ++first) {
- *first = (*this)();
- }
- }
+ { detail::generate_from_int(*this, first, last); }
/** Returns the smallest value that the generator can produce. */
static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
Modified: trunk/boost/random/subtract_with_carry.hpp
==============================================================================
--- trunk/boost/random/subtract_with_carry.hpp (original)
+++ trunk/boost/random/subtract_with_carry.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -101,8 +101,10 @@
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(subtract_with_carry_engine,
uint32_t, value)
{
- linear_congruential_engine<int32_t,40014,0,2147483563> intgen(value);
- seed(intgen);
+ typedef linear_congruential_engine<uint32_t,40014,0,2147483563> gen_t;
+ gen_t intgen(value);
+ detail::generator_seed_seq<gen_t> gen(intgen);
+ seed(gen);
}
/** Seeds the generator with values produced by @c seq.generate(). */
@@ -122,11 +124,7 @@
template<class It>
void seed(It& first, It last)
{
- unsigned int j;
- for(j = 0; j < long_lag && first != last; ++j, ++first)
- x[j] = *first % modulus;
- if(first == last && j < long_lag)
- throw std::invalid_argument("subtract_with_carry::seed");
+ detail::fill_array_int<w>(first, last, x);
carry = (x[long_lag-1] == 0);
k = 0;
}
@@ -181,11 +179,7 @@
/** Fills a range with random values. */
template<class It>
void generate(It first, It last)
- {
- for(; first != last; ++first) {
- *first = (*this)();
- }
- }
+ { detail::generate_from_int(*this, first, last); }
/** Writes a @c subtract_with_carry_engine to a @c std::ostream. */
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, subtract_with_carry_engine, f)
@@ -338,7 +332,9 @@
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(subtract_with_carry_01_engine,
uint32_t, value)
{
- random::linear_congruential<int32_t, 40014, 0, 2147483563, 0> gen(value);
+ typedef linear_congruential_engine<uint32_t, 40014, 0, 2147483563> gen_t;
+ gen_t intgen(value);
+ detail::generator_seed_seq<gen_t> gen(intgen);
seed(gen);
}
@@ -346,12 +342,9 @@
BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(subtract_with_carry_01_engine,
SeedSeq, seq)
{
- uint32_t array[(w+31)/32 * long_lag];
-
- seq.generate(&array[0], &array[0] + sizeof(array)/sizeof(array[0]));
-
- uint32_t* start = &array[0];
- seed(start, &array[0] + sizeof(array)/sizeof(array[0]));
+ detail::seed_array_real<w>(seq, x);
+ carry = (x[long_lag-1] ? 0 : 1 / _modulus);
+ k = 0;
}
/**
@@ -363,25 +356,7 @@
template<class It>
void seed(It& first, It last)
{
-#ifndef BOOST_NO_STDC_NAMESPACE
- // allow for Koenig lookup
- using std::fmod;
- using std::pow;
-#endif
- uint32_t mask = ~((~0u) << (w%32)); // now lowest (w%32) bits set
- RealType two32 = pow(RealType(2), 32);
- std::size_t j;
- for(j = 0; j < long_lag && first != last; ++j) {
- x[j] = RealType(0);
- for(std::size_t i = 0; i < w/32 && first != last; ++i, ++first)
- x[j] += *first / pow(two32,RealType(i+1));
- if(first != last && mask != 0) {
- x[j] += fmod((*first & mask) / _modulus, RealType(1));
- ++first;
- }
- }
- if(first == last && j < long_lag)
- throw std::invalid_argument("subtract_with_carry_01::seed");
+ detail::fill_array_real<w>(first, last, x);
carry = (x[long_lag-1] ? 0 : 1 / _modulus);
k = 0;
}
@@ -437,11 +412,7 @@
/** Fills a range with random values. */
template<class Iter>
void generate(Iter first, Iter last)
- {
- for(; first != last; ++first) {
- *first = (*this)();
- }
- }
+ { detail::generate_from_real(*this, first, last); }
/** Writes a \subtract_with_carry_01_engine to a @c std::ostream. */
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, subtract_with_carry_01_engine, f)
Modified: trunk/boost/random/xor_combine.hpp
==============================================================================
--- trunk/boost/random/xor_combine.hpp (original)
+++ trunk/boost/random/xor_combine.hpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -59,6 +59,10 @@
/**
* Constructs a @c xor_combine_engine, seeding both base generators
* with @c v.
+ *
+ * @xmlwarning
+ * The exact algorithm used by this function may change in the future.
+ * @endxmlwarning
*/
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(xor_combine_engine,
result_type, v)
Modified: trunk/libs/random/test/test_ecuyer1988.cpp
==============================================================================
--- trunk/libs/random/test/test_ecuyer1988.cpp (original)
+++ trunk/libs/random/test/test_ecuyer1988.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/additive_combine.hpp>
#define BOOST_RANDOM_URNG boost::random::ecuyer1988
+
+#define BOOST_RANDOM_SEED_WORDS 2
+
#define BOOST_RANDOM_VALIDATION_VALUE 2060321752
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1416886025
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 776923198
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x7AE0C087U, 0x948A8A31U, 0xBE5CCBA9U, 0x1316692CU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_generator.ipp
==============================================================================
--- trunk/libs/random/test/test_generator.ipp (original)
+++ trunk/libs/random/test/test_generator.ipp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -95,6 +95,7 @@
BOOST_CHECK(it != v.begin());
std::iterator_traits<std::vector<int>::const_iterator>::difference_type n_words = (it - v.begin());
BOOST_CHECK_GT(n_words, 0);
+ BOOST_CHECK_EQUAL(n_words, BOOST_RANDOM_SEED_WORDS);
it = v.begin();
BOOST_RANDOM_URNG urng2;
@@ -211,3 +212,34 @@
BOOST_CHECK_EQUAL(urng(), BOOST_RANDOM_VALIDATION_VALUE);
}
+BOOST_AUTO_TEST_CASE(validate_seed_seq)
+{
+ boost::random::seed_seq seed;
+ BOOST_RANDOM_URNG urng(seed);
+ for(int i = 0; i < 9999; ++i) {
+ urng();
+ }
+ BOOST_CHECK_EQUAL(urng(), BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE);
+}
+
+BOOST_AUTO_TEST_CASE(validate_iter)
+{
+ const std::vector<int> v((std::max)(std::size_t(9999u), sizeof(BOOST_RANDOM_URNG) / 4), 0x41);
+ std::vector<int>::const_iterator it = v.begin();
+ std::vector<int>::const_iterator it_end = v.end();
+ BOOST_RANDOM_URNG urng(it, it_end);
+ for(int i = 0; i < 9999; ++i) {
+ urng();
+ }
+ BOOST_CHECK_EQUAL(urng(), BOOST_RANDOM_ITERATOR_VALIDATION_VALUE);
+}
+
+BOOST_AUTO_TEST_CASE(test_generate)
+{
+ BOOST_RANDOM_URNG urng;
+ boost::uint32_t expected[] = BOOST_RANDOM_GENERATE_VALUES;
+ static const std::size_t N = sizeof(expected)/sizeof(expected[0]);
+ boost::uint32_t actual[N];
+ urng.generate(&actual[0], &actual[0] + N);
+ BOOST_CHECK_EQUAL_COLLECTIONS(actual, actual + N, expected, expected + N);
+}
Modified: trunk/libs/random/test/test_hellekalek1995.cpp
==============================================================================
--- trunk/libs/random/test/test_hellekalek1995.cpp (original)
+++ trunk/libs/random/test/test_hellekalek1995.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/inversive_congruential.hpp>
#define BOOST_RANDOM_URNG boost::random::hellekalek1995
+
+#define BOOST_RANDOM_SEED_WORDS 1
+
#define BOOST_RANDOM_VALIDATION_VALUE 1187812169
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1081665111
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 618743552
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x5642A47BU, 0x1F6987E8U, 0xD35860E7U, 0xC8C661ABU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_independent_bits31.cpp
==============================================================================
--- trunk/libs/random/test/test_independent_bits31.cpp (original)
+++ trunk/libs/random/test/test_independent_bits31.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -14,6 +14,13 @@
typedef boost::random::independent_bits_engine<boost::random::minstd_rand0, 31, boost::uint32_t> independent_bits31;
#define BOOST_RANDOM_URNG independent_bits31
+
+#define BOOST_RANDOM_SEED_WORDS 1
+
#define BOOST_RANDOM_VALIDATION_VALUE 26292962
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1147343739
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 1399154219
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xC1A63AF0U, 0xD66C0614U, 0xADE076B1U, 0xC1DAE13FU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_independent_bits32.cpp
==============================================================================
--- trunk/libs/random/test/test_independent_bits32.cpp (original)
+++ trunk/libs/random/test/test_independent_bits32.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -14,6 +14,13 @@
typedef boost::random::independent_bits_engine<boost::random::mt19937, 32, boost::uint32_t> independent_bits32;
#define BOOST_RANDOM_URNG independent_bits32
+
+#define BOOST_RANDOM_SEED_WORDS 624
+
#define BOOST_RANDOM_VALIDATION_VALUE 4123659995U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 3107690757
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 3408548740
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xD091BB5CU, 0x22AE9EF6U, 0xE7E1FAEEU, 0xD5C31F79U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_knuth_b.cpp
==============================================================================
--- trunk/libs/random/test/test_knuth_b.cpp (original)
+++ trunk/libs/random/test/test_knuth_b.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <boost/cstdint.hpp>
#define BOOST_RANDOM_URNG boost::random::knuth_b
+
+#define BOOST_RANDOM_SEED_WORDS 1
+
// validation from the C++0x draft (n3090)
#define BOOST_RANDOM_VALIDATION_VALUE 1112339016
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 160100893
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 1692601883
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x5D189C63U, 0xD0544F0EU, 0x15B0E78FU, 0xD814D654U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_kreutzer1986.cpp
==============================================================================
--- trunk/libs/random/test/test_kreutzer1986.cpp (original)
+++ trunk/libs/random/test/test_kreutzer1986.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <boost/cstdint.hpp>
#define BOOST_RANDOM_URNG boost::random::kreutzer1986
+
+#define BOOST_RANDOM_SEED_WORDS 1
+
// validation by experiment from Harry Erwin's generator.h (private e-mail)
#define BOOST_RANDOM_VALIDATION_VALUE 139726
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 227233
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 163138
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x3EADAB08U, 0x85E481CEU, 0xCF84AEA5U, 0x39D4395BU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,6 +13,13 @@
typedef boost::random::lagged_fibonacci_engine<boost::uint32_t, 24, 607, 273> lagged_fibonacci;
#define BOOST_RANDOM_URNG lagged_fibonacci
+
+#define BOOST_RANDOM_SEED_WORDS 607
+
#define BOOST_RANDOM_VALIDATION_VALUE 3543833
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 7852929
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 4372778
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xF61A5094U, 0xFC4BA046U, 0xF1C41E92U, 0x3D82FE61U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci1279.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci1279.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci1279.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/lagged_fibonacci.hpp>
#define BOOST_RANDOM_URNG boost::random::lagged_fibonacci1279
-#define BOOST_RANDOM_VALIDATION_VALUE 0.56576990947654049
+
+#define BOOST_RANDOM_SEED_WORDS 1279*2
+
+#define BOOST_RANDOM_VALIDATION_VALUE 0.39647253381274083
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 0.37536953918742455
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 0.56042480761195179
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x4D102C47U, 0xC4E610D7U, 0xF29333BEU, 0x6E45EBE7U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci19937.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci19937.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci19937.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/lagged_fibonacci.hpp>
#define BOOST_RANDOM_URNG boost::random::lagged_fibonacci19937
-#define BOOST_RANDOM_VALIDATION_VALUE 0.21779661133680173
+
+#define BOOST_RANDOM_SEED_WORDS 19937*2
+
+#define BOOST_RANDOM_VALIDATION_VALUE 0.24396310480293693
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 0.48319870930434661
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 0.0029754638678802792
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x5CE9850CU, 0xAA20067BU, 0x4E48643BU, 0xA4A59F4BU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci2281.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci2281.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci2281.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/lagged_fibonacci.hpp>
#define BOOST_RANDOM_URNG boost::random::lagged_fibonacci2281
-#define BOOST_RANDOM_VALIDATION_VALUE 0.85870032418398168
+
+#define BOOST_RANDOM_SEED_WORDS 2281*2
+
+#define BOOST_RANDOM_VALIDATION_VALUE 0.91955231927349246
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 0.58796187519502041
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 0.087280273457821522
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x7EB0882AU, 0xCE09BE60U, 0xD53046CFU, 0x93257E41U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci23209.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci23209.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci23209.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/lagged_fibonacci.hpp>
#define BOOST_RANDOM_URNG boost::random::lagged_fibonacci23209
-#define BOOST_RANDOM_VALIDATION_VALUE 0.98718042717052668
+
+#define BOOST_RANDOM_SEED_WORDS 23209*2
+
+#define BOOST_RANDOM_VALIDATION_VALUE 0.086299988971202168
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 0.59787206924233871
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 0.0019836425785868528
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x4301DE0AU, 0xAD2584E3U, 0x7C28463CU, 0x74848542U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci3217.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci3217.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci3217.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/lagged_fibonacci.hpp>
#define BOOST_RANDOM_URNG boost::random::lagged_fibonacci3217
-#define BOOST_RANDOM_VALIDATION_VALUE 0.29923216793615537
+
+#define BOOST_RANDOM_SEED_WORDS 3217*2
+
+#define BOOST_RANDOM_VALIDATION_VALUE 0.54223093970093927
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 0.51719299526538975
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 0.1805114746514036
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x4938F127U, 0x86C65CFEU, 0x65356579U, 0xA6CDC325U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci4423.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci4423.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci4423.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/lagged_fibonacci.hpp>
#define BOOST_RANDOM_URNG boost::random::lagged_fibonacci4423
-#define BOOST_RANDOM_VALIDATION_VALUE 0.39798595467394815
+
+#define BOOST_RANDOM_SEED_WORDS 4423*2
+
+#define BOOST_RANDOM_VALIDATION_VALUE 0.23188533286820601
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 0.51262293730517783
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 0.012893676760814543
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x6D4DBAFU, 0x8039C1A9U, 0x3DA53D58U, 0x95155BE5U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci44497.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci44497.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci44497.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/lagged_fibonacci.hpp>
#define BOOST_RANDOM_URNG boost::random::lagged_fibonacci44497
-#define BOOST_RANDOM_VALIDATION_VALUE 0.86191789886161496
+
+#define BOOST_RANDOM_SEED_WORDS 44497*2
+
+#define BOOST_RANDOM_VALIDATION_VALUE 0.12519369894159738
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 0.63574754742431594
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 0.0019836425785868528
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x6A2DCEA9U, 0x4668EFB4U, 0x711E352FU, 0xA963C43BU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci607.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci607.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci607.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/lagged_fibonacci.hpp>
#define BOOST_RANDOM_URNG boost::random::lagged_fibonacci607
-#define BOOST_RANDOM_VALIDATION_VALUE 0.40126853196520074
+
+#define BOOST_RANDOM_SEED_WORDS 607*2
+
+#define BOOST_RANDOM_VALIDATION_VALUE 0.039230772001715764
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 0.73011070026216984
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 0.72330291632639643
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x78EB0905U, 0x61766547U, 0xCB507F64U, 0x94FA3EC0U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_lagged_fibonacci9689.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci9689.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci9689.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/lagged_fibonacci.hpp>
#define BOOST_RANDOM_URNG boost::random::lagged_fibonacci9689
-#define BOOST_RANDOM_VALIDATION_VALUE 0.22728966337376244
+
+#define BOOST_RANDOM_SEED_WORDS 9689*2
+
+#define BOOST_RANDOM_VALIDATION_VALUE 0.059230573043926427
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 0.84199156986666068
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 0.0039672851571737056
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x32EF18BEU, 0x79277C11U, 0xA383438U, 0x32155952U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_linear_feedback_shift.cpp
==============================================================================
--- trunk/libs/random/test/test_linear_feedback_shift.cpp (original)
+++ trunk/libs/random/test/test_linear_feedback_shift.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,6 +13,13 @@
typedef boost::random::linear_feedback_shift_engine<boost::uint32_t, 32, 31, 13, 12> linear_feedback_shift;
#define BOOST_RANDOM_URNG linear_feedback_shift
-#define BOOST_RANDOM_VALIDATION_VALUE 981440277
+
+#define BOOST_RANDOM_SEED_WORDS 1
+
+#define BOOST_RANDOM_VALIDATION_VALUE 981440277U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 554836316U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 3112279337U
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x154005U, 0x54005502U, 0x5502BD4U, 0x2BD4005U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_minstd_rand.cpp
==============================================================================
--- trunk/libs/random/test/test_minstd_rand.cpp (original)
+++ trunk/libs/random/test/test_minstd_rand.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <boost/cstdint.hpp>
#define BOOST_RANDOM_URNG boost::random::minstd_rand
+
+#define BOOST_RANDOM_SEED_WORDS 1
+
// validation values from the publications
#define BOOST_RANDOM_VALIDATION_VALUE 399268537
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 2096435890
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 182651141
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x8400BC8EU, 0xF45B895FU, 0x145F0F91U, 0xE5F8F088U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_minstd_rand0.cpp
==============================================================================
--- trunk/libs/random/test/test_minstd_rand0.cpp (original)
+++ trunk/libs/random/test/test_minstd_rand0.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <boost/cstdint.hpp>
#define BOOST_RANDOM_URNG boost::random::minstd_rand0
+
+#define BOOST_RANDOM_SEED_WORDS 1
+
// validation values from the publications
#define BOOST_RANDOM_VALIDATION_VALUE 1043618065
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 849515105
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 1263181168
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xC00041A6U, 0xCD8358EBU, 0x430A4B7AU, 0x31B781ADU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_mt11213b.cpp
==============================================================================
--- trunk/libs/random/test/test_mt11213b.cpp (original)
+++ trunk/libs/random/test/test_mt11213b.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/mersenne_twister.hpp>
#define BOOST_RANDOM_URNG boost::random::mt11213b
+
+#define BOOST_RANDOM_SEED_WORDS 351
+
#define BOOST_RANDOM_VALIDATION_VALUE 3809585648U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 770080327U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 2434563197U
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xEF3F3F3FU, 0x70082175U, 0xDAF6EAF5U, 0x2A16A63EU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_mt19937.cpp
==============================================================================
--- trunk/libs/random/test/test_mt19937.cpp (original)
+++ trunk/libs/random/test/test_mt19937.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,7 +12,14 @@
#include <boost/random/mersenne_twister.hpp>
#define BOOST_RANDOM_URNG boost::random::mt19937
+
+#define BOOST_RANDOM_SEED_WORDS 624
+
// validation by experiment from mt19937.c
#define BOOST_RANDOM_VALIDATION_VALUE 4123659995U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 3107690757U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 3408548740U
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xD091BB5CU, 0x22AE9EF6U, 0xE7E1FAEEU, 0xD5C31F79U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_mt19937_64.cpp
==============================================================================
--- trunk/libs/random/test/test_mt19937_64.cpp (original)
+++ trunk/libs/random/test/test_mt19937_64.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <boost/cstdint.hpp>
#define BOOST_RANDOM_URNG boost::random::mt19937_64
+
+#define BOOST_RANDOM_SEED_WORDS 624
+
// validation from the C++0x draft (n3090)
#define BOOST_RANDOM_VALIDATION_VALUE UINT64_C(9981545732273789042)
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(10059787671936601387)
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(13543700832025962283)
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xF6F6AEA6U, 0xC96D191CU, 0x8BC80F1CU, 0x401F7AC7U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_rand48.cpp
==============================================================================
--- trunk/libs/random/test/test_rand48.cpp (original)
+++ trunk/libs/random/test/test_rand48.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,8 +13,15 @@
#include <boost/cstdint.hpp>
#define BOOST_RANDOM_URNG boost::random::rand48
+
+#define BOOST_RANDOM_SEED_WORDS 2
+
// by experiment from lrand48()
#define BOOST_RANDOM_VALIDATION_VALUE 1993516219
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1127873718U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 839037874U
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x55424A4U, 0x3A2CCEF5U, 0x6ADB4A65U, 0x2B019719U }
// rand48 uses non-standard seeding
template<class Converted, class T>
Modified: trunk/libs/random/test/test_ranlux24.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux24.cpp (original)
+++ trunk/libs/random/test/test_ranlux24.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <cmath>
#define BOOST_RANDOM_URNG boost::random::ranlux24
+
+#define BOOST_RANDOM_SEED_WORDS 24
+
// validation from the C++0x draft (n3090)
#define BOOST_RANDOM_VALIDATION_VALUE 9901578
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 4870344
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 3888733
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux24_base.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux24_base.cpp (original)
+++ trunk/libs/random/test/test_ranlux24_base.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,7 +12,14 @@
#include <boost/random/ranlux.hpp>
#define BOOST_RANDOM_URNG boost::random::ranlux24_base
+
+#define BOOST_RANDOM_SEED_WORDS 24
+
// validation from the C++0x draft (n3126).
#define BOOST_RANDOM_VALIDATION_VALUE 7937952
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 836370
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 7739608
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux3.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux3.cpp (original)
+++ trunk/libs/random/test/test_ranlux3.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,7 +12,14 @@
#include <boost/random/ranlux.hpp>
#define BOOST_RANDOM_URNG boost::random::ranlux3
+
+#define BOOST_RANDOM_SEED_WORDS 24
+
// principal operation validated with CLHEP, values by experiment
#define BOOST_RANDOM_VALIDATION_VALUE 5957620
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1848500
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 11620328
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux3_01.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux3_01.cpp (original)
+++ trunk/libs/random/test/test_ranlux3_01.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <cmath>
#define BOOST_RANDOM_URNG boost::random::ranlux3_01
+
+#define BOOST_RANDOM_SEED_WORDS 24
+
// principal operation validated with CLHEP, values by experiment
#define BOOST_RANDOM_VALIDATION_VALUE 5957620/std::pow(2.0f,24)
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1848500/std::pow(2.0f,24)
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 11620328/std::pow(2.0f,24)
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux4.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux4.cpp (original)
+++ trunk/libs/random/test/test_ranlux4.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,7 +12,14 @@
#include <boost/random/ranlux.hpp>
#define BOOST_RANDOM_URNG boost::random::ranlux4
+
+#define BOOST_RANDOM_SEED_WORDS 24
+
// principal operation validated with CLHEP, values by experiment
#define BOOST_RANDOM_VALIDATION_VALUE 8587295
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 6375782
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 4515722
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux48.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux48.cpp (original)
+++ trunk/libs/random/test/test_ranlux48.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <boost/cstdint.hpp>
#define BOOST_RANDOM_URNG boost::random::ranlux48
+
+#define BOOST_RANDOM_SEED_WORDS 24
+
// validation from the C++0x draft (n3090)
#define BOOST_RANDOM_VALIDATION_VALUE UINT64_C(249142670248501)
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(93216637457044)
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(154356577406237)
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xFCE57B2CU, 0xF2DF1555U, 0x1A0C0CD9U, 0x490109FAU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux48_base.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux48_base.cpp (original)
+++ trunk/libs/random/test/test_ranlux48_base.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <boost/cstdint.hpp>
#define BOOST_RANDOM_URNG boost::random::ranlux48_base
+
+#define BOOST_RANDOM_SEED_WORDS 24
+
// validation from the C++0x draft (n3126).
#define BOOST_RANDOM_VALIDATION_VALUE UINT64_C(61839128582725)
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(107228250000854)
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(172853405006548)
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xFCE57B2CU, 0xF2DF1555U, 0x1A0C0CD9U, 0x490109FAU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux4_01.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux4_01.cpp (original)
+++ trunk/libs/random/test/test_ranlux4_01.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <cmath>
#define BOOST_RANDOM_URNG boost::random::ranlux4_01
+
+#define BOOST_RANDOM_SEED_WORDS 24
+
// principal operation validated with CLHEP, values by experiment
#define BOOST_RANDOM_VALIDATION_VALUE 8587295/std::pow(2.0f,24)
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 6375782/std::pow(2.0f,24)
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 4515722/std::pow(2.0f,24)
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux64_3.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux64_3.cpp (original)
+++ trunk/libs/random/test/test_ranlux64_3.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -14,7 +14,14 @@
#include <cmath>
#define BOOST_RANDOM_URNG boost::random::ranlux64_3
+
+#define BOOST_RANDOM_SEED_WORDS 48
+
// principal operation validated with CLHEP, values by experiment
#define BOOST_RANDOM_VALIDATION_VALUE INT64_C(141789170949364)
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(97179253367494)
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(101724473226966)
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xC35F616BU, 0xDC3C4DF1U, 0xF3F90D0AU, 0x206F9C9EU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux64_3_01.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux64_3_01.cpp (original)
+++ trunk/libs/random/test/test_ranlux64_3_01.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <cmath>
#define BOOST_RANDOM_URNG boost::random::ranlux64_3_01
+
+#define BOOST_RANDOM_SEED_WORDS 48
+
// principal operation validated with CLHEP, values by experiment
-#define BOOST_RANDOM_VALIDATION_VALUE 0.83841253976454766
+#define BOOST_RANDOM_VALIDATION_VALUE INT64_C(141789170949364)/std::pow(2.0, 48)
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(97179253367494)/std::pow(2.0, 48)
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(101724473226966)/std::pow(2.0, 48)
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xC35F616BU, 0xDC3C4DF1U, 0xF3F90D0AU, 0x206F9C9EU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux64_4.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux64_4.cpp (original)
+++ trunk/libs/random/test/test_ranlux64_4.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -14,7 +14,14 @@
#include <cmath>
#define BOOST_RANDOM_URNG boost::random::ranlux64_4
+
+#define BOOST_RANDOM_SEED_WORDS 48
+
// principal operation validated with CLHEP, values by experiment
#define BOOST_RANDOM_VALIDATION_VALUE INT64_C(199461971133682)
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(63570328604787)
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(40074210927900)
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xC35F616BU, 0xDC3C4DF1U, 0xF3F90D0AU, 0x206F9C9EU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_ranlux64_4_01.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux64_4_01.cpp (original)
+++ trunk/libs/random/test/test_ranlux64_4_01.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -13,7 +13,14 @@
#include <cmath>
#define BOOST_RANDOM_URNG boost::random::ranlux64_4_01
+
+#define BOOST_RANDOM_SEED_WORDS 48
+
// principal operation validated with CLHEP, values by experiment
-#define BOOST_RANDOM_VALIDATION_VALUE 0.59838973302498744
+#define BOOST_RANDOM_VALIDATION_VALUE INT64_C(199461971133682)/std::pow(2.0, 48)
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(63570328604787)/std::pow(2.0, 48)
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(40074210927900)/std::pow(2.0, 48)
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0xC35F616BU, 0xDC3C4DF1U, 0xF3F90D0AU, 0x206F9C9EU }
#include "test_generator.ipp"
Modified: trunk/libs/random/test/test_taus88.cpp
==============================================================================
--- trunk/libs/random/test/test_taus88.cpp (original)
+++ trunk/libs/random/test/test_taus88.cpp 2011-03-12 23:49:34 EST (Sat, 12 Mar 2011)
@@ -12,6 +12,13 @@
#include <boost/random/taus88.hpp>
#define BOOST_RANDOM_URNG boost::random::taus88
+
+#define BOOST_RANDOM_SEED_WORDS 3
+
#define BOOST_RANDOM_VALIDATION_VALUE 3535848941U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 2005586065U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 3762466828U
+
+#define BOOST_RANDOM_GENERATE_VALUES { 0x2B55504U, 0x5403F102U, 0xED45297EU, 0x6B84007U }
#include "test_generator.ipp"
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk