#ifndef GRID_LATTICE_TRANSPOSE_H #define GRID_LATTICE_TRANSPOSE_H /////////////////////////////////////////////// // Transpose /////////////////////////////////////////////// namespace Grid { //////////////////////////////////////////////////////////////////////////////////////////////////// // Transpose //////////////////////////////////////////////////////////////////////////////////////////////////// template inline Lattice transpose(const Lattice &lhs){ Lattice ret(lhs._grid); PARALLEL_FOR_LOOP for(int ss=0;ssoSites();ss++){ ret._odata[ss] = transpose(lhs._odata[ss]); } return ret; }; //////////////////////////////////////////////////////////////////////////////////////////////////// // Index level dependent transpose //////////////////////////////////////////////////////////////////////////////////////////////////// template inline auto transposeIndex(const Lattice &lhs) -> Lattice(lhs._odata[0]))> { Lattice(lhs._odata[0]))> ret(lhs._grid); PARALLEL_FOR_LOOP for(int ss=0;ssoSites();ss++){ ret._odata[ss] = transposeIndex(lhs._odata[ss]); } return ret; }; } #endif