Header file for random.c.
More...
#include <stdlib.h>
Go to the source code of this file.
Header file for random.c.
Definition in file random.h.
◆ random_init
#define random_init |
( |
| data, |
|
|
| seed ) srand48(seed) |
Initialize random number generator
Definition at line 94 of file random.h.
◆ random_uniform
#define random_uniform |
( |
| data | ) |
drand48() |
Sample random number [0.0,1.0) from from uniform distribution
Definition at line 96 of file random.h.
◆ random_normal
Sample from Normal distribution
Definition at line 98 of file random.h.
◆ random_uniform_simd
Same as random_uniform but vectorised
Definition at line 100 of file random.h.
◆ random_normal_simd
Same as random_normal but vectorised
Definition at line 102 of file random.h.
◆ random_data
Data used by the random number generator
Definition at line 87 of file random.h.
◆ random_drand48_normal()
double random_drand48_normal |
( |
| ) |
|
Initialize random generator which uses the linear congruential algorithm and 48-bit integer arithmetic.
Definition at line 166 of file random.c.
◆ random_drand48_uniform_simd()
void random_drand48_uniform_simd |
( |
int | n, |
|
|
double * | r ) |
Vectorised sampling from uniform distribution.
Uses the linear congruential algorithm and 48-bit integer arithmetic.
- Parameters
-
n | number of numbers to be sampled |
r | pointer where the values are stored |
Definition at line 180 of file random.c.
◆ random_drand48_normal_simd()
void random_drand48_normal_simd |
( |
int | n, |
|
|
double * | r ) |
Vectorised sampling from normal distribution.
Uses the linear congruential algorithm and 48-bit integer arithmetic.
- Parameters
-
n | number of numbers to be sampled |
r | pointer where the values are stored |
Definition at line 195 of file random.c.