ComPWA
Common Partial-Wave-Analysis Framework
Random.hpp
Go to the documentation of this file.
1 // Copyright (c) 2015, 2017 The ComPWA Team.
2 // This file is part of the ComPWA framework, check
3 // https://github.com/ComPWA/ComPWA/license.txt for details.
4 
5 #ifndef COMPWA_RANDOM_H_
6 #define COMPWA_RANDOM_H_
7 
8 #include <random>
9 
10 namespace ComPWA {
11 
17 public:
18  virtual ~UniformRealNumberGenerator() = default;
19  // generate random double in the range from [0,1)
20  virtual double operator()() = 0;
21  virtual int getSeed() const = 0;
22  virtual void setSeed(int seed) = 0;
23 };
24 
27  std::uniform_real_distribution<double> UniformDistribution;
28  int Seed;
29 
30 public:
31  StdUniformRealGenerator(int seed = 123456);
32 
33  double operator()() final;
34  int getSeed() const final;
35  void setSeed(int seed) final;
36 };
37 
38 } // namespace ComPWA
39 
40 #endif
std::mt19937 MersenneTwisterRandomGenerator
Definition: Random.hpp:26
virtual ~UniformRealNumberGenerator()=default
virtual int getSeed() const =0
std::uniform_real_distribution< double > UniformDistribution
Definition: Random.hpp:27
virtual void setSeed(int seed)=0