Graph C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Groups Pages
Namespaces | Functions
random_number_generators.hpp File Reference

Random number generators and related functions for various distributions. More...

#include <cmath>
#include <cstdlib>
#include <limits>
#include <random>
#include <vector>

Go to the source code of this file.

Namespaces

 rng
 Functions related to random number generators for various distributions.
 

Functions

double rng::powerlaw_rand (std::vector< double > &param, std::mt19937 &_engine)
 Generates a random real number following a power-law distribution of the form $\rho(x) \propto x^{-\gamma}$ with $x\in(x_\mathrm{min},\infty)$. More...
 
double rng::powerlaw_m1 (std::vector< double > &param)
 Returns the first moment of a power-law distribution of the form $\rho(x) \propto x^{-\gamma}$ with $x\in(x_\mathrm{min},\infty)$. More...
 
double rng::powerlaw_hardcutoff_rand (std::vector< double > &param, std::mt19937 &_engine)
 Generates a random real number following a power-law distribution of the form $\rho(x)\propto x^{-\gamma}$ with $x\in(x_\mathrm{min},x_\mathrm{max})$ (i.e., hard cut-off). More...
 
double rng::powerlaw_hardcutoff_m1 (std::vector< double > &param)
 Returns the first moment of a power-law distribution of the form $\rho(x) \propto x^{-\gamma}$ with $x\in(x_\mathrm{min},x_\mathrm{max})$ (i.e., hard cut-off). More...
 
double rng::exponential_rand (std::vector< double > &param, std::mt19937 &_engine)
 Generates a random real number following an exponential distribution of the form $\rho(x)\propto \mathrm{e}^{-x/\beta}$ with $x\in(0,\infty)$. More...
 
double rng::exponential_m1 (double param)
 Returns the first moment of an exponential distribution of the form $\rho(x)\propto \mathrm{e}^{-x/\beta}$ with $x\in(0,\infty)$. More...
 
double rng::gamma_rand (std::vector< double > &param, std::mt19937 &_engine)
 Generates a random real number following a gamma distribution of the form $\rho(x)\propto x^{\alpha-1}\mathrm{e}^{-x/\beta}$ with $x\in(0,\infty)$. More...
 
double rng::gamma_m1 (std::vector< double > param)
 Returns the first moment of a gamma distribution of the form $\rho(x)\propto x^{\alpha-1}\mathrm{e}^{-x/\beta}$ with $x\in(0,\infty)$. More...
 

Detailed Description

Random number generators and related functions for various distributions.

Author
Antoine Allard (antoineallard.info)
Date
Sept. 2015