Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 #include "randomNumbers.h"
24 #include <SFMT.h>
25 
26 #ifdef HAVE_NTL
27 #define ENABLE_SFMT_JUMP
28 #include <SFMT-jump-alt.h>
29 #endif
30 
31 #include "bridgeIO.h"
32 using Bridge::vout;
33 
34 class RandomNumbers_SFMT : public RandomNumbers
35 {
36  static const std::string class_name;
37 
38  public:
39  RandomNumbers_SFMT(const int s);
40  RandomNumbers_SFMT(const std::string& filename) { readfile(filename); }
41 
42  ~RandomNumbers_SFMT() {}
43 
44  double get();
45  void get_block(double *v, const size_t n);
46 
47  void writefile(const std::string& filename);
48  void readfile(const std::string& filename);
49 
50 #ifdef ENABLE_SFMT_JUMP
51  virtual void uniform_lex_global(Field&);
52  virtual void gauss_lex_global(Field&);
53 
54 #endif
55 
56  private:
57 
58  template<typename T>
59  void generate_global_jump(Field& f);
60 
61  sfmt_t m_state;
62 };
63 
64 #endif /* USE_SFMTLIB */
65 
66 #endif /* RANDOMNUMBERS_SFMT_INCLUDED */
BridgeIO vout
Definition: bridgeIO.cpp:207
virtual void uniform_lex_global(Field &)
uniform random number defined on global lattice.
Container of Field-type object.
Definition: field.h:37
static const std::string class_name
Definition: randomNumbers.h:43
virtual void gauss_lex_global(Field &)
gaussian random number defined on global lattice.
Base class of random number generators.
Definition: randomNumbers.h:40