Commit 627421e1 authored by Konstantinos Chatzilygeroudis's avatar Konstantinos Chatzilygeroudis
Browse files

Minor fix in random

parent f6a50f46
......@@ -63,13 +63,13 @@ namespace limbo {
/// a mt19937-based random generator (mutex-protected)
///
/// usage :
/// - RandomGenerator<double>(0.0, 1.0);
/// - RandomGenerator<dist<double>>(0.0, 1.0);
/// - double r = rgen.rand();
template <typename D>
class RandomGenerator {
public:
using result_type = typename D::result_type;
RandomGenerator(result_type min, result_type max) : _dist(min, max), _rgen(randutils::auto_seed_128{}.base()) {}
RandomGenerator(result_type a, result_type b) : _dist(a, b), _rgen(randutils::auto_seed_128{}.base()) {}
result_type rand()
{
std::lock_guard<std::mutex> lock(_mutex);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment