Gecode::Support::LinearCongruentialGenerator< m, a, q, r > Class Template Reference
[Support algorithms and datastructures]
#include <random.hh>
Detailed Description
template<unsigned int m, unsigned int a, unsigned int q, unsigned int r>
class Gecode::Support::LinearCongruentialGenerator< m, a, q, r >
Template for linear congruential generators.
This class template defines a simple class for linear congruential generators.
The values used for calculation shouldbe specified so that
Requires
#include "gecode/support/random.hh"
Definition at line 42 of file random.hh.
Public Member Functions | |
LinearCongruentialGenerator (int _seed=1) | |
Construct the generator instance. | |
void | seed (unsigned int _seed) |
Set the current seed. | |
unsigned int | seed (void) const |
Get the current seed. | |
unsigned int | operator() (unsigned int n) |
Returns a reandom integer from the interval [0..n). | |
Public Attributes | |
const unsigned long | rand_max |
Constructor & Destructor Documentation
template<unsigned int m, unsigned int a, unsigned int q, unsigned int r>
Gecode::Support::LinearCongruentialGenerator< m, a, q, r >::LinearCongruentialGenerator | ( | int | _seed = 1 |
) | [inline] |
Member Function Documentation
template<unsigned int m, unsigned int a, unsigned int q, unsigned int r>
void Gecode::Support::LinearCongruentialGenerator< m, a, q, r >::seed | ( | unsigned int | _seed | ) | [inline] |
template<unsigned int m, unsigned int a, unsigned int q, unsigned int r>
unsigned int Gecode::Support::LinearCongruentialGenerator< m, a, q, r >::seed | ( | void | ) | const [inline] |
template<unsigned int m, unsigned int a, unsigned int q, unsigned int r>
unsigned int Gecode::Support::LinearCongruentialGenerator< m, a, q, r >::operator() | ( | unsigned int | n | ) | [inline] |
Member Data Documentation
template<unsigned int m, unsigned int a, unsigned int q, unsigned int r>
const unsigned long Gecode::Support::LinearCongruentialGenerator< m, a, q, r >::rand_max |
The documentation for this class was generated from the following file:
- gecode/support/random.hh (Revision: 3514)