#include "Basic/Law.hpp"#include "Basic/Utilities.hpp"#include "Basic/MathFunc.hpp"#include "Basic/VectorHelper.hpp"#include <math.h>#include <random>Functions | |
| void | law_set_old_style (bool style) |
| int | law_get_random_seed (void) |
| void | law_set_random_seed (int seed) |
| double | law_uniform (double mini, double maxi) |
| int | law_int_uniform (int mini, int maxi) |
| double | law_gaussian (double mean, double sigma) |
| double | law_exponential (double lambda) |
| double | law_gamma (double alpha, double beta) |
| double | law_stable_standard_abgd (double alpha) |
| double | law_stable_standard_agd (double alpha, double beta) |
| double | law_stable_standard_a1gd (double beta) |
| double | law_stable_a (double alpha, double beta, double gamma, double delta) |
| double | law_stable_a1 (double beta, double gamma, double delta) |
| double | law_stable (double alpha, double beta, double gamma, double delta) |
| double | law_beta1 (double parameter1, double parameter2) |
| double | law_beta2 (double parameter1, double parameter2) |
| double | law_df_gaussian (double value) |
| double | law_dnorm (double value, double mean, double std) |
| double | law_cdf_gaussian (double value) |
| double | law_invcdf_gaussian (double value) |
| double | law_gaussian_between_bounds (double binf, double bsup) |
| double | law_df_bigaussian (VectorDouble &vect, VectorDouble &mean, MatrixSquareSymmetric &correl) |
| double | law_df_quadgaussian (VectorDouble &vect, MatrixSquareSymmetric &correl) |
| double | law_df_multigaussian (VectorDouble &vect, MatrixSquareSymmetric &correl) |
| VectorDouble | law_df_poisson_vec (VectorInt is, double parameter) |
| double | law_df_poisson (int i, double parameter) |
| int | law_poisson (double parameter) |
| VectorInt | law_random_path (int nech) |
| int | law_binomial (int n, double p) |
| VectorDouble | law_exp_sample (const double *tabin, int mode, int nvar, int nechin, int nechout, int niter, int nconst, double *consts, int seed, double percent) |
| int | sampleInteger (int mini, int maxi) |
Variables | |
| static int | Random_factor = 105 |
| static int | Random_congruent = 20000159 |
| static int | Random_value = 43241421 |
| static bool | Random_Old_Style = true |
| std::mt19937 | Random_gen |
| double law_beta1 | ( | double | parameter1, |
| double | parameter2 | ||
| ) |
Generate random numbers according to a beta distribution (first kind)
| [in] | parameter1 | first parameter of the beta distribution |
| [in] | parameter2 | first parameter of the beta distribution |
| double law_beta2 | ( | double | parameter1, |
| double | parameter2 | ||
| ) |
Generate random numbers according to a beta distribution (second kind)
| [in] | parameter1 | first parameter of the beta distribution |
| [in] | parameter2 | first parameter of the beta distribution |
| int law_binomial | ( | int | n, |
| double | p | ||
| ) |
Generates a binomial value
| [in] | n | Number of trials |
| [in] | p | Event probability |
| double law_cdf_gaussian | ( | double | value | ) |
Cumulated density function of a gaussian distribution
| [in] | value | raw value |
| double law_df_bigaussian | ( | VectorDouble & | vect, |
| VectorDouble & | mean, | ||
| MatrixSquareSymmetric & | correl | ||
| ) |
| double law_df_gaussian | ( | double | value | ) |
Density function of a gaussian distribution
| [in] | value | raw value |
| double law_df_multigaussian | ( | VectorDouble & | vect, |
| MatrixSquareSymmetric & | correl | ||
| ) |
Density function of a multigaussian distribution
| [in] | vect | Array of values (Dimension = nvar) |
| [in] | correl | Correlation matrix (Dimension: nvar*nvar) |
| double law_df_poisson | ( | int | i, |
| double | parameter | ||
| ) |
| VectorDouble law_df_poisson_vec | ( | VectorInt | is, |
| double | parameter | ||
| ) |
| double law_df_quadgaussian | ( | VectorDouble & | vect, |
| MatrixSquareSymmetric & | correl | ||
| ) |
Density function of a quadrigaussian distribution
| [in] | vect | Array of values (Dimension = nvar) |
| [in] | correl | Correlation matrix (Dimension: nvar*nvar) |
| double law_dnorm | ( | double | value, |
| double | mean, | ||
| double | std | ||
| ) |
Density function of a (non-normalized) gaussian distribution
| [in] | value | Raw value |
| [in] | mean | Mean value |
| [in] | std | Standard deviation |
| VectorDouble law_exp_sample | ( | const double * | tabin, |
| int | mode, | ||
| int | nvar, | ||
| int | nechin, | ||
| int | nechout, | ||
| int | niter, | ||
| int | nconst, | ||
| double * | consts, | ||
| int | seed, | ||
| double | percent | ||
| ) |
Sample a multivariate empirical distribution
| [in] | tabin | Input array |
| [in] | mode | Describes the way 'tabin' and 'tabout' are filled 1: by column; 2: by row |
| [in] | nvar | Number of variables (input and output) |
| [in] | nechin | Number of samples in the input array |
| [in] | nechout | Number of created samples |
| [in] | niter | Maximum number of iterations |
| [in] | nconst | Number of constraints |
| [in] | consts | Array of constraints (optional) (Dimension: nconst * (nvar+1)) This array is entered by line |
| [in] | seed | Value for the seed generator |
| [in] | percent | Dimension of the convolution kernel expressed as a percentage of the dispersion st. dev. Should be between 0 and 100 |
| double law_exponential | ( | double | lambda | ) |
Generate random numbers according to exponential distribution
| [in] | lambda | Parameter of exponential distribution |
| double law_gamma | ( | double | alpha, |
| double | beta | ||
| ) |
Generate random numbers according to a gamma distribution
| [in] | alpha | parameter of the gamma distribution |
| [in] | beta | Second parameter of the Gamma distribution |
| double law_gaussian | ( | double | mean, |
| double | sigma | ||
| ) |
Generate random numbers according to a gaussian distribution
| [in] | mean | Mean of the Normal Distribution |
| [in] | sigma | Standard deviation of the Normal Distribution |
| double law_gaussian_between_bounds | ( | double | binf, |
| double | bsup | ||
| ) |
Generates a gaussian value which lies in an interval
| [in] | binf | lower bound of the interval |
| [in] | bsup | upper bound of the interval |
| int law_get_random_seed | ( | void | ) |
read the seed for the random number generator
| int law_int_uniform | ( | int | mini, |
| int | maxi | ||
| ) |
Draw an integer random number according to a uniform distribution
| [in] | mini | minimum value |
| [in] | maxi | maximum value |
| double law_invcdf_gaussian | ( | double | value | ) |
Inverse cumulated density function of a gaussian distribution
| [in] | value | cumulative density |
| int law_poisson | ( | double | parameter | ) |
Generate random number according to a poisson distribution
| [in] | parameter | parameter of the Poisson distribution |
| VectorInt law_random_path | ( | int | nech | ) |
Define a random path
| [in] | nech | : Number of samples |
| void law_set_old_style | ( | bool | style | ) |
| void law_set_random_seed | ( | int | seed | ) |
Sets the seed for the random number generator
| [in] | seed | the new value given to the seed |
| double law_stable | ( | double | alpha, |
| double | beta, | ||
| double | gamma, | ||
| double | delta | ||
| ) |
Generate random numbers according to a stable distribution
| [in] | alpha | value of the alpha parameter |
| [in] | beta | value of the beta parameter |
| [in] | gamma | value of the gamma parameter |
| [in] | delta | value of the delta parameter |
| double law_stable_a | ( | double | alpha, |
| double | beta, | ||
| double | gamma, | ||
| double | delta | ||
| ) |
Generate random numbers according to a stable distribution (alpha != 1)
| [in] | alpha | value of the alpha parameter |
| [in] | beta | value of the beta parameter |
| [in] | gamma | value of the gamma parameter |
| [in] | delta | value of the delta parameter |
| double law_stable_a1 | ( | double | beta, |
| double | gamma, | ||
| double | delta | ||
| ) |
Generate random numbers according to a stable distribution (alpha=1)
| [in] | beta | value of the beta parameter |
| [in] | gamma | value of the gamma parameter |
| [in] | delta | value of the delta parameter |
| double law_stable_standard_a1gd | ( | double | beta | ) |
Generate random numbers according to a standard stable distribution (alpha=1)
| [in] | beta | value of the beta parameter |
| double law_stable_standard_abgd | ( | double | alpha | ) |
Generate random numbers according to a standard stable distribution
| [in] | alpha | value of the alpha parameter |
| double law_stable_standard_agd | ( | double | alpha, |
| double | beta | ||
| ) |
Generate random numbers according to a standard stable distribution
| [in] | alpha | value of the alpha parameter |
| [in] | beta | value of the beta parameter |
| double law_uniform | ( | double | mini, |
| double | maxi | ||
| ) |
Draw a random number according to a uniform distribution
| [in] | mini | minimum value |
| [in] | maxi | maximum value |
| int sampleInteger | ( | int | mini, |
| int | maxi | ||
| ) |
Returns an integer sampled uniformly wihtin the interval [mini, maxi]
| mini | Lower bound (included) |
| maxi | Upper bound (included) |
|
static |
|
static |
| std::mt19937 Random_gen |
|
static |
|
static |