39 inline static void Seed() {
47 inline static void Seed(
int num){
52 inline static double Num() {
return 1.0 * rand() / (RAND_MAX); }
55 inline static double Num(
double max) {
return max * rand() / (RAND_MAX); }
58 inline static double Num(
double low,
double high){
59 return low + ( (high-low) * rand() / RAND_MAX );
63 inline static bool Boolean() {
return rand() & 1; }
66 inline static int Int(
int high,
int low = 0 ) {
67 int diff = high - low;
69 int result = floor(
Num(diff+1) );
107 inline static double Pareto(
double scale,
double shape=1.0){
109 return scale / ( pow( 1 -
Num(), 1.0 / shape ) );
115 inline static double Gaussian(
double x,
double b= 1,
double c = 1,
double a = 1){
117 double den = 2 * c * c;
118 return a * exp( -(num*num) / den ) ;
127 inline static bool Gaussian(
double x,
double b= 1,
double c = 1,
double a = 1){
128 return Prob( Eval::Gaussian(x,b,c,a) );
131 inline static bool Power(
double p,
double k,
double a = 1){
132 return Prob( a * pow(p,k) );
136 inline static bool Prob(
double p){
Definition: vsr_stat.h:114
Definition: vsr_stat.h:123
static double Pareto(double scale, double shape=1.0)
Normal (Gaussian) Distribution.
Definition: vsr_stat.h:107
static double Num()
Number Between 0 and 1;.
Definition: vsr_stat.h:52
static double Uniform()
Uniform Distribution [0,1)
Definition: vsr_stat.h:86
static bool Boolean()
Random Boolean.
Definition: vsr_stat.h:63
static bool Prob(double p)
Bernoulli: Returns true with a probability of p.
Definition: vsr_stat.h:136
static void Seed()
Seed.
Definition: vsr_stat.h:39
the versor library namespace
Definition: vsr_algebra.h:29
static double Num(double max)
Number Between 0 and max.
Definition: vsr_stat.h:55
Probability Density Functions.
Definition: vsr_stat.h:29
static double Num(double low, double high)
Number Between low and high.
Definition: vsr_stat.h:58
static int Int(int high, int low=0)
Integer between high and low.
Definition: vsr_stat.h:66