/* * random.hpp * * Created on: May 28, 2015 * Author: Jan Travnicek */ #ifndef RANDOM_HPP_ #define RANDOM_HPP_ namespace std { class random_devices { public: static random_device random; private: class semirandom_device { public: typedef unsigned int result_type; private: std::mt19937 gen; std::uniform_int_distribution<unsigned int> dis; public: semirandom_device() : gen(random_devices::random()) { } result_type operator()() { return dis(gen); } result_type min() { return 0; } result_type max() { return numeric_limits<result_type>::max() ; } }; public: static semirandom_device semirandom; }; } /* namespace std */ #endif /* ALGORITHM_HPP_ */