CHROMA
time_slice_set.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Convenience for building time-slice subsets
3  */
4 
6 #include "util/ft/single_phase.h"
7 #include "qdp_util.h" // part of QDP++, for crtesn()
8 
9 namespace Chroma
10 {
11 
12  // Anonymous namespace
13  namespace
14  {
15  //! Function object used for constructing the time-slice set
16  class TimeSliceFunc : public SetFunc
17  {
18  public:
19  TimeSliceFunc(int dir) : dir_decay(dir) {}
20 
21  int operator() (const multi1d<int>& coordinate) const
22  {
23  if ((dir_decay<0)||(dir_decay>=Nd)) {
24  return 0 ;
25  } else {
26  return coordinate[dir_decay] ;
27  }
28  }
29 
30  int numSubsets() const
31  {
32  if ((dir_decay<0)||(dir_decay>=Nd)) {
33  return 1 ;
34  } else {
35  return Layout::lattSize()[dir_decay] ;
36  }
37  }
38 
39  private:
40  TimeSliceFunc() {} // hide default constructor
41 
42  int dir_decay;
43  };
44 
45  } // end anonymous namespace
46 
47 
48 
49  int
51  {
52  int vol = 1;
53 
54  if ((decay_dir<0)||(decay_dir>=Nd))
55  vol = Layout::vol();
56  else
57  {
58  for(int m=0; m < Nd; ++m)
59  vol *= Layout::lattSize()[m];
60  }
61 
62  return vol;
63  }
64 
65 
67  {
69  }
70 
71 
72 } // end namespace Chroma
Function object used for constructing the time-slice set.
Definition: barQll_w.h:95
int numSubsets() const
Definition: barQll_w.h:108
int operator()(const multi1d< int > &coordinate) const
Definition: barQll_w.h:99
int numSites() const
Number of sites in each subset.
Function object used for constructing the time-slice set.
static int m[4]
Definition: make_seeds.cc:16
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
Compute a single phase factor.
Convenience for building time-slice subsets.