Salome HOME
MEDCoupling API renaming - stage #2
authorabn <adrien.bruneton@cea.fr>
Wed, 20 Jan 2016 14:09:27 +0000 (15:09 +0100)
committerabn <adrien.bruneton@cea.fr>
Wed, 20 Jan 2016 14:11:56 +0000 (15:11 +0100)
   DataArray*::search -> DataArray*::findIdSequence
   DataArray*::substr -> DataArray*::subArray

17 files changed:
doc/user/doxygen/fakesources/MEDCouplingMemArray.C
src/MEDCoupling/MEDCouplingMemArray.cxx
src/MEDCoupling/MEDCouplingMemArray.hxx
src/MEDCoupling/MEDCouplingMemArrayChar.cxx
src/MEDCoupling/MEDCouplingPointSet.cxx
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx
src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest2.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest4.py
src/MEDCoupling_Swig/MEDCouplingMemArray.i
src/MEDCoupling_Swig/MEDCouplingPickleTest.py
src/MEDLoader/MEDFileField.cxx
src/MEDLoader/MEDFileMeshLL.cxx
src/MEDLoader/Swig/MEDLoaderTest3.py

index 3f902e5b725443fe68827c5c46d4402448bbb353..cd0fe1bdaf4960185e1cb864c3bd5ecf30b500a1 100644 (file)
@@ -285,7 +285,7 @@ DataArrayDouble::selectByTupleId(const int* new2OldBg, const int* new2OldEnd) co
 DataArrayDouble::selectByTupleIdSafe(const int* new2OldBg, const int* new2OldEnd) const;
 DataArrayDouble::selectByTupleId2(int bg, int end2, int step) const;
 DataArrayDouble::selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const;
-DataArrayDouble::substr(int tupleIdBg, int tupleIdEnd=-1) const;
+DataArrayDouble::subArray(int tupleIdBg, int tupleIdEnd=-1) const;
 DataArrayDouble::rearrange(int newNbOfCompo);
 DataArrayDouble::transpose();
 DataArrayDouble::changeNbOfComponents(int newNbOfComp, double dftValue) const;
