Salome HOME
MEDCoupling1SGTUMesh::sortHexa8EachOther
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingMemArray.i
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 ////////////////////
22 %typemap(out) ParaMEDMEM::DataArray*
23 {
24   $result=convertDataArray($1,$owner);
25 }
26
27 %typemap(out) DataArray*
28 {
29   $result=convertDataArray($1,$owner);
30 }
31 //$$$$$$$$$$$$$$$$$$
32
33 ////////////////////
34 %typemap(out) ParaMEDMEM::DataArrayChar*
35 {
36   $result=convertDataArrayChar($1,$owner);
37 }
38
39 %typemap(out) DataArrayChar*
40 {
41   $result=convertDataArrayChar($1,$owner);
42 }
43 //$$$$$$$$$$$$$$$$$$
44
45 %newobject ParaMEDMEM::DataArray::deepCpy;
46 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
47 %newobject ParaMEDMEM::DataArray::selectByTupleId;
48 %newobject ParaMEDMEM::DataArray::selectByTupleIdSafe;
49 %newobject ParaMEDMEM::DataArray::selectByTupleId2;
50 %newobject ParaMEDMEM::DataArray::Aggregate;
51 %newobject ParaMEDMEM::DataArrayInt::New;
52 %newobject ParaMEDMEM::DataArrayInt::__iter__;
53 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
54 %newobject ParaMEDMEM::DataArrayInt::performCpy;
55 %newobject ParaMEDMEM::DataArrayInt::substr;
56 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
57 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
58 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
59 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
60 %newobject ParaMEDMEM::DataArrayInt::renumber;
61 %newobject ParaMEDMEM::DataArrayInt::renumberR;
62 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
63 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
64 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
65 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
66 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
67 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
68 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
69 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
70 %newobject ParaMEDMEM::DataArrayInt::sumPerTuple;
71 %newobject ParaMEDMEM::DataArrayInt::negate;
72 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
73 %newobject ParaMEDMEM::DataArrayInt::getIdsNotInRange;
74 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
75 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
76 %newobject ParaMEDMEM::DataArrayInt::Meld;
77 %newobject ParaMEDMEM::DataArrayInt::Add;
78 %newobject ParaMEDMEM::DataArrayInt::Substract;
79 %newobject ParaMEDMEM::DataArrayInt::Multiply;
80 %newobject ParaMEDMEM::DataArrayInt::Divide;
81 %newobject ParaMEDMEM::DataArrayInt::Pow;
82 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
83 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
84 %newobject ParaMEDMEM::DataArrayInt::Range;
85 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
86 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
87 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
88 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
89 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
90 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
91 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
92 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
93 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
94 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
95 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
96 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
97 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
98 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
99 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
100 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
101 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
102 %newobject ParaMEDMEM::DataArrayInt::FindPermutationFromFirstToSecond;
103 %newobject ParaMEDMEM::DataArrayInt::__neg__;
104 %newobject ParaMEDMEM::DataArrayInt::__add__;
105 %newobject ParaMEDMEM::DataArrayInt::__radd__;
106 %newobject ParaMEDMEM::DataArrayInt::__sub__;
107 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
108 %newobject ParaMEDMEM::DataArrayInt::__mul__;
109 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
110 %newobject ParaMEDMEM::DataArrayInt::__div__;
111 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
112 %newobject ParaMEDMEM::DataArrayInt::__mod__;
113 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
114 %newobject ParaMEDMEM::DataArrayInt::__pow__;
115 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
116 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
117 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
118 %newobject ParaMEDMEM::DataArrayChar::renumber;
119 %newobject ParaMEDMEM::DataArrayChar::renumberR;
120 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
121 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
122 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
123 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
124 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
125 %newobject ParaMEDMEM::DataArrayChar::Meld;
126 %newobject ParaMEDMEM::DataArrayByte::New;
127 %newobject ParaMEDMEM::DataArrayByte::__iter__;
128 %newobject ParaMEDMEM::DataArrayByte::performCpy;
129 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
130 %newobject ParaMEDMEM::DataArrayChar::substr;
131 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
132 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
133 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
134 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
135 %newobject ParaMEDMEM::DataArrayDouble::New;
136 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
137 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
138 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
139 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
140 %newobject ParaMEDMEM::DataArrayDouble::Meld;
141 %newobject ParaMEDMEM::DataArrayDouble::Dot;
142 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
143 %newobject ParaMEDMEM::DataArrayDouble::Add;
144 %newobject ParaMEDMEM::DataArrayDouble::Substract;
145 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
146 %newobject ParaMEDMEM::DataArrayDouble::Divide;
147 %newobject ParaMEDMEM::DataArrayDouble::Pow;
148 %newobject ParaMEDMEM::DataArrayDouble::substr;
149 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
150 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
151 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
152 %newobject ParaMEDMEM::DataArrayDouble::getIdsNotInRange;
153 %newobject ParaMEDMEM::DataArrayDouble::negate;
154 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
155 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
156 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
157 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
158 %newobject ParaMEDMEM::DataArrayDouble::determinant;
159 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
160 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
161 %newobject ParaMEDMEM::DataArrayDouble::inverse;
162 %newobject ParaMEDMEM::DataArrayDouble::trace;
163 %newobject ParaMEDMEM::DataArrayDouble::deviator;
164 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
165 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
166 %newobject ParaMEDMEM::DataArrayDouble::sumPerTuple;
167 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
168 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
169 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
170 %newobject ParaMEDMEM::DataArrayDouble::renumber;
171 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
172 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
173 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
174 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
175 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
176 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
177 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
178 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
179 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
180 %newobject ParaMEDMEM::DataArrayDouble::computeNbOfInteractionsWith;
181 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
182 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
183 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
184 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
185 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
186 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
187 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
188 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
189 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
190
191 %feature("unref") DataArray "$this->decrRef();"
192 %feature("unref") DataArrayDouble "$this->decrRef();"
193 %feature("unref") DataArrayInt "$this->decrRef();"
194 %feature("unref") DataArrayChar "$this->decrRef();"
195 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
196 %feature("unref") DataArrayByte "$this->decrRef();"
197
198 namespace ParaMEDMEM
199 {
200   class DataArray : public RefCountObject, public TimeLabel
201   {
202   public:
203     void setName(const char *name);
204     void copyStringInfoFrom(const DataArray& other) throw(INTERP_KERNEL::Exception);
205     void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
206     void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other) throw(INTERP_KERNEL::Exception);
207     bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const throw(INTERP_KERNEL::Exception);
208     bool areInfoEquals(const DataArray& other) const throw(INTERP_KERNEL::Exception);
209     std::string cppRepr(const char *varName) const throw(INTERP_KERNEL::Exception);
210     std::string getName() const;
211     void setInfoOnComponents(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
212     void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
213     std::vector<std::string> getVarsOnComponent() const throw(INTERP_KERNEL::Exception);
214     std::vector<std::string> getUnitsOnComponent() const throw(INTERP_KERNEL::Exception);
215     std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);
216     std::string getVarOnComponent(int i) const throw(INTERP_KERNEL::Exception);
217     std::string getUnitOnComponent(int i) const throw(INTERP_KERNEL::Exception);
218     void setInfoOnComponent(int i, const char *info) throw(INTERP_KERNEL::Exception);
219     int getNumberOfComponents() const;
220     virtual void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
221     virtual void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
222     virtual bool isAllocated() const throw(INTERP_KERNEL::Exception);
223     virtual void checkAllocated() const throw(INTERP_KERNEL::Exception);
224     virtual void desallocate() throw(INTERP_KERNEL::Exception);
225     virtual int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
226     virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
227     virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
228     virtual DataArray *deepCpy() const throw(INTERP_KERNEL::Exception);
229     virtual DataArray *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
230     virtual void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
231     void checkNbOfTuples(int nbOfTuples, const char *msg) const throw(INTERP_KERNEL::Exception);
232     void checkNbOfComps(int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
233     void checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const throw(INTERP_KERNEL::Exception);
234     void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
235     void checkNbOfElems(std::size_t nbOfElems, const char *msg) const throw(INTERP_KERNEL::Exception);
236     static int GetNumberOfItemGivenBES(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
237     static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
238     static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
239     static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
240     static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
241     void updateTime() const;
242     %extend
243     {
244       PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
245       {
246         const std::vector<std::string>& comps=self->getInfoOnComponents();
247         PyObject *ret=PyList_New((int)comps.size());
248         for(int i=0;i<(int)comps.size();i++)
249           PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
250         return ret;
251       }
252       
253       void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
254       {
255         std::vector<int> tmp;
256         convertPyToNewIntArr3(li,tmp);
257         self->copyPartOfStringInfoFrom(other,tmp);
258       }
259
260       void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
261       {
262         std::vector<int> tmp;
263         convertPyToNewIntArr3(li,tmp);
264         self->copyPartOfStringInfoFrom2(tmp,other);
265       }
266
267       virtual void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
268       {
269         void *da=0;
270         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
271         if (!SWIG_IsOK(res1))
272           {
273             int size;
274             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
275             if(size!=self->getNumberOfTuples())
276               {
277                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
278               }
279             self->renumberInPlace(tmp);
280           }
281         else
282           {
283             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
284             if(!da2)
285               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
286             da2->checkAllocated();
287             int size=self->getNumberOfTuples();
288             if(size!=self->getNumberOfTuples())
289               {
290                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
291               }
292             self->renumberInPlace(da2->getConstPointer());
293           }
294       }
295
296       virtual void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
297       {
298         void *da=0;
299         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
300         if (!SWIG_IsOK(res1))
301           {
302             int size;
303             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
304             if(size!=self->getNumberOfTuples())
305               {
306                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
307               }
308             self->renumberInPlaceR(tmp);
309           }
310         else
311           {
312             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
313             if(!da2)
314               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
315             da2->checkAllocated();
316             int size=self->getNumberOfTuples();
317             if(size!=self->getNumberOfTuples())
318               {
319                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
320               }
321             self->renumberInPlaceR(da2->getConstPointer());
322           }
323       }
324
325       //tuplesSelec in PyObject * because DataArrayInt is not already existing !
326       virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec) throw(INTERP_KERNEL::Exception)
327       {
328         static const char msg[]="DataArray::setContigPartOfSelectedValues2 : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
329           DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 3rd parameter \"aBase\" should be of type DataArray");
330         DataArray *tuplesSelecPtr=CheckAndRetrieveDataArrayInstance(tuplesSelec,msg);
331         DataArrayInt *tuplesSelecPtr2=0;
332         if(tuplesSelecPtr)
333           {
334             tuplesSelecPtr2=dynamic_cast<DataArrayInt *>(tuplesSelecPtr);
335             if(!tuplesSelecPtr2)
336               throw INTERP_KERNEL::Exception(msg);
337           }
338         self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
339       }
340       
341       virtual void setContigPartOfSelectedValues2(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
342       {
343         DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 2nd parameter \"aBase\" should be of type DataArray");
344         self->setContigPartOfSelectedValues2(tupleIdStart,a,bg,end2,step);
345       }
346
347       virtual DataArray *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
348       {
349         std::vector<std::pair<int,int> > ranges;
350         convertPyToVectorPairInt(li,ranges);
351         return self->selectByTupleRanges(ranges);
352       }
353
354       virtual DataArray *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
355       {
356         void *da=0;
357         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
358         if (!SWIG_IsOK(res1))
359           {
360             int size;
361             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
362             return self->selectByTupleId(tmp,tmp+size);
363           }
364         else
365           {
366             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
367             if(!da2)
368               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
369             da2->checkAllocated();
370             return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
371           }
372       }
373
374       virtual DataArray *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
375       {
376         void *da=0;
377         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
378         if (!SWIG_IsOK(res1))
379           {
380             int size;
381             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
382             return self->selectByTupleIdSafe(tmp,tmp+size);
383           }
384         else
385           {
386             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
387             if(!da2)
388               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
389             da2->checkAllocated();
390             return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
391           }
392       }
393
394       virtual PyObject *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
395       {
396         std::vector<int> tmp;
397         convertPyToNewIntArr3(li,tmp);
398         DataArray *ret=self->keepSelectedComponents(tmp);
399         return convertDataArray(ret,SWIG_POINTER_OWN | 0 );
400       }
401
402       static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices) throw(INTERP_KERNEL::Exception)
403       {
404         if(!PySlice_Check(slic))
405           throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
406         Py_ssize_t strt=2,stp=2,step=2;
407         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
408         if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
409           throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : the input slice is invalid !");
410         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
411           throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : the input slice contains some unknowns that can't be determined in static method ! Call DataArray::getSlice (non static) instead !");
412         int a,b;
413         DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
414         return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
415       }
416
417       PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
418       {
419         if(!PySlice_Check(slic))
420           throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
421         Py_ssize_t strt=2,stp=2,step=2;
422         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
423         if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
424           throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : the input slice is invalid !");
425         int a,b;
426         DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
427         return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
428       }
429
430       static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
431       {
432         if(!PySlice_Check(slic))
433           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
434         Py_ssize_t strt=2,stp=2,step=2;
435         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
436         if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
437           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
438         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
439           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : the input slice contains some unknowns that can't be determined in static method !");
440         return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
441       }
442
443       static int GetNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
444       {
445         if(!PySlice_Check(slic))
446           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
447         Py_ssize_t strt=2,stp=2,step=2;
448         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
449         if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
450           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
451         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
452           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice contains some unknowns that can't be determined in static method !");
453         return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
454       }
455       
456       static DataArray *Aggregate(PyObject *arrs) throw(INTERP_KERNEL::Exception)
457       {
458         std::vector<const DataArray *> tmp;
459         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArray *>(arrs,SWIGTYPE_p_ParaMEDMEM__DataArray,"DataArray",tmp);
460         return DataArray::Aggregate(tmp);
461       }
462
463       int getNumberOfItemGivenBES(PyObject *slic) const throw(INTERP_KERNEL::Exception)
464       {
465         if(!PySlice_Check(slic))
466           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
467         Py_ssize_t strt=2,stp=2,step=2;
468         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
469         if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
470           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
471         return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
472       }
473
474       int getNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
475       {
476         if(!PySlice_Check(slic))
477           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
478         Py_ssize_t strt=2,stp=2,step=2;
479         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
480         if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
481           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
482         return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
483       }
484     }
485   };
486   
487   class DataArrayInt;
488   class DataArrayDoubleIterator;
489   
490   class DataArrayDouble : public DataArray
491   {
492   public:
493     static DataArrayDouble *New();
494     double doubleValue() const throw(INTERP_KERNEL::Exception);
495     bool empty() const throw(INTERP_KERNEL::Exception);
496     DataArrayDouble *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
497     void cpyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
498     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
499     void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
500     double popBackSilent() throw(INTERP_KERNEL::Exception);
501     void pack() const throw(INTERP_KERNEL::Exception);
502     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
503     void fillWithZero() throw(INTERP_KERNEL::Exception);
504     void fillWithValue(double val) throw(INTERP_KERNEL::Exception);
505     void iota(double init=0.) throw(INTERP_KERNEL::Exception);
506     bool isUniform(double val, double eps) const throw(INTERP_KERNEL::Exception);
507     void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
508     void reverse() throw(INTERP_KERNEL::Exception);
509     void checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
510     bool isMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
511     std::string repr() const throw(INTERP_KERNEL::Exception);
512     std::string reprZip() const throw(INTERP_KERNEL::Exception);
513     bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
514     bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
515     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
516     DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
517     DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
518     DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
519     void transpose() throw(INTERP_KERNEL::Exception);
520     DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
521     void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
522     DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
523     DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception);
524     DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
525     DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const throw(INTERP_KERNEL::Exception);
526     void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
527     void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
528     void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
529     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
530     double front() const throw(INTERP_KERNEL::Exception);
531     double back() const throw(INTERP_KERNEL::Exception);
532     double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
533     void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
534     void setIJSilent(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
535     double *getPointer() throw(INTERP_KERNEL::Exception);
536     void checkNoNullValues() const throw(INTERP_KERNEL::Exception);
537     DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const throw(INTERP_KERNEL::Exception);
538     void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
539     double getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
540     double getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
541     double getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
542     double getMinValueInArray() const throw(INTERP_KERNEL::Exception);
543     int count(double value, double eps) const throw(INTERP_KERNEL::Exception);
544     double getAverageValue() const throw(INTERP_KERNEL::Exception);
545     double norm2() const throw(INTERP_KERNEL::Exception);
546     double normMax() const throw(INTERP_KERNEL::Exception);
547     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
548     DataArrayDouble *fromPolarToCart() const throw(INTERP_KERNEL::Exception);
549     DataArrayDouble *fromCylToCart() const throw(INTERP_KERNEL::Exception);
550     DataArrayDouble *fromSpherToCart() const throw(INTERP_KERNEL::Exception);
551     DataArrayDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
552     DataArrayDouble *determinant() const throw(INTERP_KERNEL::Exception);
553     DataArrayDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
554     DataArrayDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
555     DataArrayDouble *inverse() const throw(INTERP_KERNEL::Exception);
556     DataArrayDouble *trace() const throw(INTERP_KERNEL::Exception);
557     DataArrayDouble *deviator() const throw(INTERP_KERNEL::Exception);
558     DataArrayDouble *magnitude() const throw(INTERP_KERNEL::Exception);
559     DataArrayDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
560     DataArrayDouble *sumPerTuple() const throw(INTERP_KERNEL::Exception);
561     DataArrayDouble *buildEuclidianDistanceDenseMatrix() const throw(INTERP_KERNEL::Exception);
562     DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
563     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
564     void abs() throw(INTERP_KERNEL::Exception);
565     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
566     void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
567     void applyInv(double numerator) throw(INTERP_KERNEL::Exception);
568     void applyPow(double val) throw(INTERP_KERNEL::Exception);
569     void applyRPow(double val) throw(INTERP_KERNEL::Exception);
570     DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
571     DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
572     DataArrayDouble *applyFunc(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
573     DataArrayDouble *applyFunc(const char *func) const throw(INTERP_KERNEL::Exception);
574     DataArrayDouble *applyFunc2(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
575     DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
576     void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
577     void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
578     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
579     DataArrayInt *getIdsNotInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
580     static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
581     static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
582     static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
583     static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
584     static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
585     static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
586     static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
587     void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
588     static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
589     void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
590     static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
591     void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
592     static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
593     void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
594     static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
595     void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
596     %extend
597     {
598       DataArrayDouble() throw(INTERP_KERNEL::Exception)
599         {
600           return DataArrayDouble::New();
601         }
602
603       static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
604       {
605         const char *msgBase="ParaMEDMEM::DataArrayDouble::New : Available API are : \n-DataArrayDouble.New()\n-DataArrayDouble.New([1.,3.,4.])\n-DataArrayDouble.New([1.,3.,4.],3)\n-DataArrayDouble.New([1.,3.,4.,5.],2,2)\n-DataArrayDouble.New([1.,3.,4.,5.,7,8.],3,2)\n-DataArrayDouble.New([(1.,3.),(4.,5.),(7,8.)])\n-DataArrayDouble.New(5)\n-DataArrayDouble.New(5,2)";
606         std::string msg(msgBase);
607 #ifdef WITH_NUMPY
608         msg+="\n-DataArrayDouble.New(numpy array with dtype=float64)";
609 #endif
610         msg+=" !";
611         if(PyList_Check(elt0) || PyTuple_Check(elt0))
612           {
613             if(nbOfTuples)
614               {
615                 if(PyInt_Check(nbOfTuples))
616                   {
617                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
618                     if(nbOfTuples1<0)
619                       throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
620                     if(elt2)
621                       {
622                         if(PyInt_Check(elt2))
623                           {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
624                             int nbOfCompo=PyInt_AS_LONG(elt2);
625                             if(nbOfCompo<0)
626                               throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
627                             MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
628                             std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
629                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
630                             return ret.retn();
631                           }
632                         else
633                           throw INTERP_KERNEL::Exception(msg.c_str());
634                       }
635                     else
636                       {//DataArrayDouble.New([1.,3.,4.],3)
637                         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
638                         int tmpp1=-1;
639                         std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
640                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
641                         return ret.retn();
642                       }
643                   }
644                 else
645                   throw INTERP_KERNEL::Exception(msg.c_str());
646               }
647             else
648               {// DataArrayDouble.New([1.,3.,4.])
649                 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
650                 int tmpp1=-1,tmpp2=-1;
651                 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
652                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
653                 return ret.retn();
654               }
655           }
656         else if(PyInt_Check(elt0))
657           {
658             int nbOfTuples1=PyInt_AS_LONG(elt0);
659             if(nbOfTuples1<0)
660               throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
661             if(nbOfTuples)
662               {
663                 if(!elt2)
664                   {
665                     if(PyInt_Check(nbOfTuples))
666                       {//DataArrayDouble.New(5,2)
667                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
668                         if(nbOfCompo<0)
669                           throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
670                         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
671                         ret->alloc(nbOfTuples1,nbOfCompo);
672                         return ret.retn();
673                       }
674                     else
675                       throw INTERP_KERNEL::Exception(msg.c_str());
676                   }
677                 else
678                   throw INTERP_KERNEL::Exception(msg.c_str());
679               }
680             else
681               {//DataArrayDouble.New(5)
682                 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
683                 ret->alloc(nbOfTuples1,1);
684                 return ret.retn();
685               }
686           }
687 #ifdef WITH_NUMPY
688         else if(PyArray_Check(elt0) && nbOfTuples==NULL && elt2==NULL)
689           {//DataArrayDouble.New(numpyArray)
690             return BuildNewInstance<DataArrayDouble,double>(elt0,NPY_DOUBLE,&PyCallBackDataArrayDouble_RefType,"FLOAT64");
691           }
692 #endif
693         else
694           throw INTERP_KERNEL::Exception(msg.c_str());
695       }
696    
697       DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
698         {
699           return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
700         }
701
702       void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
703       {
704         double val;
705         std::vector<double> bb;
706         int sw,nbTuples=-1;
707         const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
708         const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
709         self->pushBackValsSilent(tmp,tmp+nbTuples);
710       }
711
712       std::string __repr__() const throw(INTERP_KERNEL::Exception)
713       {
714         std::ostringstream oss;
715         self->reprQuickOverview(oss);
716         return oss.str();
717       }
718
719       std::string __str__() const throw(INTERP_KERNEL::Exception)
720       {
721         return self->repr();
722       }
723
724       double __float__() const throw(INTERP_KERNEL::Exception)
725       {
726         return self->doubleValue();
727       }
728
729       int __len__() const throw(INTERP_KERNEL::Exception)
730       {
731         if(self->isAllocated())
732           {
733             return self->getNumberOfTuples();
734           }
735         else
736           {
737             throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
738           }
739       }
740
741       DataArrayDoubleIterator *__iter__() throw(INTERP_KERNEL::Exception)
742       {
743         return self->iterator();
744       }
745    
746       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
747       {
748         const char *msg="ParaMEDMEM::DataArrayDouble::setValues : Available API are : \n-DataArrayDouble.setValues([1.,3.,4.])\n-DataArrayDouble.setValues([1.,3.,4.],3)\n-DataArrayDouble.setValues([1.,3.,4.,5.],2,2)\n-DataArrayDouble.setValues([(1.,1.7),(3.,3.7),(4.,4.7)])\n !";
749         if(PyList_Check(li) || PyTuple_Check(li))
750           {
751             if(nbOfTuples)
752               {
753                 if(PyInt_Check(nbOfTuples))
754                   {
755                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
756                     if(nbOfTuples1<0)
757                       throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
758                     if(nbOfComp)
759                       {
760                         if(PyInt_Check(nbOfComp))
761                           {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
762                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
763                             if(nbOfCompo<0)
764                               throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
765                             std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
766                             self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
767                           }
768                         else
769                           throw INTERP_KERNEL::Exception(msg);
770                       }
771                     else
772                       {//DataArrayDouble.setValues([1.,3.,4.],3)
773                         int tmpp1=-1;
774                         std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
775                         self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
776                       }
777                   }
778                 else
779                   throw INTERP_KERNEL::Exception(msg);
780               }
781             else
782               {// DataArrayDouble.setValues([1.,3.,4.])
783                 int tmpp1=-1,tmpp2=-1;
784                 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
785                 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
786               }
787           }
788         else
789           throw INTERP_KERNEL::Exception(msg);
790       }
791
792       PyObject *getValues() const throw(INTERP_KERNEL::Exception)
793       {
794         const double *vals=self->getConstPointer();
795         return convertDblArrToPyList(vals,self->getNbOfElems());
796       }
797
798 #ifdef WITH_NUMPY
799       PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
800       {
801         return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
802       }
803 #endif
804
805       PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
806       {
807         std::string ret1;
808         bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
809         PyObject *ret=PyTuple_New(2);
810         PyObject *ret0Py=ret0?Py_True:Py_False;
811         Py_XINCREF(ret0Py);
812         PyTuple_SetItem(ret,0,ret0Py);
813         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
814         return ret;
815       }
816
817       PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
818       {
819         const double *vals=self->getConstPointer();
820         int nbOfComp=self->getNumberOfComponents();
821         int nbOfTuples=self->getNumberOfTuples();
822         return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
823       }
824
825       DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
826       {
827         void *da=0;
828         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
829         if (!SWIG_IsOK(res1))
830           {
831             int size;
832             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
833             if(size!=self->getNumberOfTuples())
834               {
835                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
836               }
837             return self->renumber(tmp);
838           }
839         else
840           {
841             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
842             if(!da2)
843               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
844             da2->checkAllocated();
845             int size=self->getNumberOfTuples();
846             if(size!=self->getNumberOfTuples())
847               {
848                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
849               }
850             return self->renumber(da2->getConstPointer());
851           }
852       }
853
854       DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
855       {
856         void *da=0;
857         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
858         if (!SWIG_IsOK(res1))
859           {
860             int size;
861             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
862             if(size!=self->getNumberOfTuples())
863               {
864                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
865               }
866             return self->renumberR(tmp);
867           }
868         else
869           {
870             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
871             if(!da2)
872               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
873             da2->checkAllocated();
874             int size=self->getNumberOfTuples();
875             if(size!=self->getNumberOfTuples())
876               {
877                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
878               }
879             return self->renumberR(da2->getConstPointer());
880           }
881       }
882
883       DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
884       {
885         void *da=0;
886         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
887         if (!SWIG_IsOK(res1))
888           {
889             int size;
890             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
891             if(size!=self->getNumberOfTuples())
892               {
893                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
894               }
895             return self->renumberAndReduce(tmp,newNbOfTuple);
896           }
897         else
898           {
899             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
900             if(!da2)
901               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
902             da2->checkAllocated();
903             int size=self->getNumberOfTuples();
904             if(size!=self->getNumberOfTuples())
905               {
906                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
907               }
908             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
909           }
910       }
911
912       PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
913       {
914         int thisTupleId,otherTupleId;
915         double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
916         PyObject *ret=PyTuple_New(3);
917         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
918         PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
919         PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
920         return ret;
921       }
922
923       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
924       {
925         int tmp;
926         double r1=self->getMaxValue(tmp);
927         PyObject *ret=PyTuple_New(2);
928         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
929         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
930         return ret;
931       }
932
933       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
934       {
935         DataArrayInt *tmp;
936         double r1=self->getMaxValue2(tmp);
937         PyObject *ret=PyTuple_New(2);
938         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
939         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
940         return ret;
941       }
942
943       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
944       {
945         int tmp;
946         double r1=self->getMinValue(tmp);
947         PyObject *ret=PyTuple_New(2);
948         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
949         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
950         return ret;
951       }
952
953       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
954       {
955         DataArrayInt *tmp;
956         double r1=self->getMinValue2(tmp);
957         PyObject *ret=PyTuple_New(2);
958         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
959         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
960         return ret;
961       }
962
963       PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
964       {
965         int nbOfCompo=self->getNumberOfComponents();
966         INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
967         self->getMinMaxPerComponent(tmp);
968         PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
969         return ret;
970       }
971
972       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
973       {
974         int sz=self->getNumberOfComponents();
975         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
976         self->accumulate(tmp);
977         return convertDblArrToPyList(tmp,sz);
978       }
979
980       DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
981       {
982         int sw,sz,val;
983         std::vector<int> val2;
984         const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
985         return self->accumulatePerChunck(bg,bg+sz);
986       }
987
988       PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
989       {
990         DataArrayInt *comm, *commIndex;
991         self->findCommonTuples(prec,limitNodeId,comm,commIndex);
992         PyObject *res = PyList_New(2);
993         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
994         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
995         return res;
996       }
997
998       PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
999       {
1000         double val;
1001         DataArrayDouble *a;
1002         DataArrayDoubleTuple *aa;
1003         std::vector<double> bb;
1004         int sw;
1005         int tupleId=-1,nbOfCompo=self->getNumberOfComponents();
1006         const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
1007         //
1008         double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
1009         PyObject *ret=PyTuple_New(2);
1010         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1011         PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
1012         return ret;
1013       }
1014
1015       void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
1016       {
1017         std::vector<int> tmp;
1018         convertPyToNewIntArr3(li,tmp);
1019         self->setSelectedComponents(a,tmp);
1020       }
1021    
1022       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
1023       {
1024         int sz=self->getNumberOfComponents();
1025         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
1026         self->getTuple(tupleId,tmp);
1027         return convertDblArrToPyList(tmp,sz);
1028       }
1029
1030       static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
1031       {
1032         std::vector<const DataArrayDouble *> tmp;
1033         convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
1034         return DataArrayDouble::Aggregate(tmp);
1035       }
1036
1037       static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
1038       {
1039         std::vector<const DataArrayDouble *> tmp;
1040         convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
1041         return DataArrayDouble::Meld(tmp);
1042       }
1043
1044       PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1045       {
1046         double val;
1047         DataArrayDouble *a;
1048         DataArrayDoubleTuple *aa;
1049         std::vector<double> bb;
1050         int sw;
1051         int nbComp=self->getNumberOfComponents(),nbTuples=-1;
1052         const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
1053         const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
1054         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
1055         DataArrayInt *c=0,*cI=0;
1056         self->computeTupleIdsNearTuples(inpu,eps,c,cI);
1057         PyObject *ret=PyTuple_New(2);
1058         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1059         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1060         return ret;
1061       }
1062
1063       PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const throw(INTERP_KERNEL::Exception)
1064       {
1065         DataArrayInt *ret1=0;
1066         bool ret0=self->areIncludedInMe(other,prec,ret1);
1067         PyObject *ret=PyTuple_New(2);
1068         PyObject *ret0Py=ret0?Py_True:Py_False;
1069         Py_XINCREF(ret0Py);
1070         PyTuple_SetItem(ret,0,ret0Py);
1071         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1072         return ret;
1073       }
1074
1075       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1076       {
1077         const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
1078         const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
1079         self->checkAllocated();
1080         int nbOfTuples=self->getNumberOfTuples();
1081         int nbOfComponents=self->getNumberOfComponents();
1082         int it1,ic1;
1083         std::vector<int> vt1,vc1;
1084         std::pair<int, std::pair<int,int> > pt1,pc1;
1085         DataArrayInt *dt1=0,*dc1=0;
1086         int sw;
1087         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1088         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
1089         switch(sw)
1090           {
1091           case 1:
1092             if(nbOfComponents==1)
1093               return PyFloat_FromDouble(self->getIJSafe(it1,0));
1094             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1095           case 2:
1096             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1097           case 3:
1098             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1099           case 4:
1100             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1101           case 5:
1102             return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
1103           case 6:
1104             {
1105               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1106               std::vector<int> v2(1,ic1);
1107               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1108             }
1109           case 7:
1110             {
1111               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1112               std::vector<int> v2(1,ic1);
1113               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1114             }
1115           case 8:
1116             {
1117               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1118               std::vector<int> v2(1,ic1);
1119               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1120             }
1121           case 9:
1122             {
1123               ret=self->selectByTupleIdSafe(&it1,&it1+1);
1124               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1125             }
1126           case 10:
1127             {
1128               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1129               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1130             }
1131           case 11:
1132             {
1133               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1134               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1135             }
1136           case 12:
1137             {
1138               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1139               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1140             }
1141           case 13:
1142             {
1143               ret=self->selectByTupleIdSafe(&it1,&it1+1);
1144               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1145               std::vector<int> v2(nbOfComp);
1146               for(int i=0;i<nbOfComp;i++)
1147                 v2[i]=pc1.first+i*pc1.second.second;
1148               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1149             }
1150           case 14:
1151             {
1152               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1153               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1154               std::vector<int> v2(nbOfComp);
1155               for(int i=0;i<nbOfComp;i++)
1156                 v2[i]=pc1.first+i*pc1.second.second;
1157               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1158             }
1159           case 15:
1160             {
1161               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1162               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1163               std::vector<int> v2(nbOfComp);
1164               for(int i=0;i<nbOfComp;i++)
1165                 v2[i]=pc1.first+i*pc1.second.second;
1166               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1167             }
1168           case 16:
1169             {
1170               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1171               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1172               std::vector<int> v2(nbOfComp);
1173               for(int i=0;i<nbOfComp;i++)
1174                 v2[i]=pc1.first+i*pc1.second.second;
1175               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1176             }
1177           default:
1178             throw INTERP_KERNEL::Exception(msg);
1179           }
1180       }
1181
1182       DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
1183       {
1184         self->checkAllocated();
1185         const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
1186         int nbOfTuples=self->getNumberOfTuples();
1187         int nbOfComponents=self->getNumberOfComponents();
1188         int sw1,sw2;
1189         double i1;
1190         std::vector<double> v1;
1191         DataArrayDouble *d1=0;
1192         convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
1193         int it1,ic1;
1194         std::vector<int> vt1,vc1;
1195         std::pair<int, std::pair<int,int> > pt1,pc1;
1196         DataArrayInt *dt1=0,*dc1=0;
1197         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1198         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
1199         switch(sw2)
1200           {
1201           case 1:
1202             {
1203               switch(sw1)
1204                 {
1205                 case 1:
1206                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
1207                   return self;
1208                 case 2:
1209                   tmp=DataArrayDouble::New();
1210                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1211                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
1212                   return self;
1213                 case 3:
1214                   self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
1215                   return self;
1216                 default:
1217                   throw INTERP_KERNEL::Exception(msg);
1218                 }
1219               break;
1220             }
1221           case 2:
1222             {
1223               switch(sw1)
1224                 {
1225                 case 1:
1226                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1227                   return self;
1228                 case 2:
1229                   tmp=DataArrayDouble::New();
1230                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1231                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
1232                   return self;
1233                 case 3:
1234                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1235                   return self;
1236                 default:
1237                   throw INTERP_KERNEL::Exception(msg);
1238                 }
1239               break;
1240             }
1241           case 3:
1242             {
1243               switch(sw1)
1244                 {
1245                 case 1:
1246                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1247                   return self;
1248                 case 2:
1249                   tmp=DataArrayDouble::New();
1250                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1251                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
1252                   return self;
1253                 case 3:
1254                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1255                   return self;
1256                 default:
1257                   throw INTERP_KERNEL::Exception(msg);
1258                 }
1259               break;
1260             }
1261           case 4:
1262             {
1263               switch(sw1)
1264                 {
1265                 case 1:
1266                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1267                   return self;
1268                 case 2:
1269                   tmp=DataArrayDouble::New();
1270                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1271                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
1272                   return self;
1273                 case 3:
1274                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1275                   return self;
1276                 default:
1277                   throw INTERP_KERNEL::Exception(msg);
1278                 }
1279               break;
1280             }
1281           case 5:
1282             {
1283               switch(sw1)
1284                 {
1285                 case 1:
1286                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
1287                   return self;
1288                 case 2:
1289                   tmp=DataArrayDouble::New();
1290                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1291                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
1292                   return self;
1293                 case 3:
1294                   self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
1295                   return self;
1296                 default:
1297                   throw INTERP_KERNEL::Exception(msg);
1298                 }
1299               break;
1300             }
1301           case 6:
1302             {
1303               switch(sw1)
1304                 {
1305                 case 1:
1306                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1307                   return self;
1308                 case 2:
1309                   tmp=DataArrayDouble::New();
1310                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1311                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
1312                   return self;
1313                 case 3:
1314                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1315                   return self;
1316                 default:
1317                   throw INTERP_KERNEL::Exception(msg);
1318                 }
1319               break;
1320             }
1321           case 7:
1322             {
1323               switch(sw1)
1324                 {
1325                 case 1:
1326                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1327                   return self;
1328                 case 2:
1329                   tmp=DataArrayDouble::New();
1330                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1331                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
1332                   return self;
1333                 case 3:
1334                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1335                   return self;
1336                 default:
1337                   throw INTERP_KERNEL::Exception(msg);
1338                 }
1339               break;
1340             }
1341           case 8:
1342             {
1343               switch(sw1)
1344                 {
1345                 case 1:
1346                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1347                   return self;
1348                 case 2:
1349                   tmp=DataArrayDouble::New();
1350                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1351                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
1352                   return self;
1353                 case 3:
1354                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1355                   return self;
1356                 default:
1357                   throw INTERP_KERNEL::Exception(msg);
1358                 }
1359               break;
1360             }
1361           case 9:
1362             {
1363               switch(sw1)
1364                 {
1365                 case 1:
1366                   self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1367                   return self;
1368                 case 2:
1369                   tmp=DataArrayDouble::New();
1370                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1371                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
1372                   return self;
1373                 case 3:
1374                   self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1375                   return self;
1376                 default:
1377                   throw INTERP_KERNEL::Exception(msg);
1378                 }
1379               break;
1380             }
1381           case 10:
1382             {
1383               switch(sw1)
1384                 {
1385                 case 1:
1386                   self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1387                   return self;
1388                 case 2:
1389                   tmp=DataArrayDouble::New();
1390                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1391                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
1392                   return self;
1393                 case 3:
1394                   self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1395                   return self;
1396                 default:
1397                   throw INTERP_KERNEL::Exception(msg);
1398                 }
1399               break;
1400             }
1401           case 11:
1402             {
1403               switch(sw1)
1404                 {
1405                 case 1:
1406                   self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1407                   return self;
1408                 case 2:
1409                   tmp=DataArrayDouble::New();
1410                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1411                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
1412                   return self;
1413                 case 3:
1414                   self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1415                   return self;
1416                 default:
1417                   throw INTERP_KERNEL::Exception(msg);
1418                 }
1419               break;
1420             }
1421           case 12:
1422             {
1423               switch(sw1)
1424                 {
1425                 case 1:
1426                   self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1427                   return self;
1428                 case 2:
1429                   tmp=DataArrayDouble::New();
1430                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1431                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
1432                   return self;
1433                 case 3:
1434                   self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1435                   return self;
1436                 default:
1437                   throw INTERP_KERNEL::Exception(msg);
1438                 }
1439               break;
1440             }
1441           case 13:
1442             {
1443               switch(sw1)
1444                 {
1445                 case 1:
1446                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1447                   return self;
1448                 case 2:
1449                   tmp=DataArrayDouble::New();
1450                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1451                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
1452                   return self;
1453                 case 3:
1454                   self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1455                   return self;
1456                 default:
1457                   throw INTERP_KERNEL::Exception(msg);
1458                 }
1459               break;
1460             }
1461           case 14:
1462             {
1463               switch(sw1)
1464                 {
1465                 case 1:
1466                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1467                   return self;
1468                 case 2:
1469                   tmp=DataArrayDouble::New();
1470                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1471                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
1472                   return self;
1473                 case 3:
1474                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1475                   return self;
1476                 default:
1477                   throw INTERP_KERNEL::Exception(msg);
1478                 }
1479               break;
1480             }
1481           case 15:
1482             {
1483               switch(sw1)
1484                 {
1485                 case 1:
1486                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1487                   return self;
1488                 case 2:
1489                   tmp=DataArrayDouble::New();
1490                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1491                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
1492                   return self;
1493                 case 3:
1494                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1495                   return self;
1496                 default:
1497                   throw INTERP_KERNEL::Exception(msg);
1498                 }
1499               break;
1500             }
1501           case 16:
1502             {
1503               switch(sw1)
1504                 {
1505                 case 1:
1506                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1507                   return self;
1508                 case 2:
1509                   tmp=DataArrayDouble::New();
1510                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1511                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
1512                   return self;
1513                 case 3:
1514                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1515                   return self;
1516                 default:
1517                   throw INTERP_KERNEL::Exception(msg);
1518                 }
1519               break;
1520             }
1521           default:
1522             throw INTERP_KERNEL::Exception(msg);
1523           }
1524         return self;
1525       }
1526
1527       DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
1528       {
1529         return self->negate();
1530       }
1531
1532       PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1533       {
1534         const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
1535         double val;
1536         DataArrayDouble *a;
1537         DataArrayDoubleTuple *aa;
1538         std::vector<double> bb;
1539         int sw;
1540         //
1541 #ifndef WITHOUT_AUTOFIELD
1542         void *argp;
1543         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1544           {
1545             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1546             if(other)
1547               {
1548                 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1549                 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1550                 Py_XDECREF(tmp);
1551                 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1552               }
1553             else
1554               throw INTERP_KERNEL::Exception(msg);
1555           }
1556 #endif
1557         //
1558         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1559         switch(sw)
1560           {
1561           case 1:
1562             {
1563               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1564               ret->applyLin(1.,val);
1565               return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1566             }
1567           case 2:
1568             {
1569               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1570             }
1571           case 3:
1572             {
1573               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1574               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1575             }
1576           case 4:
1577             {
1578               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1579               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1580             }
1581           default:
1582             throw INTERP_KERNEL::Exception(msg);
1583           }
1584       }
1585
1586       DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1587       {
1588         const char msg[]="Unexpected situation in __radd__ !";
1589         double val;
1590         DataArrayDouble *a;
1591         DataArrayDoubleTuple *aa;
1592         std::vector<double> bb;
1593         int sw;
1594         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1595         switch(sw)
1596           {
1597           case 1:
1598             {
1599               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1600               ret->applyLin(1.,val);
1601               return ret.retn();
1602             }
1603           case 3:
1604             {
1605               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1606               return DataArrayDouble::Add(self,aaa);
1607             }
1608           case 4:
1609             {
1610               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1611               return DataArrayDouble::Add(self,aaa);
1612             }
1613           default:
1614             throw INTERP_KERNEL::Exception(msg);
1615           }
1616       }
1617    
1618       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1619       {
1620         const char msg[]="Unexpected situation in __iadd__ !";
1621         double val;
1622         DataArrayDouble *a;
1623         DataArrayDoubleTuple *aa;
1624         std::vector<double> bb;
1625         int sw;
1626         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1627         switch(sw)
1628           {
1629           case 1:
1630             {
1631               self->applyLin(1.,val);
1632               Py_XINCREF(trueSelf);
1633               return trueSelf;
1634             }
1635           case 2:
1636             {
1637               self->addEqual(a);
1638               Py_XINCREF(trueSelf);
1639               return trueSelf;
1640             }
1641           case 3:
1642             {
1643               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1644               self->addEqual(aaa);
1645               Py_XINCREF(trueSelf);
1646               return trueSelf;
1647             }
1648           case 4:
1649             {
1650               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1651               self->addEqual(aaa);
1652               Py_XINCREF(trueSelf);
1653               return trueSelf;
1654             }
1655           default:
1656             throw INTERP_KERNEL::Exception(msg);
1657           }
1658       }
1659
1660       PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1661       {
1662         const char msg[]="Unexpected situation in __sub__ !";
1663         double val;
1664         DataArrayDouble *a;
1665         DataArrayDoubleTuple *aa;
1666         std::vector<double> bb;
1667         int sw;
1668         //
1669 #ifndef WITHOUT_AUTOFIELD
1670         void *argp;
1671         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1672           {
1673             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1674             if(other)
1675               {
1676                 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1677                 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1678                 Py_XDECREF(tmp);
1679                 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1680               }
1681             else
1682               throw INTERP_KERNEL::Exception(msg);
1683           }
1684 #endif
1685         //
1686         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1687         switch(sw)
1688           {
1689           case 1:
1690             {
1691               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1692               ret->applyLin(1.,-val);
1693               return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1694             }
1695           case 2:
1696             {
1697               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1698             }
1699           case 3:
1700             {
1701               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1702               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1703             }
1704           case 4:
1705             {
1706               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1707               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1708             }
1709           default:
1710             throw INTERP_KERNEL::Exception(msg);
1711           }
1712       }
1713
1714       DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1715       {
1716         const char msg[]="Unexpected situation in __rsub__ !";
1717         double val;
1718         DataArrayDouble *a;
1719         DataArrayDoubleTuple *aa;
1720         std::vector<double> bb;
1721         int sw;
1722         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1723         switch(sw)
1724           {
1725           case 1:
1726             {
1727               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1728               ret->applyLin(-1.,val);
1729               return ret.retn();
1730             }
1731           case 3:
1732             {
1733               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1734               return DataArrayDouble::Substract(aaa,self);
1735             }
1736           case 4:
1737             {
1738               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1739               return DataArrayDouble::Substract(aaa,self);
1740             }
1741           default:
1742             throw INTERP_KERNEL::Exception(msg);
1743           }
1744       }
1745
1746       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1747       {
1748         const char msg[]="Unexpected situation in __isub__ !";
1749         double val;
1750         DataArrayDouble *a;
1751         DataArrayDoubleTuple *aa;
1752         std::vector<double> bb;
1753         int sw;
1754         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1755         switch(sw)
1756           {
1757           case 1:
1758             {
1759               self->applyLin(1,-val);
1760               Py_XINCREF(trueSelf);
1761               return trueSelf;
1762             }
1763           case 2:
1764             {
1765               self->substractEqual(a);
1766               Py_XINCREF(trueSelf);
1767               return trueSelf;
1768             }
1769           case 3:
1770             {
1771               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1772               self->substractEqual(aaa);
1773               Py_XINCREF(trueSelf);
1774               return trueSelf;
1775             }
1776           case 4:
1777             {
1778               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1779               self->substractEqual(aaa);
1780               Py_XINCREF(trueSelf);
1781               return trueSelf;
1782             }
1783           default:
1784             throw INTERP_KERNEL::Exception(msg);
1785           }
1786       }
1787
1788       PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1789       {
1790         const char msg[]="Unexpected situation in __mul__ !";
1791         double val;
1792         DataArrayDouble *a;
1793         DataArrayDoubleTuple *aa;
1794         std::vector<double> bb;
1795         int sw;
1796         //
1797 #ifndef WITHOUT_AUTOFIELD
1798         void *argp;
1799         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1800           {
1801             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1802             if(other)
1803               {
1804                 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1805                 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1806                 Py_XDECREF(tmp);
1807                 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1808               }
1809             else
1810               throw INTERP_KERNEL::Exception(msg);
1811           }
1812 #endif
1813         //
1814         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1815         switch(sw)
1816           {
1817           case 1:
1818             {
1819               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1820               ret->applyLin(val,0.);
1821               return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1822             }
1823           case 2:
1824             {
1825               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1826             }
1827           case 3:
1828             {
1829               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1830               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1831             }
1832           case 4:
1833             {
1834               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1835               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1836             }
1837           default:
1838             throw INTERP_KERNEL::Exception(msg);
1839           }
1840       }
1841
1842       DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1843       {
1844         const char msg[]="Unexpected situation in __rmul__ !";
1845         double val;
1846         DataArrayDouble *a;
1847         DataArrayDoubleTuple *aa;
1848         std::vector<double> bb;
1849         int sw;
1850         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1851         switch(sw)
1852           {
1853           case 1:
1854             {
1855               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1856               ret->applyLin(val,0.);
1857               return ret.retn();
1858             }
1859           case 3:
1860             {
1861               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1862               return DataArrayDouble::Multiply(self,aaa);
1863             }
1864           case 4:
1865             {
1866               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1867               return DataArrayDouble::Multiply(self,aaa);
1868             }
1869           default:
1870             throw INTERP_KERNEL::Exception(msg);
1871           }
1872       }
1873
1874       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1875       {
1876         const char msg[]="Unexpected situation in __imul__ !";
1877         double val;
1878         DataArrayDouble *a;
1879         DataArrayDoubleTuple *aa;
1880         std::vector<double> bb;
1881         int sw;
1882         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1883         switch(sw)
1884           {
1885           case 1:
1886             {
1887               self->applyLin(val,0.);
1888               Py_XINCREF(trueSelf);
1889               return trueSelf;
1890             }
1891           case 2:
1892             {
1893               self->multiplyEqual(a);
1894               Py_XINCREF(trueSelf);
1895               return trueSelf;
1896             }
1897           case 3:
1898             {
1899               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1900               self->multiplyEqual(aaa);
1901               Py_XINCREF(trueSelf);
1902               return trueSelf;
1903             }
1904           case 4:
1905             {
1906               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1907               self->multiplyEqual(aaa);
1908               Py_XINCREF(trueSelf);
1909               return trueSelf;
1910             }
1911           default:
1912             throw INTERP_KERNEL::Exception(msg);
1913           }
1914       }
1915
1916       PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1917       {
1918         const char msg[]="Unexpected situation in __div__ !";
1919         double val;
1920         DataArrayDouble *a;
1921         DataArrayDoubleTuple *aa;
1922         std::vector<double> bb;
1923         int sw;
1924         //
1925 #ifndef WITHOUT_AUTOFIELD
1926         void *argp;
1927         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1928           {
1929             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1930             if(other)
1931               {
1932                 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1933                 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1934                 Py_XDECREF(tmp);
1935                 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1936               }
1937             else
1938               throw INTERP_KERNEL::Exception(msg);
1939           }
1940 #endif
1941         //
1942         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1943         switch(sw)
1944           {
1945           case 1:
1946             {
1947               if(val==0.)
1948                 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1949               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1950               ret->applyLin(1/val,0.);
1951               return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1952             }
1953           case 2:
1954             {
1955               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1956             }
1957           case 3:
1958             {
1959               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1960               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1961             }
1962           case 4:
1963             {
1964               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1965               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1966             }
1967           default:
1968             throw INTERP_KERNEL::Exception(msg);
1969           }
1970       }
1971
1972       DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1973       {
1974         const char msg[]="Unexpected situation in __rdiv__ !";
1975         double val;
1976         DataArrayDouble *a;
1977         DataArrayDoubleTuple *aa;
1978         std::vector<double> bb;
1979         int sw;
1980         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1981         switch(sw)
1982           {
1983           case 1:
1984             {
1985               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1986               ret->applyInv(val);
1987               return ret.retn();
1988             }
1989           case 3:
1990             {
1991               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1992               return DataArrayDouble::Divide(aaa,self);
1993             }
1994           case 4:
1995             {
1996               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1997               return DataArrayDouble::Divide(aaa,self);
1998             }
1999           default:
2000             throw INTERP_KERNEL::Exception(msg);
2001           }
2002       }
2003
2004       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2005       {
2006         const char msg[]="Unexpected situation in __idiv__ !";
2007         double val;
2008         DataArrayDouble *a;
2009         DataArrayDoubleTuple *aa;
2010         std::vector<double> bb;
2011         int sw;
2012         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2013         switch(sw)
2014           {
2015           case 1:
2016             {
2017               if(val==0.)
2018                 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
2019               self->applyLin(1./val,0.);
2020               Py_XINCREF(trueSelf);
2021               return trueSelf;
2022             }
2023           case 2:
2024             {
2025               self->divideEqual(a);
2026               Py_XINCREF(trueSelf);
2027               return trueSelf;
2028             }
2029           case 3:
2030             {
2031               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2032               self->divideEqual(aaa);
2033               Py_XINCREF(trueSelf);
2034               return trueSelf;
2035             }
2036           case 4:
2037             {
2038               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2039               self->divideEqual(aaa);
2040               Py_XINCREF(trueSelf);
2041               return trueSelf;
2042             }
2043           default:
2044             throw INTERP_KERNEL::Exception(msg);
2045           }
2046       }
2047    
2048       DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2049       {
2050         const char msg[]="Unexpected situation in __pow__ !";
2051         double val;
2052         DataArrayDouble *a;
2053         DataArrayDoubleTuple *aa;
2054         std::vector<double> bb;
2055         int sw;
2056         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2057         switch(sw)
2058           {
2059           case 1:
2060             {
2061               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2062               ret->applyPow(val);
2063               return ret.retn();
2064             }
2065           case 2:
2066             {
2067               return DataArrayDouble::Pow(self,a);
2068             }
2069           case 3:
2070             {
2071               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2072               return DataArrayDouble::Pow(self,aaa);
2073             }
2074           case 4:
2075             {
2076               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2077               return DataArrayDouble::Pow(self,aaa);
2078             }
2079           default:
2080             throw INTERP_KERNEL::Exception(msg);
2081           }
2082       }
2083
2084       DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2085       {
2086         const char msg[]="Unexpected situation in __rpow__ !";
2087         double val;
2088         DataArrayDouble *a;
2089         DataArrayDoubleTuple *aa;
2090         std::vector<double> bb;
2091         int sw;
2092         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2093         switch(sw)
2094           {
2095           case 1:
2096             {
2097               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2098               ret->applyRPow(val);
2099               return ret.retn();
2100             }
2101           case 3:
2102             {
2103               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2104               return DataArrayDouble::Pow(aaa,self);
2105             }
2106           case 4:
2107             {
2108               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2109               return DataArrayDouble::Pow(aaa,self);
2110             }
2111           default:
2112             throw INTERP_KERNEL::Exception(msg);
2113           }
2114       }
2115
2116       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2117       {
2118         const char msg[]="Unexpected situation in __ipow__ !";
2119         double val;
2120         DataArrayDouble *a;
2121         DataArrayDoubleTuple *aa;
2122         std::vector<double> bb;
2123         int sw;
2124         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2125         switch(sw)
2126           {
2127           case 1:
2128             {
2129               self->applyPow(val);
2130               Py_XINCREF(trueSelf);
2131               return trueSelf;
2132             }
2133           case 2:
2134             {
2135               self->powEqual(a);
2136               Py_XINCREF(trueSelf);
2137               return trueSelf;
2138             }
2139           case 3:
2140             {
2141               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2142               self->powEqual(aaa);
2143               Py_XINCREF(trueSelf);
2144               return trueSelf;
2145             }
2146           case 4:
2147             {
2148               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2149               self->powEqual(aaa);
2150               Py_XINCREF(trueSelf);
2151               return trueSelf;
2152             }
2153           default:
2154             throw INTERP_KERNEL::Exception(msg);
2155           }
2156       }
2157    
2158       PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
2159       {
2160         DataArrayInt *c=0,*cI=0;
2161         //
2162         self->computeTupleIdsNearTuples(other,eps,c,cI);
2163         PyObject *ret=PyTuple_New(2);
2164         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2165         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2166         return ret;
2167       }
2168
2169       PyObject *maxPerTupleWithCompoId() const throw(INTERP_KERNEL::Exception)
2170       {
2171         DataArrayInt *ret1=0;
2172         DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
2173         PyObject *ret=PyTuple_New(2);
2174         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2175         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2176         return ret;
2177       }
2178     }
2179   };
2180
2181   class DataArrayDoubleTuple;
2182
2183   class DataArrayDoubleIterator
2184   {
2185   public:
2186     DataArrayDoubleIterator(DataArrayDouble *da);
2187     ~DataArrayDoubleIterator();
2188     %extend
2189     {
2190       PyObject *next()
2191       {
2192         DataArrayDoubleTuple *ret=self->nextt();
2193         if(ret)
2194           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2195         else
2196           {
2197             PyErr_SetString(PyExc_StopIteration,"No more data.");
2198             return 0;
2199           }
2200       }
2201     }
2202   };
2203
2204   class DataArrayDoubleTuple
2205   {
2206   public:
2207     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
2208     DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
2209     %extend
2210     {
2211       std::string __str__() const throw(INTERP_KERNEL::Exception)
2212       {
2213         return self->repr();
2214       }
2215
2216       double __float__() const throw(INTERP_KERNEL::Exception)
2217       {
2218         return self->doubleValue();
2219       }
2220
2221       DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
2222       {
2223         return self->buildDADouble(1,self->getNumberOfCompo());
2224       }
2225
2226       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2227       {
2228         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2229         ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2230         Py_XINCREF(trueSelf);
2231         return trueSelf;
2232       }
2233   
2234       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2235       {
2236         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2237         ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2238         Py_XINCREF(trueSelf);
2239         return trueSelf;
2240       }
2241   
2242       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2243       {
2244         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2245         ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2246         Py_XINCREF(trueSelf);
2247         return trueSelf;
2248       }
2249
2250       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2251       {
2252         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2253         ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2254         Py_XINCREF(trueSelf);
2255         return trueSelf;
2256       }
2257
2258       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2259       {
2260         const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2261         int sw;
2262         int singleVal;
2263         std::vector<int> multiVal;
2264         std::pair<int, std::pair<int,int> > slic;
2265         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2266         const double *pt=self->getConstPointer();
2267         int nbc=self->getNumberOfCompo();
2268         convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2269         switch(sw)
2270           {
2271           case 1:
2272             {
2273               if(singleVal>=nbc)
2274                 {
2275                   std::ostringstream oss;
2276                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2277                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2278                 }
2279               if(singleVal>=0)
2280                 return PyFloat_FromDouble(pt[singleVal]);
2281               else
2282                 {
2283                   if(nbc+singleVal>0)
2284                     return PyFloat_FromDouble(pt[nbc+singleVal]);
2285                   else
2286                     {
2287                       std::ostringstream oss;
2288                       oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2289                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2290                     }
2291                 }
2292             }
2293           case 2:
2294             {
2295               PyObject *t=PyTuple_New(multiVal.size());
2296               for(int j=0;j<(int)multiVal.size();j++)
2297                 {
2298                   int cid=multiVal[j];
2299                   if(cid>=nbc)
2300                     {
2301                       std::ostringstream oss;
2302                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2303                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2304                     }
2305                   PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2306                 }
2307               return t;
2308             }
2309           case 3:
2310             {
2311               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2312               PyObject *t=PyTuple_New(sz);
2313               for(int j=0;j<sz;j++)
2314                 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2315               return t;
2316             }
2317           default:
2318             throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2319           }
2320       }
2321
2322       DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2323       {
2324         const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2325         const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2326         int sw1,sw2;
2327         double singleValV;
2328         std::vector<double> multiValV;
2329         ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2330         int nbc=self->getNumberOfCompo();
2331         convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2332         int singleVal;
2333         std::vector<int> multiVal;
2334         std::pair<int, std::pair<int,int> > slic;
2335         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2336         double *pt=self->getPointer();
2337         convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2338         switch(sw2)
2339           {
2340           case 1:
2341             {
2342               if(singleVal>=nbc)
2343                 {
2344                   std::ostringstream oss;
2345                   oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2346                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2347                 }
2348               switch(sw1)
2349                 {
2350                 case 1:
2351                   {
2352                     pt[singleVal]=singleValV;
2353                     return self;
2354                   }
2355                 case 2:
2356                   {
2357                     if(multiValV.size()!=1)
2358                       {
2359                         std::ostringstream oss;
2360                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2361                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2362                       }
2363                     pt[singleVal]=multiValV[0];
2364                     return self;
2365                   }
2366                 case 3:
2367                   {
2368                     pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2369                     return self;
2370                   }
2371                 default:
2372                   throw INTERP_KERNEL::Exception(msg);
2373                 }
2374             }
2375           case 2:
2376             {
2377               switch(sw1)
2378                 {
2379                 case 1:
2380                   {
2381                     for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2382                       {
2383                         if(*it>=nbc)
2384                           {
2385                             std::ostringstream oss;
2386                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2387                             throw INTERP_KERNEL::Exception(oss.str().c_str());
2388                           }
2389                         pt[*it]=singleValV;
2390                       }
2391                     return self;
2392                   }
2393                 case 2:
2394                   {
2395                     if(multiVal.size()!=multiValV.size())
2396                       {
2397                         std::ostringstream oss;
2398                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2399                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2400                       }
2401                     for(int i=0;i<(int)multiVal.size();i++)
2402                       {
2403                         int pos=multiVal[i];
2404                         if(pos>=nbc)
2405                           {
2406                             std::ostringstream oss;
2407                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2408                             throw INTERP_KERNEL::Exception(oss.str().c_str());
2409                           }
2410                         pt[multiVal[i]]=multiValV[i];
2411                       }
2412                     return self;
2413                   }
2414                 case 3:
2415                   {
2416                     const double *ptV=daIntTyyppV->getConstPointer();
2417                     if(nbc>daIntTyyppV->getNumberOfCompo())
2418                       {
2419                         std::ostringstream oss;
2420                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2421                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2422                       }
2423                     std::copy(ptV,ptV+nbc,pt);
2424                     return self;
2425                   }
2426                 default:
2427                   throw INTERP_KERNEL::Exception(msg);
2428                 }
2429             }
2430           case 3:
2431             {
2432               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2433               switch(sw1)
2434                 {
2435                 case 1:
2436                   {
2437                     for(int j=0;j<sz;j++)
2438                       pt[slic.first+j*slic.second.second]=singleValV;
2439                     return self;
2440                   }
2441                 case 2:
2442                   {
2443                     if(sz!=(int)multiValV.size())
2444                       {
2445                         std::ostringstream oss;
2446                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2447                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2448                       }
2449                     for(int j=0;j<sz;j++)
2450                       pt[slic.first+j*slic.second.second]=multiValV[j];
2451                     return self;
2452                   }
2453                 case 3:
2454                   {
2455                     const double *ptV=daIntTyyppV->getConstPointer();
2456                     if(sz>daIntTyyppV->getNumberOfCompo())
2457                       {
2458                         std::ostringstream oss;
2459                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2460                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2461                       }
2462                     for(int j=0;j<sz;j++)
2463                       pt[slic.first+j*slic.second.second]=ptV[j];
2464                     return self;
2465                   }
2466                 default:
2467                   throw INTERP_KERNEL::Exception(msg);
2468                 }
2469             }
2470           default:
2471             throw INTERP_KERNEL::Exception(msg);
2472           }
2473       }
2474     }
2475   };
2476
2477   class DataArrayIntIterator;
2478
2479   class DataArrayInt : public DataArray
2480   {
2481   public:
2482     static DataArrayInt *New();
2483     int intValue() const throw(INTERP_KERNEL::Exception);
2484     int getHashCode() const throw(INTERP_KERNEL::Exception);
2485     bool empty() const throw(INTERP_KERNEL::Exception);
2486     DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2487     void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2488     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2489     void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2490     int popBackSilent() throw(INTERP_KERNEL::Exception);
2491     void pack() const throw(INTERP_KERNEL::Exception);
2492     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2493     bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2494     bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2495     bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2496     DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2497     DataArrayInt *sumPerTuple() const throw(INTERP_KERNEL::Exception);
2498     void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2499     void reverse() throw(INTERP_KERNEL::Exception);
2500     void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2501     bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2502     void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2503     bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2504     void fillWithZero() throw(INTERP_KERNEL::Exception);
2505     void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2506     void iota(int init=0) throw(INTERP_KERNEL::Exception);
2507     std::string repr() const throw(INTERP_KERNEL::Exception);
2508     std::string reprZip() const throw(INTERP_KERNEL::Exception);
2509     DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2510     DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2511     DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2512     DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
2513     DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2514     DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2515     DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2516     DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2517     DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2518     bool isIdentity() const throw(INTERP_KERNEL::Exception);
2519     bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2520     DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2521     void transpose() throw(INTERP_KERNEL::Exception);
2522     DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2523     void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2524     void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2525     void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2526     void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2527     void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2528     int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2529     int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2530     int front() const throw(INTERP_KERNEL::Exception);
2531     int back() const throw(INTERP_KERNEL::Exception);
2532     void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2533     void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2534     int *getPointer() throw(INTERP_KERNEL::Exception);
2535     const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2536     DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2537     const int *begin() const throw(INTERP_KERNEL::Exception);
2538     const int *end() const throw(INTERP_KERNEL::Exception);
2539     DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2540     DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2541     int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2542     int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2543     int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2544     int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2545     int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2546     bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2547     bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2548     bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2549     int count(int value) const throw(INTERP_KERNEL::Exception);
2550     int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2551     int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2552     int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2553     int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2554     int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2555     void abs() throw(INTERP_KERNEL::Exception);
2556     void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2557     void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2558     void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2559     DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2560     void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2561     void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2562     void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2563     void applyPow(int val) throw(INTERP_KERNEL::Exception);
2564     void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2565     DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2566     DataArrayInt *getIdsNotInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2567     bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2568     static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2569     static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2570     static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2571     static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2572     static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2573     static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2) throw(INTERP_KERNEL::Exception);
2574     DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2575     DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2576     DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2577     DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2578     DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2579     DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2580     DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2581     void computeOffsets() throw(INTERP_KERNEL::Exception);
2582     void computeOffsets2() throw(INTERP_KERNEL::Exception);
2583     DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2584     DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2585     DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2586     DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2587     DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2588     static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2589     void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2590     static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2591     void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2592     static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2593     void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2594     static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2595     void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2596     static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2597     void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2598     static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2599     void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2600   public:
2601     static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2602     %extend
2603     {
2604       DataArrayInt() throw(INTERP_KERNEL::Exception)
2605         {
2606           return DataArrayInt::New();
2607         }
2608
2609       static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2610       {
2611         const char *msgBase="ParaMEDMEM::DataArrayInt::New : Available API are : \n-DataArrayInt.New()\n-DataArrayInt.New([1,3,4])\n-DataArrayInt.New([1,3,4],3)\n-DataArrayInt.New([1,3,4,5],2,2)\n-DataArrayInt.New([1,3,4,5,7,8],3,2)\n-DataArrayInt.New([(1,3),(4,5),(7,8)])\n-DataArrayInt.New(5)\n-DataArrayInt.New(5,2)";
2612         std::string msg(msgBase);
2613 #ifdef WITH_NUMPY
2614         msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2615 #endif
2616         msg+=" !";
2617         if(PyList_Check(elt0) || PyTuple_Check(elt0))
2618           {
2619             if(nbOfTuples)
2620               {
2621                 if(PyInt_Check(nbOfTuples))
2622                   {
2623                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2624                     if(nbOfTuples1<0)
2625                       throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2626                     if(nbOfComp)
2627                       {
2628                         if(PyInt_Check(nbOfComp))
2629                           {//DataArrayInt.New([1,3,4,5],2,2)
2630                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2631                             if(nbOfCompo<0)
2632                               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2633                             MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2634                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2635                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2636                             return ret.retn();
2637                           }
2638                         else
2639                           throw INTERP_KERNEL::Exception(msg.c_str());
2640                       }
2641                     else
2642                       {//DataArrayInt.New([1,3,4],3)
2643                         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2644                         int tmpp1=-1;
2645                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2646                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2647                         return ret.retn();
2648                       }
2649                   }
2650                 else
2651                   throw INTERP_KERNEL::Exception(msg.c_str());
2652               }
2653             else
2654               {// DataArrayInt.New([1,3,4])
2655                 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2656                 int tmpp1=-1,tmpp2=-1;
2657                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2658                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2659                 return ret.retn();
2660               }
2661           }
2662         else if(PyInt_Check(elt0))
2663           {
2664             int nbOfTuples1=PyInt_AS_LONG(elt0);
2665             if(nbOfTuples1<0)
2666               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2667             if(nbOfTuples)
2668               {
2669                 if(!nbOfComp)
2670                   {
2671                     if(PyInt_Check(nbOfTuples))
2672                       {//DataArrayInt.New(5,2)
2673                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2674                         if(nbOfCompo<0)
2675                           throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2676                         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2677                         ret->alloc(nbOfTuples1,nbOfCompo);
2678                         return ret.retn();
2679                       }
2680                     else
2681                       throw INTERP_KERNEL::Exception(msg.c_str());
2682                   }
2683                 else
2684                   throw INTERP_KERNEL::Exception(msg.c_str());
2685               }
2686             else
2687               {//DataArrayInt.New(5)
2688                 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2689                 ret->alloc(nbOfTuples1,1);
2690                 return ret.retn();
2691               }
2692           }
2693 #ifdef WITH_NUMPY
2694         else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2695           {//DataArrayInt.New(numpyArray)
2696             return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2697           }
2698 #endif
2699         else
2700           throw INTERP_KERNEL::Exception(msg.c_str());
2701       }
2702
2703       DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2704         {
2705           return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2706         }
2707
2708       std::string __str__() const throw(INTERP_KERNEL::Exception)
2709       {
2710         return self->repr();
2711       }
2712
2713       int __len__() const throw(INTERP_KERNEL::Exception)
2714       {
2715         if(self->isAllocated())
2716           {
2717             return self->getNumberOfTuples();
2718           }
2719         else
2720           {
2721             throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2722           }
2723       }
2724
2725       int __int__() const throw(INTERP_KERNEL::Exception)
2726       {
2727         return self->intValue();
2728       }
2729
2730       DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2731       {
2732         return self->iterator();
2733       }
2734    
2735       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2736       {
2737         int sz=self->getNumberOfComponents();
2738         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2739         self->accumulate(tmp);
2740         return convertIntArrToPyList(tmp,sz);
2741       }
2742
2743       DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2744       {
2745         int sw,sz,val;
2746         std::vector<int> val2;
2747         const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2748         return self->accumulatePerChunck(bg,bg+sz);
2749       }
2750
2751       PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
2752       {
2753         std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
2754         PyObject *ret=PyList_New(slcs.size());
2755         for(std::size_t i=0;i<slcs.size();i++)
2756           PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
2757         return ret;
2758       }
2759
2760       DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const throw(INTERP_KERNEL::Exception)
2761       {
2762         if(!PySlice_Check(slic))
2763           throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
2764         Py_ssize_t strt=2,stp=2,step=2;
2765         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
2766         if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
2767           throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
2768         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
2769           throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice contains some unknowns that can't be determined in static method ! Call DataArray::getSlice (non static) instead !");
2770         return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
2771       }
2772    
2773       static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2774       {
2775         int newNbOfTuples=-1;
2776         int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2777         std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2778         const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2779         const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2780         DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2781         PyObject *ret=PyTuple_New(2);
2782         PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2783         PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2784         return ret;
2785       }
2786
2787       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2788       {
2789         const char *msg="ParaMEDMEM::DataArrayInt::setValues : Available API are : \n-DataArrayInt.setValues([1,3,4])\n-DataArrayInt.setValues([1,3,4],3)\n-DataArrayInt.setValues([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n !";
2790         if(PyList_Check(li) || PyTuple_Check(li))
2791           {
2792             if(nbOfTuples)
2793               {
2794                 if(PyInt_Check(nbOfTuples))
2795                   {
2796                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2797                     if(nbOfTuples<0)
2798                       throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2799                     if(nbOfComp)
2800                       {
2801                         if(PyInt_Check(nbOfComp))
2802                           {//DataArrayInt.setValues([1,3,4,5],2,2)
2803                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2804                             if(nbOfCompo<0)
2805                               throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2806                             std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2807                             self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2808                           }
2809                         else
2810                           throw INTERP_KERNEL::Exception(msg);
2811                       }
2812                     else
2813                       {//DataArrayInt.setValues([1,3,4],3)
2814                         int tmpp1=-1;
2815                         std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2816                         self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2817                       }
2818                   }
2819                 else
2820                   throw INTERP_KERNEL::Exception(msg);
2821               }
2822             else
2823               {// DataArrayInt.setValues([1,3,4])
2824                 int tmpp1=-1,tmpp2=-1;
2825                 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2826                 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2827               }
2828           }
2829         else
2830           throw INTERP_KERNEL::Exception(msg);
2831       }
2832
2833       PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2834       {
2835         const int *vals=self->getConstPointer();
2836         return convertIntArrToPyList(vals,self->getNbOfElems());
2837       }
2838
2839 #ifdef WITH_NUMPY
2840       PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2841       {
2842         return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2843       }
2844 #endif
2845
2846       PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2847       {
2848         std::string ret1;
2849         bool ret0=self->isEqualIfNotWhy(other,ret1);
2850         PyObject *ret=PyTuple_New(2);
2851         PyObject *ret0Py=ret0?Py_True:Py_False;
2852         Py_XINCREF(ret0Py);
2853         PyTuple_SetItem(ret,0,ret0Py);
2854         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2855         return ret;
2856       }
2857
2858       PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2859       {
2860         const int *vals=self->getConstPointer();
2861         int nbOfComp=self->getNumberOfComponents();
2862         int nbOfTuples=self->getNumberOfTuples();
2863         return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2864       }
2865
2866       static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2867       {
2868         std::vector<const DataArrayInt *> groups;
2869         std::vector< std::vector<int> > fidsOfGroups;
2870         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2871         ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2872         PyObject *ret = PyList_New(2);
2873         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2874         int sz=fidsOfGroups.size();
2875         PyObject *ret1 = PyList_New(sz);
2876         for(int i=0;i<sz;i++)
2877           PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2878         PyList_SetItem(ret,1,ret1);
2879         return ret;
2880       }
2881
2882       void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2883       {
2884         void *da=0;
2885         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2886         if (!SWIG_IsOK(res1))
2887           {
2888             int size;
2889             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2890             self->transformWithIndArr(tmp,tmp+size);
2891           }
2892         else
2893           {
2894             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2895             self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2896           }
2897       }
2898
2899       DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2900       {
2901         int sw;
2902         int singleVal;
2903         std::vector<int> multiVal;
2904         std::pair<int, std::pair<int,int> > slic;
2905         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2906         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2907         switch(sw)
2908           {
2909           case 1:
2910             return self->getIdsEqualList(&singleVal,&singleVal+1);
2911           case 2:
2912             return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2913           case 4:
2914             return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2915           default:
2916             throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2917           }
2918       }
2919
2920       DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2921       {
2922         int sw;
2923         int singleVal;
2924         std::vector<int> multiVal;
2925         std::pair<int, std::pair<int,int> > slic;
2926         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2927         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2928         switch(sw)
2929           {
2930           case 1:
2931             return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2932           case 2:
2933             return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2934           case 4:
2935             return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2936           default:
2937             throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2938           }
2939       }
2940
2941       PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2942       {
2943         DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2944         void *da=0;
2945         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2946         if (!SWIG_IsOK(res1))
2947           {
2948             int size;
2949             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2950             self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2951           }
2952         else
2953           {
2954             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2955             if(!da2)
2956               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2957             da2->checkAllocated();
2958             int size=self->getNumberOfTuples();
2959             self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2960           }
2961         PyObject *ret = PyList_New(3);
2962         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2963         PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2964         PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2965         return ret;
2966       }
2967
2968       DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2969       {
2970         void *da=0;
2971         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2972         if (!SWIG_IsOK(res1))
2973           {
2974             int size;
2975             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2976             return self->transformWithIndArrR(tmp,tmp+size);
2977           }
2978         else
2979           {
2980             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2981             return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2982           }
2983       }
2984
2985       DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2986       {
2987         void *da=0;
2988         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2989         if (!SWIG_IsOK(res1))
2990           {
2991             int size;
2992             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2993             if(size!=self->getNumberOfTuples())
2994               {
2995                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2996               }
2997             return self->renumberAndReduce(tmp,newNbOfTuple);
2998           }
2999         else
3000           {
3001             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3002             if(!da2)
3003               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3004             da2->checkAllocated();
3005             int size=self->getNumberOfTuples();
3006             if(size!=self->getNumberOfTuples())
3007               {
3008                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3009               }
3010             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3011           }
3012       }
3013
3014       DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3015       {
3016         void *da=0;
3017         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3018         if (!SWIG_IsOK(res1))
3019           {
3020             int size;
3021             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3022             if(size!=self->getNumberOfTuples())
3023               {
3024                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3025               }
3026             return self->renumber(tmp);
3027           }
3028         else
3029           {
3030             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3031             if(!da2)
3032               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3033             da2->checkAllocated();
3034             int size=self->getNumberOfTuples();
3035             if(size!=self->getNumberOfTuples())
3036               {
3037                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3038               }
3039             return self->renumber(da2->getConstPointer());
3040           }
3041       }
3042
3043       DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3044       {
3045         void *da=0;
3046         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3047         if (!SWIG_IsOK(res1))
3048           {
3049             int size;
3050             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3051             if(size!=self->getNumberOfTuples())
3052               {
3053                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3054               }
3055             return self->renumberR(tmp);
3056           }
3057         else
3058           {
3059             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3060             if(!da2)
3061               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3062             da2->checkAllocated();
3063             int size=self->getNumberOfTuples();
3064             if(size!=self->getNumberOfTuples())
3065               {
3066                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3067               }
3068             return self->renumberR(da2->getConstPointer());
3069           }
3070       }
3071
3072       void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3073       {
3074         std::vector<int> tmp;
3075         convertPyToNewIntArr3(li,tmp);
3076         self->setSelectedComponents(a,tmp);
3077       }
3078
3079       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3080       {
3081         int sz=self->getNumberOfComponents();
3082         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
3083         self->getTuple(tupleId,tmp);
3084         return convertIntArrToPyList(tmp,sz);
3085       }
3086
3087       PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
3088       {
3089         DataArrayInt *arr=0;
3090         DataArrayInt *arrI=0;
3091         self->changeSurjectiveFormat(targetNb,arr,arrI);
3092         PyObject *res = PyList_New(2);
3093         PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3094         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3095         return res;
3096       }
3097
3098       static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3099       {
3100         std::vector<const DataArrayInt *> tmp;
3101         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3102         return DataArrayInt::Meld(tmp);
3103       }
3104
3105       static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3106       {
3107         std::vector<const DataArrayInt *> tmp;
3108         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3109         return DataArrayInt::Aggregate(tmp);
3110       }
3111
3112       static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
3113       {
3114         std::vector<const DataArrayInt *> tmp;
3115         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3116         return DataArrayInt::AggregateIndexes(tmp);
3117       }
3118
3119       static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
3120       {
3121         std::vector<const DataArrayInt *> tmp;
3122         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3123         return DataArrayInt::BuildUnion(tmp);
3124       }
3125
3126       static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
3127       {
3128         std::vector<const DataArrayInt *> tmp;
3129         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3130         return DataArrayInt::BuildIntersection(tmp);
3131       }
3132
3133       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3134       {
3135         int tmp;
3136         int r1=self->getMaxValue(tmp);
3137         PyObject *ret=PyTuple_New(2);
3138         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3139         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3140         return ret;
3141       }
3142
3143       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3144       {
3145         int tmp;
3146         int r1=self->getMinValue(tmp);
3147         PyObject *ret=PyTuple_New(2);
3148         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3149         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3150         return ret;
3151       }
3152
3153       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3154       {
3155         int nbOfCompo=self->getNumberOfComponents();
3156         switch(nbOfCompo)
3157           {
3158           case 1:
3159             {
3160               if(PyInt_Check(obj))
3161                 {
3162                   int val=(int)PyInt_AS_LONG(obj);
3163                   return self->locateValue(val);
3164                 }
3165               else
3166                 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
3167             }
3168           default:
3169             {
3170               std::vector<int> arr;
3171               convertPyToNewIntArr3(obj,arr);
3172               return self->locateTuple(arr);
3173             }
3174           }
3175       }
3176
3177       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3178       {
3179         int nbOfCompo=self->getNumberOfComponents();
3180         switch(nbOfCompo)
3181           {
3182           case 0:
3183             return false;
3184           case 1:
3185             {
3186               if(PyInt_Check(obj))
3187                 {
3188                   int val=(int)PyInt_AS_LONG(obj);
3189                   return self->presenceOfValue(val);
3190                 }
3191               else
3192                 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
3193             }
3194           default:
3195             {
3196               std::vector<int> arr;
3197               convertPyToNewIntArr3(obj,arr);
3198               return self->presenceOfTuple(arr);
3199             }
3200           }
3201       }
3202
3203       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3204       {
3205         const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
3206         const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
3207         self->checkAllocated();
3208         int nbOfTuples=self->getNumberOfTuples();
3209         int nbOfComponents=self->getNumberOfComponents();
3210         int it1,ic1;
3211         std::vector<int> vt1,vc1;
3212         std::pair<int, std::pair<int,int> > pt1,pc1;
3213         DataArrayInt *dt1=0,*dc1=0;
3214         int sw;
3215         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3216         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3217         switch(sw)
3218           {
3219           case 1:
3220             {
3221               if(nbOfComponents==1)
3222                 return PyInt_FromLong(self->getIJSafe(it1,0));
3223               return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3224             }
3225           case 2:
3226             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3227           case 3:
3228             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3229           case 4:
3230             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3231           case 5:
3232             return PyInt_FromLong(self->getIJSafe(it1,ic1));
3233           case 6:
3234             {
3235               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3236               std::vector<int> v2(1,ic1);
3237               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3238             }
3239           case 7:
3240             {
3241               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3242               std::vector<int> v2(1,ic1);
3243               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3244             }
3245           case 8:
3246             {
3247               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3248               std::vector<int> v2(1,ic1);
3249               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3250             }
3251           case 9:
3252             {
3253               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3254               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3255             }
3256           case 10:
3257             {
3258               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3259               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3260             }
3261           case 11:
3262             {
3263               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3264               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3265             }
3266           case 12:
3267             {
3268               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3269               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3270             }
3271           case 13:
3272             {
3273               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3274               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3275               std::vector<int> v2(nbOfComp);
3276               for(int i=0;i<nbOfComp;i++)
3277                 v2[i]=pc1.first+i*pc1.second.second;
3278               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3279             }
3280           case 14:
3281             {
3282               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3283               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3284               std::vector<int> v2(nbOfComp);
3285               for(int i=0;i<nbOfComp;i++)
3286                 v2[i]=pc1.first+i*pc1.second.second;
3287               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3288             }
3289           case 15:
3290             {
3291               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3292               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3293               std::vector<int> v2(nbOfComp);
3294               for(int i=0;i<nbOfComp;i++)
3295                 v2[i]=pc1.first+i*pc1.second.second;
3296               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3297             }
3298           case 16:
3299             {
3300               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3301               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3302               std::vector<int> v2(nbOfComp);
3303               for(int i=0;i<nbOfComp;i++)
3304                 v2[i]=pc1.first+i*pc1.second.second;
3305               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3306             }
3307           default:
3308             throw INTERP_KERNEL::Exception(msg);
3309           }
3310       }
3311
3312       DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3313       {
3314         self->checkAllocated();
3315         const char msg[]="Unexpected situation in __setitem__ !";
3316         int nbOfTuples=self->getNumberOfTuples();
3317         int nbOfComponents=self->getNumberOfComponents();
3318         int sw1,sw2;
3319         int i1;
3320         std::vector<int> v1;
3321         DataArrayInt *d1=0;
3322         DataArrayIntTuple *dd1=0;
3323         convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3324         int it1,ic1;
3325         std::vector<int> vt1,vc1;
3326         std::pair<int, std::pair<int,int> > pt1,pc1;
3327         DataArrayInt *dt1=0,*dc1=0;
3328         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3329         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3330         switch(sw2)
3331           {
3332           case 1:
3333             {
3334               switch(sw1)
3335                 {
3336                 case 1:
3337                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3338                   return self;
3339                 case 2:
3340                   tmp=DataArrayInt::New();
3341                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3342                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3343                   return self;
3344                 case 3:
3345                   self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3346                   return self;
3347                 case 4:
3348                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3349                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3350                   return self;
3351                 default:
3352                   throw INTERP_KERNEL::Exception(msg);
3353                 }
3354               break;
3355             }
3356           case 2:
3357             {
3358               switch(sw1)
3359                 {
3360                 case 1:
3361                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3362                   return self;
3363                 case 2:
3364                   tmp=DataArrayInt::New();
3365                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3366                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3367                   return self;
3368                 case 3:
3369                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3370                   return self;
3371                 case 4:
3372                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3373                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3374                   return self;
3375                 default:
3376                   throw INTERP_KERNEL::Exception(msg);
3377                 }
3378               break;
3379             }
3380           case 3:
3381             {
3382               switch(sw1)
3383                 {
3384                 case 1:
3385                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3386                   return self;
3387                 case 2:
3388                   tmp=DataArrayInt::New();
3389                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3390                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3391                   return self;
3392                 case 3:
3393                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3394                   return self;
3395                 case 4:
3396                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3397                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3398                   return self;
3399                 default:
3400                   throw INTERP_KERNEL::Exception(msg);
3401                 }
3402               break;
3403             }
3404           case 4:
3405             {
3406               switch(sw1)
3407                 {
3408                 case 1:
3409                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3410                   return self;
3411                 case 2:
3412                   tmp=DataArrayInt::New();
3413                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3414                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3415                   return self;
3416                 case 3:
3417                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3418                   return self;
3419                 case 4:
3420                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3421                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3422                   return self;
3423                 default:
3424                   throw INTERP_KERNEL::Exception(msg);
3425                 }
3426               break;
3427             }
3428           case 5:
3429             {
3430               switch(sw1)
3431                 {
3432                 case 1:
3433                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3434                   return self;
3435                 case 2:
3436                   tmp=DataArrayInt::New();
3437                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3438                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3439                   return self;
3440                 case 3:
3441                   self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3442                   return self;
3443                 case 4:
3444                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3445                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3446                   return self;
3447                 default:
3448                   throw INTERP_KERNEL::Exception(msg);
3449                 }
3450               break;
3451             }
3452           case 6:
3453             {
3454               switch(sw1)
3455                 {
3456                 case 1:
3457                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3458                   return self;
3459                 case 2:
3460                   tmp=DataArrayInt::New();
3461                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3462                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3463                   return self;
3464                 case 3:
3465                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3466                   return self;
3467                 case 4:
3468                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3469                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3470                   return self;
3471                 default:
3472                   throw INTERP_KERNEL::Exception(msg);
3473                 }
3474               break;
3475             }
3476           case 7:
3477             {
3478               switch(sw1)
3479                 {
3480                 case 1:
3481                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3482                   return self;
3483                 case 2:
3484                   tmp=DataArrayInt::New();
3485                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3486                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3487                   return self;
3488                 case 3:
3489                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3490                   return self;
3491                 case 4:
3492                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3493                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3494                   return self;
3495                 default:
3496                   throw INTERP_KERNEL::Exception(msg);
3497                 }
3498               break;
3499             }
3500           case 8:
3501             {
3502               switch(sw1)
3503                 {
3504                 case 1:
3505                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3506                   return self;
3507                 case 2:
3508                   tmp=DataArrayInt::New();
3509                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3510                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3511                   return self;
3512                 case 3:
3513                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3514                   return self;
3515                 case 4:
3516                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3517                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3518                   return self;
3519                 default:
3520                   throw INTERP_KERNEL::Exception(msg);
3521                 }
3522               break;
3523             }
3524           case 9:
3525             {
3526               switch(sw1)
3527                 {
3528                 case 1:
3529                   self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3530                   return self;
3531                 case 2:
3532                   tmp=DataArrayInt::New();
3533                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3534                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3535                   return self;
3536                 case 3:
3537                   self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3538                   return self;
3539                 case 4:
3540                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3541                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3542                   return self;
3543                 default:
3544                   throw INTERP_KERNEL::Exception(msg);
3545                 }
3546               break;
3547             }
3548           case 10:
3549             {
3550               switch(sw1)
3551                 {
3552                 case 1:
3553                   self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3554                   return self;
3555                 case 2:
3556                   tmp=DataArrayInt::New();
3557                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3558                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3559                   return self;
3560                 case 3:
3561                   self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3562                   return self;
3563                 case 4:
3564                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3565                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3566                   return self;
3567                 default:
3568                   throw INTERP_KERNEL::Exception(msg);
3569                 }
3570               break;
3571             }
3572           case 11:
3573             {
3574               switch(sw1)
3575                 {
3576                 case 1:
3577                   self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3578                   return self;
3579                 case 2:
3580                   tmp=DataArrayInt::New();
3581                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3582                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3583                   return self;
3584                 case 3:
3585                   self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3586                   return self;
3587                 case 4:
3588                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3589                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3590                   return self;
3591                 default:
3592                   throw INTERP_KERNEL::Exception(msg);
3593                 }
3594               break;
3595             }
3596           case 12:
3597             {
3598               switch(sw1)
3599                 {
3600                 case 1:
3601                   self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3602                   return self;
3603                 case 2:
3604                   tmp=DataArrayInt::New();
3605                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3606                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3607                   return self;
3608                 case 3:
3609                   self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3610                   return self;
3611                 case 4:
3612                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3613                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3614                   return self;
3615                 default:
3616                   throw INTERP_KERNEL::Exception(msg);
3617                 }
3618               break;
3619             }
3620           case 13:
3621             {
3622               switch(sw1)
3623                 {
3624                 case 1:
3625                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3626                   return self;
3627                 case 2:
3628                   tmp=DataArrayInt::New();
3629                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3630                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3631                   return self;
3632                 case 3:
3633                   self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3634                   return self;
3635                 case 4:
3636                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3637                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3638                   return self;
3639                 default:
3640                   throw INTERP_KERNEL::Exception(msg);
3641                 }
3642               break;
3643             }
3644           case 14:
3645             {
3646               switch(sw1)
3647                 {
3648                 case 1:
3649                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3650                   return self;
3651                 case 2:
3652                   tmp=DataArrayInt::New();
3653                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3654                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3655                   return self;
3656                 case 3:
3657                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3658                   return self;
3659                 case 4:
3660                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3661                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3662                   return self;
3663                 default:
3664                   throw INTERP_KERNEL::Exception(msg);
3665                 }
3666               break;
3667             }
3668           case 15:
3669             {
3670               switch(sw1)
3671                 {
3672                 case 1:
3673                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3674                   return self;
3675                 case 2:
3676                   tmp=DataArrayInt::New();
3677                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3678                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3679                   return self;
3680                 case 3:
3681                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3682                   return self;
3683                 case 4:
3684                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3685                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3686                   return self;
3687                 default:
3688                   throw INTERP_KERNEL::Exception(msg);
3689                 }
3690               break;
3691             }
3692           case 16:
3693             {
3694               switch(sw1)
3695                 {
3696                 case 1:
3697                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3698                   return self;
3699                 case 2:
3700                   tmp=DataArrayInt::New();
3701                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3702                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3703                   return self;
3704                 case 3:
3705                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3706                   return self;
3707                 case 4:
3708                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3709                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3710                   return self;
3711                 default:
3712                   throw INTERP_KERNEL::Exception(msg);
3713                 }
3714               break;
3715             }
3716           default:
3717             throw INTERP_KERNEL::Exception(msg);
3718           }
3719         return self;
3720       }
3721
3722       DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3723       {
3724         return self->negate();
3725       }
3726  
3727       DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3728       {
3729         const char msg[]="Unexpected situation in __add__ !";
3730         int val;
3731         DataArrayInt *a;
3732         std::vector<int> aa;
3733         DataArrayIntTuple *aaa;
3734         int sw;
3735         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3736         switch(sw)
3737           {
3738           case 1:
3739             {
3740               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3741               ret->applyLin(1,val);
3742               return ret.retn();
3743             }
3744           case 2:
3745             {
3746               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3747               return DataArrayInt::Add(self,aaaa);
3748             }
3749           case 3:
3750             {
3751               return DataArrayInt::Add(self,a);
3752             }
3753           case 4:
3754             {
3755               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3756               return DataArrayInt::Add(self,aaaa);
3757             }
3758           default:
3759             throw INTERP_KERNEL::Exception(msg);
3760           }
3761       }
3762
3763       DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3764       {
3765         const char msg[]="Unexpected situation in __radd__ !";
3766         int val;
3767         DataArrayInt *a;
3768         std::vector<int> aa;
3769         DataArrayIntTuple *aaa;
3770         int sw;
3771         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3772         switch(sw)
3773           {
3774           case 1:
3775             {
3776               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3777               ret->applyLin(1,val);
3778               return ret.retn();
3779             }
3780           case 2:
3781             {
3782               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3783               return DataArrayInt::Add(self,aaaa);
3784             }
3785           case 4:
3786             {
3787               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3788               return DataArrayInt::Add(self,aaaa);
3789             }
3790           default:
3791             throw INTERP_KERNEL::Exception(msg);
3792           }
3793       }
3794
3795       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3796       {
3797         const char msg[]="Unexpected situation in __iadd__ !";
3798         int val;
3799         DataArrayInt *a;
3800         std::vector<int> aa;
3801         DataArrayIntTuple *aaa;
3802         int sw;
3803         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3804         switch(sw)
3805           {
3806           case 1:
3807             {
3808               self->applyLin(1,val);
3809               Py_XINCREF(trueSelf);
3810               return trueSelf;
3811             }
3812           case 2:
3813             {
3814               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3815               self->addEqual(bb);
3816               Py_XINCREF(trueSelf);
3817               return trueSelf;
3818             }
3819           case 3:
3820             {
3821               self->addEqual(a);
3822               Py_XINCREF(trueSelf);
3823               return trueSelf;
3824             }
3825           case 4:
3826             {
3827               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3828               self->addEqual(aaaa);
3829               Py_XINCREF(trueSelf);
3830               return trueSelf;
3831             }
3832           default:
3833             throw INTERP_KERNEL::Exception(msg);
3834           }
3835       }
3836
3837       DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3838       {
3839         const char msg[]="Unexpected situation in __sub__ !";
3840         int val;
3841         DataArrayInt *a;
3842         std::vector<int> aa;
3843         DataArrayIntTuple *aaa;
3844         int sw;
3845         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3846         switch(sw)
3847           {
3848           case 1:
3849             {
3850               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3851               ret->applyLin(1,-val);
3852               return ret.retn();
3853             }
3854           case 2:
3855             {
3856               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3857               return DataArrayInt::Substract(self,aaaa);
3858             }
3859           case 3:
3860             {
3861               return DataArrayInt::Substract(self,a);
3862             }
3863           case 4:
3864             {
3865               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3866               return DataArrayInt::Substract(self,aaaa);
3867             }
3868           default:
3869             throw INTERP_KERNEL::Exception(msg);
3870           }
3871       }
3872
3873       DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3874       {
3875         const char msg[]="Unexpected situation in __rsub__ !";
3876         int val;
3877         DataArrayInt *a;
3878         std::vector<int> aa;
3879         DataArrayIntTuple *aaa;
3880         int sw;
3881         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3882         switch(sw)
3883           {
3884           case 1:
3885             {
3886               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3887               ret->applyLin(-1,val);
3888               return ret.retn();
3889             }
3890           case 2:
3891             {
3892               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3893               return DataArrayInt::Substract(aaaa,self);
3894             }
3895           case 4:
3896             {
3897               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3898               return DataArrayInt::Substract(aaaa,self);
3899             }
3900           default:
3901             throw INTERP_KERNEL::Exception(msg);
3902           }
3903       }
3904
3905       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3906       {
3907         const char msg[]="Unexpected situation in __isub__ !";
3908         int val;
3909         DataArrayInt *a;
3910         std::vector<int> aa;
3911         DataArrayIntTuple *aaa;
3912         int sw;
3913         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3914         switch(sw)
3915           {
3916           case 1:
3917             {
3918               self->applyLin(1,-val);
3919               Py_XINCREF(trueSelf);
3920               return trueSelf;
3921             }
3922           case 2:
3923             {
3924               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3925               self->substractEqual(bb);
3926               Py_XINCREF(trueSelf);
3927               return trueSelf;
3928             }
3929           case 3:
3930             {
3931               self->substractEqual(a);
3932               Py_XINCREF(trueSelf);
3933               return trueSelf;
3934             }
3935           case 4:
3936             {
3937               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3938               self->substractEqual(aaaa);
3939               Py_XINCREF(trueSelf);
3940               return trueSelf;
3941             }
3942           default:
3943             throw INTERP_KERNEL::Exception(msg);
3944           }
3945       }
3946
3947       DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3948       {
3949         const char msg[]="Unexpected situation in __mul__ !";
3950         int val;
3951         DataArrayInt *a;
3952         std::vector<int> aa;
3953         DataArrayIntTuple *aaa;
3954         int sw;
3955         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3956         switch(sw)
3957           {
3958           case 1:
3959             {
3960               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3961               ret->applyLin(val,0);
3962               return ret.retn();
3963             }
3964           case 2:
3965             {
3966               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3967               return DataArrayInt::Multiply(self,aaaa);
3968             }
3969           case 3:
3970             {
3971               return DataArrayInt::Multiply(self,a);
3972             }
3973           case 4:
3974             {
3975               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3976               return DataArrayInt::Multiply(self,aaaa);
3977             }
3978           default:
3979             throw INTERP_KERNEL::Exception(msg);
3980           }
3981       }
3982
3983       DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3984       {
3985         const char msg[]="Unexpected situation in __rmul__ !";
3986         int val;
3987         DataArrayInt *a;
3988         std::vector<int> aa;
3989         DataArrayIntTuple *aaa;
3990         int sw;
3991         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3992         switch(sw)
3993           {
3994           case 1:
3995             {
3996               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3997               ret->applyLin(val,0);
3998               return ret.retn();
3999             }
4000           case 2:
4001             {
4002               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4003               return DataArrayInt::Multiply(self,aaaa);
4004             }
4005           case 4:
4006             {
4007               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4008               return DataArrayInt::Multiply(self,aaaa);
4009             }
4010           default:
4011             throw INTERP_KERNEL::Exception(msg);
4012           }
4013       }
4014
4015       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4016       {
4017         const char msg[]="Unexpected situation in __imul__ !";
4018         int val;
4019         DataArrayInt *a;
4020         std::vector<int> aa;
4021         DataArrayIntTuple *aaa;
4022         int sw;
4023         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4024         switch(sw)
4025           {
4026           case 1:
4027             {
4028               self->applyLin(val,0);
4029               Py_XINCREF(trueSelf);
4030               return trueSelf;
4031             }
4032           case 2:
4033             {
4034               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4035               self->multiplyEqual(bb);
4036               Py_XINCREF(trueSelf);
4037               return trueSelf;
4038             }
4039           case 3:
4040             {
4041               self->multiplyEqual(a);
4042               Py_XINCREF(trueSelf);
4043               return trueSelf;
4044             }
4045           case 4:
4046             {
4047               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4048               self->multiplyEqual(aaaa);
4049               Py_XINCREF(trueSelf);
4050               return trueSelf;
4051             }
4052           default:
4053             throw INTERP_KERNEL::Exception(msg);
4054           }
4055       }
4056
4057       DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4058       {
4059         const char msg[]="Unexpected situation in __div__ !";
4060         int val;
4061         DataArrayInt *a;
4062         std::vector<int> aa;
4063         DataArrayIntTuple *aaa;
4064         int sw;
4065         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4066         switch(sw)
4067           {
4068           case 1:
4069             {
4070               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4071               ret->applyDivideBy(val);
4072               return ret.retn();
4073             }
4074           case 2:
4075             {
4076               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4077               return DataArrayInt::Divide(self,aaaa);
4078             }
4079           case 3:
4080             {
4081               return DataArrayInt::Divide(self,a);
4082             }
4083           case 4:
4084             {
4085               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4086               return DataArrayInt::Divide(self,aaaa);
4087             }
4088           default:
4089             throw INTERP_KERNEL::Exception(msg);
4090           }
4091       }
4092
4093       DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4094       {
4095         const char msg[]="Unexpected situation in __rdiv__ !";
4096         int val;
4097         DataArrayInt *a;
4098         std::vector<int> aa;
4099         DataArrayIntTuple *aaa;
4100         int sw;
4101         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4102         switch(sw)
4103           {
4104           case 1:
4105             {
4106               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4107               ret->applyInv(val);
4108               return ret.retn();
4109             }
4110           case 2:
4111             {
4112               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4113               return DataArrayInt::Divide(aaaa,self);
4114             }
4115           case 4:
4116             {
4117               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4118               return DataArrayInt::Divide(aaaa,self);
4119             }
4120           default:
4121             throw INTERP_KERNEL::Exception(msg);
4122           }
4123       }
4124
4125       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4126       {
4127         const char msg[]="Unexpected situation in __idiv__ !";
4128         int val;
4129         DataArrayInt *a;
4130         std::vector<int> aa;
4131         DataArrayIntTuple *aaa;
4132         int sw;
4133         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4134         switch(sw)
4135           {
4136           case 1:
4137             {
4138               self->applyDivideBy(val);
4139               Py_XINCREF(trueSelf);
4140               return trueSelf;
4141             }
4142           case 2:
4143             {
4144               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4145               self->divideEqual(bb);
4146               Py_XINCREF(trueSelf);
4147               return trueSelf;
4148             }
4149           case 3:
4150             {
4151               self->divideEqual(a);
4152               Py_XINCREF(trueSelf);
4153               return trueSelf;
4154             }
4155           case 4:
4156             {
4157               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4158               self->divideEqual(aaaa);
4159               Py_XINCREF(trueSelf);
4160               return trueSelf;
4161             }
4162           default:
4163             throw INTERP_KERNEL::Exception(msg);
4164           }
4165       }
4166
4167       DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4168       {
4169         const char msg[]="Unexpected situation in __mod__ !";
4170         int val;
4171         DataArrayInt *a;
4172         std::vector<int> aa;
4173         DataArrayIntTuple *aaa;
4174         int sw;
4175         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4176         switch(sw)
4177           {
4178           case 1:
4179             {
4180               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4181               ret->applyModulus(val);
4182               return ret.retn();
4183             }
4184           case 2:
4185             {
4186               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4187               return DataArrayInt::Modulus(self,aaaa);
4188             }
4189           case 3:
4190             {
4191               return DataArrayInt::Modulus(self,a);
4192             }
4193           case 4:
4194             {
4195               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4196               return DataArrayInt::Modulus(self,aaaa);
4197             }
4198           default:
4199             throw INTERP_KERNEL::Exception(msg);
4200           }
4201       }
4202
4203       DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4204       {
4205         const char msg[]="Unexpected situation in __rmod__ !";
4206         int val;
4207         DataArrayInt *a;
4208         std::vector<int> aa;
4209         DataArrayIntTuple *aaa;
4210         int sw;
4211         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4212         switch(sw)
4213           {
4214           case 1:
4215             {
4216               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4217               ret->applyRModulus(val);
4218               return ret.retn();
4219             }
4220           case 2:
4221             {
4222               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4223               return DataArrayInt::Modulus(aaaa,self);
4224             }
4225           case 3:
4226             {
4227               return DataArrayInt::Modulus(a,self);
4228             }
4229           case 4:
4230             {
4231               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4232               return DataArrayInt::Modulus(aaaa,self);
4233             }
4234           default:
4235             throw INTERP_KERNEL::Exception(msg);
4236           }
4237       }
4238
4239       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4240       {
4241         const char msg[]="Unexpected situation in __imod__ !";
4242         int val;
4243         DataArrayInt *a;
4244         std::vector<int> aa;
4245         DataArrayIntTuple *aaa;
4246         int sw;
4247         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4248         switch(sw)
4249           {
4250           case 1:
4251             {
4252               self->applyModulus(val);
4253               Py_XINCREF(trueSelf);
4254               return trueSelf;
4255             }
4256           case 3:
4257             {
4258               self->modulusEqual(a);
4259               Py_XINCREF(trueSelf);
4260               return trueSelf;
4261             }
4262           case 4:
4263             {
4264               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4265               self->modulusEqual(aaaa);
4266               Py_XINCREF(trueSelf);
4267               return trueSelf;
4268             }
4269           default:
4270             throw INTERP_KERNEL::Exception(msg);
4271           }
4272       }
4273
4274       DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4275       {
4276         const char msg[]="Unexpected situation in __pow__ !";
4277         int val;
4278         DataArrayInt *a;
4279         std::vector<int> aa;
4280         DataArrayIntTuple *aaa;
4281         int sw;
4282         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4283         switch(sw)
4284           {
4285           case 1:
4286             {
4287               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4288               ret->applyPow(val);
4289               return ret.retn();
4290             }
4291           case 2:
4292             {
4293               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4294               return DataArrayInt::Pow(self,aaaa);
4295             }
4296           case 3:
4297             {
4298               return DataArrayInt::Pow(self,a);
4299             }
4300           case 4:
4301             {
4302               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4303               return DataArrayInt::Pow(self,aaaa);
4304             }
4305           default:
4306             throw INTERP_KERNEL::Exception(msg);
4307           }
4308       }
4309
4310       DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4311       {
4312         const char msg[]="Unexpected situation in __rpow__ !";
4313         int val;
4314         DataArrayInt *a;
4315         std::vector<int> aa;
4316         DataArrayIntTuple *aaa;
4317         int sw;
4318         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4319         switch(sw)
4320           {
4321           case 1:
4322             {
4323               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4324               ret->applyRPow(val);
4325               return ret.retn();
4326             }
4327           case 2:
4328             {
4329               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4330               return DataArrayInt::Pow(aaaa,self);
4331             }
4332           case 3:
4333             {
4334               return DataArrayInt::Pow(a,self);
4335             }
4336           case 4:
4337             {
4338               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4339               return DataArrayInt::Pow(aaaa,self);
4340             }
4341           default:
4342             throw INTERP_KERNEL::Exception(msg);
4343           }
4344       }
4345    
4346       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4347       {
4348         const char msg[]="Unexpected situation in __ipow__ !";
4349         int val;
4350         DataArrayInt *a;
4351         std::vector<int> aa;
4352         DataArrayIntTuple *aaa;
4353         int sw;
4354         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4355         switch(sw)
4356           {
4357           case 1:
4358             {
4359               self->applyPow(val);
4360               Py_XINCREF(trueSelf);
4361               return trueSelf;
4362             }
4363           case 3:
4364             {
4365               self->powEqual(a);
4366               Py_XINCREF(trueSelf);
4367               return trueSelf;
4368             }
4369           case 4:
4370             {
4371               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4372               self->powEqual(aaaa);
4373               Py_XINCREF(trueSelf);
4374               return trueSelf;
4375             }
4376           default:
4377             throw INTERP_KERNEL::Exception(msg);
4378           }
4379       }
4380
4381       std::string __repr__() const throw(INTERP_KERNEL::Exception)
4382       {
4383         std::ostringstream oss;
4384         self->reprQuickOverview(oss);
4385         return oss.str();
4386       }
4387       
4388       void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4389       {
4390         int szArr,sw,iTypppArr;
4391         std::vector<int> stdvecTyyppArr;
4392         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4393         self->pushBackValsSilent(tmp,tmp+szArr);
4394       }
4395       
4396       PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4397       {
4398         std::vector<int> ret1;
4399         std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4400         std::size_t sz=ret0.size();
4401         PyObject *pyRet=PyTuple_New(2);
4402         PyObject *pyRet0=PyList_New((int)sz);
4403         PyObject *pyRet1=PyList_New((int)sz);
4404         for(std::size_t i=0;i<sz;i++)
4405           {
4406             PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4407             PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4408           }
4409         PyTuple_SetItem(pyRet,0,pyRet0);
4410         PyTuple_SetItem(pyRet,1,pyRet1);
4411         return pyRet;
4412       }
4413       
4414       PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4415       {
4416         DataArrayInt *ret0=0,*ret1=0;
4417         self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4418         PyObject *pyRet=PyTuple_New(2);
4419         PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4420         PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4421         return pyRet;
4422       }
4423     }
4424   };
4425
4426   class DataArrayIntTuple;
4427
4428   class DataArrayIntIterator
4429   {
4430   public:
4431     DataArrayIntIterator(DataArrayInt *da);
4432     ~DataArrayIntIterator();
4433     %extend
4434     {
4435       PyObject *next()
4436       {
4437         DataArrayIntTuple *ret=self->nextt();
4438         if(ret)
4439           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4440         else
4441           {
4442             PyErr_SetString(PyExc_StopIteration,"No more data.");
4443             return 0;
4444           }
4445       }
4446     }
4447   };
4448
4449   class DataArrayIntTuple
4450   {
4451   public:
4452     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4453     DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4454     %extend
4455     {
4456       std::string __str__() const throw(INTERP_KERNEL::Exception)
4457       {
4458         return self->repr();
4459       }
4460
4461       int __int__() const throw(INTERP_KERNEL::Exception)
4462       {
4463         return self->intValue();
4464       }
4465
4466       DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4467       {
4468         return self->buildDAInt(1,self->getNumberOfCompo());
4469       }
4470
4471       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4472       {
4473         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4474         ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4475         Py_XINCREF(trueSelf);
4476         return trueSelf;
4477       }
4478   
4479       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4480       {
4481         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4482         ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4483         Py_XINCREF(trueSelf);
4484         return trueSelf;
4485       }
4486   
4487       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4488       {
4489         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4490         ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4491         Py_XINCREF(trueSelf);
4492         return trueSelf;
4493       }
4494
4495       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4496       {
4497         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4498         ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4499         Py_XINCREF(trueSelf);
4500         return trueSelf;
4501       }
4502
4503       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4504       {
4505         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4506         ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4507         Py_XINCREF(trueSelf);
4508         return trueSelf;
4509       }
4510   
4511       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4512       {
4513         const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4514         int sw;
4515         int singleVal;
4516         std::vector<int> multiVal;
4517         std::pair<int, std::pair<int,int> > slic;
4518         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4519         const int *pt=self->getConstPointer();
4520         int nbc=self->getNumberOfCompo();
4521         convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4522         switch(sw)
4523           {
4524           case 1:
4525             {
4526               if(singleVal>=nbc)
4527                 {
4528                   std::ostringstream oss;
4529                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4530                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4531                 }
4532               if(singleVal>=0)
4533                 return PyInt_FromLong(pt[singleVal]);
4534               else
4535                 {
4536                   if(nbc+singleVal>0)
4537                     return PyInt_FromLong(pt[nbc+singleVal]);
4538                   else
4539                     {
4540                       std::ostringstream oss;
4541                       oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4542                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4543                     }
4544                 }
4545             }
4546           case 2:
4547             {
4548               PyObject *t=PyTuple_New(multiVal.size());
4549               for(int j=0;j<(int)multiVal.size();j++)
4550                 {
4551                   int cid=multiVal[j];
4552                   if(cid>=nbc)
4553                     {
4554                       std::ostringstream oss;
4555                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4556                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4557                     }
4558                   PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4559                 }
4560               return t;
4561             }
4562           case 3:
4563             {
4564               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4565               PyObject *t=PyTuple_New(sz);
4566               for(int j=0;j<sz;j++)
4567                 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4568               return t;
4569             }
4570           default:
4571             throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4572           }
4573       }
4574
4575       DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4576       {
4577         const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4578         const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4579         int sw1,sw2;
4580         int singleValV;
4581         std::vector<int> multiValV;
4582         std::pair<int, std::pair<int,int> > slicV;
4583         ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4584         int nbc=self->getNumberOfCompo();
4585         convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4586         int singleVal;
4587         std::vector<int> multiVal;
4588         std::pair<int, std::pair<int,int> > slic;
4589         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4590         int *pt=self->getPointer();
4591         convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4592         switch(sw2)
4593           {
4594           case 1:
4595             {
4596               if(singleVal>=nbc)
4597                 {
4598                   std::ostringstream oss;
4599                   oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4600                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4601                 }
4602               switch(sw1)
4603                 {
4604                 case 1:
4605                   {
4606                     pt[singleVal]=singleValV;
4607                     return self;
4608                   }
4609                 case 2:
4610                   {
4611                     if(multiValV.size()!=1)
4612                       {
4613                         std::ostringstream oss;
4614                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4615                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4616                       }
4617                     pt[singleVal]=multiValV[0];
4618                     return self;
4619                   }
4620                 case 4:
4621                   {
4622                     pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4623                     return self;
4624                   }
4625                 default:
4626                   throw INTERP_KERNEL::Exception(msg);
4627                 }
4628             }
4629           case 2:
4630             {
4631               switch(sw1)
4632                 {
4633                 case 1:
4634                   {
4635                     for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4636                       {
4637                         if(*it>=nbc)
4638                           {
4639                             std::ostringstream oss;
4640                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4641                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4642                           }
4643                         pt[*it]=singleValV;
4644                       }
4645                     return self;
4646                   }
4647                 case 2:
4648                   {
4649                     if(multiVal.size()!=multiValV.size())
4650                       {
4651                         std::ostringstream oss;
4652                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4653                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4654                       }
4655                     for(int i=0;i<(int)multiVal.size();i++)
4656                       {
4657                         int pos=multiVal[i];
4658                         if(pos>=nbc)
4659                           {
4660                             std::ostringstream oss;
4661                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4662                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4663                           }
4664                         pt[multiVal[i]]=multiValV[i];
4665                       }
4666                     return self;
4667                   }
4668                 case 4:
4669                   {
4670                     const int *ptV=daIntTyyppV->getConstPointer();
4671                     if(nbc>daIntTyyppV->getNumberOfCompo())
4672                       {
4673                         std::ostringstream oss;
4674                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4675                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4676                       }
4677                     std::copy(ptV,ptV+nbc,pt);
4678                     return self;
4679                   }
4680                 default:
4681                   throw INTERP_KERNEL::Exception(msg);
4682                 }
4683             }
4684           case 3:
4685             {
4686               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4687               switch(sw1)
4688                 {
4689                 case 1:
4690                   {
4691                     for(int j=0;j<sz;j++)
4692                       pt[slic.first+j*slic.second.second]=singleValV;
4693                     return self;
4694                   }
4695                 case 2:
4696                   {
4697                     if(sz!=(int)multiValV.size())
4698                       {
4699                         std::ostringstream oss;
4700                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4701                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4702                       }
4703                     for(int j=0;j<sz;j++)
4704                       pt[slic.first+j*slic.second.second]=multiValV[j];
4705                     return self;
4706                   }
4707                 case 4:
4708                   {
4709                     const int *ptV=daIntTyyppV->getConstPointer();
4710                     if(sz>daIntTyyppV->getNumberOfCompo())
4711                       {
4712                         std::ostringstream oss;
4713                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4714                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4715                       }
4716                     for(int j=0;j<sz;j++)
4717                       pt[slic.first+j*slic.second.second]=ptV[j];
4718                     return self;
4719                   }
4720                 default:
4721                   throw INTERP_KERNEL::Exception(msg);
4722                 }
4723             }
4724           default:
4725             throw INTERP_KERNEL::Exception(msg);
4726           }
4727       }
4728     }
4729   };
4730
4731   class DataArrayChar : public DataArray
4732   {
4733   public:
4734     virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4735     int getHashCode() const throw(INTERP_KERNEL::Exception);
4736     bool empty() const throw(INTERP_KERNEL::Exception);
4737     void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4738     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4739     void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4740     char popBackSilent() throw(INTERP_KERNEL::Exception);
4741     void pack() const throw(INTERP_KERNEL::Exception);
4742     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4743     bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4744     bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4745     void reverse() throw(INTERP_KERNEL::Exception);
4746     void fillWithZero() throw(INTERP_KERNEL::Exception);
4747     void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4748     std::string repr() const throw(INTERP_KERNEL::Exception);
4749     std::string reprZip() const throw(INTERP_KERNEL::Exception);
4750     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4751     DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4752     DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4753     DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4754     bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4755     DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4756     DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4757     void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4758     void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4759     char front() const throw(INTERP_KERNEL::Exception);
4760     char back() const throw(INTERP_KERNEL::Exception);
4761     void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4762     void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4763     char *getPointer() throw(INTERP_KERNEL::Exception);
4764     DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4765     DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4766     int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4767     bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4768     char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4769     char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4770     char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4771     char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4772     DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4773     static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4774     static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4775     %extend
4776     {
4777       int __len__() const throw(INTERP_KERNEL::Exception)
4778       {
4779         if(self->isAllocated())
4780           {
4781             return self->getNumberOfTuples();
4782           }
4783         else
4784           {
4785             throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4786           }
4787       }
4788       
4789       PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4790       {
4791         std::string ret1;
4792         bool ret0=self->isEqualIfNotWhy(other,ret1);
4793         PyObject *ret=PyTuple_New(2);
4794         PyObject *ret0Py=ret0?Py_True:Py_False;
4795         Py_XINCREF(ret0Py);
4796         PyTuple_SetItem(ret,0,ret0Py);
4797         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4798         return ret;
4799       }
4800       
4801       DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4802       {
4803         void *da=0;
4804         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4805         if (!SWIG_IsOK(res1))
4806           {
4807             int size;
4808             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4809             if(size!=self->getNumberOfTuples())
4810               {
4811                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4812               }
4813             return self->renumber(tmp);
4814           }
4815         else
4816           {
4817             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4818             if(!da2)
4819               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4820             da2->checkAllocated();
4821             int size=self->getNumberOfTuples();
4822             if(size!=self->getNumberOfTuples())
4823               {
4824                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4825               }
4826             return self->renumber(da2->getConstPointer());
4827           }
4828       }
4829       
4830       DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4831       {
4832         void *da=0;
4833         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4834         if (!SWIG_IsOK(res1))
4835           {
4836             int size;
4837             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4838             if(size!=self->getNumberOfTuples())
4839               {
4840                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4841               }
4842             return self->renumberR(tmp);
4843           }
4844         else
4845           {
4846             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4847             if(!da2)
4848               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4849             da2->checkAllocated();
4850             int size=self->getNumberOfTuples();
4851             if(size!=self->getNumberOfTuples())
4852               {
4853                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4854               }
4855             return self->renumberR(da2->getConstPointer());
4856           }
4857       }
4858       
4859       DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4860       {
4861         void *da=0;
4862         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4863         if (!SWIG_IsOK(res1))
4864           {
4865             int size;
4866             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4867             if(size!=self->getNumberOfTuples())
4868               {
4869                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4870               }
4871             return self->renumberAndReduce(tmp,newNbOfTuple);
4872           }
4873         else
4874           {
4875             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4876             if(!da2)
4877               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4878             da2->checkAllocated();
4879             int size=self->getNumberOfTuples();
4880             if(size!=self->getNumberOfTuples())
4881               {
4882                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4883               }
4884             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4885           }
4886       }
4887       
4888       static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4889       {
4890         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4891         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4892         return DataArrayChar::Aggregate(tmp);
4893       }
4894       
4895       static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4896       {
4897         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4898         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4899         return DataArrayChar::Meld(tmp);
4900       }
4901     }
4902   };
4903   
4904   class DataArrayByteIterator;
4905
4906   class DataArrayByte : public DataArrayChar
4907   {
4908   public:
4909     static DataArrayByte *New();
4910     DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4911     DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4912     char byteValue() const throw(INTERP_KERNEL::Exception);
4913     %extend
4914     {
4915       DataArrayByte() throw(INTERP_KERNEL::Exception)
4916         {
4917           return DataArrayByte::New();
4918         }
4919
4920       static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4921       {
4922         const char *msg="ParaMEDMEM::DataArrayByte::New : Available API are : \n-DataArrayByte.New()\n--DataArrayByte.New([1,3,4])\n-DataArrayByte.New([1,3,4],3)\n-DataArrayByte.New([1,3,4,5],2,2)\n-DataArrayByte.New(5)\n-DataArrayByte.New(5,2) !";
4923         if(PyList_Check(elt0) || PyTuple_Check(elt0))
4924           {
4925             if(nbOfTuples)
4926               {
4927                 if(PyInt_Check(nbOfTuples))
4928                   {
4929                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4930                     if(nbOfTuples1<0)
4931                       throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4932                     if(nbOfComp)
4933                       {
4934                         if(PyInt_Check(nbOfComp))
4935                           {//DataArrayByte.New([1,3,4,5],2,2)
4936                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4937                             if(nbOfCompo<0)
4938                               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4939                             MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4940                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4941                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4942                             return ret.retn();
4943                           }
4944                         else
4945                           throw INTERP_KERNEL::Exception(msg);
4946                       }
4947                     else
4948                       {//DataArrayByte.New([1,3,4],3)
4949                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4950                         int tmpp1=-1;
4951                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4952                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4953                         return ret.retn();
4954                       }
4955                   }
4956                 else
4957                   throw INTERP_KERNEL::Exception(msg);
4958               }
4959             else
4960               {// DataArrayByte.New([1,3,4])
4961                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4962                 int tmpp1=-1,tmpp2=-1;
4963                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4964                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4965                 return ret.retn();
4966               }
4967           }
4968         else if(PyInt_Check(elt0))
4969           {
4970             int nbOfTuples1=PyInt_AS_LONG(elt0);
4971             if(nbOfTuples1<0)
4972               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4973             if(nbOfTuples)
4974               {
4975                 if(!nbOfComp)
4976                   {
4977                     if(PyInt_Check(nbOfTuples))
4978                       {//DataArrayByte.New(5,2)
4979                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4980                         if(nbOfCompo<0)
4981                           throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4982                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4983                         ret->alloc(nbOfTuples1,nbOfCompo);
4984                         return ret.retn();
4985                       }
4986                     else
4987                       throw INTERP_KERNEL::Exception(msg);
4988                   }
4989                 else
4990                   throw INTERP_KERNEL::Exception(msg);
4991               }
4992             else
4993               {//DataArrayByte.New(5)
4994                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4995                 ret->alloc(nbOfTuples1,1);
4996                 return ret.retn();
4997               }
4998           }
4999         else
5000           throw INTERP_KERNEL::Exception(msg);
5001       }
5002
5003       DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5004         {
5005           return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5006         }
5007    
5008       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5009       {
5010         std::ostringstream oss;
5011         self->reprQuickOverview(oss);
5012         return oss.str();
5013       }
5014   
5015       int __int__() const throw(INTERP_KERNEL::Exception)
5016       {
5017         return (int) self->byteValue();
5018       }
5019
5020       DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
5021       {
5022         return self->iterator();
5023       }
5024
5025       int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5026       {
5027         return (int)self->getIJ(tupleId,compoId);
5028       }
5029       
5030       int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5031       {
5032         return (int)self->getIJSafe(tupleId,compoId);
5033       }
5034
5035       std::string __str__() const throw(INTERP_KERNEL::Exception)
5036       {
5037         return self->repr();
5038       }
5039
5040       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5041       {
5042         const char *vals=self->getConstPointer();
5043         int nbOfComp=self->getNumberOfComponents();
5044         int nbOfTuples=self->getNumberOfTuples();
5045         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5046       }
5047    
5048       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5049       {
5050         int sz=-1,sw=-1;
5051         int ival=-1; std::vector<int> ivval;
5052         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5053         std::vector<char> vals(sz);
5054         std::copy(pt,pt+sz,vals.begin());
5055         return self->presenceOfTuple(vals);
5056       }
5057
5058       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5059       {
5060         int sz=-1,sw=-1;
5061         int ival=-1; std::vector<int> ivval;
5062         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5063         std::vector<char> vals2(sz);
5064         std::copy(pt,pt+sz,vals2.begin());
5065         return self->presenceOfValue(vals2);
5066       }
5067
5068       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5069       {
5070         int sz=-1,sw=-1;
5071         int ival=-1; std::vector<int> ivval;
5072         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5073         std::vector<char> vals2(sz);
5074         std::copy(pt,pt+sz,vals2.begin());
5075         return self->locateValue(vals2);
5076       }
5077
5078       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5079       {
5080         int sz=-1,sw=-1;
5081         int ival=-1; std::vector<int> ivval;
5082         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5083         std::vector<char> vals(sz);
5084         std::copy(pt,pt+sz,vals.begin());
5085         return self->locateTuple(vals);
5086       }
5087
5088       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5089       {
5090         int sz=-1,sw=-1;
5091         int ival=-1; std::vector<int> ivval;
5092         const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
5093         std::vector<char> vals(sz);
5094         std::copy(pt,pt+sz,vals.begin());
5095         return self->search(vals);
5096       }
5097
5098       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5099       {
5100         int sz=self->getNumberOfComponents();
5101         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
5102         self->getTuple(tupleId,tmp);
5103         PyObject *ret=PyTuple_New(sz);
5104         for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
5105         return ret;
5106       }
5107
5108       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5109       {
5110         int tmp;
5111         int r1=(int)self->getMaxValue(tmp);
5112         PyObject *ret=PyTuple_New(2);
5113         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5114         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5115         return ret;
5116       }
5117
5118       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5119       {
5120         int tmp;
5121         int r1=(int)self->getMinValue(tmp);
5122         PyObject *ret=PyTuple_New(2);
5123         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5124         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5125         return ret;
5126       }
5127
5128       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5129       {
5130         int nbOfCompo=self->getNumberOfComponents();
5131         switch(nbOfCompo)
5132           {
5133           case 1:
5134             {
5135               if(PyInt_Check(obj))
5136                 {
5137                   int val=(int)PyInt_AS_LONG(obj);
5138                   return self->locateValue(val);
5139                 }
5140               else
5141                 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
5142             }
5143           default:
5144             return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
5145           }
5146       }
5147
5148       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5149       {
5150         int nbOfCompo=self->getNumberOfComponents();
5151         switch(nbOfCompo)
5152           {
5153           case 0:
5154             return false;
5155           case 1:
5156             {
5157               if(PyInt_Check(obj))
5158                 {
5159                   int val=(int)PyInt_AS_LONG(obj);
5160                   return self->presenceOfValue(val);
5161                 }
5162               else
5163                 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5164             }
5165           default:
5166             return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
5167           }
5168       }
5169     }
5170   };
5171
5172   class DataArrayByteTuple;
5173
5174   class DataArrayByteIterator
5175   {
5176   public:
5177     DataArrayByteIterator(DataArrayByte *da);
5178     ~DataArrayByteIterator();
5179   };
5180
5181   class DataArrayByteTuple
5182   {
5183   public:
5184     std::string repr() const throw(INTERP_KERNEL::Exception);
5185     DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5186     %extend
5187     {
5188       std::string __str__() const throw(INTERP_KERNEL::Exception)
5189       {
5190         return self->repr();
5191       }
5192       
5193       char __int__() const throw(INTERP_KERNEL::Exception)
5194       {
5195         return self->byteValue();
5196       }
5197       
5198       DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5199       {
5200         return self->buildDAByte(1,self->getNumberOfCompo());
5201       }
5202     }
5203   };
5204   
5205   class DataArrayAsciiCharIterator;
5206   
5207   class DataArrayAsciiChar : public DataArrayChar
5208   {
5209   public:
5210     static DataArrayAsciiChar *New();
5211     DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5212     DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5213     char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5214     %extend
5215     {
5216       DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5217         {
5218           return DataArrayAsciiChar::New();
5219         }
5220
5221       static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5222       {
5223         const char *msg="ParaMEDMEM::DataArrayAsciiChar::New : Available API are : \n-DataArrayAsciiChar.New()\n-DataArrayAsciiChar.New([1,3,4])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"],\"t\")\n-DataArrayAsciiChar.New([1,3,4],3)\n-DataArrayAsciiChar.New([1,3,4,5],2,2)\n-DataArrayAsciiChar.New(5)\n-DataArrayAsciiChar.New(5,2) !";
5224         if(PyList_Check(elt0) || PyTuple_Check(elt0))
5225           {
5226             if(nbOfTuples)
5227               {
5228                 if(PyInt_Check(nbOfTuples))
5229                   {
5230                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5231                     if(nbOfTuples1<0)
5232                       throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5233                     if(nbOfComp)
5234                       {
5235                         if(PyInt_Check(nbOfComp))
5236                           {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5237                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5238                             if(nbOfCompo<0)
5239                               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5240                             MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5241                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5242                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5243                             return ret.retn();
5244                           }
5245                         else
5246                           throw INTERP_KERNEL::Exception(msg);
5247                       }
5248                     else
5249                       {//DataArrayAsciiChar.New([1,3,4],3)
5250                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5251                         int tmpp1=-1;
5252                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5253                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5254                         return ret.retn();
5255                       }
5256                   }
5257                 else if(PyString_Check(nbOfTuples))
5258                   {
5259                     if(PyString_Size(nbOfTuples)!=1)
5260                       throw INTERP_KERNEL::Exception(msg);
5261                     //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5262                     std::vector<std::string> tmp;
5263                     if(fillStringVector(elt0,tmp))
5264                       return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5265                     else
5266                       throw INTERP_KERNEL::Exception(msg);
5267                   }
5268                 else
5269                   throw INTERP_KERNEL::Exception(msg);
5270               }
5271             else
5272               {
5273                 std::vector<std::string> tmmp;
5274                 if(fillStringVector(elt0,tmmp))
5275                   //DataArrayAsciiChar.New(["abc","de","fghi"])
5276                   return DataArrayAsciiChar::New(tmmp,' ');
5277                 else
5278                   {
5279                     // DataArrayAsciiChar.New([1,3,4])
5280                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5281                     int tmpp1=-1,tmpp2=-1;
5282                     std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5283                     ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5284                     return ret.retn();
5285                   }
5286               }
5287           }
5288         else if(PyInt_Check(elt0))
5289           {
5290             int nbOfTuples1=PyInt_AS_LONG(elt0);
5291             if(nbOfTuples1<0)
5292               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5293             if(nbOfTuples)
5294               {
5295                 if(!nbOfComp)
5296                   {
5297                     if(PyInt_Check(nbOfTuples))
5298                       {//DataArrayAsciiChar.New(5,2)
5299                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5300                         if(nbOfCompo<0)
5301                           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5302                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5303                         ret->alloc(nbOfTuples1,nbOfCompo);
5304                         return ret.retn();
5305                       }
5306                     else
5307                       throw INTERP_KERNEL::Exception(msg);
5308                   }
5309                 else
5310                   throw INTERP_KERNEL::Exception(msg);
5311               }
5312             else
5313               {//DataArrayAsciiChar.New(5)
5314                 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5315                 ret->alloc(nbOfTuples1,1);
5316                 return ret.retn();
5317               }
5318           }
5319         else
5320           throw INTERP_KERNEL::Exception(msg);
5321       }
5322
5323       DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5324         {
5325           return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5326         }
5327
5328       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5329       {
5330         std::ostringstream oss;
5331         self->reprQuickOverview(oss);
5332         return oss.str();
5333       }
5334
5335       DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5336       {
5337         return self->iterator();
5338       }
5339
5340       std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5341       {
5342         char tmp[2]; tmp[1]='\0';
5343         tmp[0]=self->getIJ(tupleId,compoId);
5344         return std::string(tmp);
5345       }
5346    
5347       std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5348       {
5349         char tmp[2]; tmp[1]='\0';
5350         tmp[0]=self->getIJSafe(tupleId,compoId);
5351         return std::string(tmp);
5352       }
5353
5354       std::string __str__() const throw(INTERP_KERNEL::Exception)
5355       {
5356         return self->repr();
5357       }
5358
5359       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5360       {
5361         const char *vals=self->getConstPointer();
5362         int nbOfComp=self->getNumberOfComponents();
5363         int nbOfTuples=self->getNumberOfTuples();
5364         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5365       }
5366
5367       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5368       {
5369         if(PyString_Check(tupl))
5370           {
5371             Py_ssize_t sz=PyString_Size(tupl);
5372             std::vector<char> vals(sz);
5373             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5374             return self->presenceOfTuple(vals);
5375           }
5376         else
5377           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5378       }
5379    
5380       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5381       {
5382         if(PyString_Check(vals))
5383           {
5384             Py_ssize_t sz=PyString_Size(vals);
5385             std::vector<char> vals2(sz);
5386             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5387             return self->presenceOfValue(vals2);
5388           }
5389         else
5390           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5391       }
5392
5393       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5394       {
5395         if(PyString_Check(vals))
5396           {
5397             Py_ssize_t sz=PyString_Size(vals);
5398             std::vector<char> vals2(sz);
5399             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5400             return self->locateValue(vals2);
5401           }
5402         else
5403           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5404       }
5405
5406       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5407       {
5408         if(PyString_Check(tupl))
5409           {
5410             Py_ssize_t sz=PyString_Size(tupl);
5411             std::vector<char> vals(sz);
5412             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5413             return self->locateTuple(vals);
5414           }
5415         else
5416           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5417       }
5418
5419       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5420       {
5421         if(PyString_Check(strOrListOfInt))
5422           {
5423             Py_ssize_t sz=PyString_Size(strOrListOfInt);
5424             std::vector<char> vals(sz);
5425             std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5426             return self->search(vals);
5427           }
5428         else
5429           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5430       }
5431    
5432       PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5433       {
5434         int sz=self->getNumberOfComponents();
5435         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5436         self->getTuple(tupleId,tmp);
5437         return PyString_FromString(tmp);
5438       }
5439
5440       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5441       {
5442         int tmp;
5443         char tmp2[2]; tmp2[1]='\0';
5444         tmp2[0]=self->getMaxValue(tmp);
5445         PyObject *ret=PyTuple_New(2);
5446         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5447         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5448         return ret;
5449       }
5450
5451       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5452       {
5453         int tmp;
5454         char tmp2[2]; tmp2[1]='\0';
5455         tmp2[0]=self->getMinValue(tmp);
5456         PyObject *ret=PyTuple_New(2);
5457         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5458         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5459         return ret;
5460       }
5461
5462       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5463       {
5464         int nbOfCompo=self->getNumberOfComponents();
5465         switch(nbOfCompo)
5466           {
5467           case 1:
5468             {
5469               if(PyString_Check(obj))
5470                 {
5471                   Py_ssize_t sz=PyString_Size(obj);
5472                   char *pt=PyString_AsString(obj);
5473                   if(sz==1)
5474                     return self->locateValue(pt[0]);
5475                   else
5476                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5477                 }
5478               else
5479                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5480             }
5481           default:
5482             return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5483           }
5484       }
5485
5486       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5487       {
5488         int nbOfCompo=self->getNumberOfComponents();
5489         switch(nbOfCompo)
5490           {
5491           case 0:
5492             return false;
5493           case 1:
5494             {
5495               if(PyString_Check(obj))
5496                 {
5497                   Py_ssize_t sz=PyString_Size(obj);
5498                   char *pt=PyString_AsString(obj);
5499                   if(sz==1)
5500                     return self->presenceOfValue(pt[0]);
5501                   else
5502                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5503                 }
5504               else
5505                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5506             }
5507           default:
5508             return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5509           }
5510       }
5511
5512       PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5513       {
5514         int sw,iTypppArr;
5515         std::vector<int> stdvecTyyppArr;
5516         std::pair<int, std::pair<int,int> > sTyyppArr;
5517         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5518         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5519         switch(sw)
5520           {
5521           case 1:
5522             return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5523           case 2:
5524             return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5525           case 3:
5526             return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5527           case 4:
5528             return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5529           default:
5530             throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5531           }
5532       }
5533
5534       DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5535       {
5536         static const char msg[]="DataArrayAsciiChar::__setitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input, and 4 types accepted in value : string, list or tuple of strings having same size, not null DataArrayChar instance.";
5537         int sw1,iTypppArr;
5538         std::vector<int> stdvecTyyppArr;
5539         std::pair<int, std::pair<int,int> > sTyyppArr;
5540         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5541         int nbOfCompo=self->getNumberOfComponents();
5542         int nbOfTuples=self->getNumberOfTuples();
5543         convertObjToPossibleCpp2(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5544         int sw2;
5545         char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5546         convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5547         switch(sw1)
5548           {
5549           case 1:
5550             {//obj int
5551               switch(sw2)
5552                 {//value char
5553                 case 1:
5554                   {
5555                     self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5556                     return self;
5557                   }
5558                   //value string
5559                 case 2:
5560                   {
5561                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5562                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5563                     return self;
5564                   }
5565                   //value vector<string>
5566                 case 3:
5567                   {
5568                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5569                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5570                     return self;
5571                   }
5572                   //value DataArrayChar
5573                 case 4:
5574                   {
5575                     self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5576                     return self;
5577                   }
5578                 default:
5579                   throw INTERP_KERNEL::Exception(msg);
5580                 }
5581             }
5582           case 2:
5583             {//obj list-tuple[int]
5584               switch(sw2)
5585                 {
5586                   {//value char
5587                   case 1:
5588                     {
5589                       self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5590                       return self;
5591                     }
5592                     //value string
5593                   case 2:
5594                     {
5595                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5596                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5597                       return self;
5598                     }
5599                     //value vector<string>
5600                   case 3:
5601                     {
5602                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5603                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5604                       return self;
5605                     }
5606                     //value DataArrayChar
5607                   case 4:
5608                     {
5609                       self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5610                       return self;
5611                     }
5612                   default:
5613                     throw INTERP_KERNEL::Exception(msg);
5614                   }
5615                 }
5616             }
5617           case 3:
5618             {//slice
5619               switch(sw2)
5620                 {
5621                   {//value char
5622                   case 1:
5623                     {
5624                       self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5625                       return self;
5626                     }
5627                     //value string
5628                   case 2:
5629                     {
5630                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5631                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5632                       return self;
5633                     }
5634                     //value vector<string>
5635                   case 3:
5636                     {
5637                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5638                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5639                       return self;
5640                     }
5641                     //value DataArrayChar
5642                   case 4:
5643                     {
5644                       self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5645                       return self;
5646                     }
5647                   default:
5648                     throw INTERP_KERNEL::Exception(msg);
5649                   }
5650                 }
5651             }
5652           case 4:
5653             {//DataArrayInt
5654               switch(sw2)
5655                 {
5656                   {//value char
5657                   case 1:
5658                     {
5659                       self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5660                       return self;
5661                     }
5662                     //value string
5663                   case 2:
5664                     {
5665                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5666                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5667                       return self;
5668                     }
5669                     //value vector<string>
5670                   case 3:
5671                     {
5672                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5673                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5674                       return self;
5675                     }
5676                     //value DataArrayChar
5677                   case 4:
5678                     {
5679                       self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5680                       return self;
5681                     }
5682                   default:
5683                     throw INTERP_KERNEL::Exception(msg);
5684                   }
5685                 }
5686             }
5687           default:
5688             throw INTERP_KERNEL::Exception(msg);
5689           }
5690       }
5691     }
5692   };
5693
5694   class DataArrayAsciiCharTuple;
5695
5696   class DataArrayAsciiCharIterator
5697   {
5698   public:
5699     DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5700     ~DataArrayAsciiCharIterator();
5701     %extend
5702     {
5703       PyObject *next()
5704       {
5705         DataArrayAsciiCharTuple *ret=self->nextt();
5706         if(ret)
5707           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5708         else
5709           {
5710             PyErr_SetString(PyExc_StopIteration,"No more data.");
5711             return 0;
5712           }
5713       }
5714     }
5715   };
5716
5717   class DataArrayAsciiCharTuple
5718   {
5719   public:
5720     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5721     DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5722     %extend
5723     {
5724       std::string __str__() const throw(INTERP_KERNEL::Exception)
5725       {
5726         return self->repr();
5727       }
5728       
5729       DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5730       {
5731         return self->buildDAAsciiChar(1,self->getNumberOfCompo());
5732       }
5733     }
5734   };
5735 }