PaGMO  1.1.5
Static Public Member Functions
pagmo::rng_generator Class Reference

Generic thread-safe generator of pseudo-random number generators. More...

#include <rng.h>

Static Public Member Functions

template<class Rng >
static Rng get ()
 Return pseudo-random number generator. More...
 
static void set_seed (int)
 Set seed. More...
 

Detailed Description

Generic thread-safe generator of pseudo-random number generators.

To use, call the static member get() to get a pseudo-random number generator seeded with an initial pseudo-random value.

Implementation internally uses a mutex, so that this generator can be safely called concurrently from multiple threads. The initial seed used is the number of microseconds elapsed since 01/01/1970, cast to uint32_t.

See also
http://www.boost.org/doc/libs/release/libs/random/index.html
Author
Francesco Biscani (blues.nosp@m.carn.nosp@m.i@gma.nosp@m.il.c.nosp@m.om)

Definition at line 138 of file rng.h.

Member Function Documentation

template<class Rng >
template rng_uint32 pagmo::rng_generator::get< rng_uint32 > ( )
static

Return pseudo-random number generator.

Type Rng must be a Boost-like pseudo-random number generator initialisable with a boost::uint32_t. Return value is seeded with an internal static pagmo::rng_uint32.

Returns
pseudo-random number generator seeded with pseudo-random value.

Definition at line 55 of file rng.cpp.

void pagmo::rng_generator::set_seed ( int  n)
static

Set seed.

Set the seed of the internal generator to n. Thread-safe. Note that input integer n will be cast to uint32_t.

Parameters
[in]nseed for the generator of pseudo-random number generators.

Definition at line 47 of file rng.cpp.


The documentation for this class was generated from the following files: