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