sPyNNaker neural_modelling 7.3.1
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
rng.h File Reference

Random number generator interface. More...

#include <common-typedefs.h>
#include <random.h>

Go to the source code of this file.

Data Structures

struct  rng_t
 The Random number generator parameters. More...
 

Functions

rng_trng_init (void **region)
 Initialise the random number generator.
 
uint32_t rng_generator (rng_t *rng)
 Generate a uniformly-distributed random number.
 
accum rng_exponential (rng_t *rng)
 Generate an exponentially-distributed random number.
 
accum rng_normal (rng_t *rng)
 Generate an normally-distributed random number.
 
void rng_free (rng_t *rng)
 Finish with a random number generator.
 

Variables

rng_tpopulation_rng
 An RNG that starts in the same place on every core of the Population.
 
rng_tcore_rng
 An RNG that is local to the current core.
 

Detailed Description

Random number generator interface.

Definition in file rng.h.


Data Structure Documentation

◆ rng_t

struct rng_t

The Random number generator parameters.

Definition at line 30 of file rng.h.

Data Fields
mars_kiss64_seed_t seed

Function Documentation

◆ rng_init()

rng_t * rng_init ( void **  region)

Initialise the random number generator.

Parameters
[in,out]regionThe 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]rngThe 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]rngThe 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]rngThe 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]rngThe generator to free

Variable Documentation

◆ population_rng

rng_t* population_rng
extern

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

rng_t* core_rng
extern

An RNG that is local to the current core.

Definition at line 152 of file neuron_expander.c.