sPyNNaker neural_modelling 7.1.1
Loading...
Searching...
No Matches
rng.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 The University of Manchester
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
21#include "rng.h"
22#include <spin1_api.h>
23#include <normal.h>
24#include "common_mem.h"
25
27 return mars_kiss64_seed(rng->seed);
28}
29
33
35 uint32_t random_value = rng_generator(rng);
36 return norminv_urt(random_value);
37}
Utility functions for working with memory.
uint32_t mars_kiss64_seed(mars_kiss64_seed_t seed)
s1615 exponential_dist_variate(uniform_rng uni_rng, uint32_t *seed_arg)
accum rng_exponential(rng_t *rng)
Generate an exponentially-distributed random number.
Definition rng.c:30
accum rng_normal(rng_t *rng)
Generate an normally-distributed random number.
Definition rng.c:34
uint32_t rng_generator(rng_t *rng)
Generate a uniformly-distributed random number.
Definition rng.c:26
Random number generator interface.
The Random number generator parameters.
Definition rng.h:30
static uint32_t rng(void)
Random number generation for the Poisson sources. This is a local version for speed of operation.