#include <LC_RNGs.h>
Inheritance diagram for generators::LC_RNG:

Public Member Functions | |
| LC_RNG () | |
| Constructs a new default linear congruential RNG. | |
| LC_RNG (unsigned int a, unsigned int c, unsigned int m) | |
| Constructs a new linear congruential RNG. | |
| virtual unsigned int | getA () |
| virtual unsigned int | getC () |
| virtual unsigned int | getM () |
| virtual unsigned int | getMaximum () |
Protected Member Functions | |
| virtual unsigned int | nextInt () |
| Returns the next pseudo-random number from this RNG. | |
| virtual unsigned int | linear_congruential (unsigned int x) |
| The linear congruential function for calculating '(ax+c) mod m'. | |
Protected Attributes | |
| unsigned int | _a |
| Stores the values a, c and m as in (ax+c) mod m. | |
| unsigned int | _c |
| Stores the values a, c and m as in (ax+c) mod m. | |
| unsigned int | _m |
| Stores the values a, c and m as in (ax+c) mod m. | |
Linear congruential generators calculate the next pseudorandom number as:
next = (a*x+c) mod m
|
|
Constructs a new default linear congruential RNG. Use the three-argument constructor instead.
|
|
||||||||||||||||
|
Constructs a new linear congruential RNG.
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from generators::RNG. |
|
|
The linear congruential function for calculating '(ax+c) mod m'.
|
|
|
Returns the next pseudo-random number from this RNG. Seed updating is done automatically. Uses the linear_congruential function to determine the next pseudo-random number.
Implements generators::RNG. |
|
|
Stores the values a, c and m as in (ax+c) mod m.
|
|
|
Stores the values a, c and m as in (ax+c) mod m.
|
|
|
Stores the values a, c and m as in (ax+c) mod m.
|
1.3.9.1