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