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