Update src/distribution.cpp

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Olaf Schumann 2021-09-29 17:10:11 +02:00 committed by GitHub
parent d7622c1b5d
commit 3fde9412f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -323,10 +323,7 @@ double Mixture::sample(uint64_t* seed) const
p, [](const DistPair& pair, double p) { return pair.first < p; });
// This should not happen. Catch it
// TODO: Remove this check, when the code is trusted to always operate
if (it == distribution_.cend()) {
fatal_error("Bad Sampling in Mixture Distribution.");
}
Ensures(it != distribution_.cend());
// Sample the choosen distribution
return it->second->sample(seed);