|
Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
|
Uniform-sampling Monte Carlo integrator for N-dimensional domains. More...
#include <MCintegrator.hpp>
Public Member Functions | |
| MontecarloIntegrator (const mc::domains::IntegrationDomain< dim > &d) | |
| Construct a uniform Monte Carlo integrator for a domain. | |
| double | OLDintegrate (const std::function< double(const mc::geom::Point< dim > &)> &f, int n_samples) |
| Legacy integration routine (deprecated). | |
| double | integrate (const std::function< double(const mc::geom::Point< dim > &)> &f, int n_samples, const mc::proposals::Proposal< dim > &proposal, std::uint32_t seed) override |
| Compute the integral using uniform Monte Carlo sampling. | |
Public Member Functions inherited from mc::integrators::Integrator< dim > | |
| Integrator (const mc::domains::IntegrationDomain< dim > &d) | |
| Constructs an integrator for a specific domain. | |
| virtual | ~Integrator ()=default |
| Virtual destructor for proper polymorphic cleanup. | |
Additional Inherited Members | |
Protected Member Functions inherited from mc::integrators::Integrator< dim > | |
| std::vector< mc::geom::Point< dim > > | initializeRandomizer (int numbers) |
| Initializes random samples uniformly distributed in the domain. | |
Protected Attributes inherited from mc::integrators::Integrator< dim > | |
| const mc::domains::IntegrationDomain< dim > & | domain |
| Reference to the integration domain. | |
| std::vector< std::mt19937 > | randomizer |
| Per-thread random number generators. | |
Uniform-sampling Monte Carlo integrator for N-dimensional domains.
| dim | Dimensionality of the integration domain. |
Computes the integral: ∫_Ω f(x) dx ≈ V_Ω · (1/N) ∑ᵢ f(xᵢ)
where xᵢ are samples drawn uniformly from the bounding box and f(xᵢ) is zero if xᵢ ∉ Ω (hit-or-miss style).
Modern implementation uses MCMeanEstimator for variance-reduced sampling.
Definition at line 40 of file MCintegrator.hpp.
|
explicit |
Construct a uniform Monte Carlo integrator for a domain.
| d | Reference to the integration domain. |
|
overridevirtual |
Compute the integral using uniform Monte Carlo sampling.
| f | Integrand function: ℝⁿ → ℝ. |
| n_samples | Number of sample points to evaluate. |
| proposal | Proposal distribution (ignored for uniform MC; for API consistency). |
| seed | Random seed for reproducibility. |
Uses MCMeanEstimator to compute mean of f over the domain, then multiplies by domain's bounding box volume.
Implements mc::integrators::Integrator< dim >.
| double mc::integrators::MontecarloIntegrator< dim >::OLDintegrate | ( | const std::function< double(const mc::geom::Point< dim > &)> & | f, |
| int | n_samples | ||
| ) |
Legacy integration routine (deprecated).
| f | Integrand function. |
| n_samples | Number of sample points. |