|
Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
|
Hit-or-Miss Monte Carlo volume estimator. More...
#include <VolumeEstimatorMC.hpp>
Public Member Functions | |
| VolumeEstimate< dim > | estimate (const mc::domains::IntegrationDomain< dim > &domain, std::uint32_t seed, std::size_t n_samples) const |
| Estimate the volume of a domain using hit-or-miss sampling. | |
Hit-or-Miss Monte Carlo volume estimator.
| dim | Dimensionality of the space. |
Estimates the volume of an arbitrary domain Ω by sampling uniformly in the bounding box and counting the fraction of samples inside Ω.
Algorithm:
Definition at line 68 of file VolumeEstimatorMC.hpp.
| VolumeEstimate< dim > mc::estimators::VolumeEstimatorMC< dim >::estimate | ( | const mc::domains::IntegrationDomain< dim > & | domain, |
| std::uint32_t | seed, | ||
| std::size_t | n_samples | ||
| ) | const |
Estimate the volume of a domain using hit-or-miss sampling.
| domain | The integration domain whose volume to estimate. |
| seed | Random seed for reproducibility. |
| n_samples | Number of sample points to evaluate. |
| std::invalid_argument | if n_samples == 0. |
Uses OpenMP parallelization for efficient parallel sampling. Each thread gets a deterministic RNG stream based on seed and thread ID.