#include <random_generator.h>
Public Member Functions | |
virtual unsigned int | generate (unsigned int limit)=0 |
Return a random number in the given range (note that not all the RNG can handle a given limit). | |
virtual double | generate01 ()=0 |
Return a random number in the [0,1) real interval. | |
virtual double | generate01closed ()=0 |
Returns a random number in the [0,1] real interval. | |
virtual double | generate01open ()=0 |
Generates a random number in the (0,1) real interval. | |
virtual void | initialize (unsigned int seed)=0 |
(Re-)initialize with a given seed. | |
RandomGenerator () | |
virtual | ~RandomGenerator () |
Common interface for random generation (with uniform distribution).
Two RNGs are available: Subtractive Ring and an improved Marsenne-Twister.
Definition at line 37 of file random_generator.h.
vcg::math::RandomGenerator::RandomGenerator | ( | ) | [inline] |
Definition at line 43 of file random_generator.h.
virtual vcg::math::RandomGenerator::~RandomGenerator | ( | ) | [inline, virtual] |
Definition at line 45 of file random_generator.h.
virtual unsigned int vcg::math::RandomGenerator::generate | ( | unsigned int | limit | ) | [pure virtual] |
Return a random number in the given range (note that not all the RNG can handle a given limit).
Implemented in vcg::math::SubtractiveRingRNG, and vcg::math::MarsenneTwisterRNG.
virtual double vcg::math::RandomGenerator::generate01 | ( | ) | [pure virtual] |
Return a random number in the [0,1) real interval.
Implemented in vcg::math::SubtractiveRingRNG, and vcg::math::MarsenneTwisterRNG.
virtual double vcg::math::RandomGenerator::generate01closed | ( | ) | [pure virtual] |
Returns a random number in the [0,1] real interval.
Implemented in vcg::math::SubtractiveRingRNG, and vcg::math::MarsenneTwisterRNG.
virtual double vcg::math::RandomGenerator::generate01open | ( | ) | [pure virtual] |
Generates a random number in the (0,1) real interval.
Implemented in vcg::math::SubtractiveRingRNG, and vcg::math::MarsenneTwisterRNG.
virtual void vcg::math::RandomGenerator::initialize | ( | unsigned int | seed | ) | [pure virtual] |
(Re-)initialize with a given seed.
Implemented in vcg::math::SubtractiveRingRNG, and vcg::math::MarsenneTwisterRNG.