ESyS-Particle  2.3.2
Rng.hpp
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 namespace esys
15 {
16  namespace lsm
17  {
18  template <typename TmplRng>
19  UniformRng<TmplRng>::UniformRng(double minRn, double maxRn)
20  : m_rng(),
21  m_uniform(minRn, maxRn),
22  m_generator(m_rng, m_uniform)
23  {
24  }
25 
26  template <typename TmplRng>
28  {
29  return m_generator();
30  }
31 
32  template <typename TmplRng>
34  {
35  m_rng.seed();
36  }
37 
38  template <typename TmplRng>
39  template <typename Tmpl>
41  {
42  m_rng.seed(s);
43  }
44 
45  template <typename TmplRng>
46  template <typename TmplIt>
47  void UniformRng<TmplRng>::seed(TmplIt first, TmplIt last)
48  {
49  m_rng.seed(first, last);
50  }
51  }
52 }