Definition at line 55 of file IDistribution2DSampler.h.
◆ Distribution2DGateSampler()
Distribution2DGateSampler::Distribution2DGateSampler |
( |
double |
omega_x, |
|
|
double |
omega_y |
|
) |
| |
|
inline |
◆ randomSample()
std::pair< double, double > Distribution2DGateSampler::randomSample |
( |
| ) |
const |
|
finalvirtual |
Implements IDistribution2DSampler.
Definition at line 155 of file IDistribution2DSampler.cpp.
157 std::random_device rd;
158 std::mt19937 gen(rd());
159 std::uniform_real_distribution<double> uniformDist(0.0, 1.0);
161 double cdf_value_phi = uniformDist(gen);
164 double phi = std::sqrt(cdf_value_phi);
165 double alpha = 2 *
M_PI * uniformDist(gen);
166 return std::make_pair(
m_omega_x * phi * std::cos(alpha),
m_omega_y * phi * std::sin(alpha));
References m_omega_x, m_omega_y, and M_PI.
◆ m_omega_x
double Distribution2DGateSampler::m_omega_x |
|
private |
◆ m_omega_y
double Distribution2DGateSampler::m_omega_y |
|
private |
The documentation for this class was generated from the following files: