Utilities for randomization.
Definition in file randutils.hpp.
#include <medusa/Config.hpp>
#include <medusa/bits/utils/assert.hpp>
#include <medusa/bits/types/Range.hpp>
#include <random>
#include <chrono>
Go to the source code of this file.
Namespaces | |
mm | |
Root namespace for the whole library. | |
Functions | |
unsigned int | mm::get_seed () |
Return a random seed. More... | |
template<typename T , typename URNG > | |
T | mm::random_choice (const Range< T > &elements, const Range< double > &weights, bool normed, URNG &generator) |
Overload for custom generator. More... | |
template<typename T > | |
T | mm::random_choice (const Range< T > &elements, const Range< double > &weights={}, bool normed=false) |
Randomly returns one of the specified elements with distribution according to given weights. More... | |