Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

fermiqcd_staggered_field.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00024 class staggered_field: public mdp_complex_field {
00025  public:
00026   int nc, ndim, nspin;
00027 
00028   staggered_field(mdp_lattice &a, int nc_, int nspin_=4) {
00029     // attention here that nspin_ is ignored!
00030     nc=nc_;
00031     nspin=nspin_;
00032     ndim=a.ndim;
00033     allocate_field(a,nc);
00034   }
00035   staggered_field(staggered_field &chi) {
00036     // attention here that nspin_ is ignored!
00037     nc=chi.nc;
00038     nspin=chi.nspin;
00039     ndim=chi.lattice().ndim;
00040     allocate_field(chi.lattice(),nc);
00041   }
00042   staggered_field(const staggered_field &chi) : mdp_complex_field() {
00043     nc=chi.nc;
00044     ndim=chi.ndim;
00045     nspin=chi.nspin;
00046     mdp_complex_field::operator=(chi);
00047   }
00048   void operator=(const staggered_field &chi) {
00049     nc=chi.nc;
00050     ndim=chi.ndim;
00051     nspin=chi.nspin;
00052     mdp_complex_field::operator=(chi);
00053   }
00054   inline mdp_matrix operator() (site x) {
00055     return mdp_matrix(address(x),nc,1);
00056   }
00057   inline mdp_complex& operator() (site x, int i) { 
00058     return *(address(x,i));
00059   }
00060   inline const mdp_complex& operator() (site x, int i) const { 
00061     return *(address(x,i));
00062   }
00063   void operator= (mdp_complex a) {
00064     for(long i=0; i<size; i++) m[i]=a;
00065   }
00066    
00067   inline mdp_real component(site x, int mu) { 
00068     return x(mu) % 2;
00069   }
00070   inline mdp_real eta(site x, int mu) { 
00071 #ifdef USE_GOLTERMAN
00072     int i, tmp, i_max=(mu+ndim-1) % ndim;
00073     tmp=0;
00074     for(i=1; i<=i_max; i++) tmp+=x(i);
00075 #else
00076     int i, tmp;
00077     tmp=0;
00078     for(i=0; i<mu; i++) tmp+=x(i);
00079 #endif  
00080     return mdp_mod2sign(tmp);
00081   }
00082   /*
00083   inline mdp_real zeta(site x, int mu) { 
00084     
00085   }
00086   */
00087   inline mdp_real eps (site x) { 
00088     int tmp;
00089     int i;
00090     tmp=x(0);
00091     for(i=1; i<ndim; i++) tmp+=x(i);
00092     return mdp_mod2sign(tmp);
00093   }
00094   inline mdp_real type (site x) { 
00095     mdp_real tmp;
00096     int i;
00097     tmp=x(0) % 2;
00098     for(i=1; i<ndim; i++) tmp+=(x(i) % 2)*pow(2.0,i);
00099     return tmp;
00100   }
00101 
00102 
00103 };
00104 

Generated on Sun Feb 27 15:12:19 2005 by  doxygen 1.4.1