Bridge++  Version 1.4.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  int Nex = v.nex();
26  int Nvol = v.nvol();
27  int Nin = v.nin();
28 
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  double rn1 = v.cmp(in, site, ex);
35  double rn2 = floor(2.0 * rn1);
36  double 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:164
virtual void uniform_lex_global(Field &)
uniform random number defined on global lattice.
Container of Field-type object.
Definition: field.h:39
int nvol() const
Definition: field.h:116
double cmp(const int jin, const int site, const int jex) const
Definition: field.h:132
RandomNumbers * m_rand
int nin() const
Definition: field.h:115
int nex() const
Definition: field.h:117
void set(Field &v)
setting a noise vector.
static const std::string class_name