Exponential Distribution Checker
A Program that Runs Experiments on Generating Random Numbers with an Exponential Distribution
 All Files Functions Variables Macros Pages
Macros | Functions
Random.cpp File Reference

Code for generating exponentially distributed random numbers. More...

#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include "Random.h"
#include "defines.h"

Macros

#define clip(x, a, b)   min(max(x, a), b)
 Clip x to [a,b].
 

Functions

float UniformRand ()
 Uniform random number generator.
 
float ExpRand ()
 Exponential random number generator.
 
float ExpRand (float omega)
 Exponential random number generator with lifted tail.
 

Function Documentation

float ExpRand ( )

A random number generator that generates an exponentially distributed pseudorandom floating point number between 0 and 1.

Returns
An exponentially distributed random number > 0 and < 1.
float ExpRand ( float  omega)

A random number generator that generates an exponentially distributed pseudorandom floating point number between 0 and 1 with the tail of the distribution artificially lifted up.

Parameters
omegaThe tail multiplier, which controls how low the tails of the distribution can be.
Returns
An exponentially distributed random number > 0 and < 1.
float UniformRand ( )

A random number generator that generates a uniformly distributed pseudorandom floating point number between 0 and 1.

Returns
A uniformly distributed random number > 0 and < 1.