yat
0.8.3pre
|
General. More...
#include <yat/random/random.h>
Public Member Functions | |
DiscreteGeneral (const statistics::Histogram &hist) | |
Constructor. | |
DiscreteGeneral (const DiscreteGeneral &) | |
Copy constructor. | |
~DiscreteGeneral (void) | |
Destructor. | |
unsigned long | operator() (void) const |
DiscreteGeneral & | operator= (const DiscreteGeneral &) |
Assignment operator. | |
void | seed (unsigned long s) const |
Set the seed to s. | |
unsigned long | seed_from_devurandom (void) |
Set the seed using the /dev/urandom device. | |
Protected Attributes | |
RNG * | rng_ |
GSL random gererator. |
General.
|
explicit |
Constructor.
hist | is a Histogram defining the probability distribution |
Copy constructor.
|
virtual |
The generated number is an integer and proportinal to the frequency in the corresponding histogram bin. In other words, the probability that 0 is returned is proportinal to the size of the first bin.
Implements theplu::yat::random::Discrete.
DiscreteGeneral& theplu::yat::random::DiscreteGeneral::operator= | ( | const DiscreteGeneral & | ) |
Assignment operator.
|
inherited |
Set the seed to s.
Set the seed to s in the underlying rng. If s is zero, a default value from the rng's original implementation is used (cf. GSL documentation).
|
inherited |
Set the seed using the /dev/urandom device.