Random number generator.
More...
#include <rnd.hpp>
Random number generator.
Definition at line 46 of file rnd.hpp.
◆ Rnd() [1/3]
Gecode::Rnd::Rnd |
( |
void |
| ) |
|
Default constructor that does not initialize the generator.
Definition at line 64 of file rnd.cpp.
◆ Rnd() [2/3]
Gecode::Rnd::Rnd |
( |
const Rnd & |
r | ) |
|
Initialize from generator r.
Definition at line 68 of file rnd.cpp.
◆ ~Rnd()
Gecode::Rnd::~Rnd |
( |
void |
| ) |
|
Destructor.
Definition at line 75 of file rnd.cpp.
◆ Rnd() [3/3]
Gecode::Rnd::Rnd |
( |
unsigned int |
s | ) |
|
Initialize with seed s.
Definition at line 65 of file rnd.cpp.
◆ operator=()
Rnd & Gecode::Rnd::operator= |
( |
const Rnd & |
r | ) |
|
Assignment operator.
Definition at line 71 of file rnd.cpp.
◆ seed() [1/2]
void Gecode::Rnd::seed |
( |
unsigned int |
s | ) |
|
Set the current seed to s (initializes if needed)
Definition at line 78 of file rnd.cpp.
◆ time()
void Gecode::Rnd::time |
( |
void |
| ) |
|
Set current seed based on time (initializes if needed)
Definition at line 82 of file rnd.cpp.
◆ hw()
void Gecode::Rnd::hw |
( |
void |
| ) |
|
Set current seed to hardware-based random number (initializes if needed)
Definition at line 86 of file rnd.cpp.
◆ seed() [2/2]
unsigned int Gecode::Rnd::seed |
( |
void |
| ) |
const |
|
inline |
Return current seed.
Definition at line 97 of file rnd.hpp.
◆ operator()()
unsigned int Gecode::Rnd::operator() |
( |
unsigned int |
n | ) |
|
|
inline |
Return a random integer from the interval [0..n)
Definition at line 102 of file rnd.hpp.
◆ initialized()
bool Gecode::Rnd::initialized |
( |
void |
| ) |
const |
|
inline |
Test whether generator has been properly initialized.
Definition at line 107 of file rnd.hpp.
The documentation for this class was generated from the following files: