#ifndef UNIFORM_H #define UNIFORM_H #include #include namespace Distribution { /** uniform distribution */ template class Uniform { private: std::minstd_rand gen; std::uniform_real_distribution dist; public: /** ctor */ Uniform(const T min, const T max) : gen(1234), dist(min, max) { } /** get a uniformaly distributed random number */ T draw() { return dist(gen); } /** set the seed to use */ void setSeed(const long seed) { gen.seed(seed); } }; } #endif // UNIFORM_H