#include <eoUniformInit.h>
Public Member Functions | |
eoUniformInit (T _max=T(1.0), eoRng &_rng=rng) | |
Ctor with only a max bound. | |
eoUniformInit (eoRealBounds &_bound, eoRng &_rng=rng) | |
Ctor with an eoRealBound. | |
eoUniformInit (T _min, T _max, eoRng &_rng=rng) | |
Ctor with explicit min and max. | |
void | operator() (T &_t) |
Generates the number, uses a static_cast to get the right behaviour for ints and unsigneds. | |
template<> | |
void | operator() (bool &_b) |
Private Attributes | |
T | minim |
T | range |
eoRng & | uniform |
It can also be used for ints and unsigneds by virtue of the static_cast
Also present is a specialization for boolean, that will ignore the minima and maxima that are possibly set and will return an unbiased flip of a coin. For a biased flip, use the eoBoolean
either in [0, _max) if only 1 value (_max) is given (or none, as _max defaults to 1.0) or in [_min,_max) if 2 values are given (_min, _max)
Definition at line 62 of file eoUniformInit.h.