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