@@ -480,7 +480,7 @@ DataArrayInt::changeSurjectiveFormat(int targetNb, DataArrayInt *&arr, DataArray
 DataArrayInt::buildPermArrPerLevel() const;
 DataArrayInt::isIdentity2(int sizeExpected) const;
 DataArrayInt::isUniform(int val) const;
-DataArrayInt::substr(int tupleIdBg, int tupleIdEnd=-1) const;
+DataArrayInt::subArray(int tupleIdBg, int tupleIdEnd=-1) const;
 DataArrayInt::rearrange(int newNbOfCompo);
 DataArrayInt::transpose();
 DataArrayInt::changeNbOfComponents(int newNbOfComp, int dftValue) const;
@@ -585,7 +585,7 @@ DataArrayInt::end() const;
 DataArrayInt::locateTuple(const std::vector<int>& tupl) const;
 DataArrayInt::locateValue(int value) const;
 DataArrayInt::locateValue(const std::vector<int>& vals) const;
-DataArrayInt::search(const std::vector<int>& vals) const;
+DataArrayInt::findIdSequence(const std::vector<int>& vals) const;
 DataArrayInt::presenceOfTuple(const std::vector<int>& tupl) const;
 DataArrayInt::accumulate(int* res) const;
 DataArrayInt::accumulate(int compId) const;
index 75979d5eb02d6d6287766c483d0ce377df8d3abb..a53430517ce3dcda26b4b9a1ac3a7050e1de6f98 100644 (file)
@@ -1463,7 +1463,7 @@ DataArrayDouble *DataArrayDouble::toNoInterlace() const
  * Permutes values of \a this array as required by \a old2New array. The values are
  * permuted so that \c new[ \a old2New[ i ]] = \c old[ i ]. Number of tuples remains
  * the same as in \c this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
  * For more info on renumbering see \ref numbering.
  *  \param [in] old2New - C array of length equal to \a this->getNumberOfTuples()
  *     giving a new position for i-th old value.
@@ -1556,7 +1556,7 @@ DataArrayDouble *DataArrayDouble::renumber(const int *old2New) const
  * Returns a copy of \a this array with values permuted as required by \a new2Old array.
  * The values are permuted so that  \c new[ i ] = \c old[ \a new2Old[ i ]]. Number of
  * tuples in the result array remains the same as in \c this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
  * For more info on renumbering see \ref numbering.
  *  \param [in] new2Old - C array of length equal to \a this->getNumberOfTuples()
  *     giving a previous position of i-th new value.
@@ -1700,7 +1700,7 @@ DataArrayDouble *DataArrayDouble::selectByTupleIdSafe(const int *new2OldBg, cons
  *  \param [in] step - index increment to get index of the next tuple to copy.
  *  \return DataArrayDouble * - the new instance of DataArrayDouble that the caller
  *          is to delete using decrRef() as it is no more needed.
- *  \sa DataArrayDouble::substr.
+ *  \sa DataArrayDouble::subArray.
  */
 DataArrayDouble *DataArrayDouble::selectByTupleIdSafeSlice(int bg, int end2, int step) const
 {
@@ -1796,19 +1796,19 @@ DataArray *DataArrayDouble::selectByTupleRanges(const std::vector<std::pair<int,
     \throw If \a tupleIdEnd != -1 && \a tupleIdEnd < \a this->getNumberOfTuples().
  *  \sa DataArrayDouble::selectByTupleIdSafeSlice
  */
-DataArrayDouble *DataArrayDouble::substr(int tupleIdBg, int tupleIdEnd) const
+DataArrayDouble *DataArrayDouble::subArray(int tupleIdBg, int tupleIdEnd) const
 {
   checkAllocated();
   int nbt=getNumberOfTuples();
   if(tupleIdBg<0)
-    throw INTERP_KERNEL::Exception("DataArrayDouble::substr : The tupleIdBg parameter must be greater than 0 !");
+    throw INTERP_KERNEL::Exception("DataArrayDouble::subArray : The tupleIdBg parameter must be greater than 0 !");
   if(tupleIdBg>nbt)
-    throw INTERP_KERNEL::Exception("DataArrayDouble::substr : The tupleIdBg parameter is greater than number of tuples !");
+    throw INTERP_KERNEL::Exception("DataArrayDouble::subArray : The tupleIdBg parameter is greater than number of tuples !");
   int trueEnd=tupleIdEnd;
   if(tupleIdEnd!=-1)
     {
       if(tupleIdEnd>nbt)
-        throw INTERP_KERNEL::Exception("DataArrayDouble::substr : The tupleIdBg parameter is greater or equal than number of tuples !");
+        throw INTERP_KERNEL::Exception("DataArrayDouble::subArray : The tupleIdBg parameter is greater or equal than number of tuples !");
     }
   else
     trueEnd=nbt;
@@ -7205,7 +7205,7 @@ DataArrayInt *DataArrayInt::toNoInterlace() const
  * Permutes values of \a this array as required by \a old2New array. The values are
  * permuted so that \c new[ \a old2New[ i ]] = \c old[ i ]. Number of tuples remains
  * the same as in \c this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
  * For more info on renumbering see \ref numbering.
  *  \param [in] old2New - C array of length equal to \a this->getNumberOfTuples()
  *     giving a new position for i-th old value.
@@ -7298,7 +7298,7 @@ DataArrayInt *DataArrayInt::renumber(const int *old2New) const
  * Returns a copy of \a this array with values permuted as required by \a new2Old array.
  * The values are permuted so that  \c new[ i ] = \c old[ \a new2Old[ i ]]. Number of
  * tuples in the result array remains the same as in \c this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
  * For more info on renumbering see \ref numbering.
  *  \param [in] new2Old - C array of length equal to \a this->getNumberOfTuples()
  *     giving a previous position of i-th new value.
@@ -7437,7 +7437,7 @@ DataArrayInt *DataArrayInt::selectByTupleIdSafe(const int *new2OldBg, const int
  *  \param [in] step - index increment to get index of the next tuple to copy.
  *  \return DataArrayInt * - the new instance of DataArrayInt that the caller
  *          is to delete using decrRef() as it is no more needed.
- *  \sa DataArrayInt::substr.
+ *  \sa DataArrayInt::subArray.
  */
 DataArrayInt *DataArrayInt::selectByTupleIdSafeSlice(int bg, int end2, int step) const
 {
@@ -7853,19 +7853,19 @@ DataArrayDouble *DataArrayInt::convertToDblArr() const
     \throw If \a tupleIdEnd != -1 && \a tupleIdEnd < \a this->getNumberOfTuples().
  *  \sa DataArrayInt::selectByTupleIdSafeSlice
  */
-DataArrayInt *DataArrayInt::substr(int tupleIdBg, int tupleIdEnd) const
+DataArrayInt *DataArrayInt::subArray(int tupleIdBg, int tupleIdEnd) const
 {
   checkAllocated();
   int nbt=getNumberOfTuples();
   if(tupleIdBg<0)
-    throw INTERP_KERNEL::Exception("DataArrayInt::substr : The tupleIdBg parameter must be greater than 0 !");
+    throw INTERP_KERNEL::Exception("DataArrayInt::subArray : The tupleIdBg parameter must be greater than 0 !");
   if(tupleIdBg>nbt)
-    throw INTERP_KERNEL::Exception("DataArrayInt::substr : The tupleIdBg parameter is greater than number of tuples !");
+    throw INTERP_KERNEL::Exception("DataArrayInt::subArray : The tupleIdBg parameter is greater than number of tuples !");
   int trueEnd=tupleIdEnd;
   if(tupleIdEnd!=-1)
     {
       if(tupleIdEnd>nbt)
-        throw INTERP_KERNEL::Exception("DataArrayInt::substr : The tupleIdBg parameter is greater or equal than number of tuples !");
+        throw INTERP_KERNEL::Exception("DataArrayInt::subArray : The tupleIdBg parameter is greater or equal than number of tuples !");
     }
   else
     trueEnd=nbt;
@@ -8966,7 +8966,7 @@ DataArrayInt *DataArrayInt::findIdsNotEqualList(const int *valsBg, const int *va
  * the input vector. An INTERP_KERNEL::Exception is thrown too if \b this is not allocated.
  *
  * \return tuple id where \b tupl is. -1 if no such tuple exists in \b this.
- * \sa DataArrayInt::search, DataArrayInt::presenceOfTuple.
+ * \sa DataArrayInt::findIdSequence, DataArrayInt::presenceOfTuple.
  */
 int DataArrayInt::findIdFirstEqualTuple(const std::vector<int>& tupl) const
 {
@@ -9001,12 +9001,12 @@ int DataArrayInt::findIdFirstEqualTuple(const std::vector<int>& tupl) const
  * This method differs from DataArrayInt::findIdFirstEqualTuple in that the position is internal raw data is not considered here contrary to DataArrayInt::findIdFirstEqualTuple.
  * \sa DataArrayInt::findIdFirstEqualTuple
  */
-int DataArrayInt::search(const std::vector<int>& vals) const
+int DataArrayInt::findIdSequence(const std::vector<int>& vals) const
 {
   checkAllocated();
   int nbOfCompo=getNumberOfComponents();
   if(nbOfCompo!=1)
-    throw INTERP_KERNEL::Exception("DataArrayInt::search : works only for DataArrayInt instance with one component !");
+    throw INTERP_KERNEL::Exception("DataArrayInt::findIdSequence : works only for DataArrayInt instance with one component !");
   const int *cptr=getConstPointer();
   std::size_t nbOfVals=getNbOfElems();
   const int *loc=std::search(cptr,cptr+nbOfVals,vals.begin(),vals.end());
index 1232b7b1e14fb2c7cc6a851817c670a8d7184e44..51723e5f47cc53f43cf563a8ad882e6d856f2c51 100644 (file)
@@ -266,7 +266,7 @@ namespace MEDCoupling
     MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const;
     MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafeSlice(int bg, int end2, int step) const;
     MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const;
-    MEDCOUPLING_EXPORT DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const;
+    MEDCOUPLING_EXPORT DataArrayDouble *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
     MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
     MEDCOUPLING_EXPORT void transpose();
     MEDCOUPLING_EXPORT DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const;
@@ -522,7 +522,7 @@ namespace MEDCoupling
     MEDCOUPLING_EXPORT DataArrayInt *buildPermArrPerLevel() const;
     MEDCOUPLING_EXPORT bool isIota(int sizeExpected) const;
     MEDCOUPLING_EXPORT bool isUniform(int val) const;
-    MEDCOUPLING_EXPORT DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const;
+    MEDCOUPLING_EXPORT DataArrayInt *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
     MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
     MEDCOUPLING_EXPORT void transpose();
     MEDCOUPLING_EXPORT DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const;
@@ -562,7 +562,7 @@ namespace MEDCoupling
     MEDCOUPLING_EXPORT int findIdFirstEqualTuple(const std::vector<int>& tupl) const;
     MEDCOUPLING_EXPORT int findIdFirstEqual(int value) const;
     MEDCOUPLING_EXPORT int findIdFirstEqual(const std::vector<int>& vals) const;
-    MEDCOUPLING_EXPORT int search(const std::vector<int>& vals) const;
+    MEDCOUPLING_EXPORT int findIdSequence(const std::vector<int>& vals) const;
     MEDCOUPLING_EXPORT bool presenceOfTuple(const std::vector<int>& tupl) const;
     MEDCOUPLING_EXPORT bool presenceOfValue(int value) const;
     MEDCOUPLING_EXPORT bool presenceOfValue(const std::vector<int>& vals) const;
@@ -728,7 +728,7 @@ namespace MEDCoupling
     MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafeSlice(int bg, int end, int step) const;
     MEDCOUPLING_EXPORT bool isUniform(char val) const;
     MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
-    MEDCOUPLING_EXPORT DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const;
+    MEDCOUPLING_EXPORT DataArrayChar *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
     MEDCOUPLING_EXPORT DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const;
     MEDCOUPLING_EXPORT DataArrayChar *keepSelectedComponents(const std::vector<int>& compoIds) const;
     MEDCOUPLING_EXPORT void meldWith(const DataArrayChar *other);
@@ -757,7 +757,7 @@ namespace MEDCoupling
     MEDCOUPLING_EXPORT const char *end() const { return getConstPointer()+getNbOfElems(); }
     MEDCOUPLING_EXPORT DataArrayInt *findIdsEqual(char val) const;
     MEDCOUPLING_EXPORT DataArrayInt *findIdsNotEqual(char val) const;
-    MEDCOUPLING_EXPORT int search(const std::vector<char>& vals) const;
+    MEDCOUPLING_EXPORT int findIdSequence(const std::vector<char>& vals) const;
     MEDCOUPLING_EXPORT int findIdFirstEqualTuple(const std::vector<char>& tupl) const;
     MEDCOUPLING_EXPORT int findIdFirstEqual(char value) const;
     MEDCOUPLING_EXPORT int findIdFirstEqual(const std::vector<char>& vals) const;
index 99d19fbff36727177e6dcae90c540add825d5911..077f567e4f7cf5ba5400a5fc03c020359adb93af 100644 (file)
@@ -379,7 +379,7 @@ DataArrayInt *DataArrayChar::convertToIntArr() const
  * Permutes values of \a this array as required by \a old2New array. The values are
  * permuted so that \c new[ \a old2New[ i ]] = \c old[ i ]. Number of tuples remains
  * the same as in \this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
  * For more info on renumbering see \ref numbering.
  *  \param [in] old2New - C array of length equal to \a this->getNumberOfTuples()
  *     giving a new position for i-th old value.
@@ -452,7 +452,7 @@ DataArrayChar *DataArrayChar::renumber(const int *old2New) const
  * Returns a copy of \a this array with values permuted as required by \a new2Old array.
  * The values are permuted so that  \c new[ i ] = \c old[ \a new2Old[ i ]]. Number of
  * tuples in the result array remains the same as in \this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
  * For more info on renumbering see \ref numbering.
  *  \param [in] new2Old - C array of length equal to \a this->getNumberOfTuples()
  *     giving a previous position of i-th new value.
@@ -647,7 +647,7 @@ void DataArrayChar::rearrange(int newNbOfCompo)
 /*!
  * Returns a shorten copy of \a this array. The new DataArrayChar contains all
  * tuples starting from the \a tupleIdBg-th tuple and including all tuples located before
- * the \a tupleIdEnd-th one. This methods has a similar behavior as std::string::substr().
+ * the \a tupleIdEnd-th one. This methods has a similar behavior as std::string::subArray().
  * This method is a specialization of selectByTupleIdSafeSlice().
  *  \param [in] tupleIdBg - index of the first tuple to copy from \a this array.
  *  \param [in] tupleIdEnd - index of the tuple before which the tuples to copy are located.
@@ -659,7 +659,7 @@ void DataArrayChar::rearrange(int newNbOfCompo)
     \throw If \a tupleIdEnd != -1 && \a tupleIdEnd < \a this->getNumberOfTuples().
  *  \sa DataArrayChar::selectByTupleIdSafeSlice
  */
-DataArrayChar *DataArrayChar::substr(int tupleIdBg, int tupleIdEnd) const
+DataArrayChar *DataArrayChar::subArray(int tupleIdBg, int tupleIdEnd) const
 {
   checkAllocated();
   int nbt=getNumberOfTuples();
@@ -1594,12 +1594,12 @@ DataArrayInt *DataArrayChar::findIdsNotEqual(char val) const
  * This method differs from DataArrayChar::findIdFirstEqualTuple in that the position is internal raw data is not considered here contrary to DataArrayChar::findIdFirstEqualTuple.
  * \sa DataArrayChar::findIdFirstEqualTuple
  */
-int DataArrayChar::search(const std::vector<char>& vals) const
+int DataArrayChar::findIdSequence(const std::vector<char>& vals) const
 {
   checkAllocated();
   int nbOfCompo=getNumberOfComponents();
   if(nbOfCompo!=1)
-    throw INTERP_KERNEL::Exception("DataArrayChar::search : works only for DataArrayChar instance with one component !");
+    throw INTERP_KERNEL::Exception("DataArrayChar::findIdSequence : works only for DataArrayChar instance with one component !");
   const char *cptr=getConstPointer();
   std::size_t nbOfVals=getNbOfElems();
   const char *loc=std::search(cptr,cptr+nbOfVals,vals.begin(),vals.end());
@@ -1618,7 +1618,7 @@ int DataArrayChar::search(const std::vector<char>& vals) const
  * the input vector. An INTERP_KERNEL::Exception is thrown too if \b this is not allocated.
  *
  * \return tuple id where \b tupl is. -1 if no such tuple exists in \b this.
- * \sa DataArrayChar::search.
+ * \sa DataArrayChar::findIdSequence.
  */
 int DataArrayChar::findIdFirstEqualTuple(const std::vector<char>& tupl) const
 {
index 1710b932df087a80279bd2083ec235e07547297c..eb1c284eb5ec418d8a9037f94805b313bf984c7d 100644 (file)
@@ -1481,7 +1481,7 @@ void MEDCouplingPointSet::checkDeepEquivalWith(const MEDCouplingMesh *other, int
     throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some nodes in other are not in this !");
   m->renumberNodes(da->getConstPointer(),newNbOfNodes);
   //
-  MCAuto<DataArrayInt> nodeCor2=da->substr(oldNbOfNodes);
+  MCAuto<DataArrayInt> nodeCor2=da->subArray(oldNbOfNodes);
   da=m->mergeNodes(prec,areNodesMerged,newNbOfNodes);
   //
   da=m->zipConnectivityTraducer(cellCompPol);
index ff320449fbfe1b0897df7b2d2d8791eee51e6d29..0bfd7174deca5bf4233ac4a80dab461701738372 100644 (file)
@@ -1932,7 +1932,7 @@ bool MEDCouplingUMesh::areCellsIncludedIn(const MEDCouplingUMesh *other, int com
       throw INTERP_KERNEL::Exception(oss.str().c_str());
     }
   MCAuto<DataArrayInt> o2n=mesh->zipConnectivityTraducer(compType,nbOfCells);
-  arr=o2n->substr(nbOfCells);
+  arr=o2n->subArray(nbOfCells);
   arr->setName(other->getName());
   int tmp;
   if(other->getNumberOfCells()==0)
index bd99d67295d5f2a834e0c1323966d0f5bf32d415..528fc1a3a264c6b5eb7c03958c063e9bc79a3c77 100644 (file)
@@ -91,12 +91,12 @@ void MEDCouplingBasicsTest1::testArray3()
   CPPUNIT_ASSERT_EQUAL(7,arr1->getNumberOfTuples());
   CPPUNIT_ASSERT_EQUAL(2,arr1->getNumberOfComponents());
   CPPUNIT_ASSERT(std::equal(arr1Ref,arr1Ref+14,arr1->getConstPointer()));
-  DataArrayInt *arr2=arr1->substr(3);
+  DataArrayInt *arr2=arr1->subArray(3);
   CPPUNIT_ASSERT_EQUAL(4,arr2->getNumberOfTuples());
   CPPUNIT_ASSERT_EQUAL(2,arr2->getNumberOfComponents());
   CPPUNIT_ASSERT(std::equal(arr1Ref+6,arr1Ref+14,arr2->getConstPointer()));
   arr2->decrRef();
-  DataArrayInt *arr3=arr1->substr(2,5);
+  DataArrayInt *arr3=arr1->subArray(2,5);
   CPPUNIT_ASSERT_EQUAL(3,arr3->getNumberOfTuples());
   CPPUNIT_ASSERT_EQUAL(2,arr3->getNumberOfComponents());
   CPPUNIT_ASSERT(std::equal(arr1Ref+4,arr1Ref+10,arr3->getConstPointer()));
@@ -111,12 +111,12 @@ void MEDCouplingBasicsTest1::testArray3()
   CPPUNIT_ASSERT_EQUAL(7,arr4->getNumberOfTuples());
   CPPUNIT_ASSERT_EQUAL(2,arr4->getNumberOfComponents());
   CPPUNIT_ASSERT(std::equal(arr4Ref,arr4Ref+14,arr4->getConstPointer()));
-  DataArrayDouble *arr5=arr4->substr(3);
+  DataArrayDouble *arr5=arr4->subArray(3);
   CPPUNIT_ASSERT_EQUAL(4,arr5->getNumberOfTuples());
   CPPUNIT_ASSERT_EQUAL(2,arr5->getNumberOfComponents());
   CPPUNIT_ASSERT(std::equal(arr4Ref+6,arr4Ref+14,arr5->getConstPointer()));
   arr5->decrRef();
-  DataArrayDouble *arr6=arr4->substr(2,5);
+  DataArrayDouble *arr6=arr4->subArray(2,5);
   CPPUNIT_ASSERT_EQUAL(3,arr6->getNumberOfTuples());
   CPPUNIT_ASSERT_EQUAL(2,arr6->getNumberOfComponents());
   CPPUNIT_ASSERT(std::equal(arr4Ref+4,arr4Ref+10,arr6->getConstPointer()));
index 7b75d55bb0b075354d587b7b6204d78718c2c7cc..229502ee203e0636b2e034fb7786bc588a8f7d50 100644 (file)
@@ -103,7 +103,7 @@ void MEDCouplingBasicsTest2::testGaussPointField1()
   CPPUNIT_ASSERT_EQUAL(2,(int)tmpIds.size());
   CPPUNIT_ASSERT(std::equal(ids2,ids2+2,tmpIds.begin()));
   CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);//<- it's always not ok because undelying array not with the good size.
-  DataArrayDouble *array2=f->getArray()->substr(0,10);
+  DataArrayDouble *array2=f->getArray()->subArray(0,10);
   f->setArray(array2);
   array2->decrRef();
   f->checkConsistencyLight();//<- here it is OK
index 27d40f49650cb0560582f92cadde74ac1a6b88d5..bfb65596dcf5c292c2a8141d0383bb914b5463d2 100644 (file)
@@ -941,9 +941,9 @@ void MEDCouplingBasicsTest3::testElementaryDAThrowAndSpecialCases()
   CPPUNIT_ASSERT(!((ret.str().find("16 15 14 13 12 11 10"))==std::string::npos));
   
   CPPUNIT_ASSERT_THROW(dbl->selectByTupleIdSafeSlice(0,1,-1),INTERP_KERNEL::Exception);
-  CPPUNIT_ASSERT_THROW(dbl->substr(-1,1),INTERP_KERNEL::Exception);
-  CPPUNIT_ASSERT_THROW(dbl->substr(8,1),INTERP_KERNEL::Exception);
-  CPPUNIT_ASSERT_THROW(dbl->substr(0,8),INTERP_KERNEL::Exception);
+  CPPUNIT_ASSERT_THROW(dbl->subArray(-1,1),INTERP_KERNEL::Exception);
+  CPPUNIT_ASSERT_THROW(dbl->subArray(8,1),INTERP_KERNEL::Exception);
+  CPPUNIT_ASSERT_THROW(dbl->subArray(0,8),INTERP_KERNEL::Exception);
   CPPUNIT_ASSERT_THROW(dbl->meldWith(dd),INTERP_KERNEL::Exception);
   
   CPPUNIT_ASSERT_THROW(dbl->setPartOfValuesAdv(dbl2,da),INTERP_KERNEL::Exception); //dbl dbl2 not have the same number of components
index 94e074eaedb8e8a5e1062160411eb75fe8f0342e..549527b6b31fedf418aeb1c956fa5f5995fa9787 100644 (file)
@@ -45,11 +45,11 @@ class MEDCouplingBasicsTest1(unittest.TestCase):
         self.assertEqual(7,arr1.getNumberOfTuples());
         self.assertEqual(2,arr1.getNumberOfComponents());
         self.assertEqual(arr1Ref,list(arr1.getValues()));
-        arr2=arr1.substr(3);
+        arr2=arr1.subArray(3);
         self.assertEqual(4,arr2.getNumberOfTuples());
         self.assertEqual(2,arr2.getNumberOfComponents());
         self.assertEqual(arr1Ref[6:],list(arr2.getValues()));
-        arr3=arr1.substr(2,5);
+        arr3=arr1.subArray(2,5);
         self.assertEqual(3,arr3.getNumberOfTuples());
         self.assertEqual(2,arr3.getNumberOfComponents());
         self.assertEqual(arr1Ref[4:10],list(arr3.getValues()));
@@ -63,14 +63,14 @@ class MEDCouplingBasicsTest1(unittest.TestCase):
         for i in xrange(14):
             self.assertTrue(abs(arr4Ref[i]-tmp[i])<1e-14);
             pass
-        arr5=arr4.substr(3);
+        arr5=arr4.subArray(3);
         self.assertEqual(4,arr5.getNumberOfTuples());
         self.assertEqual(2,arr5.getNumberOfComponents());
         tmp=arr5.getValues()
         for i in xrange(8):
             self.assertTrue(abs(arr4Ref[6+i]-tmp[i])<1e-14);
             pass
-        arr6=arr4.substr(2,5);
+        arr6=arr4.subArray(2,5);
         self.assertEqual(3,arr6.getNumberOfTuples());
         self.assertEqual(2,arr6.getNumberOfComponents());
         tmp=arr6.getValues()
@@ -2122,7 +2122,7 @@ class MEDCouplingBasicsTest1(unittest.TestCase):
         tmpIds=f.getCellIdsHavingGaussLocalization(0);
         self.assertEqual(ids2,list(tmpIds.getValues()));
         self.assertRaises(InterpKernelException,f.checkConsistencyLight);#<- it's always not ok because undelying array not with the good size.
-        array2=f.getArray().substr(0,10);
+        array2=f.getArray().subArray(0,10);
         f.setArray(array2);
         f.checkConsistencyLight();#<- here it is OK
         f2=f.clone(True);
index 4a63f9ac217c11a6291d8c5a49bb447949cd3e7b..fabd7936e15cc221def888d8886bf45918d8db11 100644 (file)
@@ -1727,9 +1727,9 @@ class MEDCouplingBasicsTest2(unittest.TestCase):
         self.assertTrue(not ((dbl.reprZip().find("Number of components : 1"))==-1));
         
         self.assertRaises(InterpKernelException, dbl.selectByTupleIdSafeSlice, 0, 1, -1);
-        self.assertRaises(InterpKernelException, dbl.substr, -1, 1);
-        self.assertRaises(InterpKernelException, dbl.substr, 8, 1);
-        self.assertRaises(InterpKernelException, dbl.substr, 0, 8);
+        self.assertRaises(InterpKernelException, dbl.subArray, -1, 1);
+        self.assertRaises(InterpKernelException, dbl.subArray, 8, 1);
+        self.assertRaises(InterpKernelException, dbl.subArray, 0, 8);
         self.assertRaises(InterpKernelException, dbl.meldWith, dd);
         
         self.assertRaises(InterpKernelException, dbl.setPartOfValuesAdv, dbl2, da); #dbl dbl2 not have the same number of components
index 76b25ab886c56142ad173db5f0554efe5d15774d..a4106d88b8ba1576b59b267da8fa77e9a4cfed3e 100644 (file)
@@ -958,8 +958,8 @@ class MEDCouplingBasicsTest4(unittest.TestCase):
         self.assertEqual(0,da.index(7))
         self.assertEqual(10,da.index(47))
         self.assertTrue(14 not in da)
-        self.assertEqual(5,da.search([9,9]))
-        self.assertEqual(-1,da.search([5,8]))
+        self.assertEqual(5,da.findIdSequence([9,9]))
+        self.assertEqual(-1,da.findIdSequence([5,8]))
         da.rearrange(2)
         self.assertTrue([47,16] not in da)
         self.assertTrue([5,6] not in da)
@@ -2762,8 +2762,8 @@ class MEDCouplingBasicsTest4(unittest.TestCase):
         self.assertTrue(e.isEqual(DataArrayInt([0,1,2,5,6,7,10,11,12,15,16,17,20,21,22,25,26,27,30,31,32,35,36,37,40,41,42,45,46,47,50,51,52,55,56,57,61,62])))
         self.assertEqual(("d",6),dd3.getMaxValue())
         self.assertEqual(("A",0),dd3.getMinValue())
-        self.assertEqual(26,dd3.search("LGYYM"))
-        self.assertEqual(-1,dd3.search("LGYYN"))
+        self.assertEqual(26,dd3.findIdSequence("LGYYM"))
+        self.assertEqual(-1,dd3.findIdSequence("LGYYN"))
         dd3.rearrange(5)
         self.assertEqual(7,dd3.findIdFirstEqualTuple("OPGYY"))
         self.assertTrue("OPGYY" in dd3)
index a56db7e2e1285515f113b475b98dcef21e206e76..455b6bd3cc3ec09a08cff482ccbb547f13b33b71 100644 (file)
@@ -52,7 +52,7 @@
 %newobject MEDCoupling::DataArrayInt::__iter__;
 %newobject MEDCoupling::DataArrayInt::convertToDblArr;
 %newobject MEDCoupling::DataArrayInt::performCopyOrIncrRef;
-%newobject MEDCoupling::DataArrayInt::substr;
+%newobject MEDCoupling::DataArrayInt::subArray;
 %newobject MEDCoupling::DataArrayInt::changeNbOfComponents;
 %newobject MEDCoupling::DataArrayInt::accumulatePerChunck;
 %newobject MEDCoupling::DataArrayInt::checkAndPreparePermutation;
 %newobject MEDCoupling::DataArrayByte::__iter__;
 %newobject MEDCoupling::DataArrayByte::performCopyOrIncrRef;
 %newobject MEDCoupling::DataArrayByteTuple::buildDAByte;
-%newobject MEDCoupling::DataArrayChar::substr;
+%newobject MEDCoupling::DataArrayChar::subArray;
 %newobject MEDCoupling::DataArrayAsciiChar::New;
 %newobject MEDCoupling::DataArrayAsciiChar::__iter__;
 %newobject MEDCoupling::DataArrayAsciiChar::performCopyOrIncrRef;
 %newobject MEDCoupling::DataArrayDouble::Multiply;
 %newobject MEDCoupling::DataArrayDouble::Divide;
 %newobject MEDCoupling::DataArrayDouble::Pow;
-%newobject MEDCoupling::DataArrayDouble::substr;
+%newobject MEDCoupling::DataArrayDouble::subArray;
 %newobject MEDCoupling::DataArrayDouble::changeNbOfComponents;
 %newobject MEDCoupling::DataArrayDouble::accumulatePerChunck;
 %newobject MEDCoupling::DataArrayDouble::findIdsInRange;
@@ -555,7 +555,7 @@ namespace MEDCoupling
     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
     DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
     DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
-    DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
+    DataArrayDouble *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
     void transpose() throw(INTERP_KERNEL::Exception);
     DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
     void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
@@ -2622,7 +2622,7 @@ namespace MEDCoupling
     DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
     bool isIota(int sizeExpected) const throw(INTERP_KERNEL::Exception);
     bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
-    DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
+    DataArrayInt *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
     void transpose() throw(INTERP_KERNEL::Exception);
     DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
     void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
@@ -2647,7 +2647,7 @@ namespace MEDCoupling
     int findIdFirstEqualTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
     int findIdFirstEqual(int value) const throw(INTERP_KERNEL::Exception);
     int findIdFirstEqual(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
-    int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
+    int findIdSequence(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
     bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
     bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
     bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
@@ -4968,7 +4968,7 @@ namespace MEDCoupling
     DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
     DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
     bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
-    DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
+    DataArrayChar *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
     DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
     void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
     void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
@@ -5301,14 +5301,14 @@ namespace MEDCoupling
         return self->findIdFirstEqualTuple(vals);
       }
 
-      int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
+      int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
       {
         int sz=-1,sw=-1;
         int ival=-1; std::vector<int> ivval;
         const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
         std::vector<char> vals(sz);
         std::copy(pt,pt+sz,vals.begin());
-        return self->search(vals);
+        return self->findIdSequence(vals);
       }
 
       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
@@ -5849,14 +5849,14 @@ namespace MEDCoupling
           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqualTuple : only strings in input supported !");
       }
 
-      int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
+      int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
       {
         if(PyString_Check(strOrListOfInt))
           {
             Py_ssize_t sz=PyString_Size(strOrListOfInt);
             std::vector<char> vals(sz);
             std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
-            return self->search(vals);
+            return self->findIdSequence(vals);
           }
         else
           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
index 4b954c468b64f978574aac277c3f97a70da853ae..6e99259a34940e62b056ad319f5ca43a86b2714c 100644 (file)
@@ -271,7 +271,7 @@ class MEDCouplingPickleTest(unittest.TestCase):
         tmpIds=f.getCellIdsHavingGaussLocalization(0);
         self.assertEqual(ids2,list(tmpIds.getValues()));
         self.assertRaises(InterpKernelException,f.checkConsistencyLight);#<- it's always not ok because undelying array not with the good size.
-        array2=f.getArray().substr(0,10);
+        array2=f.getArray().subArray(0,10);
         f.setArray(array2);
         f.checkConsistencyLight();
         ####
index 8a0509d165e1755c6b8d56a60763570f8ec90bac..c22cc1484f29dfa96e8b5ca490de27c35e71daa6 100644 (file)
@@ -928,7 +928,7 @@ bool MEDFileFieldPerMeshPerTypePerDisc::RenumberChunks(int offset, const std::ve
   for(std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>::const_iterator it=entriesOnSameDisc.begin();it!=entriesOnSameDisc.end();it++,id++)
     {
       int startOfEltIdOfChunk=(*it)->_start;
-      MCAuto<DataArrayInt> newEltIds=explicitIdsInMesh->substr(startOfEltIdOfChunk,startOfEltIdOfChunk+(*it)->_nval);
+      MCAuto<DataArrayInt> newEltIds=explicitIdsInMesh->subArray(startOfEltIdOfChunk,startOfEltIdOfChunk+(*it)->_nval);
       MCAuto<DataArrayInt> rangeIdsForChunk=newEltIds->findRangeIdForEachTuple(ranges);
       MCAuto<DataArrayInt> idsInRrangeForChunk=newEltIds->findIdInRangeForEachTuple(ranges);
       //
@@ -945,7 +945,7 @@ bool MEDFileFieldPerMeshPerTypePerDisc::RenumberChunks(int offset, const std::ve
   //
   MCAuto<DataArrayInt> renumTupleIds=newGeoTypesPerChunk4->buildPermArrPerLevel();
   //
-  MCAuto<DataArrayDouble> arrPart=arr->substr(offset,offset+szTuples);
+  MCAuto<DataArrayDouble> arrPart=arr->subArray(offset,offset+szTuples);
   arrPart->renumberInPlace(renumTupleIds->begin());
   arr->setPartOfValues1(arrPart,offset,offset+szTuples,1,0,arrPart->getNumberOfComponents(),1);
   bool ret=false;
index a9a458b0f50ecc81f1abd385e2b8ca6edc77852f..f46f9b0c77a5c573595a5323796d2da65e92d007 100644 (file)
@@ -1233,11 +1233,11 @@ void MEDFileUMeshSplitL1::write(med_idt fid, const std::string& mName, int mdim)
       MCAuto<DataArrayInt> fam,num;
       MCAuto<DataArrayAsciiChar> names;
       if((const DataArrayInt *)_fam)
-        fam=_fam->substr(start,end);
+        fam=_fam->subArray(start,end);
       if((const DataArrayInt *)_num)
-        num=_num->substr(start,end);
+        num=_num->subArray(start,end);
       if((const DataArrayAsciiChar *)_names)
-        names=static_cast<DataArrayAsciiChar *>(_names->substr(start,end));
+        names=static_cast<DataArrayAsciiChar *>(_names->subArray(start,end));
       MEDFileUMeshPerType::Write(fid,mName,mdim,(*it),fam,num,names);
       start=end;
     }
index 29aa66cb71ad8b755147ae5eabf1fee79a49f3a2..95bd6a69ab7e5da9fae2d3fe55d9194523f0b379 100644 (file)
@@ -2162,10 +2162,10 @@ class MEDLoaderTest(unittest.TestCase):
         namesCellL0=DataArrayAsciiChar(6,16)
         namesCellL0[:]=["CellL0#%.3d      "%(i) for i in xrange(6)]
         mm.setNameFieldAtLevel(0,namesCellL0)
-        namesCellL1=DataArrayAsciiChar.Aggregate([namesCellL0,namesCellL0,namesCellL0.substr(2)])
+        namesCellL1=DataArrayAsciiChar.Aggregate([namesCellL0,namesCellL0,namesCellL0.subArray(2)])
         namesCellL1[:]=["CellLM1#%.3d     "%(i) for i in xrange(16)]
         mm.setNameFieldAtLevel(-1,namesCellL1)
-        namesNodes=namesCellL1.substr(4,16)
+        namesNodes=namesCellL1.subArray(4,16)
         namesNodes[:]=["Node#%.3d        "%(i) for i in xrange(12)]
         mm.setNameFieldAtLevel(1,namesNodes)
         mm.write(fname,2)