src/lib/ranges/dynamic_range.cc: warning (no error) if ranges different, check meta instead (preliminary solution)

This commit is contained in:
Christian Zimmermann 2020-12-14 18:35:26 +01:00
parent ac5b74c57a
commit e3a1b87200

View file

@ -180,9 +180,18 @@ namespace MultiArrayTools
const std::string& iname = inames[i];
const std::string smeta = (iname.find_first_of("=") != std::string::npos) ? iname.substr(iname.find_first_of("=")+1) : "";
if(sIMap.count(iname) != 0){
MA_ASSERT(this->range()->sub(i) == sIMap.at(iname)->range(),
std::string("range of index at position ")+std::to_string(i)+
" is different from range of index with name "+iname);
auto thisr = this->range()->sub(i);
auto mapr = sIMap.at(iname)->range();
if(thisr != mapr){
MA_WARNING(std::string("range of index at position ")+std::to_string(i)+
" is different from range of index with name "+iname);
MA_ASSERT(thisr->size() == mapr->size(),
"different size!");
for(size_t jj = 0; jj != thisr->size(); ++jj){
MA_ASSERT(thisr->stringMeta(jj) == mapr->stringMeta(jj),
"different meta");
}
}
}
else {
sIMap[iname] = this->range()->sub(i)->aindex();