aboutsummaryrefslogtreecommitdiffstats
path: root/random.h
blob: fb0c7b3ef79293dfa17caedd020a9ded9c2db717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef RANDOM_H
#define RANDOM_H

#include <random>

inline double randomN()
{
    static std::uniform_real_distribution<double> distribution (0.0, 1.0);
    static std::mt19937 generator;
    return distribution(generator);
}

#endif // RANDOM_H