Skip to content

Commit

Permalink
build: use std::shuffle rather than deprecated/removed std::random_sh…
Browse files Browse the repository at this point in the history
…uffle
  • Loading branch information
Kai Germaschewski authored and germasch committed Jul 10, 2024
1 parent bc7ab69 commit d7e1cd7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libpsc/psc_collision/psc_collision_impl.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <cmath>
#include <numeric>
#include <random>

extern void* global_collision; // FIXME

Expand Down Expand Up @@ -164,11 +165,11 @@ struct CollisionHost
// ----------------------------------------------------------------------
// randomize_in_cell

static std::vector<int> randomize_in_cell(int n_start, int n_end)
std::vector<int> randomize_in_cell(int n_start, int n_end)
{
std::vector<int> 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;
}

Expand Down Expand Up @@ -265,6 +266,8 @@ private:
double nu_;
int interval_;

std::mt19937 rng_;

public: // FIXME
// for output
Mfields mflds_stats_;
Expand Down

0 comments on commit d7e1cd7

Please sign in to comment.