aboutsummaryrefslogtreecommitdiffstats
path: root/random.h
blob: ec6020905c00c8d9e1f6e0c7a3d1dba80d47fa5a (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 (std::random_device{}());
    return distribution(generator);
}

#endif // RANDOM_H