#ifndef GRID_LATTICE_UNARY_H #define GRID_LATTICE_UNARY_H namespace Grid { template Lattice pow(const Lattice &rhs,RealD y){ Lattice ret(rhs._grid); ret.checkerboard = rhs.checkerboard; conformable(ret,rhs); PARALLEL_FOR_LOOP for(int ss=0;ssoSites();ss++){ ret._odata[ss]=pow(rhs._odata[ss],y); } return ret; } template Lattice mod(const Lattice &rhs,Integer y){ Lattice ret(rhs._grid); ret.checkerboard = rhs.checkerboard; conformable(ret,rhs); PARALLEL_FOR_LOOP for(int ss=0;ssoSites();ss++){ ret._odata[ss]=mod(rhs._odata[ss],y); } return ret; } template Lattice div(const Lattice &rhs,Integer y){ Lattice ret(rhs._grid); ret.checkerboard = rhs.checkerboard; conformable(ret,rhs); PARALLEL_FOR_LOOP for(int ss=0;ssoSites();ss++){ ret._odata[ss]=div(rhs._odata[ss],y); } return ret; } template Lattice expMat(const Lattice &rhs, ComplexD alpha, Integer Nexp = DEFAULT_MAT_EXP){ Lattice ret(rhs._grid); ret.checkerboard = rhs.checkerboard; conformable(ret,rhs); PARALLEL_FOR_LOOP for(int ss=0;ssoSites();ss++){ ret._odata[ss]=Exponentiate(rhs._odata[ss],alpha, Nexp); } return ret; } } #endif