6 double& upperE,
double& distpara1,
double& distpara2, label& Npoints)
9 std::mt19937 generator(rd());
12 for (label
i = 0;
i < pdftype.size();
i++)
14 pdftype[
i] = toupper(pdftype[
i]);
18 bool pdf_found =
false;
19 Eigen::VectorXd samplingVector;
20 samplingVector.resize(Npoints);
21 std::uniform_real_distribution<> dist0(distpara1, distpara2);
22 std::normal_distribution<> dist1(distpara1, distpara2);
23 std::poisson_distribution<> dist2(distpara1);
24 std::exponential_distribution<> dist3(distpara1);
26 for (label j = 0; j < distributions.size(); j++)
28 if (pdftype == distributions[j])
38 if (pdf_found ==
true)
40 while (p_counter < samplingVector.size())
45 random = dist0(generator);
49 random = dist1(generator);
53 random = dist2(generator);
57 random = dist3(generator);
61 if (random >= lowerE && random <= upperE)
63 samplingVector(p_counter) = random;
70 std::cout <<
"pdf '" << pdftype <<
"' not implemented, programm aborted" <<
75 return samplingVector;
static Eigen::VectorXd samplingMC(std::string pdftype, double &lowerE, double &upperE, double &distpara1, double &distpara2, label &Npoints)