Removed 'image' test (superseeded by 'luaimage' test)
[tagua/yd.git] / src / random.h
blobea819a1b776f53dc7114413b74935389fdce7c55
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
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.
9 */
11 #ifndef RANDOM_H
12 #define RANDOM_H
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>
19 class Random {
20 public:
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;
28 public:
29 IntegerGenerator rand(int min, int max);
30 RealGenerator rand(float min, float max);
31 RealGenerator rand(double min, double max);
34 #endif // RANDOM_H