|
Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
|
Test suite for RNG reproducibility and optimizer determinism. More...
#include <iostream>#include <vector>#include <cmath>#include <iomanip>#include <omp.h>#include "montecarlo/rng/rng_global.hpp"#include "montecarlo/rng/rng_factory.hpp"#include "montecarlo/optimizers/PSO.hpp"#include "montecarlo/optimizers/GA.hpp"Go to the source code of this file.
Functions | |
| double | rosenbrock (const std::vector< double > &x) |
| Rosenbrock function benchmark. | |
| double | run_pso_test () |
| Run PSO on Rosenbrock function and return best value found. | |
| double | run_ga_test () |
| Run GA on Rosenbrock function and return best value found. | |
| std::vector< double > | generate_samples (int n_samples, std::uint64_t stream_id) |
| int | main () |
Test suite for RNG reproducibility and optimizer determinism.
Validates that:
Test Functions:
Verification:
Definition in file test_rng_reproducibility.cpp.
| std::vector< double > generate_samples | ( | int | n_samples, |
| std::uint64_t | stream_id | ||
| ) |
Definition at line 104 of file test_rng_reproducibility.cpp.
| int main | ( | ) |
Definition at line 118 of file test_rng_reproducibility.cpp.
| double rosenbrock | ( | const std::vector< double > & | x | ) |
Rosenbrock function benchmark.
| x | Vector of two coordinates [x0, x1] |
Classic benchmark function with global minimum at (1,1) = 0. Used to test optimizer reproducibility and convergence.
Definition at line 39 of file test_rng_reproducibility.cpp.
| double run_ga_test | ( | ) |
Run GA on Rosenbrock function and return best value found.
Configuration:
Definition at line 85 of file test_rng_reproducibility.cpp.
| double run_pso_test | ( | ) |
Run PSO on Rosenbrock function and return best value found.
Configuration:
Definition at line 56 of file test_rng_reproducibility.cpp.