Generated on Wed Nov 1 15:05:25 2006 for Gecode by doxygen 1.4.5

Gecode::Support::LinearCongruentialGenerator< m, a, q, r > Class Template Reference
[Support algorithms and datastructures]

#include <random.hh>

List of all members.


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

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]
 

Construct the generator instance.

Definition at line 56 of file random.hh.


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]
 

Set the current seed.

Definition at line 61 of file random.hh.

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]
 

Get the current seed.

Definition at line 66 of file random.hh.

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 reandom integer from the interval [0..n).

Definition at line 70 of file random.hh.


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
 

Definition at line 53 of file random.hh.


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