GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBT / V1-6-2 > lcbt / rad750
Classes | |
struct | _RND_lc0 |
Structure giving the parameters of a simply linear congruent random number generator. More... | |
struct | _RND_normal_lc0 |
Structure giving the parameters of a simple normal distribution random number generator. More... | |
struct | _RND_poisson_lc0 |
Structure giving the parameters of a poisson distribution. More... | |
Typedefs | |
typedef struct _RND_lc0 | RND_lc0 |
Typedef for the struct _RND_lc0. | |
typedef struct _RND_normal_lc0 | RND_normal_lc0 |
Typedef for the struct _RND_normal0. | |
typedef struct _RND_poisson_lc0 | RND_poisson_lc0 |
Typedef for the struct _LSI_poisson_lco. | |
Functions | |
void | RND_lc0_init (RND_lc0 *ctx, unsigned int seed) |
Init. | |
unsigned int | RND_lc0_gen (RND_lc0 *ctx) |
Produces a random number in the range 0 - 2**32-1 using a linear congruent method. | |
int | RND_normal_lc0_gen (RND_normal_lc0 *ctx) |
Produces a normal distribution. |
CVS $Id: RND.h,v 1.1 2004/07/19 20:04:00 ebacho Exp $
Typedef for the struct _RND_lc0.
This random number generator uses the formula
x_{n+1} = (a x_n + c)
Suggested choices are
The seed value must be odd. It has been selected since it is relatively fast, involving only a multiply and an addition. Probably not a great choice for real math, but for generating random patterns, not bad
Typedef for the struct _RND_normal0.
This is a very simplistic generator, just adding 6 random numbers from the LC generator
Typedef for the struct _LSI_poisson_lco.
This is just a scaled exponential distribution, using a linear congruent
unsigned int RND_lc0_gen | ( | RND_lc0 * | ctx | ) |
Produces a random number in the range 0 - 2**32-1 using a linear congruent method.
ctx | Context parameter |
r = RND__lc0_args (...) % 256;
To produce a number from 0 - 255. Rather do
r = RND__lco_args (...) >> 24;
References _RND_lc0::a, _RND_lc0::c, RND__lc0_args(), and _RND_lc0::seed.
Referenced by LCBT_eventCorrupt(), and LCBT_eventSend().
void RND_lc0_init | ( | RND_lc0 * | ctx, | |
unsigned int | seed | |||
) |
Init.
ctx | Context parameter | |
seed | random number seed |
References _RND_lc0::a, _RND_lc0::c, and _RND_lc0::seed.
Referenced by LCBT_eventCorrupt(), and LCBT_eventSend().
int RND_normal_lc0_gen | ( | RND_normal_lc0 * | ctx | ) |
Produces a normal distribution.
ctx | Context parameter |
References _RND_lc0::a, _RND_lc0::c, _RND_normal_lc0::lc0, _RND_normal_lc0::mean, RND__lc0_args(), _RND_lc0::seed, and _RND_normal_lc0::sigma.