Ocular Engine
MersenneTwister127.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_MATH_RANDOM_TINY_MERSENNE_TWISTER__H__
19 #define __H__OCULAR_MATH_RANDOM_TINY_MERSENNE_TWISTER__H__
20 
21 #include "ARandom.hpp"
22 #include <array>
23 
24 //------------------------------------------------------------------------------------------
25 
30 namespace Ocular
31 {
36  namespace Math
37  {
42  namespace Random
43  {
53  class MersenneTwister127 : public ARandom
54  {
55  public:
56 
59 
60  virtual void seed(int64_t seed);
61  virtual uint32_t next();
62 
63  protected:
64 
65  void nextState();
66  uint64_t temper();
67 
68  int64_t m_Mat1;
69  int64_t m_Mat2;
70  int64_t m_TMat;
71 
72  std::array<int64_t, 4> m_Status;
73 
74  private:
75  };
76  }
80  }
84 }
89 //------------------------------------------------------------------------------------------
90 
91 #endif
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: MersenneTwister127.hpp:53
virtual uint32_t next()
Definition: MersenneTwister127.cpp:74
void seed()
Definition: ARandom.cpp:52
Definition: ARandom.hpp:67