MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / rand_setSeedsToDefault

Function rand_setSeedsToDefault

quest/src/core/randomiser.cpp:86–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85
86void rand_setSeedsToDefault() {
87
88 // seeds will attempt to use device's CSPRNG
89 std::random_device device;
90
91 // use CSPRNG to generate well-spread seeds
92 vector<unsigned> seeds(DEFAULT_NUM_RNG_SEEDS);
93
94 // root node produces seeds (non-root seeds would be ignored)
95 if (comm_getRank() == 0)
96 for (auto &seed : seeds)
97 seed = device();
98
99 rand_setSeeds(seeds);
100}
101
102
103int rand_getNumSeeds() {

Callers 2

setSeedsToDefaultFunction · 0.85

Calls 2

comm_getRankFunction · 0.85
rand_setSeedsFunction · 0.85

Tested by

no test coverage detected