Definition at line 81 of file IDistribution1DSampler.h.
◆ Distribution1DCosineSampler()
Distribution1DCosineSampler::Distribution1DCosineSampler |
( |
double |
omega | ) |
|
|
inline |
◆ randomSample()
double Distribution1DCosineSampler::randomSample |
( |
| ) |
const |
|
overridevirtual |
Implements IDistribution1DSampler.
Definition at line 69 of file IDistribution1DSampler.cpp.
71 std::random_device rd;
72 std::mt19937 gen(rd());
75 std::uniform_real_distribution<> uniformDist(0.0, 1.0);
76 double cdf_value = uniformDist(gen);
79 double func = 0.0, funcDeriv = 0.0, x = 0.0;
87 bool convergedSoln =
false;
88 while (!convergedSoln) {
92 x = x - func / funcDeriv;
94 if (std::abs(func / funcDeriv) < 0.001)
References m_omega, and M_PI.
◆ m_omega
double Distribution1DCosineSampler::m_omega |
|
private |
The documentation for this class was generated from the following files: