]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Change funny message on exception in DataArrayInt::changeSurjectiveFormat
authorageay <ageay>
Fri, 22 Feb 2013 11:24:17 +0000 (11:24 +0000)
committerageay <ageay>
Fri, 22 Feb 2013 11:24:17 +0000 (11:24 +0000)
src/MEDCoupling/MEDCouplingMemArray.cxx

index cb6a5b3de5808d0ef2a62b6fc4f42d30955f6d4b..bdc9588ed44ee822fde6bfcb12ec83ddca30248d 100644 (file)
@@ -4484,11 +4484,11 @@ void DataArrayInt::changeSurjectiveFormat(int targetNb, DataArrayInt *&arr, Data
   for(int i=0;i<nbOfTuples;i++)
     {
       int tmp2=input[i];
-      if(tmp2<targetNb)
+      if(tmp2>=0 && tmp2<targetNb)
         tmp[tmp2].push_back(i);
       else
         {
-          std::ostringstream oss; oss << "DataArrayInt::changeSurjectiveFormat : At pos " << i << " presence of element " << tmp2 << " higher than " << targetNb;
+          std::ostringstream oss; oss << "DataArrayInt::changeSurjectiveFormat : At pos " << i << " presence of element " << tmp2 << " ! should be in [0," << targetNb << ") !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
     }