Random number generator interface.
More...
Go to the source code of this file.
|
struct | rng_t |
| The Random number generator parameters. More...
|
|
Random number generator interface.
Definition in file rng.h.
◆ rng_t
The Random number generator parameters.
Definition at line 30 of file rng.h.
◆ rng_init()
rng_t * rng_init |
( |
void ** |
region | ) |
|
Initialise the random number generator.
- Parameters
-
[in,out] | region | The address to read data from; updated to position after data has been read |
- Returns
- An initialised random number generator that can be used with other functions, or NULL if it couldn't be initialised for any reason
◆ rng_generator()
uint32_t rng_generator |
( |
rng_t * |
rng | ) |
|
Generate a uniformly-distributed random number.
- Parameters
-
[in] | rng | The random number generator instance to generate from |
- Returns
- The number generated between 0 and 0xFFFFFFFF
Definition at line 26 of file rng.c.
◆ rng_exponential()
accum rng_exponential |
( |
rng_t * |
rng | ) |
|
Generate an exponentially-distributed random number.
- Parameters
-
[in] | rng | The random number generator instance to use |
- Returns
- The number generated
Definition at line 30 of file rng.c.
◆ rng_normal()
accum rng_normal |
( |
rng_t * |
rng | ) |
|
Generate an normally-distributed random number.
- Parameters
-
[in] | rng | The random number generator instance to use |
- Returns
- The number generated
Definition at line 34 of file rng.c.
◆ rng_free()
void rng_free |
( |
rng_t * |
rng | ) |
|
Finish with a random number generator.
- Parameters
-
[in] | rng | The generator to free |
◆ population_rng
An RNG that starts in the same place on every core of the Population.
Definition at line 151 of file neuron_expander.c.
◆ core_rng