ESyS-Particle  2.3.2
Rng.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 
14 #ifndef ESYS_LSMRNG_H
15 #define ESYS_LSMRNG_H
16 
17 #include <boost/random.hpp>
18 
19 namespace esys
20 {
21  namespace lsm
22  {
26  template <typename TmplRng=boost::mt19937>
27  class UniformRng
28  {
29  public:
30  typedef TmplRng Rng;
31  typedef boost::uniform_real<> UniformReal;
32  typedef boost::variate_generator<Rng &, UniformReal> Generator;
33 
39  UniformRng(double minRn, double maxRn);
40 
45  double operator()();
46 
50  void seed();
51 
56  template <typename Tmpl>
57  void seed(Tmpl &s);
58 
64  template <typename TmplIt>
65  void seed(TmplIt begin, TmplIt end);
66 
67  private:
71  };
72 
74 
75  namespace rng
76  {
78  }
79  }
80 }
81 
82 #include "Foundation/Rng.hpp"
83 
84 #endif