#include <stdlib.h>#include <math.h>#include "misc.h"Functions | |
| void | aspi_init_rand (int seed) |
| Init random number generator. | |
| double | aspi_misc_random_number (void) |
| Random number. | |
| double | aspi_misc_random_gaussian (double mean, double sigma) |
| Gaussian random number. | |
| int | aspi_misc_random_binomial (int runs, double proba) |
| int | aspi_misc_random_poisson (double lambda) |
| void | aspi_misc_poisson_set_runs (int runs) |
| double | aspi_misc_gaussian (double mu, double sigma, double x) |
Variables | |
| const void * | aspi_null = NULL |
| void aspi_init_rand | ( | int | seed | ) |
Init random number generator.
| seed,: | the seed |
| double aspi_misc_gaussian | ( | double | mu, | |
| double | sigma, | |||
| double | x | |||
| ) |
Return a number of a gaussian function (not random distribution
References ASPI_PI.
| void aspi_misc_poisson_set_runs | ( | int | runs | ) |
Set the number of runs to calculate poisson law
Poisson law is appromixated by n runs of a binomial law. This function allows you to set this n.
| int aspi_misc_random_binomial | ( | int | runs, | |
| double | proba | |||
| ) |
Return a number following a binomial law
Corresponds to running n Bernouilli trials.
| runs | : number of runs | |
| proba | : probability of each run |
References aspi_misc_random_number().
Referenced by aspi_misc_random_poisson().
| double aspi_misc_random_gaussian | ( | double | mean, | |
| double | sigma | |||
| ) |
Gaussian random number.
Return a number using a gaussian random law
| mean | : mean of the law | |
| sigma | : variance |
References aspi_misc_random_number(), and ASPI_PI.
Referenced by aspi_leaky_update_voltage(), and aspi_network_ml_init_sparse().
| double aspi_misc_random_number | ( | void | ) |
Random number.
Generator must have been initialized with srand ()
Referenced by aspi_misc_random_binomial(), aspi_misc_random_gaussian(), and aspi_network_ml_init_sparse().
| int aspi_misc_random_poisson | ( | double | lambda | ) |
Return a number following a random gaussian law
| lambda,: | the parameter to poisson law. |
References aspi_misc_random_binomial().
Referenced by aspi_network_ml_init_poisson().
| const void* aspi_null = NULL |
1.5.5