Definition at line 67 of file IDistribution1DSampler.h.
◆ Distribution1DCosineSampler()
Distribution1DCosineSampler::Distribution1DCosineSampler |
( |
double |
omega | ) |
|
|
inline |
◆ randomSample()
double Distribution1DCosineSampler::randomSample |
( |
| ) |
const |
|
finalvirtual |
Implements IDistribution1DSampler.
Definition at line 73 of file IDistribution1DSampler.cpp.
75 std::random_device rd;
76 std::mt19937 gen(rd());
79 std::uniform_real_distribution<> uniformDist(0.0, 1.0);
80 double cdf_value = uniformDist(gen);
83 double func = 0.0, funcDeriv = 0.0, x = 0.0;
91 bool convergedSoln =
false;
92 while (!convergedSoln) {
96 x = x - func / funcDeriv;
98 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: