Random number generator.
More...
#include <rnd.hpp>
List of all members.
Public Member Functions |
| | Rnd (void) |
| | Default constructor that does not initialize the generator.
|
| | Rnd (const Rnd &r) |
| | Initialize from generator r.
|
| Rnd & | operator= (const Rnd &r) |
| | Assignment operator.
|
| | ~Rnd (void) |
| | Destructor.
|
| | Rnd (unsigned int s) |
| | Initialize with seed s.
|
| void | seed (unsigned int s) |
| | Set the current seed to s (initializes if needed).
|
| void | time (void) |
| | Set current seed based on time (initializes if needed).
|
| void | hw (void) |
| | Set current seed to hardware-based random number (initializes if needed).
|
| unsigned int | seed (void) const |
| | Return current seed.
|
| unsigned int | operator() (unsigned int n) |
| | Return a random integer from the interval [0..n).
|
Detailed Description
Random number generator.
Definition at line 42 of file rnd.hpp.
Constructor & Destructor Documentation
| Gecode::Rnd::Rnd |
( |
void |
|
) |
|
Default constructor that does not initialize the generator.
Definition at line 57 of file rnd.cpp.
| Gecode::Rnd::Rnd |
( |
const Rnd & |
r |
) |
|
Initialize from generator r.
Definition at line 61 of file rnd.cpp.
| Gecode::Rnd::~Rnd |
( |
void |
|
) |
|
Destructor.
Definition at line 68 of file rnd.cpp.
| Gecode::Rnd::Rnd |
( |
unsigned int |
s |
) |
|
Initialize with seed s.
Definition at line 58 of file rnd.cpp.
Member Function Documentation
| Rnd & Gecode::Rnd::operator= |
( |
const Rnd & |
r |
) |
|
Assignment operator.
Definition at line 64 of file rnd.cpp.
| void Gecode::Rnd::seed |
( |
unsigned int |
s |
) |
|
Set the current seed to s (initializes if needed).
Definition at line 71 of file rnd.cpp.
| void Gecode::Rnd::time |
( |
void |
|
) |
|
Set current seed based on time (initializes if needed).
Definition at line 75 of file rnd.cpp.
| void Gecode::Rnd::hw |
( |
void |
|
) |
|
Set current seed to hardware-based random number (initializes if needed).
Definition at line 79 of file rnd.cpp.
| unsigned int Gecode::Rnd::seed |
( |
void |
|
) |
const [inline] |
Return current seed.
Definition at line 120 of file rnd.hpp.
| unsigned int Gecode::Rnd::operator() |
( |
unsigned int |
n |
) |
[inline] |
Return a random integer from the interval [0..n).
Definition at line 125 of file rnd.hpp.
The documentation for this class was generated from the following files: