Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
VolumeEstimatorMC.hpp
Go to the documentation of this file.
1
20#ifndef MONTECARLO_DGL_VOLUMEESTIMATORMC_HPP
21#define MONTECARLO_DGL_VOLUMEESTIMATORMC_HPP
22
23#include <cstddef>
24#include <cstdint>
25#include <cmath>
26#include <stdexcept>
27
28#include "../domains/integration_domain.hpp"
29#include "../geometry.hpp"
30
31namespace mc::estimators {
32
38template <std::size_t dim>
41 double volume = 0.0;
43 double stderr = 0.0;
45 double inside_ratio = 0.0;
47 std::size_t n_samples = 0;
48};
49
67template <std::size_t dim>
69public:
83 std::uint32_t seed,
84 std::size_t n_samples) const;
85};
86
87} // namespace mc::estimators
88
89#include "VolumeEstimatorMC.tpp"
90
91#endif // MONTECARLO_DGL_VOLUMEESTIMATORMC_HPP
Abstract base class for N-dimensional integration domains.
Hit-or-Miss Monte Carlo volume estimator.
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.
Result of Monte Carlo volume estimation.
double volume
Estimated domain volume: V̂ = V_box · p̂
double stderr
Standard error in the volume estimate.
double inside_ratio
Fraction of samples inside domain: p̂ = N_hits / N_total.
std::size_t n_samples
Total number of samples evaluated.