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