Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Use our PCG32 RNG instead of mt19937 in Benchmark::analyse_samples

Commit
1887d42e3d880414a8e9c6746810a42521b0ee90
Author
Martin Hořeňovský ·
Parents
1774dbfd53ba

Files · Download .tar.gz

Changes

 src/catch2/benchmark/detail/catch_stats.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/catch2/benchmark/detail/catch_stats.cpp b/src/catch2/benchmark/detail/catch_stats.cpp
index 6030e55c..5867f1e1 100644
--- a/src/catch2/benchmark/detail/catch_stats.cpp
+++ b/src/catch2/benchmark/detail/catch_stats.cpp
@@ -11,6 +11,7 @@
 
 #include <catch2/internal/catch_compiler_capabilities.hpp>
 #include <catch2/internal/catch_floating_point_helpers.hpp>
+#include <catch2/internal/catch_random_number_generator.hpp>
 
 #include <algorithm>
 #include <cassert>
@@ -368,7 +369,7 @@ namespace Catch {
                 auto Estimate = [=](double(*f)(double const*, double const*)) {
                     auto seed = entropy();
                     return std::async(std::launch::async, [=] {
-                        std::mt19937 rng(seed);
+                        SimplePcg32 rng( seed );
                         auto resampled = resample(rng, n_resamples, first, last, f);
                         return bootstrap(confidence_level, first, last, resampled, f);
                     });
@@ -382,7 +383,7 @@ namespace Catch {
 #else
                 auto Estimate = [=](double(*f)(double const* , double const*)) {
                     auto seed = entropy();
-                    std::mt19937 rng(seed);
+                    SimplePcg32 rng( seed );
                     auto resampled = resample(rng, n_resamples, first, last, f);
                     return bootstrap(confidence_level, first, last, resampled, f);
                 };