Template for linear congruential generators. More...
#include <random.hpp>
Public Member Functions | |
void | seed (unsigned int _s) |
Set the current seed. | |
LinearCongruentialGenerator (unsigned int _s=1) | |
Construct the generator instance. | |
unsigned int | seed (void) const |
Return current seed. | |
unsigned int | operator() (unsigned int n) |
Returns a random integer from the interval [0..n) | |
size_t | size (void) const |
Report size occupied. |
Template for linear congruential generators.
This class template defines a simple class for linear congruential generators.
Gecode::Support::LinearCongruentialGenerator::LinearCongruentialGenerator | ( | unsigned int | _s = 1 | ) | [inline] |
Construct the generator instance.
Definition at line 88 of file random.hpp.
void Gecode::Support::LinearCongruentialGenerator::seed | ( | unsigned int | _s | ) | [inline] |
Set the current seed.
Definition at line 81 of file random.hpp.
unsigned int Gecode::Support::LinearCongruentialGenerator::seed | ( | void | ) | const [inline] |
Return current seed.
Definition at line 93 of file random.hpp.
unsigned int Gecode::Support::LinearCongruentialGenerator::operator() | ( | unsigned int | n | ) | [inline] |
Returns a random integer from the interval [0..n)
Definition at line 98 of file random.hpp.
size_t Gecode::Support::LinearCongruentialGenerator::size | ( | void | ) | const [inline] |
Report size occupied.
Definition at line 108 of file random.hpp.