RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
norm_dist_rnd_generator.c File Reference

Generating normally distributed random numbers. More...

#include <stdlib.h>
#include <math.h>
#include "norm_dist_rnd_generator.h"

Go to the source code of this file.

Functions

double get_norm_distr_rand_num (double mean_val, double std_dev_val)
 Get a normally distributed random number by applying the Box–Muller method. More...
 
double get_rand_num (int initial_seed_val)
 Generate uniform (0.0, 1.0) random numbers by using the Linear Congruential Generator (LGC) algorithm. More...
 

Detailed Description

Generating normally distributed random numbers.

The generation of normally distributed random numbers is implemented by using the Box–Muller method.

Author
Zakaria Kasmi zkasm.nosp@m.i@in.nosp@m.f.fu-.nosp@m.berl.nosp@m.in.de

Definition in file norm_dist_rnd_generator.c.

Function Documentation

◆ get_norm_distr_rand_num()

double get_norm_distr_rand_num ( double  mean_val,
double  std_dev_val 
)

Get a normally distributed random number by applying the Box–Muller method.

Parameters
[in]mean_valmean value.
[in]std_dev_valstandard deviation.
Returns
normally distributed random number.

Definition at line 40 of file norm_dist_rnd_generator.c.

References get_rand_num(), and PI.

Referenced by sim_UWB_dist().

◆ get_rand_num()

double get_rand_num ( int  initial_seed_val)

Generate uniform (0.0, 1.0) random numbers by using the Linear Congruential Generator (LGC) algorithm.

Note
The LGC is implemented based on the following book: R. Jain, "The Art of Computer Systems Performance Analysis," John Wiley & Sons, 1991.
Parameters
[in]initial_seed_valinitial seed value.
Returns
random number between 0.0 and 1.0.

Definition at line 80 of file norm_dist_rnd_generator.c.

Referenced by get_norm_distr_rand_num(), and sim_UWB_dist().