Algos directory is setup.

This commit is contained in:
Zed A. Shaw 2026-02-27 12:07:01 -05:00
parent 0064664556
commit b91e9ffaf6
38 changed files with 46 additions and 47 deletions

31
src/algos/rand.hpp Normal file
View 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);
}