Bridge++  Ver. 1.1.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 //====================================================================
18 {
19  // This implementation assumes the given field v is complex field.
20 
22 
23  int Nex = v.nex();
24  int Nvol = v.nvol();
25  int Nin = v.nin();
26  double rn, rn2, rn3;
27  double RF2 = 1.0 / sqrt(2.0);
28 
29  for (int ex = 0; ex < Nex; ++ex) {
30  for (int site = 0; site < Nvol; ++site) {
31  for (int in = 0; in < Nin; ++in) {
32  rn = v.cmp(in, site, ex);
33  rn2 = floor(2.0 * rn);
34  rn3 = (2.0 * rn2 - 1.0) * RF2;
35  v.set(in, site, ex, rn3);
36  }
37  }
38  }
39 }
40 
41 
42 //====================================================================
43 //============================================================END=====