IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 8429946d authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan:
Browse files

Merge branch '14-requirements-for-first-interface-to-corsika-random-numbers' into 'master'

Resolve "Requirements for first interface to CORSIKA: Random numbers"

Closes #14

See merge request !6
parents d90842e5 cd86021d
No related branches found
No related tags found
1 merge request!6Resolve "Requirements for first interface to CORSIKA: Random numbers"
......@@ -10,7 +10,8 @@ void corsika::random::RNGManager::RegisterRandomStream(std::string const& pStrea
rngs[pStreamName] = std::move(rng);
}
corsika::random::RNG& corsika::random::RNGManager::GetRandomStream(std::string const& pStreamName) {
corsika::random::RNG& corsika::random::RNGManager::GetRandomStream(
std::string const& pStreamName) {
return rngs.at(pStreamName);
}
......@@ -22,3 +23,8 @@ std::stringstream corsika::random::RNGManager::dumpState() const {
return buffer;
}
void corsika::random::RNGManager::SetSeedSeq(std::string const& pStreamName,
std::seed_seq const& pSeedSeq) {
seeds[pStreamName] = pSeedSeq;
}
......@@ -38,7 +38,12 @@ namespace corsika::random {
* into a std::stringstream.
*/
std::stringstream dumpState() const;
/**
* set seed_seq of \a pStreamName to \a pSeedSeq
*/
void SetSeedSeq(std::string const& pStreamName, std::seed_seq& const pSeedSeq);
};
} // namespace Random
} // namespace corsika::random
#endif
......@@ -21,6 +21,8 @@ SCENARIO("random-number streams can be registered and retrieved") {
THEN("an unknown sequence cannot be retrieved") {
REQUIRE_THROWS(rngManager.GetRandomStream("stream_UNKNOWN"));
}
// seeding not covered yet
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment