Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages | Search for

# eoUniformInit< T > Class Template Reference

The class eoUniformInit can be used in the STL apply function to easily randomize floats and doubles. More...

`#include <eoUniformInit.h>`

Inheritance diagram for eoUniformInit< T >:

List of all members.

## 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

## Detailed Description

### template<class T = double>
class eoUniformInit< T >

The class eoUniformInit can be used in the STL apply function to easily randomize floats and doubles.

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.

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

- eoUniformInit.h