Code for generating exponentially distributed random numbers.
More...
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include "Random.h"
#include "defines.h"
|
|
#define | clip(x, a, b) min(max(x, a), b) |
| | Clip x to [a,b].
|
| |
|
| float | UniformRand () |
| | Uniform random number generator.
|
| |
| float | ExpRand () |
| | Exponential random number generator.
|
| |
| float | ExpRand (float omega) |
| | Exponential random number generator with lifted tail.
|
| |
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
-
| omega | The tail multiplier, which controls how low the tails of the distribution can be. |
- Returns
- An exponentially distributed random number > 0 and < 1.
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.