ASCOT5
Loading...
Searching...
No Matches
Functions
random.c File Reference

Random number generator interface. More...

#include <stdlib.h>
#include <math.h>
#include "ascot5.h"
#include "consts.h"
#include "random.h"

Go to the source code of this file.

Functions

double random_drand48_normal ()
 Initialize random generator which uses the linear congruential algorithm and 48-bit integer arithmetic.
 
void random_drand48_uniform_simd (int n, double *r)
 Vectorised sampling from uniform distribution.
 
void random_drand48_normal_simd (int n, double *r)
 Vectorised sampling from normal distribution.
 

Detailed Description

Random number generator interface.

Definition in file random.c.

Function Documentation

◆ 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
nnumber of numbers to be sampled
rpointer 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
nnumber of numbers to be sampled
rpointer where the values are stored

Definition at line 195 of file random.c.