Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
Functions | Variables
benchmarks.cpp File Reference

Implementation of shared benchmark utilities and global configuration. More...

#include "apps/benchmarks.hpp"
Include dependency graph for benchmarks.cpp:

Go to the source code of this file.

Functions

void saveResults (const std::string &filename, const std::vector< results > &results, const std::string &function_expr)
 Export benchmark results to CSV file for analysis.
 

Variables

const std::vector< size_t > n_samples_vector = {10'000, 50'000, 100'000, 500'000, 1'000'000}
 Global sample count vector used across all benchmarks for convergence testing.
 
unsigned int n_threads
 Global OpenMP thread count (set at runtime)
 

Detailed Description

Implementation of shared benchmark utilities and global configuration.

Provides:

Benchmark Components:

Sample Configuration:

See also
benchmarks.hpp, saveResults()

Definition in file benchmarks.cpp.

Function Documentation

◆ saveResults()

void saveResults ( const std::string &  filename,
const std::vector< results > &  results,
const std::string &  function_expr 
)

Export benchmark results to CSV file for analysis.

Save benchmark results to a CSV file.

Parameters
filenameOutput CSV filename
resultsVector of benchmark results {n_samples, integration_result, duration_ms}
function_exprString description of the integrated function

CSV Format:

  • Header: Function description and column labels
  • Each row: n_samples \t result \t duration_ms

Useful for:

  • Plotting convergence curves: error vs sample count
  • Computing empirical convergence rate
  • Analyzing computational efficiency
  • Comparing algorithm scalability

Definition at line 49 of file benchmarks.cpp.

Variable Documentation

◆ n_samples_vector

const std::vector<size_t> n_samples_vector = {10'000, 50'000, 100'000, 500'000, 1'000'000}

Global sample count vector used across all benchmarks for convergence testing.

Global benchmark configuration.

Definition at line 28 of file benchmarks.cpp.

◆ n_threads

unsigned int n_threads

Global OpenMP thread count (set at runtime)

Definition at line 31 of file benchmarks.cpp.