CHROMA
shift2.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Shift by a power of 2
3  */
4 
5 #include "chromabase.h"
6 #include "util/gauge/shift2.h"
7 
8 namespace Chroma
9 {
10 
11  //! A simple not-fancy power of 2 shift
12  /*! \ingroup gauge */
13  LatticeColorMatrix shift2(const LatticeColorMatrix& s1, int isign, int dir, int level)
14  {
15  START_CODE();
16 
17  LatticeColorMatrix d;
18 
19  if (level == 0)
20  {
21  d = shift(s1,isign,dir);
22  }
23  else
24  {
25  LatticeColorMatrix tmp = shift(s1,isign,dir);
26  d = shift(tmp,isign,dir);
27 
28  int cnt = 1 << (level -1);
29  for (; cnt-- > 0; )
30  {
31  tmp = shift(d,isign,dir);
32  d = shift(tmp,isign,dir);
33  }
34  }
35 
36  END_CODE();
37 
38  return d;
39  }
40 
41 }
Primary include file for CHROMA library code.
LatticeColorMatrix shift2(const LatticeColorMatrix &s1, int isign, int dir, int level)
A simple not-fancy power of 2 shift.
Definition: shift2.cc:13
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
DComplex d
Definition: invbicg.cc:99
START_CODE()
Shift by a power of 2.