From e3a1b87200caf45d00c3601e940fecd48c4dee6a Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Mon, 14 Dec 2020 18:35:26 +0100 Subject: [PATCH] src/lib/ranges/dynamic_range.cc: warning (no error) if ranges different, check meta instead (preliminary solution) --- src/lib/ranges/dynamic_range.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lib/ranges/dynamic_range.cc b/src/lib/ranges/dynamic_range.cc index 0c7ac2a..7d2c641 100644 --- a/src/lib/ranges/dynamic_range.cc +++ b/src/lib/ranges/dynamic_range.cc @@ -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();