|
NEST
2.6.0,not_revisioned_source_dir@0
|
Abstract base class for all random generator objects. More...
#include <randomgen.h>
Public Member Functions | |
| RandomGen () | |
| virtual | ~RandomGen () |
| double | drand (void) |
| The following functions implement the user interface of the RandomGen class, including buffer management. More... | |
| double | operator() (void) |
| draw from [0, 1) More... | |
| double | drandpos (void) |
| draw from (0, 1) More... | |
| unsigned long | ulrand (const unsigned long) |
| draw from [0, n-1] More... | |
| void | seed (const unsigned long) |
| set random seed to a new value More... | |
| size_t | get_buffsize (void) const |
| returns buffer size More... | |
| void | set_buffsize (const size_t) |
| set buffer size More... | |
| virtual RngPtr | clone (const unsigned long)=0 |
| clone a random number generator of same type initialized with given seed More... | |
Static Public Member Functions | |
| static RngPtr | create_knuthlfg_rng (unsigned long) |
| Create built-in Knuth Lagged Fibonacci random generator. More... | |
Static Public Attributes | |
| static const unsigned long | DefaultSeed = 0xd37ca59fUL |
| Default value for seeding generators in places where no seed is supplied. More... | |
Protected Member Functions | |
| virtual void | seed_ (unsigned long)=0 |
| The following functions provide the interface to the actual random generator. More... | |
| virtual double | drand_ ()=0 |
| drawing interface More... | |
Private Member Functions | |
| void | refill_ () |
| refill buffer More... | |
| RandomGen (const RandomGen &) | |
Private Attributes | |
| std::vector< double > | buffer_ |
| random number buffer More... | |
| std::vector< double > ::const_iterator | next_ |
| next number to return More... | |
| std::vector< double > ::const_iterator | end_ |
| == buffer_.end() More... | |
Static Private Attributes | |
| static const size_t | DEFAULT_BUFFSIZE = 128 * 1024 |
Abstract base class for all random generator objects.
Class RandomGen is the top of the random generator object hierarchy. It defines the interface to random generators:
| librandom::RandomGen::RandomGen | ( | ) |
References DEFAULT_BUFFSIZE, and set_buffsize().
|
inlinevirtual |
|
private |
|
pure virtual |
clone a random number generator of same type initialized with given seed
Implemented in librandom::MT19937, librandom::KnuthLFG, and librandom::GslRandomGen.
|
static |
Create built-in Knuth Lagged Fibonacci random generator.
This function is provided so that RNGs can be created in places where the SLI rngdict is not accessible.
Referenced by nest::mip_generator::Parameters_::Parameters_(), and nest::Scheduler::prepare_nodes().
|
inline |
The following functions implement the user interface of the RandomGen class, including buffer management.
The actual interface to the underlying random generator is provided by protected member functions below.draw from [0, 1)
References end_, next_, and refill_().
Referenced by drandpos(), librandom::LognormalRandomDev::operator()(), librandom::NormalRandomDev::operator()(), operator()(), ulrand(), and librandom::GammaRandomDev::unscaled_gamma().
|
protectedpure virtual |
drawing interface
Implemented in librandom::MT19937, librandom::KnuthLFG, and librandom::GslRandomGen.
|
inline |
|
inline |
returns buffer size
References buffer_.
|
inline |
draw from [0, 1)
References drand().
|
private |
refill buffer
Referenced by drand().
| void librandom::RandomGen::seed | ( | const unsigned long | n | ) |
set random seed to a new value
|
protectedpure virtual |
The following functions provide the interface to the actual random generator.
They must be implemented by each derived generator class.seeding interface
Implemented in librandom::MT19937, librandom::KnuthLFG, and librandom::GslRandomGen.
| void librandom::RandomGen::set_buffsize | ( | const size_t | buffsize | ) |
|
inline |
draw from [0, n-1]
References drand().
|
private |
random number buffer
Referenced by get_buffsize().
|
staticprivate |
Referenced by RandomGen().
|
static |
Default value for seeding generators in places where no seed is supplied.
Referenced by main(), and nest::Scheduler::prepare_nodes().
|
private |
== buffer_.end()
Referenced by drand().
|
private |
next number to return
Referenced by drand().
1.8.7