namespace alps { template <class RNG> void seed_with_sequence(RNG& rng, uint32_t seed); template <class T=double> class BufferedRandomNumberGeneratorBase { public: typedef T result_type; BufferedRandomNumberGeneratorBase(std::size_t b=10240); inline T operator()(); virtual void seed(uint32_t) = 0; virtual void seed() =0; }; template <class RNG> class BufferedRandomNumberGeneratorAdaptor : public BufferedRandomNumberGeneratorBase<typename RNG::result_type> { public: typedef typename RNG::result_type result_type; BufferedRandomNumberGeneratorAdaptor(RNG&& rng); template <class IT> void seed(IT start, IT end); void seed(uint32_t); void seed(); }; template <class RNG> class BufferedRandomNumberGenerator : public BufferedRandomNumberGeneratorAdaptor<typename RNG::result_type> { public: typedef typename RNG::result_type result_type; BufferedRandomNumberGenerator(); BufferedRandomNumberGenerator(const RNG& r); }; }
seeds a random number generator following the Boost library proposed for the next version of the C++ standard library with a unique sequence, initialized from the given seed using a Pseudo-DES generator. This allows generic seeding of all conforming random number generators.template <class RNG> void seed_with_sequence(RNG& rng, uint32_t seed);
is the type of random numbers generatedtypedef T result_type;
the buffer size is passed to the constructor.BufferedRandomNumberGeneratorBase(std::size_t b=10240);
returns the next random number.inline T operator()();
seeds the generator with an integer seed.virtual void seed(uint32_t) = 0;
seeds the generator with the default seed.virtual void seed() =0;
is the type of random numbers generated, taken from the base generator.typedef typename RNG::result_type result_type;
The constructor takes the base generator as argument.BufferedRandomNumberGeneratorAdaptor(RNG& rng);
returns the next random number.inline T operator()();
seeds the generator with an integer seed, using the function seed_with_sequencevirtual void seed(uint32_t);
seeds the generator with the default seed.virtual void seed();
seeds the generator from a buffer given by a pair if iterators, following the new Boost random number generator concepts proposed for the next revision of the C++ standard.template <class IT> void seed(IT start, IT end);
seeds the generator with its default seed.BufferedRandomNumberGenerator();
seeds the generator with a copy of the argument.BufferedRandomNumberGenerator(const RNG& rng);
copyright (c) 1994-2010 by Matthias Troyer
Distributed under the Boost Software License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt)