![]() |
Virtual Belgium
2.0
A micro-simulation platform for the Belgian population
|
Random number generators and related tools. More...
#include <iostream>#include <vector>#include <cmath>#include <stdexcept>Go to the source code of this file.
Classes | |
| struct | draw_2d |
| struct | dist_param |
| struct | dist_param_mixture |
| struct | dist_param_2d |
| struct | dist_param_mixture_2d |
| struct | Ranq1 |
| Simplest and fastest random number generator recommended by Numerical Recipes. More... | |
| struct | Ranfib |
| Fast and good random number generator (see Numerical Recipes). More... | |
| struct | Normaldev |
| Fast Random number generator for normal distribution (Numerical Recipes). More... | |
| struct | LogNormaldev |
| Fast Random number generator for log-normal distribution (Numerical Recipes). More... | |
| struct | MixtureNormal |
| Fast Random number generator for mixture of normal distribution (Numerical Recipes). More... | |
| struct | MixtureLogNormal |
| Fast Random number generator for mixture of log-normal distribution (Numerical Recipes). More... | |
| struct | MixtureLogNormal2D |
| Fast Random number generator for mixture of bivariate log-normal distribution (Numerical Recipes). More... | |
| class | SingletonRnd< T > |
| SingletonRnd class for the RandomGenerators class. More... | |
| class | RandomGenerators |
| Random generators. More... | |
Typedefs | |
| typedef struct draw_2d | draw_2d |
| A simple structure for returning a 2d draw. More... | |
| typedef struct dist_param | dist_param |
| A structure for storing the parameters of an univariate distribution. More... | |
| typedef struct dist_param_mixture | dist_param_mixture |
| A structure for storing the parameters of a mixture of univariate distributions. More... | |
| typedef struct dist_param_2d | dist_param_2d |
| A structure for storing the parameters of a bivariate distribution (X_1, X_2). More... | |
| typedef struct dist_param_mixture_2d | dist_param_mixture_2d |
| A structure for storing the parameters of a mixture of bivariate distributions. More... | |
Functions | |
| template<typename T > | |
| int | draw_discrete (std::vector< T > freq) |
| Randomly draws a class identifier within an empirical density function. More... | |
| template<typename T > | |
| int | draw_discrete (std::vector< T > freq, int lo_bound, int up_bound) |
| Randomly draws a class identifier within an interval of an empirical density function. More... | |
| float | norm_rand (float mu, float sigma) |
| Random number generator following a normal distribution (DEPRECIATED) More... | |
| float | norm_rand (float mu, float sigma, float max) |
| Random number generator following a bounded normal distribution (DEPRECIATED) More... | |
| float | log_rand (float mu, float sigma) |
| Random number generator following a log-normal distribution (DEPRECIATED) More... | |
| float | log_rand (float mu, float sigma, float max) |
| Random number generator following a bounded log-normal distribution (DEPRECIATED) More... | |
Random number generators and related tools.
| typedef struct dist_param dist_param |
A structure for storing the parameters of an univariate distribution.
This structure saves the location, scale parameters and upper bound of an univariate distribution.
| typedef struct dist_param_2d dist_param_2d |
A structure for storing the parameters of a bivariate distribution (X_1, X_2).
This structure saves the location vector, the (Choleski decomposition of the) covariance matrix and the upper bounds vector of a bivariate distribution.
| typedef struct dist_param_mixture dist_param_mixture |
A structure for storing the parameters of a mixture of univariate distributions.
This structure saves the the location and scale parameters of the components and the upper bound of an univariate distribution.
| typedef struct dist_param_mixture_2d dist_param_mixture_2d |
A structure for storing the parameters of a mixture of bivariate distributions.
This structure saves the location vectors, the Choleski decomposition of the covariance matrices and the upper bounds vectors of the components of bivariate mixture distribution.
| int draw_discrete | ( | std::vector< T > | freq | ) |
Randomly draws a class identifier within an empirical density function.
| freq | the empirical density function in which the random draw is done. |
| int draw_discrete | ( | std::vector< T > | freq, |
| int | lo_bound, | ||
| int | up_bound | ||
| ) |
Randomly draws a class identifier within an interval of an empirical density function.
| freq | the empirical density function in wich the random draw is done. |
| lo_bound | the lower bound index of freq to consider. |
| up_bound | the upper bound index of freq to consider. |
| float log_rand | ( | float | mu, |
| float | sigma | ||
| ) |
Random number generator following a log-normal distribution (DEPRECIATED)
| float log_rand | ( | float | mu, |
| float | sigma, | ||
| float | max | ||
| ) |
Random number generator following a bounded log-normal distribution (DEPRECIATED)
| float norm_rand | ( | float | mu, |
| float | sigma | ||
| ) |
Random number generator following a normal distribution (DEPRECIATED)
| float norm_rand | ( | float | mu, |
| float | sigma, | ||
| float | max | ||
| ) |
Random number generator following a bounded normal distribution (DEPRECIATED)