Skip to content
Snippets Groups Projects
Commit b26cd4ff authored by Carl Philipp Klemm's avatar Carl Philipp Klemm
Browse files

add missing files

parent dc695953
No related branches found
No related tags found
No related merge requests found
#include "randomgen.h"
#include <assert.h>
#include <cstddef>
#include <cstdint>
#include <random>
static std::default_random_engine randomEngine;
static std::uniform_real_distribution<double> dist(0, 1);
static std::uniform_int_distribution<size_t> distSt(0, SIZE_MAX);
double rd::rand(double max)
{
return dist(randomEngine)*max;
}
size_t rd::uid()
{
return distSt(randomEngine);
}
void rd::init()
{
std::random_device randomDevice;
randomEngine.seed(randomDevice());
}
#pragma once
#include <cstddef>
namespace rd
{
double rand(double max = 1);
void init();
size_t uid();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment