GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBT / V1-6-2 > lcbt / rad750
#include <RND.h>
#include <math.h>
Functions | |
static unsigned int | RND__lc0_args (unsigned int prv, unsigned int a, unsigned int c) |
Produces a random number in the range 0 - 2**32-1 using a linear congruent method. | |
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. |
unsigned int RND__lc0_args | ( | unsigned int | prv, | |
unsigned int | a, | |||
unsigned int | c | |||
) | [inline, static] |
Produces a random number in the range 0 - 2**32-1 using a linear congruent method.
prv | The previous random number | |
a | The multiplier | |
c | The additive factor |
r = RND__lc0_args (...) % 256;
To produce a number from 0 - 255. Rather do
r = RND__lco_args (...) >> 24;
Referenced by RND_lc0_gen(), and RND_normal_lc0_gen().
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().
unsigned 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.