From dc9a331d07fceefb3b440df8205879f62d26772b Mon Sep 17 00:00:00 2001 From: void Date: Mon, 21 Dec 2009 00:15:14 +0100 Subject: [PATCH] Added random_real --- ail/random.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ail/random.hpp b/ail/random.hpp index 73edac0..92ad14c 100644 --- a/ail/random.hpp +++ b/ail/random.hpp @@ -4,6 +4,7 @@ #include #include +#include namespace ail { @@ -27,6 +28,18 @@ namespace ail return generator(); } + template + real_type random_real(real_type minimum = 0, real_type maximum = 1) + { + seed_check(); + + typedef boost::uniform_real distribution_type; + + distribution_type distribution(minimum, maximum); + boost::variate_generator generator(prng_algorithm, distribution); + return generator(); + } + template element_type & random_pick(element_type (&array)[array_size]) { -- 2.11.4.GIT