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.
13 Random
* Random::m_instance
= 0;
17 Random::IntegerGenerator
Random::rand(int min
, int max
) {
18 return IntegerGenerator(&m_generator
, IntegerDistribution(min
, max
));
21 Random::RealGenerator
Random::rand(float min
, float max
) {
22 return RealGenerator(&m_generator
, RealDistribution(min
, max
));
25 Random::RealGenerator
Random::rand(double min
, double max
) {
26 return rand(static_cast<float>(min
),
27 static_cast<float>(max
));
30 Random
& Random::instance() {
32 m_instance
= new Random
;