From 9f891e268e09f52551090d7256dc0df9b9522c4b Mon Sep 17 00:00:00 2001 From: Kai Germaschewski Date: Wed, 5 Jun 2024 22:19:08 -0400 Subject: [PATCH] build: use std::shuffle rather than deprecated/removed std::random_shuffle --- src/libpsc/psc_collision/psc_collision_impl.hxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libpsc/psc_collision/psc_collision_impl.hxx b/src/libpsc/psc_collision/psc_collision_impl.hxx index 78d8dbc8c8..eadf79688e 100644 --- a/src/libpsc/psc_collision/psc_collision_impl.hxx +++ b/src/libpsc/psc_collision/psc_collision_impl.hxx @@ -8,6 +8,7 @@ #include #include +#include extern void* global_collision; // FIXME @@ -164,11 +165,11 @@ struct CollisionHost // ---------------------------------------------------------------------- // randomize_in_cell - static std::vector randomize_in_cell(int n_start, int n_end) + std::vector randomize_in_cell(int n_start, int n_end) { std::vector permute(n_end - n_start); std::iota(permute.begin(), permute.end(), n_start); - std::random_shuffle(permute.begin(), permute.end()); + std::shuffle(permute.begin(), permute.end(), rng_); return permute; } @@ -265,6 +266,8 @@ private: double nu_; int interval_; + std::mt19937 rng_; + public: // FIXME // for output Mfields mflds_stats_;