DFNgen  2.0
DFN Model Generator
expDist.h
Go to the documentation of this file.
1 #ifndef _expDist_h_
2 #define _expDist_h_
3 #include <random>
4 
12 class ExpDist {
13 
14 private:
19  double maxInput;
20 
21  double unifRandom(double, double);
22 
25  std::mt19937_64 &generator;
26 
27 public:
28 
29  // Constructor. maxDecimal is the maximum number less than 1,
30  // using maximum digits in the double's mantissa, to use
31  // when sampling the dist. This prevents .999999... being
32  // turned into 1, causing a return of inf from the distribution
33  //ExpDist(double maxDecimal, std::mt19937_64 &_generator);
34  ExpDist(double maxDecimal,std::mt19937_64 &_generator);
35 
36  // Returns double using rv as "random variable"
37  double getValue(double lambda, double rv);
38 
39  // Generates its own random input to distribution
40  double getValue(double lambda, double minInput, double maxInput);
41 
42  // Returns maximum value computer is able to produce
43  // can be relatively small with certain parameters for lambda
44  // due to precision issues.
45  double getMaxValue(double lambda);
46 
47  // Computes what the input value needs to be in
48  // order for the distribution to return "output" value
49  double computeInput(double output, double lambda);
50 };
51 
52 #endif
53 
54 
double getValue(double lambda, double rv)
Definition: expDist.cpp:46
double unifRandom(double, double)
Definition: expDist.cpp:33
double getMaxValue(double lambda)
Definition: expDist.cpp:115
double maxInput
Definition: expDist.h:19
double computeInput(double output, double lambda)
Definition: expDist.cpp:129
std::mt19937_64 & generator
Definition: expDist.h:25
ExpDist(double maxDecimal, std::mt19937_64 &_generator)
Definition: expDist.cpp:21