Bridge++  Version 1.5.4
 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  const int Nex = v.nex();
26  const int Nvol = v.nvol();
27  const int Nin = v.nin();
28 
29  const 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  double rn1 = v.cmp(in, site, ex);
35  double rn2 = floor(2.0 * rn1);
36  double rn3 = (2.0 * rn2 - 1.0) * RF2;
37 
38  v.set(in, site, ex, rn3);
39  }
40  }
41  }
42 }
43 
44 
45 //====================================================================
46 //============================================================END=====
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:175
virtual void uniform_lex_global(Field &)
uniform random number defined on global lattice.
Container of Field-type object.
Definition: field.h:45
int nvol() const
Definition: field.h:127
double cmp(const int jin, const int site, const int jex) const
Definition: field.h:143
RandomNumbers * m_rand
int nin() const
Definition: field.h:126
int nex() const
Definition: field.h:128
void set(Field &v)
setting a noise vector.
static const std::string class_name