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