Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
noiseVector_Z2.cpp
Go to the documentation of this file.
1 
14 #include "noiseVector_Z2.h"
15 
16 const std::string NoiseVector_Z2::class_name = "NoiseVector_Z2";
17 
18 //====================================================================
20 {
21  // This implementation assumes the given field v is complex field.
22 
24 
25  int Nex = v.nex();
26  int Nvol = v.nvol();
27  int Nin = v.nin();
28  double rn, rn2, rn3;
29  double RF2 = 1.0 / sqrt(2.0);
30 
31  for (int ex = 0; ex < Nex; ++ex) {
32  for (int site = 0; site < Nvol; ++site) {
33  for (int in = 0; in < Nin; ++in) {
34  rn = v.cmp(in, site, ex);
35  rn2 = floor(2.0 * rn);
36  rn3 = (2.0 * rn2 - 1.0) * RF2;
37  v.set(in, site, ex, rn3);
38  }
39  }
40  }
41 }
42 
43 
44 //====================================================================
45 //============================================================END=====
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:128
virtual void uniform_lex_global(Field &)
uniform random number defined on global lattice.
Container of Field-type object.
Definition: field.h:37
int nvol() const
Definition: field.h:101
double cmp(const int jin, const int site, const int jex) const
Definition: field.h:108
RandomNumbers * m_rand
int nin() const
Definition: field.h:100
int nex() const
Definition: field.h:102
void set(Field &v)
setting a noise vector.
static const std::string class_name