1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-17 15:27:06 +01:00

Addressed when coor.size() != dim.size() in Lexicographic

This commit is contained in:
Chulwoo Jung
2017-10-19 10:28:57 -04:00
parent ef61b549e6
commit 137886c316
3 changed files with 20 additions and 4 deletions

View File

@ -18,6 +18,10 @@ namespace Grid{
static inline void IndexFromCoor (const std::vector<int>& coor,int &index,const std::vector<int> &dims){
int nd=dims.size();
if(nd > coor.size()) {
std::cout<< "coor.size "<<coor.size()<<" >dims.size "<<dims.size()<<std::endl;
assert(0);
}
int stride=1;
index=0;
for(int d=0;d<nd;d++){