Bridge++  Ver. 1.3.x
randomNumbers_SFMT.h
Go to the documentation of this file.
1 
14 #ifndef RANDOMNUMBERS_SFMT_INCLUDED
15 #define RANDOMNUMBERS_SFMT_INCLUDED
16 
17 #ifdef USE_SFMTLIB
18 
19 // #define __STDC_CONSTANT_MACROS
20 
21 #include <string>
22 #include <cassert>
23 
24 #include "randomNumbers.h"
25 
26 #include <SFMT.h>
27 
28 #ifdef HAVE_NTL
29 #define ENABLE_SFMT_JUMP
30 #include <SFMT-jump-alt.h>
31 #endif
32 
33 #include "bridgeIO.h"
34 using Bridge::vout;
35 
36 class RandomNumbers_SFMT : public RandomNumbers
37 {
38  static const std::string class_name;
39 
40  public:
41  RandomNumbers_SFMT(const int s);
42  RandomNumbers_SFMT(const std::string& filename) { readfile(filename); }
43 
44  ~RandomNumbers_SFMT() {}
45 
46  double get();
47  void get_block(double *v, const size_t n);
48 
49  void writefile(const std::string& filename);
50  void readfile(const std::string& filename);
51 
52 #ifdef ENABLE_SFMT_JUMP
53  virtual void uniform_lex_global(Field&);
54  virtual void gauss_lex_global(Field&);
55 #endif
56 
57  private:
58 
59  template<typename T>
60  void generate_global_jump(Field& f);
61 
62  sfmt_t m_state;
63 };
64 #endif /* USE_SFMTLIB */
65 #endif /* RANDOMNUMBERS_SFMT_INCLUDED */
BridgeIO vout
Definition: bridgeIO.cpp:278
virtual void uniform_lex_global(Field &)
uniform random number defined on global lattice.
Container of Field-type object.
Definition: field.h:39
static const std::string class_name
Definition: randomNumbers.h:42
virtual void gauss_lex_global(Field &)
gaussian random number defined on global lattice.
Base class of random number generators.
Definition: randomNumbers.h:39