LibRan  0.1
Pseudo-random number distribution generator
Functions
LRunif.c File Reference

The uniform distribution on the [a,b) interval. More...

#include "libran.h"
Include dependency graph for LRunif.c:

Go to the source code of this file.

Functions

double LRd_unif_RAN (LR_obj *o)
 LRd_unif_RAN(LR_obj *o) - double random uniform distribution. More...
 
double LRd_unif_PDF (LR_obj *o, double x)
 LRd_unif_PDF(LR_obj *o, double x) - double uniform probablity distribution function. More...
 
double LRd_unif_CDF (LR_obj *o, double x)
 LRd_unif_CDF(LR_obj *o, double x) - double uniform cumulative distribution function. More...
 
float LRf_unif_RAN (LR_obj *o)
 LRf_unif_RAN(LR_obj *o) - float random uniform distribution. More...
 
float LRf_unif_PDF (LR_obj *o, float x)
 LRf_unif_PDF(LR_obj *o, float x) - float uniform probablity distribution function. More...
 
float LRf_unif_CDF (LR_obj *o, float x)
 LRf_unif_CDF(LR_obj *o, float x) - float uniform cumulative distribution function. More...
 

Detailed Description

The uniform distribution on the [a,b) interval.

The pseudo-random numbers are uniformly distributed on an interval from the lower bound "a" upto "b" - the interval [a,b).

\begin{eqnarray*} \mbox{PDF } u(x) &= \left\{ \begin{array}{ll} 0, & x < a \mbox{ or } x \ge b, \\ \frac{1}{b-a}, & a \le x < b , \\ \end{array} \right. \\ \mbox{CDF } U(x) &= \left\{ \begin{array}{ll} 0, & x < a , \\ \frac{x-a}{b-a}, & a \le x < b , \\ 1, & x \ge b . \end{array} \right. \end{eqnarray*}

Default:

See also
urand/urand.c

Definition in file LRunif.c.

Function Documentation

◆ LRd_unif_CDF()

double LRd_unif_CDF ( LR_obj o,
double  x 
)

LRd_unif_CDF(LR_obj *o, double x) - double uniform cumulative distribution function.

Parameters
oLR_obj object
xvalue
Returns
double CDF at x

Definition at line 86 of file LRunif.c.

◆ LRd_unif_PDF()

double LRd_unif_PDF ( LR_obj o,
double  x 
)

LRd_unif_PDF(LR_obj *o, double x) - double uniform probablity distribution function.

Parameters
oLR_obj object
xvalue
Returns
double PDF at x

Definition at line 69 of file LRunif.c.

◆ LRd_unif_RAN()

double LRd_unif_RAN ( LR_obj o)

LRd_unif_RAN(LR_obj *o) - double random uniform distribution.

Parameters
oLR_obj object
Returns
double

Definition at line 55 of file LRunif.c.

◆ LRf_unif_CDF()

float LRf_unif_CDF ( LR_obj o,
float  x 
)

LRf_unif_CDF(LR_obj *o, float x) - float uniform cumulative distribution function.

Parameters
oLR_obj object
xvalue
Returns
float CDF at x

Definition at line 135 of file LRunif.c.

◆ LRf_unif_PDF()

float LRf_unif_PDF ( LR_obj o,
float  x 
)

LRf_unif_PDF(LR_obj *o, float x) - float uniform probablity distribution function.

Parameters
oLR_obj object
xvalue
Returns
float PDF at x

Definition at line 118 of file LRunif.c.

◆ LRf_unif_RAN()

float LRf_unif_RAN ( LR_obj o)

LRf_unif_RAN(LR_obj *o) - float random uniform distribution.

Parameters
oLR_obj object
Returns
float

Definition at line 104 of file LRunif.c.