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

fermiqcd_check_differences.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 // compares two fields and returns the max distrance between 
00014 // equivalent components.
00015 float check_differences(mdp_field<mdp_complex> &chi,
00016                         mdp_field<mdp_complex> &psi) {
00017   begin_function("check_differences");
00018 
00019   long i;
00020   long i_min=psi.physical_local_start();
00021   long i_max=psi.physical_local_stop();
00022   float max=0, tmp;
00023   if(&chi.lattice()!=&psi.lattice()) 
00024     error("check_differences()\nFields defined on different lattices");
00025   for(i=i_min; i<i_max; i++) {
00026     tmp=abs(chi[i]-psi[i]);
00027     if(tmp>max) max=tmp;
00028   }
00029   mdp << "Fields agree/disagree within precision=" << max << '\n';
00030 
00031   end_function("check_differences");
00032   return max;
00033 }

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