#include <Random.h>
Useful for making random data. The randomizer uses a linear congruential generator I_k = (a * I_{k-1} + c ) mod m with a = 3877, c = 29574, m = 139968. Should probably try find better numbers here.
Definition at line 66 of file Random.h.
Public Member Functions | |
ByteGenerator (unsigned int seed=0) | |
void | fill_bytes (void *buf, size_t size) |
Fill a buffer with size random bytes. | |
Static Public Attributes | |
static const unsigned int | A = 1277 |
static const unsigned int | M = 131072 |
static const unsigned int | C = 29574 |
Private Member Functions | |
void | next () |
Calculate next random number. | |
Private Attributes | |
unsigned int | cur_ |
oasys::ByteGenerator::ByteGenerator | ( | unsigned int | seed = 0 |
) |
void oasys::ByteGenerator::fill_bytes | ( | void * | buf, | |
size_t | size | |||
) |
void oasys::ByteGenerator::next | ( | ) | [private] |
Calculate next random number.
Definition at line 42 of file Random.cc.
Referenced by ByteGenerator(), and fill_bytes().
const unsigned int oasys::ByteGenerator::A = 1277 [static] |
const unsigned int oasys::ByteGenerator::M = 131072 [static] |
const unsigned int oasys::ByteGenerator::C = 29574 [static] |
unsigned int oasys::ByteGenerator::cur_ [private] |