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

mdp_matrix_field.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00024 class mdp_matrix_field: public mdp_field<mdp_complex> {
00025 public:
00026   int rows, columns, imax;
00027   mdp_matrix_field() {
00028     rows=columns=imax=0;
00029     mdp_field<mdp_complex>::reset_field();
00030   }
00031   mdp_matrix_field(mdp_matrix_field &field) {
00032     mdp_field<mdp_complex>::reset_field();
00033     rows=field.rows;
00034     columns=field.columns;
00035     imax=field.imax;
00036     allocate_field(field.lattice(),field.imax);
00037   }
00038   mdp_matrix_field(mdp_lattice &a, int i, int j) {
00039     mdp_field<mdp_complex>::reset_field();
00040     rows=i;
00041     columns=j;
00042     imax=i*j;
00043     allocate_field(a,imax);
00044   }
00045   void allocate_mdp_matrix_field(mdp_lattice &a, int i, int j) {
00046     deallocate_field();
00047     rows=i;
00048     columns=j;
00049     imax=i*j;
00050     allocate_field(a,imax);
00051   }
00052   mdp_matrix operator() (mdp_site x) {
00053     return mdp_matrix(address(x),rows,columns);
00054   }
00055   mdp_complex& operator() (mdp_site x, int i, int j) {
00056     return address(x)[i*columns+j];
00057   }
00058   const mdp_complex& operator() (mdp_site x, int i, int j) const {
00059     return address(x)[i*columns+j];
00060   }
00061 };

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