mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-03 21:44:33 +00:00 
			
		
		
		
	cout IO for all types
This commit is contained in:
		@@ -176,7 +176,27 @@ PARALLEL_FOR_LOOP
 | 
			
		||||
        }
 | 
			
		||||
        return ret;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 }; // class Lattice
 | 
			
		||||
 | 
			
		||||
  template<class vobj> inline std::ostream& operator<< (std::ostream& stream, const Lattice<vobj> &o){
 | 
			
		||||
    std::vector<int> gcoor;
 | 
			
		||||
    typedef typename vobj::scalar_object sobj;
 | 
			
		||||
    sobj ss;
 | 
			
		||||
    for(int g=0;g<o._grid->_gsites;g++){
 | 
			
		||||
      o._grid->GlobalIndexToGlobalCoor(g,gcoor);
 | 
			
		||||
      peekSite(ss,o,gcoor);
 | 
			
		||||
      stream<<"[";
 | 
			
		||||
      for(int d=0;d<gcoor.size();d++){
 | 
			
		||||
	stream<<gcoor[d];
 | 
			
		||||
	if(d!=gcoor.size()-1) stream<<",";
 | 
			
		||||
      }
 | 
			
		||||
      stream<<"]\t";
 | 
			
		||||
      stream<<ss<<std::endl;
 | 
			
		||||
    }
 | 
			
		||||
    return stream;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -110,7 +110,7 @@ PARALLEL_FOR_LOOP
 | 
			
		||||
    // Peek a scalar object from the SIMD array
 | 
			
		||||
    //////////////////////////////////////////////////////////
 | 
			
		||||
    template<class vobj,class sobj>
 | 
			
		||||
      void peekSite(sobj &s,Lattice<vobj> &l,std::vector<int> &site){
 | 
			
		||||
      void peekSite(sobj &s,const Lattice<vobj> &l,std::vector<int> &site){
 | 
			
		||||
        
 | 
			
		||||
      GridBase *grid=l._grid;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user