3 #ifndef SZA_UTIL_SAMPLER_H
4 #define SZA_UTIL_SAMPLER_H
16 #define SAMPLER_FN(fn) double (fn)(double x)
43 void setdYdX(
unsigned n,
double* x,
double* y);
44 void setdYdX(std::vector<double>& x, std::vector<double>& y);
48 void setdYdX(SAMPLER_FN(fn),
double xMin,
double xMax,
double dx);
53 void setYX(SAMPLER_FN(fn));
59 std::vector<double> generateSamples(
unsigned nSamp);
65 static std::vector<unsigned>
66 generatePoissonSamples(
double mean,
unsigned nSamp);
72 static std::vector<double>
73 generateGaussianSamples(
double sigma,
unsigned nSamp);
79 static void seed(
unsigned int s);
80 static void seedRandom();
89 static double lnGamma(
double x);
95 static double lnFactrl(
unsigned n);
100 static double poissPdf(
unsigned k,
double lambda);
106 double binSearchForSample();
123 std::vector<double> yInt_;
124 std::vector<double> xInt_;
133 #endif // End #ifndef SZA_UTIL_SAMPLER_H