mirror of
https://github.com/YutaItoh/3D-Eye-Tracker.git
synced 2025-09-26 23:39:12 +08:00
17 lines
421 B
C++
17 lines
421 B
C++
#include <singleeyefitter/utils.h>
|
|
|
|
#include <random>
|
|
|
|
static std::mt19937 static_gen;
|
|
int singleeyefitter::random(int min, int max)
|
|
{
|
|
std::uniform_int_distribution<> distribution(min, max);
|
|
return distribution(static_gen);
|
|
}
|
|
int singleeyefitter::random(int min, int max, unsigned int seed)
|
|
{
|
|
std::mt19937 gen(seed);
|
|
std::uniform_int_distribution<> distribution(min, max);
|
|
return distribution(gen);
|
|
}
|