Gecode::Support::LinearCongruentialGenerator< m, a, q, r > Class Template Reference
Common functionality » Support algorithms and datastructures

Template for linear congruential generators. More...

`#include <random.hpp>`

## Public Member Functions

void | seed (unsigned int s)
| Set the current seed to s.
| LinearCongruentialGenerator (unsigned int s=1)
| Construct the generator instance with seed s.
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.

## 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.

Definition at line 46 of file random.hpp.

## Constructor & Destructor Documentation

## LinearCongruentialGenerator()

template<unsigned int m, unsigned int a, unsigned int q, unsigned int r>

Gecode::Support::LinearCongruentialGenerator< m, a, q, r >::LinearCongruentialGenerator | ( | unsigned int | s = 1 | ) |

inline

Construct the generator instance with seed s.

Definition at line 83 of file random.hpp.

## Member Function Documentation

## seed() [1/2]

template<unsigned int m, unsigned int a, unsigned int q, unsigned int r>

void Gecode::Support::LinearCongruentialGenerator< m, a, q, r >::seed | ( | unsigned int | s | ) |

inline

Set the current seed to s.

Definition at line 77 of file random.hpp.

## seed() [2/2]

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

Return current seed.

Definition at line 89 of file random.hpp.

## operator()()

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

Returns a random integer from the interval [0..n).

Definition at line 94 of file random.hpp.

## size()

template<unsigned int m, unsigned int a, unsigned int q, unsigned int r>

size_t Gecode::Support::LinearCongruentialGenerator< m, a, q, r >::size | ( | void |  | ) | const

inline

Report size occupied.

Definition at line 104 of file random.hpp.

The documentation for this class was generated from the following file:

- gecode/support/random.hpp