|
Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
|
Benchmark suite for Monte Carlo integration algorithms. More...
#include "apps/benchmarks.hpp"#include <montecarlo/integrators/ISintegrator.hpp>#include <montecarlo/utils/muParserXInterface.hpp>#include <montecarlo/rng/rng_global.hpp>#include <cmath>#include <cstdint>#include <iostream>#include <functional>#include <limits>#include <random>#include <string>Go to the source code of this file.
Functions | |
| template<size_t dim, typename Func > | |
| void | executeBenchmark (const std::string &title, const std::string &filename, mc::integrators::MontecarloIntegrator< dim > &integrator, const mc::domains::IntegrationDomain< dim > &domain, Func &&f, bool useGnuplot, const std::string &rawDataFile, const std::string &functionExpr) |
| Generic execution loop for integration benchmarks. | |
| template<typename Func > | |
| void | runCircleBenchmark (Func f, const std::string &modeLabel, bool useGnuplot, const std::string &funcStr) |
| template<typename Func > | |
| void | runSphereBenchmark (Func f, const std::string &modeLabel, bool useGnuplot, const std::string &funcStr) |
| template<typename Func > | |
| void | runRectBenchmark (Func f, const std::string &modeLabel, bool useGnuplot, const std::string &funcStr) |
| template<typename Func > | |
| void | runCylinderBenchmark (Func f, const std::string &modeLabel, bool useGnuplot, const std::string &funcStr) |
| void | circleIntegration (bool useGnuplot) |
| void | sphereIntegration (bool useGnuplot) |
| void | rectangularIntegration (bool useGnuplot) |
| void | cylinderIntegration (bool useGnuplot) |
| void | circleIntegrationParser (const std::string &expr, bool useGnuplot) |
| void | sphereIntegrationParser (const std::string &expr, bool useGnuplot) |
| void | rectangularIntegrationParser (const std::string &expr, bool useGnuplot) |
| void | cylinderIntegrationParser (const std::string &expr, bool useGnuplot) |
| void | runBenchmarks (bool useGnuplot) |
| Run integration benchmarks with hardcoded integrands. | |
| void | runBenchmarksMH () |
| Run Metropolis-Hastings MCMC integration benchmarks. | |
| void | runBenchmarks (const std::string &expression, bool useGnuplot) |
| Run integration benchmarks with custom mathematical expression. | |
Benchmark suite for Monte Carlo integration algorithms.
Comprehensive evaluation of integration accuracy and performance across:
Methodology:
Key Benchmarks:
Definition in file integration_benchmarks.cpp.
| void circleIntegration | ( | bool | useGnuplot | ) |
Definition at line 213 of file integration_benchmarks.cpp.
| void circleIntegrationParser | ( | const std::string & | expr, |
| bool | useGnuplot | ||
| ) |
Definition at line 242 of file integration_benchmarks.cpp.
| void cylinderIntegration | ( | bool | useGnuplot | ) |
Definition at line 231 of file integration_benchmarks.cpp.
| void cylinderIntegrationParser | ( | const std::string & | expr, |
| bool | useGnuplot | ||
| ) |
Definition at line 278 of file integration_benchmarks.cpp.
| void executeBenchmark | ( | const std::string & | title, |
| const std::string & | filename, | ||
| mc::integrators::MontecarloIntegrator< dim > & | integrator, | ||
| const mc::domains::IntegrationDomain< dim > & | domain, | ||
| Func && | f, | ||
| bool | useGnuplot, | ||
| const std::string & | rawDataFile, | ||
| const std::string & | functionExpr | ||
| ) |
Generic execution loop for integration benchmarks.
| dim | Dimensionality of the integration domain. |
| Func | Function type (integrand). |
| title | Display title for the benchmark |
| filename | Output CSV filename |
| integrator | Integration engine to benchmark |
| domain | Integration domain (used for visualization) |
| f | Integrand function |
| useGnuplot | If true, generate visualization script |
| rawDataFile | Raw data filename for plotting |
| functionExpr | String representation of the integrand |
GENERIC execution loop. Runs the integration for increasing sample sizes, measures time, plots results, and saves to file.
Definition at line 57 of file integration_benchmarks.cpp.
| void rectangularIntegration | ( | bool | useGnuplot | ) |
Definition at line 225 of file integration_benchmarks.cpp.
| void rectangularIntegrationParser | ( | const std::string & | expr, |
| bool | useGnuplot | ||
| ) |
Definition at line 266 of file integration_benchmarks.cpp.
| void runBenchmarks | ( | bool | useGnuplot | ) |
Run integration benchmarks with hardcoded integrands.
| useGnuplot | If true, generate gnuplot script for visualization. |
Definition at line 292 of file integration_benchmarks.cpp.
| void runBenchmarks | ( | const std::string & | expression, |
| bool | useGnuplot | ||
| ) |
Run integration benchmarks with custom mathematical expression.
| expression | Mathematical function string (muParserX syntax) |
| useGnuplot | If true, generate gnuplot script |
Definition at line 449 of file integration_benchmarks.cpp.
| void runBenchmarksMH | ( | ) |
Run Metropolis-Hastings MCMC integration benchmarks.
Definition at line 309 of file integration_benchmarks.cpp.
| void runCircleBenchmark | ( | Func | f, |
| const std::string & | modeLabel, | ||
| bool | useGnuplot, | ||
| const std::string & | funcStr | ||
| ) |
Definition at line 160 of file integration_benchmarks.cpp.
| void runCylinderBenchmark | ( | Func | f, |
| const std::string & | modeLabel, | ||
| bool | useGnuplot, | ||
| const std::string & | funcStr | ||
| ) |
Definition at line 195 of file integration_benchmarks.cpp.
| void runRectBenchmark | ( | Func | f, |
| const std::string & | modeLabel, | ||
| bool | useGnuplot, | ||
| const std::string & | funcStr | ||
| ) |
Definition at line 183 of file integration_benchmarks.cpp.
| void runSphereBenchmark | ( | Func | f, |
| const std::string & | modeLabel, | ||
| bool | useGnuplot, | ||
| const std::string & | funcStr | ||
| ) |
Definition at line 171 of file integration_benchmarks.cpp.
| void sphereIntegration | ( | bool | useGnuplot | ) |
Definition at line 219 of file integration_benchmarks.cpp.
| void sphereIntegrationParser | ( | const std::string & | expr, |
| bool | useGnuplot | ||
| ) |
Definition at line 254 of file integration_benchmarks.cpp.