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