Files are now in a src directory and I'm using a src/meson.build and tests/meson.build to specify what to build.
This commit is contained in:
parent
4778677647
commit
1d4ae911b9
108 changed files with 94 additions and 83 deletions
31
src/rand.hpp
Normal file
31
src/rand.hpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
#include <random>
|
||||
#include <chrono>
|
||||
|
||||
|
||||
namespace Random {
|
||||
extern std::mt19937 GENERATOR;
|
||||
|
||||
template<typename T>
|
||||
T uniform(T from, T to) {
|
||||
std::uniform_int_distribution<T> rand(from, to);
|
||||
|
||||
return rand(GENERATOR);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T uniform_real(T from, T to) {
|
||||
std::uniform_real_distribution<T> rand(from, to);
|
||||
|
||||
return rand(GENERATOR);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T normal(T mean, T stddev) {
|
||||
std::normal_distribution<T> rand(mean, stddev);
|
||||
|
||||
return rand(GENERATOR);
|
||||
}
|
||||
|
||||
std::chrono::milliseconds milliseconds(int from, int to);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue