1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-13 12:47:05 +01:00

Fix to iVector and iMatrix pokeIndex and checkerboard local site indexing.

This commit is contained in:
Christopher Kelly
2016-07-11 17:15:22 -04:00
parent c5106d0c03
commit a3c0fb79b6
3 changed files with 18 additions and 7 deletions

View File

@ -123,7 +123,7 @@ public:
//////////////////////////////////////////////////////////
// SIMD lane addressing
//////////////////////////////////////////////////////////
inline int iIndex(std::vector<int> &lcoor)
virtual int iIndex(std::vector<int> &lcoor)
{
int idx=0;
for(int d=0;d<_ndimension;d++) idx+=_istride[d]*(lcoor[d]/_rdimensions[d]);

View File

@ -224,9 +224,20 @@ protected:
idx+=_ostride[d]*(coor[d]%_rdimensions[d]);
}
}
return idx;
return idx;
};
virtual int iIndex(std::vector<int> &lcoor)
{
int idx=0;
for(int d=0;d<_ndimension;d++) {
if( d==_checker_dim ) {
idx+=_istride[d]*(lcoor[d]/(2*_rdimensions[d]));
} else {
idx+=_istride[d]*(lcoor[d]/_rdimensions[d]);
}
}
return idx;
}
};
}