00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00026 class dwfermi_field: public mdp_complex_field {
00027 public:
00028 int nspin, nc, L5;
00029 dwfermi_field() {
00030 reset_field();
00031 L5=0;
00032 }
00033 dwfermi_field(mdp_lattice &a, int L5_, int nc_, int nspin_=4) {
00034 reset_field();
00035 L5=L5_;
00036 nc=nc_;
00037 nspin=nspin_;
00038 allocate_field(a, L5*nspin*nc);
00039 }
00040 dwfermi_field(const dwfermi_field &psi) : mdp_complex_field(psi) {
00041 L5=psi.L5;
00042 nc=psi.nc;
00043 nspin=psi.nspin;
00044 }
00045 void allocate_dwfermi_field(mdp_lattice &a,
00046 int L5_, int nc_, int nspin_=4) {
00047 deallocate_field();
00048 L5=L5_;
00049 nc=nc_;
00050 nspin=nspin_;
00051 allocate_field(a, L5*nspin*nc);
00052 }
00053 inline mdp_matrix operator() (site x, int L5_) {
00054 return mdp_matrix(address(x, L5_*nc*nspin),nspin,nc);
00055 }
00056 inline mdp_matrix operator() (site x, int L5_, int a) {
00057 return mdp_matrix(address(x,(L5_*nspin+a)*nc),nc,1);
00058 }
00059 inline mdp_complex& operator() (site x, int L5_, int a, int i) {
00060 return *(address(x,(L5_*nspin+a)*nc+i));
00061 }
00062 inline const mdp_complex& operator() (site x, int L5_, int a, int i) const {
00063 return *(address(x,(L5_*nspin+a)*nc+i));
00064 }
00065 void operator= (mdp_complex a) {
00066 for(mdp_int i=0; i<size; i++) m[i]=a;
00067 }
00068 };
00069
00070