From 4ba682328edca9bdbfe3933e23ffa225d78615e2 Mon Sep 17 00:00:00 2001 From: andreas <andreas@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Fri, 3 Sep 2010 19:49:04 +0000 Subject: [PATCH] added random range generator to value util git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2689 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/img/base/src/value_util.hh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/img/base/src/value_util.hh b/modules/img/base/src/value_util.hh index b17e42cff..44247eda7 100644 --- a/modules/img/base/src/value_util.hh +++ b/modules/img/base/src/value_util.hh @@ -69,7 +69,16 @@ T Random() { return UniformRandom(); } - +typedef boost::variate_generator<boost::mt19937&, boost::uniform_int<> > UniformIntGenerator; + +inline +UniformIntGenerator GetUniformIntGenerator(int min, int max) +{ + boost::uniform_int<> dist(min,max); + return UniformIntGenerator(RandomGenerator, dist); +} + + // value to value conversion // declaration -- GitLab