2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
14 #include <boost/random/mersenne_twister.hpp>
15 #include <boost/random/variate_generator.hpp>
16 #include <boost/random/uniform_smallint.hpp>
17 #include <boost/random/uniform_real.hpp>
21 typedef boost::mt19937 RandomGenerator
;
22 typedef boost::uniform_smallint
<> IntegerDistribution
;
23 typedef boost::uniform_real
<float> RealDistribution
;
24 typedef boost::variate_generator
<RandomGenerator
*, IntegerDistribution
> IntegerGenerator
;
25 typedef boost::variate_generator
<RandomGenerator
*, RealDistribution
> RealGenerator
;
27 RandomGenerator m_generator
;
29 Random(); // singleton
30 static Random
* m_instance
;
32 IntegerGenerator
rand(int min
, int max
);
33 RealGenerator
rand(float min
, float max
);
34 RealGenerator
rand(double min
, double max
);
36 static Random
& instance();