Salome HOME
Some useful tools for MEDCouplingMappedExtrudedMesh users that needs to store it...
[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         static const char MSG[]="DataArrayDouble.__new__ : the args in input is expected to be a tuple !";
2260         if(!PyTuple_Check(args))
2261           throw INTERP_KERNEL::Exception(MSG);
2262         PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
2263         PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
2264         PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
2265         //
2266         PyObject *tmp0(PyTuple_New(1));
2267         PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
2268         PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
2269         Py_DECREF(tmp0);
2270         Py_DECREF(selfMeth);
2271         PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
2272         int sz(PyTuple_Size(args));
2273         
2274         if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
2275           {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
2276             PyObject *zeNumpyRepr(0);
2277             PyObject *tmp1(PyInt_FromLong(0));
2278             zeNumpyRepr=PyDict_GetItem(PyTuple_GetItem(args,1),tmp1);//borrowed
2279             Py_DECREF(tmp1);
2280             PyObject *tmp3(PyTuple_New(1));
2281             PyTuple_SetItem(tmp3,0,zeNumpyRepr); Py_XINCREF(zeNumpyRepr);
2282             PyObject *tmp2(PyObject_CallObject(initMeth,tmp3));
2283             Py_XDECREF(tmp2);
2284             Py_DECREF(tmp3);
2285           }
2286         Py_DECREF(initMeth);
2287         return instance;
2288       }
2289
2290       PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
2291       {
2292 #ifdef WITH_NUMPY
2293         if(!self->isAllocated())
2294           throw INTERP_KERNEL::Exception("PyWrap of DataArrayDouble.__getnewargs__ : self is not allocated !");
2295         PyObject *ret(PyTuple_New(1));
2296         PyObject *ret0(PyDict_New());
2297         PyObject *numpyArryObj(MEDCoupling_DataArrayDouble_toNumPyArray(self));
2298         {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
2299           PyObject *tmp1(PyInt_FromLong(0));
2300           PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
2301           PyTuple_SetItem(ret,0,ret0);
2302         }
2303         return ret;
2304 #else
2305         throw INTERP_KERNEL::Exception("PyWrap of DataArrayDouble.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
2306 #endif
2307       }
2308     }
2309   };
2310
2311   class DataArrayDoubleTuple;
2312
2313   class DataArrayDoubleIterator
2314   {
2315   public:
2316     DataArrayDoubleIterator(DataArrayDouble *da);
2317     ~DataArrayDoubleIterator();
2318     %extend
2319     {
2320       PyObject *next()
2321       {
2322         DataArrayDoubleTuple *ret=self->nextt();
2323         if(ret)
2324           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2325         else
2326           {
2327             PyErr_SetString(PyExc_StopIteration,"No more data.");
2328             return 0;
2329           }
2330       }
2331     }
2332   };
2333
2334   class DataArrayDoubleTuple
2335   {
2336   public:
2337     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
2338     DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
2339     %extend
2340     {
2341       std::string __str__() const throw(INTERP_KERNEL::Exception)
2342       {
2343         return self->repr();
2344       }
2345
2346       double __float__() const throw(INTERP_KERNEL::Exception)
2347       {
2348         return self->doubleValue();
2349       }
2350
2351       DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
2352       {
2353         return self->buildDADouble(1,self->getNumberOfCompo());
2354       }
2355
2356       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2357       {
2358         MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2359         MEDCoupling_DataArrayDouble____iadd___(ret,0,obj);
2360         Py_XINCREF(trueSelf);
2361         return trueSelf;
2362       }
2363   
2364       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2365       {
2366         MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2367         MEDCoupling_DataArrayDouble____isub___(ret,0,obj);
2368         Py_XINCREF(trueSelf);
2369         return trueSelf;
2370       }
2371   
2372       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2373       {
2374         MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2375         MEDCoupling_DataArrayDouble____imul___(ret,0,obj);
2376         Py_XINCREF(trueSelf);
2377         return trueSelf;
2378       }
2379
2380       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2381       {
2382         MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2383         MEDCoupling_DataArrayDouble____idiv___(ret,0,obj);
2384         Py_XINCREF(trueSelf);
2385         return trueSelf;
2386       }
2387
2388       PyObject *__len__() throw(INTERP_KERNEL::Exception)
2389       {
2390         return PyInt_FromLong(self->getNumberOfCompo());
2391       }
2392
2393       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2394       {
2395         const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2396         int sw;
2397         int singleVal;
2398         std::vector<int> multiVal;
2399         std::pair<int, std::pair<int,int> > slic;
2400         MEDCoupling::DataArrayInt *daIntTyypp=0;
2401         const double *pt=self->getConstPointer();
2402         int nbc=self->getNumberOfCompo();
2403         convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2404         switch(sw)
2405           {
2406           case 1:
2407             {
2408               if(singleVal>=nbc)
2409                 {
2410                   std::ostringstream oss;
2411                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2412                   PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
2413                   return 0;
2414                 }
2415               if(singleVal>=0)
2416                 return PyFloat_FromDouble(pt[singleVal]);
2417               else
2418                 {
2419                   if(nbc+singleVal>0)
2420                     return PyFloat_FromDouble(pt[nbc+singleVal]);
2421                   else
2422                     {
2423                       std::ostringstream oss;
2424                       oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2425                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2426                     }
2427                 }
2428             }
2429           case 2:
2430             {
2431               PyObject *t=PyTuple_New(multiVal.size());
2432               for(int j=0;j<(int)multiVal.size();j++)
2433                 {
2434                   int cid=multiVal[j];
2435                   if(cid>=nbc)
2436                     {
2437                       std::ostringstream oss;
2438                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2439                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2440                     }
2441                   PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2442                 }
2443               return t;
2444             }
2445           case 3:
2446             {
2447               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2448               PyObject *t=PyTuple_New(sz);
2449               for(int j=0;j<sz;j++)
2450                 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2451               return t;
2452             }
2453           default:
2454             throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2455           }
2456       }
2457
2458       DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2459       {
2460         const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2461         const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2462         int sw1,sw2;
2463         double singleValV;
2464         std::vector<double> multiValV;
2465         MEDCoupling::DataArrayDoubleTuple *daIntTyyppV=0;
2466         int nbc=self->getNumberOfCompo();
2467         convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2468         int singleVal;
2469         std::vector<int> multiVal;
2470         std::pair<int, std::pair<int,int> > slic;
2471         MEDCoupling::DataArrayInt *daIntTyypp=0;
2472         double *pt=self->getPointer();
2473         convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2474         switch(sw2)
2475           {
2476           case 1:
2477             {
2478               if(singleVal>=nbc)
2479                 {
2480                   std::ostringstream oss;
2481                   oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2482                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2483                 }
2484               switch(sw1)
2485                 {
2486                 case 1:
2487                   {
2488                     pt[singleVal]=singleValV;
2489                     return self;
2490                   }
2491                 case 2:
2492                   {
2493                     if(multiValV.size()!=1)
2494                       {
2495                         std::ostringstream oss;
2496                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2497                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2498                       }
2499                     pt[singleVal]=multiValV[0];
2500                     return self;
2501                   }
2502                 case 3:
2503                   {
2504                     pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2505                     return self;
2506                   }
2507                 default:
2508                   throw INTERP_KERNEL::Exception(msg);
2509                 }
2510             }
2511           case 2:
2512             {
2513               switch(sw1)
2514                 {
2515                 case 1:
2516                   {
2517                     for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2518                       {
2519                         if(*it>=nbc)
2520                           {
2521                             std::ostringstream oss;
2522                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2523                             throw INTERP_KERNEL::Exception(oss.str().c_str());
2524                           }
2525                         pt[*it]=singleValV;
2526                       }
2527                     return self;
2528                   }
2529                 case 2:
2530                   {
2531                     if(multiVal.size()!=multiValV.size())
2532                       {
2533                         std::ostringstream oss;
2534                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2535                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2536                       }
2537                     for(int i=0;i<(int)multiVal.size();i++)
2538                       {
2539                         int pos=multiVal[i];
2540                         if(pos>=nbc)
2541                           {
2542                             std::ostringstream oss;
2543                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2544                             throw INTERP_KERNEL::Exception(oss.str().c_str());
2545                           }
2546                         pt[multiVal[i]]=multiValV[i];
2547                       }
2548                     return self;
2549                   }
2550                 case 3:
2551                   {
2552                     const double *ptV=daIntTyyppV->getConstPointer();
2553                     if(nbc>daIntTyyppV->getNumberOfCompo())
2554                       {
2555                         std::ostringstream oss;
2556                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2557                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2558                       }
2559                     std::copy(ptV,ptV+nbc,pt);
2560                     return self;
2561                   }
2562                 default:
2563                   throw INTERP_KERNEL::Exception(msg);
2564                 }
2565             }
2566           case 3:
2567             {
2568               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2569               switch(sw1)
2570                 {
2571                 case 1:
2572                   {
2573                     for(int j=0;j<sz;j++)
2574                       pt[slic.first+j*slic.second.second]=singleValV;
2575                     return self;
2576                   }
2577                 case 2:
2578                   {
2579                     if(sz!=(int)multiValV.size())
2580                       {
2581                         std::ostringstream oss;
2582                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2583                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2584                       }
2585                     for(int j=0;j<sz;j++)
2586                       pt[slic.first+j*slic.second.second]=multiValV[j];
2587                     return self;
2588                   }
2589                 case 3:
2590                   {
2591                     const double *ptV=daIntTyyppV->getConstPointer();
2592                     if(sz>daIntTyyppV->getNumberOfCompo())
2593                       {
2594                         std::ostringstream oss;
2595                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2596                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2597                       }
2598                     for(int j=0;j<sz;j++)
2599                       pt[slic.first+j*slic.second.second]=ptV[j];
2600                     return self;
2601                   }
2602                 default:
2603                   throw INTERP_KERNEL::Exception(msg);
2604                 }
2605             }
2606           default:
2607             throw INTERP_KERNEL::Exception(msg);
2608           }
2609       }
2610     }
2611   };
2612
2613   class DataArrayIntIterator;
2614
2615   class DataArrayInt : public DataArray
2616   {
2617   public:
2618     static DataArrayInt *New();
2619     int intValue() const throw(INTERP_KERNEL::Exception);
2620     int getHashCode() const throw(INTERP_KERNEL::Exception);
2621     bool empty() const throw(INTERP_KERNEL::Exception);
2622     void aggregate(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2623     DataArrayInt *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
2624     void deepCopyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2625     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2626     void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2627     int popBackSilent() throw(INTERP_KERNEL::Exception);
2628     void pack() const throw(INTERP_KERNEL::Exception);
2629     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2630     bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2631     bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2632     bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2633     DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2634     DataArrayInt *sumPerTuple() const throw(INTERP_KERNEL::Exception);
2635     void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2636     void reverse() throw(INTERP_KERNEL::Exception);
2637     void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2638     bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2639     void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2640     bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2641     void fillWithZero() throw(INTERP_KERNEL::Exception);
2642     void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2643     void iota(int init=0) throw(INTERP_KERNEL::Exception);
2644     std::string repr() const throw(INTERP_KERNEL::Exception);
2645     std::string reprZip() const throw(INTERP_KERNEL::Exception);
2646     std::string reprNotTooLong() const throw(INTERP_KERNEL::Exception);
2647     DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2648     DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2649     DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2650     DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
2651     DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2652     DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2653     DataArrayInt *selectByTupleIdSafeSlice(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2654     DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2655     DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2656     bool isIota(int sizeExpected) const throw(INTERP_KERNEL::Exception);
2657     bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2658     bool hasUniqueValues() const throw(INTERP_KERNEL::Exception);
2659     DataArrayInt *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2660     void transpose() throw(INTERP_KERNEL::Exception);
2661     DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2662     void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2663     void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2664     void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2665     void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2666     void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2667     int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2668     int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2669     int front() const throw(INTERP_KERNEL::Exception);
2670     int back() const throw(INTERP_KERNEL::Exception);
2671     void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2672     void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2673     int *getPointer() throw(INTERP_KERNEL::Exception);
2674     const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2675     DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2676     const int *begin() const throw(INTERP_KERNEL::Exception);
2677     const int *end() const throw(INTERP_KERNEL::Exception);
2678     DataArrayInt *findIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2679     DataArrayInt *findIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2680     int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2681     int findIdFirstEqualTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2682     int findIdFirstEqual(int value) const throw(INTERP_KERNEL::Exception);
2683     int findIdFirstEqual(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2684     int findIdSequence(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2685     bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2686     bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2687     bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2688     int count(int value) const throw(INTERP_KERNEL::Exception);
2689     int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2690     int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2691     int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2692     int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2693     int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2694     void abs() throw(INTERP_KERNEL::Exception);
2695     DataArrayInt *computeAbs() const throw(INTERP_KERNEL::Exception);
2696     void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2697     void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2698     void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2699     DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2700     void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2701     void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2702     void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2703     void applyPow(int val) throw(INTERP_KERNEL::Exception);
2704     void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2705     DataArrayInt *findIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2706     DataArrayInt *findIdsNotInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2707     DataArrayInt *findIdsStricltyNegative() const throw(INTERP_KERNEL::Exception);
2708     bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2709     static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2710     static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2711     static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2712     static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2713     static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2714     static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2) throw(INTERP_KERNEL::Exception);
2715     DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2716     DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2717     DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2718     DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2719     DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2720     DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2721     DataArrayInt *buildUniqueNotSorted() const throw(INTERP_KERNEL::Exception);
2722     DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2723     void computeOffsets() throw(INTERP_KERNEL::Exception);
2724     void computeOffsetsFull() throw(INTERP_KERNEL::Exception);
2725     DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2726     DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2727     DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2728     void sortEachPairToMakeALinkedList() throw(INTERP_KERNEL::Exception);
2729     DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2730     DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2731     static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2732     void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2733     static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2734     void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2735     static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2736     void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2737     static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2738     void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2739     static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2740     void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2741     static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2742     void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2743   public:
2744     static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2745     %extend
2746     {
2747       DataArrayInt() throw(INTERP_KERNEL::Exception)
2748         {
2749           return DataArrayInt::New();
2750         }
2751
2752       static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2753       {
2754         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)";
2755         std::string msg(msgBase);
2756 #ifdef WITH_NUMPY
2757         msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2758 #endif
2759         msg+=" !";
2760         if(PyList_Check(elt0) || PyTuple_Check(elt0))
2761           {
2762             if(nbOfTuples)
2763               {
2764                 if(PyInt_Check(nbOfTuples))
2765                   {
2766                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2767                     if(nbOfTuples1<0)
2768                       throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2769                     if(nbOfComp)
2770                       {
2771                         if(PyInt_Check(nbOfComp))
2772                           {//DataArrayInt.New([1,3,4,5],2,2)
2773                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2774                             if(nbOfCompo<0)
2775                               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2776                             MCAuto<DataArrayInt> ret=DataArrayInt::New();
2777                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2778                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2779                             return ret.retn();
2780                           }
2781                         else
2782                           throw INTERP_KERNEL::Exception(msg.c_str());
2783                       }
2784                     else
2785                       {//DataArrayInt.New([1,3,4],3)
2786                         MCAuto<DataArrayInt> ret=DataArrayInt::New();
2787                         int tmpp1=-1;
2788                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2789                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2790                         return ret.retn();
2791                       }
2792                   }
2793                 else
2794                   throw INTERP_KERNEL::Exception(msg.c_str());
2795               }
2796             else
2797               {// DataArrayInt.New([1,3,4])
2798                 MCAuto<DataArrayInt> ret=DataArrayInt::New();
2799                 int tmpp1=-1,tmpp2=-1;
2800                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2801                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2802                 return ret.retn();
2803               }
2804           }
2805         else if(PyInt_Check(elt0))
2806           {
2807             int nbOfTuples1=PyInt_AS_LONG(elt0);
2808             if(nbOfTuples1<0)
2809               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2810             if(nbOfTuples)
2811               {
2812                 if(!nbOfComp)
2813                   {
2814                     if(PyInt_Check(nbOfTuples))
2815                       {//DataArrayInt.New(5,2)
2816                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2817                         if(nbOfCompo<0)
2818                           throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2819                         MCAuto<DataArrayInt> ret=DataArrayInt::New();
2820                         ret->alloc(nbOfTuples1,nbOfCompo);
2821                         return ret.retn();
2822                       }
2823                     else
2824                       throw INTERP_KERNEL::Exception(msg.c_str());
2825                   }
2826                 else
2827                   throw INTERP_KERNEL::Exception(msg.c_str());
2828               }
2829             else
2830               {//DataArrayInt.New(5)
2831                 MCAuto<DataArrayInt> ret=DataArrayInt::New();
2832                 ret->alloc(nbOfTuples1,1);
2833                 return ret.retn();
2834               }
2835           }
2836 #ifdef WITH_NUMPY
2837         else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2838           {//DataArrayInt.New(numpyArray)
2839             return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2840           }
2841 #endif
2842         else
2843           throw INTERP_KERNEL::Exception(msg.c_str());
2844         throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
2845       }
2846
2847       DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2848         {
2849           return MEDCoupling_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2850         }
2851
2852       std::string __str__() const throw(INTERP_KERNEL::Exception)
2853       {
2854         return self->reprNotTooLong();
2855       }
2856
2857       int __len__() const throw(INTERP_KERNEL::Exception)
2858       {
2859         if(self->isAllocated())
2860           {
2861             return self->getNumberOfTuples();
2862           }
2863         else
2864           {
2865             throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2866           }
2867       }
2868
2869       int __int__() const throw(INTERP_KERNEL::Exception)
2870       {
2871         return self->intValue();
2872       }
2873
2874       DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2875       {
2876         return self->iterator();
2877       }
2878    
2879       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2880       {
2881         int sz=self->getNumberOfComponents();
2882         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2883         self->accumulate(tmp);
2884         return convertIntArrToPyList(tmp,sz);
2885       }
2886
2887       DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2888       {
2889         int sw,sz,val;
2890         std::vector<int> val2;
2891         const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2892         return self->accumulatePerChunck(bg,bg+sz);
2893       }
2894
2895       DataArrayInt *findIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
2896       {
2897         int sw,sz,val;
2898         std::vector<int> val2;
2899         const int *bg(convertObjToPossibleCpp1_Safe(inputTuple,sw,sz,val,val2));
2900         return self->findIdsEqualTuple(bg,bg+sz);
2901       }
2902
2903       PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
2904       {
2905         std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
2906         PyObject *ret=PyList_New(slcs.size());
2907         for(std::size_t i=0;i<slcs.size();i++)
2908           PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
2909         return ret;
2910       }
2911
2912       DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const throw(INTERP_KERNEL::Exception)
2913       {
2914         if(!PySlice_Check(slic))
2915           throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
2916         Py_ssize_t strt=2,stp=2,step=2;
2917         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
2918         GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
2919         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
2920           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 !");
2921         return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
2922       }
2923
2924       PyObject *getMinMaxValues() const throw(INTERP_KERNEL::Exception)
2925       {
2926         int a,b;
2927         self->getMinMaxValues(a,b);
2928         PyObject *ret=PyTuple_New(2);
2929         PyTuple_SetItem(ret,0,PyInt_FromLong(a));
2930         PyTuple_SetItem(ret,1,PyInt_FromLong(b));
2931         return ret;
2932       }
2933    
2934       static PyObject *ConvertIndexArrayToO2N(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2935       {
2936         int newNbOfTuples=-1;
2937         int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2938         std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2939         const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2940         const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2941         DataArrayInt *ret0=MEDCoupling::DataArrayInt::ConvertIndexArrayToO2N(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2942         PyObject *ret=PyTuple_New(2);
2943         PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
2944         PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2945         return ret;
2946       }
2947
2948       static DataArrayInt *CheckAndPreparePermutation(PyObject *arr) throw(INTERP_KERNEL::Exception)
2949       {
2950         MCAuto<DataArrayInt> ret(DataArrayInt::New());
2951         int szArr,sw,iTypppArr;
2952         std::vector<int> stdvecTyyppArr;
2953         const int *arrPtr(convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
2954         int *pt(MEDCoupling::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
2955         ret->useArray(pt,true,MEDCoupling::C_DEALLOC,szArr,1);
2956         return ret.retn();
2957       }
2958
2959       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2960       {
2961         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 !";
2962         if(PyList_Check(li) || PyTuple_Check(li))
2963           {
2964             if(nbOfTuples)
2965               {
2966                 if(PyInt_Check(nbOfTuples))
2967                   {
2968                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2969                     if(nbOfTuples<0)
2970                       throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2971                     if(nbOfComp)
2972                       {
2973                         if(PyInt_Check(nbOfComp))
2974                           {//DataArrayInt.setValues([1,3,4,5],2,2)
2975                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2976                             if(nbOfCompo<0)
2977                               throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2978                             std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2979                             self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2980                           }
2981                         else
2982                           throw INTERP_KERNEL::Exception(msg);
2983                       }
2984                     else
2985                       {//DataArrayInt.setValues([1,3,4],3)
2986                         int tmpp1=-1;
2987                         std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2988                         self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2989                       }
2990                   }
2991                 else
2992                   throw INTERP_KERNEL::Exception(msg);
2993               }
2994             else
2995               {// DataArrayInt.setValues([1,3,4])
2996                 int tmpp1=-1,tmpp2=-1;
2997                 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2998                 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2999               }
3000           }
3001         else
3002           throw INTERP_KERNEL::Exception(msg);
3003       }
3004
3005       PyObject *getValues() const throw(INTERP_KERNEL::Exception)
3006       {
3007         const int *vals=self->getConstPointer();
3008         return convertIntArrToPyList(vals,self->getNbOfElems());
3009       }
3010
3011 #ifdef WITH_NUMPY
3012       PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
3013       {
3014         return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
3015       }
3016 #endif
3017
3018       PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
3019       {
3020         std::string ret1;
3021         bool ret0=self->isEqualIfNotWhy(other,ret1);
3022         PyObject *ret=PyTuple_New(2);
3023         PyObject *ret0Py=ret0?Py_True:Py_False;
3024         Py_XINCREF(ret0Py);
3025         PyTuple_SetItem(ret,0,ret0Py);
3026         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3027         return ret;
3028       }
3029
3030       PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
3031       {
3032         const int *vals=self->getConstPointer();
3033         int nbOfComp=self->getNumberOfComponents();
3034         int nbOfTuples=self->getNumberOfTuples();
3035         return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
3036       }
3037
3038       static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
3039       {
3040         std::vector<const DataArrayInt *> groups;
3041         std::vector< std::vector<int> > fidsOfGroups;
3042         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(gps,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",groups);
3043         MEDCoupling::DataArrayInt *ret0=MEDCoupling::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
3044         PyObject *ret = PyList_New(2);
3045         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3046         int sz=fidsOfGroups.size();
3047         PyObject *ret1 = PyList_New(sz);
3048         for(int i=0;i<sz;i++)
3049           PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
3050         PyList_SetItem(ret,1,ret1);
3051         return ret;
3052       }
3053
3054       void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
3055       {
3056         void *da=0;
3057         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3058         if (!SWIG_IsOK(res1))
3059           {
3060             int size;
3061             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3062             self->transformWithIndArr(tmp,tmp+size);
3063           }
3064         else
3065           {
3066             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3067             self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3068           }
3069       }
3070
3071       DataArrayInt *findIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
3072       {
3073         int sw;
3074         int singleVal;
3075         std::vector<int> multiVal;
3076         std::pair<int, std::pair<int,int> > slic;
3077         MEDCoupling::DataArrayInt *daIntTyypp=0;
3078         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
3079         switch(sw)
3080           {
3081           case 1:
3082             return self->findIdsEqualList(&singleVal,&singleVal+1);
3083           case 2:
3084             return self->findIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
3085           case 4:
3086             return self->findIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
3087           default:
3088             throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
3089           }
3090       }
3091
3092       DataArrayInt *findIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
3093       {
3094         int sw;
3095         int singleVal;
3096         std::vector<int> multiVal;
3097         std::pair<int, std::pair<int,int> > slic;
3098         MEDCoupling::DataArrayInt *daIntTyypp=0;
3099         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
3100         switch(sw)
3101           {
3102           case 1:
3103             return self->findIdsNotEqualList(&singleVal,&singleVal+1);
3104           case 2:
3105             return self->findIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
3106           case 4:
3107             return self->findIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
3108           default:
3109             throw INTERP_KERNEL::Exception("DataArrayInt::findIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
3110           }
3111       }
3112
3113       PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
3114       {
3115         DataArrayInt *ret0=0,*ret1=0,*ret2=0;
3116         void *da=0;
3117         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3118         if (!SWIG_IsOK(res1))
3119           {
3120             int size;
3121             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3122             self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
3123           }
3124         else
3125           {
3126             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3127             if(!da2)
3128               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3129             da2->checkAllocated();
3130             self->splitByValueRange(da2->begin(),da2->end(),ret0,ret1,ret2);
3131           }
3132         PyObject *ret = PyList_New(3);
3133         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3134         PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3135         PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3136         return ret;
3137       }
3138
3139       DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
3140       {
3141         void *da=0;
3142         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3143         if (!SWIG_IsOK(res1))
3144           {
3145             int size;
3146             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3147             return self->transformWithIndArrR(tmp,tmp+size);
3148           }
3149         else
3150           {
3151             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3152             return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3153           }
3154       }
3155
3156       DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3157       {
3158         void *da=0;
3159         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3160         if (!SWIG_IsOK(res1))
3161           {
3162             int size;
3163             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3164             if(size!=self->getNumberOfTuples())
3165               {
3166                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3167               }
3168             return self->renumberAndReduce(tmp,newNbOfTuple);
3169           }
3170         else
3171           {
3172             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3173             if(!da2)
3174               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3175             da2->checkAllocated();
3176             int size=self->getNumberOfTuples();
3177             if(size!=self->getNumberOfTuples())
3178               {
3179                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3180               }
3181             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3182           }
3183       }
3184
3185       DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3186       {
3187         void *da=0;
3188         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3189         if (!SWIG_IsOK(res1))
3190           {
3191             int size;
3192             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3193             if(size!=self->getNumberOfTuples())
3194               {
3195                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3196               }
3197             return self->renumber(tmp);
3198           }
3199         else
3200           {
3201             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3202             if(!da2)
3203               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3204             da2->checkAllocated();
3205             int size=self->getNumberOfTuples();
3206             if(size!=self->getNumberOfTuples())
3207               {
3208                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3209               }
3210             return self->renumber(da2->getConstPointer());
3211           }
3212       }
3213
3214       DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3215       {
3216         void *da=0;
3217         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3218         if (!SWIG_IsOK(res1))
3219           {
3220             int size;
3221             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3222             if(size!=self->getNumberOfTuples())
3223               {
3224                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3225               }
3226             return self->renumberR(tmp);
3227           }
3228         else
3229           {
3230             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3231             if(!da2)
3232               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3233             da2->checkAllocated();
3234             int size=self->getNumberOfTuples();
3235             if(size!=self->getNumberOfTuples())
3236               {
3237                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3238               }
3239             return self->renumberR(da2->getConstPointer());
3240           }
3241       }
3242
3243       void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3244       {
3245         std::vector<int> tmp;
3246         convertPyToNewIntArr3(li,tmp);
3247         self->setSelectedComponents(a,tmp);
3248       }
3249
3250       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3251       {
3252         int sz=self->getNumberOfComponents();
3253         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
3254         self->getTuple(tupleId,tmp);
3255         return convertIntArrToPyList(tmp,sz);
3256       }
3257
3258       PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
3259       {
3260         DataArrayInt *arr=0;
3261         DataArrayInt *arrI=0;
3262         self->changeSurjectiveFormat(targetNb,arr,arrI);
3263         PyObject *res = PyList_New(2);
3264         PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3265         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3266         return res;
3267       }
3268
3269       static DataArrayInt *Meld(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::Meld(tmp);
3274       }
3275
3276       static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3277       {
3278         std::vector<const DataArrayInt *> tmp;
3279         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3280         return DataArrayInt::Aggregate(tmp);
3281       }
3282
3283       static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
3284       {
3285         std::vector<const DataArrayInt *> tmp;
3286         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3287         return DataArrayInt::AggregateIndexes(tmp);
3288       }
3289
3290       static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
3291       {
3292         std::vector<const DataArrayInt *> tmp;
3293         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3294         return DataArrayInt::BuildUnion(tmp);
3295       }
3296
3297       static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
3298       {
3299         std::vector<const DataArrayInt *> tmp;
3300         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3301         return DataArrayInt::BuildIntersection(tmp);
3302       }
3303
3304       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3305       {
3306         int tmp;
3307         int r1=self->getMaxValue(tmp);
3308         PyObject *ret=PyTuple_New(2);
3309         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3310         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3311         return ret;
3312       }
3313
3314       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3315       {
3316         int tmp;
3317         int r1=self->getMinValue(tmp);
3318         PyObject *ret=PyTuple_New(2);
3319         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3320         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3321         return ret;
3322       }
3323
3324       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3325       {
3326         int nbOfCompo=self->getNumberOfComponents();
3327         switch(nbOfCompo)
3328           {
3329           case 1:
3330             {
3331               if(PyInt_Check(obj))
3332                 {
3333                   int val=(int)PyInt_AS_LONG(obj);
3334                   return self->findIdFirstEqual(val);
3335                 }
3336               else
3337                 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
3338             }
3339           default:
3340             {
3341               std::vector<int> arr;
3342               convertPyToNewIntArr3(obj,arr);
3343               return self->findIdFirstEqualTuple(arr);
3344             }
3345           }
3346       }
3347
3348       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3349       {
3350         int nbOfCompo=self->getNumberOfComponents();
3351         switch(nbOfCompo)
3352           {
3353           case 0:
3354             return false;
3355           case 1:
3356             {
3357               if(PyInt_Check(obj))
3358                 {
3359                   int val=(int)PyInt_AS_LONG(obj);
3360                   return self->presenceOfValue(val);
3361                 }
3362               else
3363                 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
3364             }
3365           default:
3366             {
3367               std::vector<int> arr;
3368               convertPyToNewIntArr3(obj,arr);
3369               return self->presenceOfTuple(arr);
3370             }
3371           }
3372       }
3373
3374       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3375       {
3376         const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
3377         const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
3378         self->checkAllocated();
3379         int nbOfTuples=self->getNumberOfTuples();
3380         int nbOfComponents=self->getNumberOfComponents();
3381         int it1,ic1;
3382         std::vector<int> vt1,vc1;
3383         std::pair<int, std::pair<int,int> > pt1,pc1;
3384         DataArrayInt *dt1=0,*dc1=0;
3385         int sw;
3386         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3387         MCAuto<DataArrayInt> ret;
3388         switch(sw)
3389           {
3390           case 1:
3391             {
3392               if(nbOfComponents==1)
3393                 return PyInt_FromLong(self->getIJSafe(it1,0));
3394               return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3395             }
3396           case 2:
3397             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3398           case 3:
3399             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3400           case 4:
3401             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3402           case 5:
3403             return PyInt_FromLong(self->getIJSafe(it1,ic1));
3404           case 6:
3405             {
3406               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3407               std::vector<int> v2(1,ic1);
3408               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3409             }
3410           case 7:
3411             {
3412               ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
3413               std::vector<int> v2(1,ic1);
3414               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3415             }
3416           case 8:
3417             {
3418               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3419               std::vector<int> v2(1,ic1);
3420               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3421             }
3422           case 9:
3423             {
3424               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3425               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3426             }
3427           case 10:
3428             {
3429               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3430               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3431             }
3432           case 11:
3433             {
3434               ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
3435               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3436             }
3437           case 12:
3438             {
3439               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3440               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3441             }
3442           case 13:
3443             {
3444               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3445               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3446               std::vector<int> v2(nbOfComp);
3447               for(int i=0;i<nbOfComp;i++)
3448                 v2[i]=pc1.first+i*pc1.second.second;
3449               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3450             }
3451           case 14:
3452             {
3453               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3454               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3455               std::vector<int> v2(nbOfComp);
3456               for(int i=0;i<nbOfComp;i++)
3457                 v2[i]=pc1.first+i*pc1.second.second;
3458               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3459             }
3460           case 15:
3461             {
3462               ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
3463               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3464               std::vector<int> v2(nbOfComp);
3465               for(int i=0;i<nbOfComp;i++)
3466                 v2[i]=pc1.first+i*pc1.second.second;
3467               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3468             }
3469           case 16:
3470             {
3471               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3472               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3473               std::vector<int> v2(nbOfComp);
3474               for(int i=0;i<nbOfComp;i++)
3475                 v2[i]=pc1.first+i*pc1.second.second;
3476               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3477             }
3478           default:
3479             throw INTERP_KERNEL::Exception(msg);
3480           }
3481       }
3482
3483       DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3484       {
3485         self->checkAllocated();
3486         const char msg[]="Unexpected situation in __setitem__ !";
3487         int nbOfTuples=self->getNumberOfTuples();
3488         int nbOfComponents=self->getNumberOfComponents();
3489         int sw1,sw2;
3490         int i1;
3491         std::vector<int> v1;
3492         DataArrayInt *d1=0;
3493         DataArrayIntTuple *dd1=0;
3494         convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3495         int it1,ic1;
3496         std::vector<int> vt1,vc1;
3497         std::pair<int, std::pair<int,int> > pt1,pc1;
3498         DataArrayInt *dt1=0,*dc1=0;
3499         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3500         MCAuto<DataArrayInt> tmp;
3501         switch(sw2)
3502           {
3503           case 1:
3504             {
3505               switch(sw1)
3506                 {
3507                 case 1:
3508                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3509                   return self;
3510                 case 2:
3511                   tmp=DataArrayInt::New();
3512                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3513                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3514                   return self;
3515                 case 3:
3516                   self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3517                   return self;
3518                 case 4:
3519                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3520                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3521                   return self;
3522                 default:
3523                   throw INTERP_KERNEL::Exception(msg);
3524                 }
3525               break;
3526             }
3527           case 2:
3528             {
3529               switch(sw1)
3530                 {
3531                 case 1:
3532                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3533                   return self;
3534                 case 2:
3535                   tmp=DataArrayInt::New();
3536                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3537                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3538                   return self;
3539                 case 3:
3540                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3541                   return self;
3542                 case 4:
3543                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3544                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3545                   return self;
3546                 default:
3547                   throw INTERP_KERNEL::Exception(msg);
3548                 }
3549               break;
3550             }
3551           case 3:
3552             {
3553               switch(sw1)
3554                 {
3555                 case 1:
3556                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3557                   return self;
3558                 case 2:
3559                   tmp=DataArrayInt::New();
3560                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3561                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3562                   return self;
3563                 case 3:
3564                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3565                   return self;
3566                 case 4:
3567                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3568                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3569                   return self;
3570                 default:
3571                   throw INTERP_KERNEL::Exception(msg);
3572                 }
3573               break;
3574             }
3575           case 4:
3576             {
3577               switch(sw1)
3578                 {
3579                 case 1:
3580                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3581                   return self;
3582                 case 2:
3583                   tmp=DataArrayInt::New();
3584                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3585                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3586                   return self;
3587                 case 3:
3588                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3589                   return self;
3590                 case 4:
3591                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3592                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3593                   return self;
3594                 default:
3595                   throw INTERP_KERNEL::Exception(msg);
3596                 }
3597               break;
3598             }
3599           case 5:
3600             {
3601               switch(sw1)
3602                 {
3603                 case 1:
3604                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3605                   return self;
3606                 case 2:
3607                   tmp=DataArrayInt::New();
3608                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3609                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3610                   return self;
3611                 case 3:
3612                   self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3613                   return self;
3614                 case 4:
3615                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3616                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3617                   return self;
3618                 default:
3619                   throw INTERP_KERNEL::Exception(msg);
3620                 }
3621               break;
3622             }
3623           case 6:
3624             {
3625               switch(sw1)
3626                 {
3627                 case 1:
3628                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3629                   return self;
3630                 case 2:
3631                   tmp=DataArrayInt::New();
3632                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3633                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3634                   return self;
3635                 case 3:
3636                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3637                   return self;
3638                 case 4:
3639                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3640                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3641                   return self;
3642                 default:
3643                   throw INTERP_KERNEL::Exception(msg);
3644                 }
3645               break;
3646             }
3647           case 7:
3648             {
3649               switch(sw1)
3650                 {
3651                 case 1:
3652                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3653                   return self;
3654                 case 2:
3655                   tmp=DataArrayInt::New();
3656                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3657                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3658                   return self;
3659                 case 3:
3660                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3661                   return self;
3662                 case 4:
3663                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3664                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3665                   return self;
3666                 default:
3667                   throw INTERP_KERNEL::Exception(msg);
3668                 }
3669               break;
3670             }
3671           case 8:
3672             {
3673               switch(sw1)
3674                 {
3675                 case 1:
3676                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3677                   return self;
3678                 case 2:
3679                   tmp=DataArrayInt::New();
3680                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3681                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3682                   return self;
3683                 case 3:
3684                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3685                   return self;
3686                 case 4:
3687                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3688                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3689                   return self;
3690                 default:
3691                   throw INTERP_KERNEL::Exception(msg);
3692                 }
3693               break;
3694             }
3695           case 9:
3696             {
3697               switch(sw1)
3698                 {
3699                 case 1:
3700                   self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3701                   return self;
3702                 case 2:
3703                   tmp=DataArrayInt::New();
3704                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3705                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3706                   return self;
3707                 case 3:
3708                   self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3709                   return self;
3710                 case 4:
3711                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3712                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3713                   return self;
3714                 default:
3715                   throw INTERP_KERNEL::Exception(msg);
3716                 }
3717               break;
3718             }
3719           case 10:
3720             {
3721               switch(sw1)
3722                 {
3723                 case 1:
3724                   self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3725                   return self;
3726                 case 2:
3727                   tmp=DataArrayInt::New();
3728                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3729                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3730                   return self;
3731                 case 3:
3732                   self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3733                   return self;
3734                 case 4:
3735                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3736                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3737                   return self;
3738                 default:
3739                   throw INTERP_KERNEL::Exception(msg);
3740                 }
3741               break;
3742             }
3743           case 11:
3744             {
3745               switch(sw1)
3746                 {
3747                 case 1:
3748                   self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3749                   return self;
3750                 case 2:
3751                   tmp=DataArrayInt::New();
3752                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3753                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3754                   return self;
3755                 case 3:
3756                   self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3757                   return self;
3758                 case 4:
3759                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3760                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3761                   return self;
3762                 default:
3763                   throw INTERP_KERNEL::Exception(msg);
3764                 }
3765               break;
3766             }
3767           case 12:
3768             {
3769               switch(sw1)
3770                 {
3771                 case 1:
3772                   self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3773                   return self;
3774                 case 2:
3775                   tmp=DataArrayInt::New();
3776                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3777                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3778                   return self;
3779                 case 3:
3780                   self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3781                   return self;
3782                 case 4:
3783                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3784                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3785                   return self;
3786                 default:
3787                   throw INTERP_KERNEL::Exception(msg);
3788                 }
3789               break;
3790             }
3791           case 13:
3792             {
3793               switch(sw1)
3794                 {
3795                 case 1:
3796                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3797                   return self;
3798                 case 2:
3799                   tmp=DataArrayInt::New();
3800                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3801                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3802                   return self;
3803                 case 3:
3804                   self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3805                   return self;
3806                 case 4:
3807                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3808                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3809                   return self;
3810                 default:
3811                   throw INTERP_KERNEL::Exception(msg);
3812                 }
3813               break;
3814             }
3815           case 14:
3816             {
3817               switch(sw1)
3818                 {
3819                 case 1:
3820                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3821                   return self;
3822                 case 2:
3823                   tmp=DataArrayInt::New();
3824                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3825                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3826                   return self;
3827                 case 3:
3828                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3829                   return self;
3830                 case 4:
3831                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3832                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3833                   return self;
3834                 default:
3835                   throw INTERP_KERNEL::Exception(msg);
3836                 }
3837               break;
3838             }
3839           case 15:
3840             {
3841               switch(sw1)
3842                 {
3843                 case 1:
3844                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3845                   return self;
3846                 case 2:
3847                   tmp=DataArrayInt::New();
3848                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3849                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3850                   return self;
3851                 case 3:
3852                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3853                   return self;
3854                 case 4:
3855                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3856                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3857                   return self;
3858                 default:
3859                   throw INTERP_KERNEL::Exception(msg);
3860                 }
3861               break;
3862             }
3863           case 16:
3864             {
3865               switch(sw1)
3866                 {
3867                 case 1:
3868                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3869                   return self;
3870                 case 2:
3871                   tmp=DataArrayInt::New();
3872                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3873                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3874                   return self;
3875                 case 3:
3876                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3877                   return self;
3878                 case 4:
3879                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3880                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3881                   return self;
3882                 default:
3883                   throw INTERP_KERNEL::Exception(msg);
3884                 }
3885               break;
3886             }
3887           default:
3888             throw INTERP_KERNEL::Exception(msg);
3889           }
3890         return self;
3891       }
3892
3893       DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3894       {
3895         return self->negate();
3896       }
3897  
3898       DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3899       {
3900         const char msg[]="Unexpected situation in __add__ !";
3901         int val;
3902         DataArrayInt *a;
3903         std::vector<int> aa;
3904         DataArrayIntTuple *aaa;
3905         int sw;
3906         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3907         switch(sw)
3908           {
3909           case 1:
3910             {
3911               MCAuto<DataArrayInt> ret=self->deepCopy();
3912               ret->applyLin(1,val);
3913               return ret.retn();
3914             }
3915           case 2:
3916             {
3917               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3918               return DataArrayInt::Add(self,aaaa);
3919             }
3920           case 3:
3921             {
3922               return DataArrayInt::Add(self,a);
3923             }
3924           case 4:
3925             {
3926               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3927               return DataArrayInt::Add(self,aaaa);
3928             }
3929           default:
3930             throw INTERP_KERNEL::Exception(msg);
3931           }
3932       }
3933
3934       DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3935       {
3936         const char msg[]="Unexpected situation in __radd__ !";
3937         int val;
3938         DataArrayInt *a;
3939         std::vector<int> aa;
3940         DataArrayIntTuple *aaa;
3941         int sw;
3942         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3943         switch(sw)
3944           {
3945           case 1:
3946             {
3947               MCAuto<DataArrayInt> ret=self->deepCopy();
3948               ret->applyLin(1,val);
3949               return ret.retn();
3950             }
3951           case 2:
3952             {
3953               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3954               return DataArrayInt::Add(self,aaaa);
3955             }
3956           case 4:
3957             {
3958               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3959               return DataArrayInt::Add(self,aaaa);
3960             }
3961           default:
3962             throw INTERP_KERNEL::Exception(msg);
3963           }
3964       }
3965
3966       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3967       {
3968         const char msg[]="Unexpected situation in __iadd__ !";
3969         int val;
3970         DataArrayInt *a;
3971         std::vector<int> aa;
3972         DataArrayIntTuple *aaa;
3973         int sw;
3974         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3975         switch(sw)
3976           {
3977           case 1:
3978             {
3979               self->applyLin(1,val);
3980               Py_XINCREF(trueSelf);
3981               return trueSelf;
3982             }
3983           case 2:
3984             {
3985               MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3986               self->addEqual(bb);
3987               Py_XINCREF(trueSelf);
3988               return trueSelf;
3989             }
3990           case 3:
3991             {
3992               self->addEqual(a);
3993               Py_XINCREF(trueSelf);
3994               return trueSelf;
3995             }
3996           case 4:
3997             {
3998               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3999               self->addEqual(aaaa);
4000               Py_XINCREF(trueSelf);
4001               return trueSelf;
4002             }
4003           default:
4004             throw INTERP_KERNEL::Exception(msg);
4005           }
4006       }
4007
4008       DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4009       {
4010         const char msg[]="Unexpected situation in __sub__ !";
4011         int val;
4012         DataArrayInt *a;
4013         std::vector<int> aa;
4014         DataArrayIntTuple *aaa;
4015         int sw;
4016         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4017         switch(sw)
4018           {
4019           case 1:
4020             {
4021               MCAuto<DataArrayInt> ret=self->deepCopy();
4022               ret->applyLin(1,-val);
4023               return ret.retn();
4024             }
4025           case 2:
4026             {
4027               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4028               return DataArrayInt::Substract(self,aaaa);
4029             }
4030           case 3:
4031             {
4032               return DataArrayInt::Substract(self,a);
4033             }
4034           case 4:
4035             {
4036               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4037               return DataArrayInt::Substract(self,aaaa);
4038             }
4039           default:
4040             throw INTERP_KERNEL::Exception(msg);
4041           }
4042       }
4043
4044       DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4045       {
4046         const char msg[]="Unexpected situation in __rsub__ !";
4047         int val;
4048         DataArrayInt *a;
4049         std::vector<int> aa;
4050         DataArrayIntTuple *aaa;
4051         int sw;
4052         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4053         switch(sw)
4054           {
4055           case 1:
4056             {
4057               MCAuto<DataArrayInt> ret=self->deepCopy();
4058               ret->applyLin(-1,val);
4059               return ret.retn();
4060             }
4061           case 2:
4062             {
4063               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4064               return DataArrayInt::Substract(aaaa,self);
4065             }
4066           case 4:
4067             {
4068               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4069               return DataArrayInt::Substract(aaaa,self);
4070             }
4071           default:
4072             throw INTERP_KERNEL::Exception(msg);
4073           }
4074       }
4075
4076       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4077       {
4078         const char msg[]="Unexpected situation in __isub__ !";
4079         int val;
4080         DataArrayInt *a;
4081         std::vector<int> aa;
4082         DataArrayIntTuple *aaa;
4083         int sw;
4084         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4085         switch(sw)
4086           {
4087           case 1:
4088             {
4089               self->applyLin(1,-val);
4090               Py_XINCREF(trueSelf);
4091               return trueSelf;
4092             }
4093           case 2:
4094             {
4095               MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4096               self->substractEqual(bb);
4097               Py_XINCREF(trueSelf);
4098               return trueSelf;
4099             }
4100           case 3:
4101             {
4102               self->substractEqual(a);
4103               Py_XINCREF(trueSelf);
4104               return trueSelf;
4105             }
4106           case 4:
4107             {
4108               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4109               self->substractEqual(aaaa);
4110               Py_XINCREF(trueSelf);
4111               return trueSelf;
4112             }
4113           default:
4114             throw INTERP_KERNEL::Exception(msg);
4115           }
4116       }
4117
4118       DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4119       {
4120         const char msg[]="Unexpected situation in __mul__ !";
4121         int val;
4122         DataArrayInt *a;
4123         std::vector<int> aa;
4124         DataArrayIntTuple *aaa;
4125         int sw;
4126         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4127         switch(sw)
4128           {
4129           case 1:
4130             {
4131               MCAuto<DataArrayInt> ret=self->deepCopy();
4132               ret->applyLin(val,0);
4133               return ret.retn();
4134             }
4135           case 2:
4136             {
4137               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4138               return DataArrayInt::Multiply(self,aaaa);
4139             }
4140           case 3:
4141             {
4142               return DataArrayInt::Multiply(self,a);
4143             }
4144           case 4:
4145             {
4146               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4147               return DataArrayInt::Multiply(self,aaaa);
4148             }
4149           default:
4150             throw INTERP_KERNEL::Exception(msg);
4151           }
4152       }
4153
4154       DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4155       {
4156         const char msg[]="Unexpected situation in __rmul__ !";
4157         int val;
4158         DataArrayInt *a;
4159         std::vector<int> aa;
4160         DataArrayIntTuple *aaa;
4161         int sw;
4162         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4163         switch(sw)
4164           {
4165           case 1:
4166             {
4167               MCAuto<DataArrayInt> ret=self->deepCopy();
4168               ret->applyLin(val,0);
4169               return ret.retn();
4170             }
4171           case 2:
4172             {
4173               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4174               return DataArrayInt::Multiply(self,aaaa);
4175             }
4176           case 4:
4177             {
4178               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4179               return DataArrayInt::Multiply(self,aaaa);
4180             }
4181           default:
4182             throw INTERP_KERNEL::Exception(msg);
4183           }
4184       }
4185
4186       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4187       {
4188         const char msg[]="Unexpected situation in __imul__ !";
4189         int val;
4190         DataArrayInt *a;
4191         std::vector<int> aa;
4192         DataArrayIntTuple *aaa;
4193         int sw;
4194         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4195         switch(sw)
4196           {
4197           case 1:
4198             {
4199               self->applyLin(val,0);
4200               Py_XINCREF(trueSelf);
4201               return trueSelf;
4202             }
4203           case 2:
4204             {
4205               MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4206               self->multiplyEqual(bb);
4207               Py_XINCREF(trueSelf);
4208               return trueSelf;
4209             }
4210           case 3:
4211             {
4212               self->multiplyEqual(a);
4213               Py_XINCREF(trueSelf);
4214               return trueSelf;
4215             }
4216           case 4:
4217             {
4218               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4219               self->multiplyEqual(aaaa);
4220               Py_XINCREF(trueSelf);
4221               return trueSelf;
4222             }
4223           default:
4224             throw INTERP_KERNEL::Exception(msg);
4225           }
4226       }
4227
4228       DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4229       {
4230         const char msg[]="Unexpected situation in __div__ !";
4231         int val;
4232         DataArrayInt *a;
4233         std::vector<int> aa;
4234         DataArrayIntTuple *aaa;
4235         int sw;
4236         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4237         switch(sw)
4238           {
4239           case 1:
4240             {
4241               MCAuto<DataArrayInt> ret=self->deepCopy();
4242               ret->applyDivideBy(val);
4243               return ret.retn();
4244             }
4245           case 2:
4246             {
4247               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4248               return DataArrayInt::Divide(self,aaaa);
4249             }
4250           case 3:
4251             {
4252               return DataArrayInt::Divide(self,a);
4253             }
4254           case 4:
4255             {
4256               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4257               return DataArrayInt::Divide(self,aaaa);
4258             }
4259           default:
4260             throw INTERP_KERNEL::Exception(msg);
4261           }
4262       }
4263
4264       DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4265       {
4266         const char msg[]="Unexpected situation in __rdiv__ !";
4267         int val;
4268         DataArrayInt *a;
4269         std::vector<int> aa;
4270         DataArrayIntTuple *aaa;
4271         int sw;
4272         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4273         switch(sw)
4274           {
4275           case 1:
4276             {
4277               MCAuto<DataArrayInt> ret=self->deepCopy();
4278               ret->applyInv(val);
4279               return ret.retn();
4280             }
4281           case 2:
4282             {
4283               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4284               return DataArrayInt::Divide(aaaa,self);
4285             }
4286           case 4:
4287             {
4288               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4289               return DataArrayInt::Divide(aaaa,self);
4290             }
4291           default:
4292             throw INTERP_KERNEL::Exception(msg);
4293           }
4294       }
4295
4296       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4297       {
4298         const char msg[]="Unexpected situation in __idiv__ !";
4299         int val;
4300         DataArrayInt *a;
4301         std::vector<int> aa;
4302         DataArrayIntTuple *aaa;
4303         int sw;
4304         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4305         switch(sw)
4306           {
4307           case 1:
4308             {
4309               self->applyDivideBy(val);
4310               Py_XINCREF(trueSelf);
4311               return trueSelf;
4312             }
4313           case 2:
4314             {
4315               MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4316               self->divideEqual(bb);
4317               Py_XINCREF(trueSelf);
4318               return trueSelf;
4319             }
4320           case 3:
4321             {
4322               self->divideEqual(a);
4323               Py_XINCREF(trueSelf);
4324               return trueSelf;
4325             }
4326           case 4:
4327             {
4328               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4329               self->divideEqual(aaaa);
4330               Py_XINCREF(trueSelf);
4331               return trueSelf;
4332             }
4333           default:
4334             throw INTERP_KERNEL::Exception(msg);
4335           }
4336       }
4337
4338       DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4339       {
4340         const char msg[]="Unexpected situation in __mod__ !";
4341         int val;
4342         DataArrayInt *a;
4343         std::vector<int> aa;
4344         DataArrayIntTuple *aaa;
4345         int sw;
4346         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4347         switch(sw)
4348           {
4349           case 1:
4350             {
4351               MCAuto<DataArrayInt> ret=self->deepCopy();
4352               ret->applyModulus(val);
4353               return ret.retn();
4354             }
4355           case 2:
4356             {
4357               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4358               return DataArrayInt::Modulus(self,aaaa);
4359             }
4360           case 3:
4361             {
4362               return DataArrayInt::Modulus(self,a);
4363             }
4364           case 4:
4365             {
4366               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4367               return DataArrayInt::Modulus(self,aaaa);
4368             }
4369           default:
4370             throw INTERP_KERNEL::Exception(msg);
4371           }
4372       }
4373
4374       DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4375       {
4376         const char msg[]="Unexpected situation in __rmod__ !";
4377         int val;
4378         DataArrayInt *a;
4379         std::vector<int> aa;
4380         DataArrayIntTuple *aaa;
4381         int sw;
4382         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4383         switch(sw)
4384           {
4385           case 1:
4386             {
4387               MCAuto<DataArrayInt> ret=self->deepCopy();
4388               ret->applyRModulus(val);
4389               return ret.retn();
4390             }
4391           case 2:
4392             {
4393               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4394               return DataArrayInt::Modulus(aaaa,self);
4395             }
4396           case 3:
4397             {
4398               return DataArrayInt::Modulus(a,self);
4399             }
4400           case 4:
4401             {
4402               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4403               return DataArrayInt::Modulus(aaaa,self);
4404             }
4405           default:
4406             throw INTERP_KERNEL::Exception(msg);
4407           }
4408       }
4409
4410       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4411       {
4412         const char msg[]="Unexpected situation in __imod__ !";
4413         int val;
4414         DataArrayInt *a;
4415         std::vector<int> aa;
4416         DataArrayIntTuple *aaa;
4417         int sw;
4418         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4419         switch(sw)
4420           {
4421           case 1:
4422             {
4423               self->applyModulus(val);
4424               Py_XINCREF(trueSelf);
4425               return trueSelf;
4426             }
4427           case 3:
4428             {
4429               self->modulusEqual(a);
4430               Py_XINCREF(trueSelf);
4431               return trueSelf;
4432             }
4433           case 4:
4434             {
4435               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4436               self->modulusEqual(aaaa);
4437               Py_XINCREF(trueSelf);
4438               return trueSelf;
4439             }
4440           default:
4441             throw INTERP_KERNEL::Exception(msg);
4442           }
4443       }
4444
4445       DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4446       {
4447         const char msg[]="Unexpected situation in __pow__ !";
4448         int val;
4449         DataArrayInt *a;
4450         std::vector<int> aa;
4451         DataArrayIntTuple *aaa;
4452         int sw;
4453         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4454         switch(sw)
4455           {
4456           case 1:
4457             {
4458               MCAuto<DataArrayInt> ret=self->deepCopy();
4459               ret->applyPow(val);
4460               return ret.retn();
4461             }
4462           case 2:
4463             {
4464               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4465               return DataArrayInt::Pow(self,aaaa);
4466             }
4467           case 3:
4468             {
4469               return DataArrayInt::Pow(self,a);
4470             }
4471           case 4:
4472             {
4473               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4474               return DataArrayInt::Pow(self,aaaa);
4475             }
4476           default:
4477             throw INTERP_KERNEL::Exception(msg);
4478           }
4479       }
4480
4481       DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4482       {
4483         const char msg[]="Unexpected situation in __rpow__ !";
4484         int val;
4485         DataArrayInt *a;
4486         std::vector<int> aa;
4487         DataArrayIntTuple *aaa;
4488         int sw;
4489         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4490         switch(sw)
4491           {
4492           case 1:
4493             {
4494               MCAuto<DataArrayInt> ret=self->deepCopy();
4495               ret->applyRPow(val);
4496               return ret.retn();
4497             }
4498           case 2:
4499             {
4500               MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4501               return DataArrayInt::Pow(aaaa,self);
4502             }
4503           case 3:
4504             {
4505               return DataArrayInt::Pow(a,self);
4506             }
4507           case 4:
4508             {
4509               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4510               return DataArrayInt::Pow(aaaa,self);
4511             }
4512           default:
4513             throw INTERP_KERNEL::Exception(msg);
4514           }
4515       }
4516    
4517       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4518       {
4519         const char msg[]="Unexpected situation in __ipow__ !";
4520         int val;
4521         DataArrayInt *a;
4522         std::vector<int> aa;
4523         DataArrayIntTuple *aaa;
4524         int sw;
4525         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4526         switch(sw)
4527           {
4528           case 1:
4529             {
4530               self->applyPow(val);
4531               Py_XINCREF(trueSelf);
4532               return trueSelf;
4533             }
4534           case 3:
4535             {
4536               self->powEqual(a);
4537               Py_XINCREF(trueSelf);
4538               return trueSelf;
4539             }
4540           case 4:
4541             {
4542               MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4543               self->powEqual(aaaa);
4544               Py_XINCREF(trueSelf);
4545               return trueSelf;
4546             }
4547           default:
4548             throw INTERP_KERNEL::Exception(msg);
4549           }
4550       }
4551
4552       std::string __repr__() const throw(INTERP_KERNEL::Exception)
4553       {
4554         std::ostringstream oss;
4555         self->reprQuickOverview(oss);
4556         return oss.str();
4557       }
4558       
4559       void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4560       {
4561         int szArr,sw,iTypppArr;
4562         std::vector<int> stdvecTyyppArr;
4563         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4564         self->pushBackValsSilent(tmp,tmp+szArr);
4565       }
4566       
4567       PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4568       {
4569         std::vector<int> ret1;
4570         std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4571         std::size_t sz=ret0.size();
4572         PyObject *pyRet=PyTuple_New(2);
4573         PyObject *pyRet0=PyList_New((int)sz);
4574         PyObject *pyRet1=PyList_New((int)sz);
4575         for(std::size_t i=0;i<sz;i++)
4576           {
4577             PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4578             PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4579           }
4580         PyTuple_SetItem(pyRet,0,pyRet0);
4581         PyTuple_SetItem(pyRet,1,pyRet1);
4582         return pyRet;
4583       }
4584       
4585       PyObject *findIdsRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4586       {
4587         DataArrayInt *ret0=0,*ret1=0;
4588         self->findIdsRangesInListOfIds(listOfIds,ret0,ret1);
4589         PyObject *pyRet=PyTuple_New(2);
4590         PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4591         PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4592         return pyRet;
4593       }
4594
4595       PyObject *isRange() const throw(INTERP_KERNEL::Exception)
4596       {
4597         int a(0),b(0),c(0);
4598         bool ret(self->isRange(a,b,c));
4599         PyObject *pyRet=PyTuple_New(2);
4600         PyObject *ret0Py=ret?Py_True:Py_False,*ret1Py(0);
4601         Py_XINCREF(ret0Py);
4602         PyTuple_SetItem(pyRet,0,ret0Py);
4603         if(ret)
4604           ret1Py=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
4605         else
4606           {
4607             ret1Py=Py_None;
4608             Py_XINCREF(ret1Py);
4609           }
4610         PyTuple_SetItem(pyRet,1,ret1Py);
4611         return pyRet;
4612       }
4613       
4614       // serialization
4615       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4616       {
4617         static const char MSG[]="DataArrayInt.__new__ : the args in input is expected to be a tuple !";
4618         if(!PyTuple_Check(args))
4619           throw INTERP_KERNEL::Exception(MSG);
4620         PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4621         PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4622         PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4623         //
4624         PyObject *tmp0(PyTuple_New(1));
4625         PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4626         PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4627         Py_DECREF(tmp0);
4628         Py_DECREF(selfMeth);
4629         PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4630         int sz(PyTuple_Size(args));
4631         
4632         if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4633           {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4634             PyObject *zeNumpyRepr(0);
4635             PyObject *tmp1(PyInt_FromLong(0));
4636             zeNumpyRepr=PyDict_GetItem(PyTuple_GetItem(args,1),tmp1);//borrowed
4637             Py_DECREF(tmp1);
4638             PyObject *tmp3(PyTuple_New(1));
4639             PyTuple_SetItem(tmp3,0,zeNumpyRepr); Py_XINCREF(zeNumpyRepr);
4640             PyObject *tmp2(PyObject_CallObject(initMeth,tmp3));
4641             Py_XDECREF(tmp2);
4642             Py_DECREF(tmp3);
4643           }
4644         Py_DECREF(initMeth);
4645         return instance;
4646       }
4647       
4648       PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4649       {
4650 #ifdef WITH_NUMPY
4651         if(!self->isAllocated())
4652           throw INTERP_KERNEL::Exception("PyWrap of DataArrayInt.__getnewargs__ : self is not allocated !");
4653         PyObject *ret(PyTuple_New(1));
4654         PyObject *ret0(PyDict_New());
4655         PyObject *numpyArryObj(MEDCoupling_DataArrayInt_toNumPyArray(self));
4656         {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
4657           PyObject *tmp1(PyInt_FromLong(0));
4658           PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
4659           PyTuple_SetItem(ret,0,ret0);
4660         }
4661         return ret;
4662 #else
4663         throw INTERP_KERNEL::Exception("PyWrap of DataArrayInt.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
4664 #endif
4665       }
4666     }
4667   };
4668
4669   class DataArrayIntTuple;
4670
4671   class DataArrayIntIterator
4672   {
4673   public:
4674     DataArrayIntIterator(DataArrayInt *da);
4675     ~DataArrayIntIterator();
4676     %extend
4677     {
4678       PyObject *next()
4679       {
4680         DataArrayIntTuple *ret=self->nextt();
4681         if(ret)
4682           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4683         else
4684           {
4685             PyErr_SetString(PyExc_StopIteration,"No more data.");
4686             return 0;
4687           }
4688       }
4689     }
4690   };
4691
4692   class DataArrayIntTuple
4693   {
4694   public:
4695     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4696     DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4697     %extend
4698     {
4699       std::string __str__() const throw(INTERP_KERNEL::Exception)
4700       {
4701         return self->repr();
4702       }
4703
4704       int __int__() const throw(INTERP_KERNEL::Exception)
4705       {
4706         return self->intValue();
4707       }
4708
4709       DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4710       {
4711         return self->buildDAInt(1,self->getNumberOfCompo());
4712       }
4713
4714       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4715       {
4716         MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4717         MEDCoupling_DataArrayInt____iadd___(ret,0,obj);
4718         Py_XINCREF(trueSelf);
4719         return trueSelf;
4720       }
4721   
4722       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4723       {
4724         MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4725         MEDCoupling_DataArrayInt____isub___(ret,0,obj);
4726         Py_XINCREF(trueSelf);
4727         return trueSelf;
4728       }
4729   
4730       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4731       {
4732         MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4733         MEDCoupling_DataArrayInt____imul___(ret,0,obj);
4734         Py_XINCREF(trueSelf);
4735         return trueSelf;
4736       }
4737
4738       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4739       {
4740         MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4741         MEDCoupling_DataArrayInt____idiv___(ret,0,obj);
4742         Py_XINCREF(trueSelf);
4743         return trueSelf;
4744       }
4745
4746       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4747       {
4748         MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4749         MEDCoupling_DataArrayInt____imod___(ret,0,obj);
4750         Py_XINCREF(trueSelf);
4751         return trueSelf;
4752       }
4753
4754       PyObject *__len__() throw(INTERP_KERNEL::Exception)
4755       {
4756         return PyInt_FromLong(self->getNumberOfCompo());
4757       }
4758   
4759       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4760       {
4761         const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4762         int sw;
4763         int singleVal;
4764         std::vector<int> multiVal;
4765         std::pair<int, std::pair<int,int> > slic;
4766         MEDCoupling::DataArrayInt *daIntTyypp=0;
4767         const int *pt=self->getConstPointer();
4768         int nbc=self->getNumberOfCompo();
4769         convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4770         switch(sw)
4771           {
4772           case 1:
4773             {
4774               if(singleVal>=nbc)
4775                 {
4776                   std::ostringstream oss;
4777                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4778                   PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4779                   return 0;
4780                 }
4781               if(singleVal>=0)
4782                 return PyInt_FromLong(pt[singleVal]);
4783               else
4784                 {
4785                   if(nbc+singleVal>0)
4786                     return PyInt_FromLong(pt[nbc+singleVal]);
4787                   else
4788                     {
4789                       std::ostringstream oss;
4790                       oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4791                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4792                     }
4793                 }
4794             }
4795           case 2:
4796             {
4797               PyObject *t=PyTuple_New(multiVal.size());
4798               for(int j=0;j<(int)multiVal.size();j++)
4799                 {
4800                   int cid=multiVal[j];
4801                   if(cid>=nbc)
4802                     {
4803                       std::ostringstream oss;
4804                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4805                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4806                     }
4807                   PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4808                 }
4809               return t;
4810             }
4811           case 3:
4812             {
4813               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4814               PyObject *t=PyTuple_New(sz);
4815               for(int j=0;j<sz;j++)
4816                 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4817               return t;
4818             }
4819           default:
4820             throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4821           }
4822       }
4823
4824       DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4825       {
4826         const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4827         const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4828         int sw1,sw2;
4829         int singleValV;
4830         std::vector<int> multiValV;
4831         std::pair<int, std::pair<int,int> > slicV;
4832         MEDCoupling::DataArrayIntTuple *daIntTyyppV=0;
4833         int nbc=self->getNumberOfCompo();
4834         convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4835         int singleVal;
4836         std::vector<int> multiVal;
4837         std::pair<int, std::pair<int,int> > slic;
4838         MEDCoupling::DataArrayInt *daIntTyypp=0;
4839         int *pt=self->getPointer();
4840         convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4841         switch(sw2)
4842           {
4843           case 1:
4844             {
4845               if(singleVal>=nbc)
4846                 {
4847                   std::ostringstream oss;
4848                   oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4849                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4850                 }
4851               switch(sw1)
4852                 {
4853                 case 1:
4854                   {
4855                     pt[singleVal]=singleValV;
4856                     return self;
4857                   }
4858                 case 2:
4859                   {
4860                     if(multiValV.size()!=1)
4861                       {
4862                         std::ostringstream oss;
4863                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4864                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4865                       }
4866                     pt[singleVal]=multiValV[0];
4867                     return self;
4868                   }
4869                 case 4:
4870                   {
4871                     pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4872                     return self;
4873                   }
4874                 default:
4875                   throw INTERP_KERNEL::Exception(msg);
4876                 }
4877             }
4878           case 2:
4879             {
4880               switch(sw1)
4881                 {
4882                 case 1:
4883                   {
4884                     for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4885                       {
4886                         if(*it>=nbc)
4887                           {
4888                             std::ostringstream oss;
4889                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4890                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4891                           }
4892                         pt[*it]=singleValV;
4893                       }
4894                     return self;
4895                   }
4896                 case 2:
4897                   {
4898                     if(multiVal.size()!=multiValV.size())
4899                       {
4900                         std::ostringstream oss;
4901                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4902                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4903                       }
4904                     for(int i=0;i<(int)multiVal.size();i++)
4905                       {
4906                         int pos=multiVal[i];
4907                         if(pos>=nbc)
4908                           {
4909                             std::ostringstream oss;
4910                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4911                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4912                           }
4913                         pt[multiVal[i]]=multiValV[i];
4914                       }
4915                     return self;
4916                   }
4917                 case 4:
4918                   {
4919                     const int *ptV=daIntTyyppV->getConstPointer();
4920                     if(nbc>daIntTyyppV->getNumberOfCompo())
4921                       {
4922                         std::ostringstream oss;
4923                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4924                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4925                       }
4926                     std::copy(ptV,ptV+nbc,pt);
4927                     return self;
4928                   }
4929                 default:
4930                   throw INTERP_KERNEL::Exception(msg);
4931                 }
4932             }
4933           case 3:
4934             {
4935               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4936               switch(sw1)
4937                 {
4938                 case 1:
4939                   {
4940                     for(int j=0;j<sz;j++)
4941                       pt[slic.first+j*slic.second.second]=singleValV;
4942                     return self;
4943                   }
4944                 case 2:
4945                   {
4946                     if(sz!=(int)multiValV.size())
4947                       {
4948                         std::ostringstream oss;
4949                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4950                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4951                       }
4952                     for(int j=0;j<sz;j++)
4953                       pt[slic.first+j*slic.second.second]=multiValV[j];
4954                     return self;
4955                   }
4956                 case 4:
4957                   {
4958                     const int *ptV=daIntTyyppV->getConstPointer();
4959                     if(sz>daIntTyyppV->getNumberOfCompo())
4960                       {
4961                         std::ostringstream oss;
4962                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4963                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4964                       }
4965                     for(int j=0;j<sz;j++)
4966                       pt[slic.first+j*slic.second.second]=ptV[j];
4967                     return self;
4968                   }
4969                 default:
4970                   throw INTERP_KERNEL::Exception(msg);
4971                 }
4972             }
4973           default:
4974             throw INTERP_KERNEL::Exception(msg);
4975           }
4976       }
4977     }
4978   };
4979
4980   class DataArrayChar : public DataArray
4981   {
4982   public:
4983     virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4984     int getHashCode() const throw(INTERP_KERNEL::Exception);
4985     bool empty() const throw(INTERP_KERNEL::Exception);
4986     void deepCopyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4987     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4988     void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4989     char popBackSilent() throw(INTERP_KERNEL::Exception);
4990     void pack() const throw(INTERP_KERNEL::Exception);
4991     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4992     bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4993     bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4994     void reverse() throw(INTERP_KERNEL::Exception);
4995     void fillWithZero() throw(INTERP_KERNEL::Exception);
4996     void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4997     std::string repr() const throw(INTERP_KERNEL::Exception);
4998     std::string reprZip() const throw(INTERP_KERNEL::Exception);
4999     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
5000     DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
5001     DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
5002     DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
5003     bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
5004     void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
5005     DataArrayChar *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
5006     DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
5007     void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
5008     void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
5009     char front() const throw(INTERP_KERNEL::Exception);
5010     char back() const throw(INTERP_KERNEL::Exception);
5011     void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
5012     void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
5013     char *getPointer() throw(INTERP_KERNEL::Exception);
5014     DataArrayInt *findIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
5015     DataArrayInt *findIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
5016     int findIdFirstEqualTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
5017     bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
5018     char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
5019     char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
5020     char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
5021     char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
5022     DataArrayInt *findIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
5023     static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
5024     static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
5025     %extend
5026     {
5027       int __len__() const throw(INTERP_KERNEL::Exception)
5028       {
5029         if(self->isAllocated())
5030           {
5031             return self->getNumberOfTuples();
5032           }
5033         else
5034           {
5035             throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
5036           }
5037       }
5038       
5039       PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
5040       {
5041         std::string ret1;
5042         bool ret0=self->isEqualIfNotWhy(other,ret1);
5043         PyObject *ret=PyTuple_New(2);
5044         PyObject *ret0Py=ret0?Py_True:Py_False;
5045         Py_XINCREF(ret0Py);
5046         PyTuple_SetItem(ret,0,ret0Py);
5047         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5048         return ret;
5049       }
5050       
5051       DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
5052       {
5053         void *da=0;
5054         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
5055         if (!SWIG_IsOK(res1))
5056           {
5057             int size;
5058             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5059             if(size!=self->getNumberOfTuples())
5060               {
5061                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5062               }
5063             return self->renumber(tmp);
5064           }
5065         else
5066           {
5067             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5068             if(!da2)
5069               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5070             da2->checkAllocated();
5071             int size=self->getNumberOfTuples();
5072             if(size!=self->getNumberOfTuples())
5073               {
5074                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5075               }
5076             return self->renumber(da2->getConstPointer());
5077           }
5078       }
5079       
5080       DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
5081       {
5082         void *da=0;
5083         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
5084         if (!SWIG_IsOK(res1))
5085           {
5086             int size;
5087             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5088             if(size!=self->getNumberOfTuples())
5089               {
5090                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5091               }
5092             return self->renumberR(tmp);
5093           }
5094         else
5095           {
5096             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5097             if(!da2)
5098               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5099             da2->checkAllocated();
5100             int size=self->getNumberOfTuples();
5101             if(size!=self->getNumberOfTuples())
5102               {
5103                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5104               }
5105             return self->renumberR(da2->getConstPointer());
5106           }
5107       }
5108       
5109       DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
5110       {
5111         void *da=0;
5112         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
5113         if (!SWIG_IsOK(res1))
5114           {
5115             int size;
5116             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5117             if(size!=self->getNumberOfTuples())
5118               {
5119                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5120               }
5121             return self->renumberAndReduce(tmp,newNbOfTuple);
5122           }
5123         else
5124           {
5125             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5126             if(!da2)
5127               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5128             da2->checkAllocated();
5129             int size=self->getNumberOfTuples();
5130             if(size!=self->getNumberOfTuples())
5131               {
5132                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5133               }
5134             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
5135           }
5136       }
5137       
5138       static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
5139       {
5140         std::vector<const MEDCoupling::DataArrayChar *> tmp;
5141         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
5142         return DataArrayChar::Aggregate(tmp);
5143       }
5144       
5145       static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
5146       {
5147         std::vector<const MEDCoupling::DataArrayChar *> tmp;
5148         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
5149         return DataArrayChar::Meld(tmp);
5150       }
5151     }
5152   };
5153   
5154   class DataArrayByteIterator;
5155
5156   class DataArrayByte : public DataArrayChar
5157   {
5158   public:
5159     static DataArrayByte *New();
5160     DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
5161     DataArrayByte *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
5162     char byteValue() const throw(INTERP_KERNEL::Exception);
5163     %extend
5164     {
5165       DataArrayByte() throw(INTERP_KERNEL::Exception)
5166         {
5167           return DataArrayByte::New();
5168         }
5169
5170       static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5171       {
5172         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) !";
5173         if(PyList_Check(elt0) || PyTuple_Check(elt0))
5174           {
5175             if(nbOfTuples)
5176               {
5177                 if(PyInt_Check(nbOfTuples))
5178                   {
5179                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5180                     if(nbOfTuples1<0)
5181                       throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
5182                     if(nbOfComp)
5183                       {
5184                         if(PyInt_Check(nbOfComp))
5185                           {//DataArrayByte.New([1,3,4,5],2,2)
5186                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5187                             if(nbOfCompo<0)
5188                               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
5189                             MCAuto<DataArrayByte> ret=DataArrayByte::New();
5190                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5191                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5192                             return ret.retn();
5193                           }
5194                         else
5195                           throw INTERP_KERNEL::Exception(msg);
5196                       }
5197                     else
5198                       {//DataArrayByte.New([1,3,4],3)
5199                         MCAuto<DataArrayByte> ret=DataArrayByte::New();
5200                         int tmpp1=-1;
5201                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5202                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5203                         return ret.retn();
5204                       }
5205                   }
5206                 else
5207                   throw INTERP_KERNEL::Exception(msg);
5208               }
5209             else
5210               {// DataArrayByte.New([1,3,4])
5211                 MCAuto<DataArrayByte> ret=DataArrayByte::New();
5212                 int tmpp1=-1,tmpp2=-1;
5213                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5214                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5215                 return ret.retn();
5216               }
5217           }
5218         else if(PyInt_Check(elt0))
5219           {
5220             int nbOfTuples1=PyInt_AS_LONG(elt0);
5221             if(nbOfTuples1<0)
5222               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
5223             if(nbOfTuples)
5224               {
5225                 if(!nbOfComp)
5226                   {
5227                     if(PyInt_Check(nbOfTuples))
5228                       {//DataArrayByte.New(5,2)
5229                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5230                         if(nbOfCompo<0)
5231                           throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
5232                         MCAuto<DataArrayByte> ret=DataArrayByte::New();
5233                         ret->alloc(nbOfTuples1,nbOfCompo);
5234                         return ret.retn();
5235                       }
5236                     else
5237                       throw INTERP_KERNEL::Exception(msg);
5238                   }
5239                 else
5240                   throw INTERP_KERNEL::Exception(msg);
5241               }
5242             else
5243               {//DataArrayByte.New(5)
5244                 MCAuto<DataArrayByte> ret=DataArrayByte::New();
5245                 ret->alloc(nbOfTuples1,1);
5246                 return ret.retn();
5247               }
5248           }
5249         else
5250           throw INTERP_KERNEL::Exception(msg);
5251       }
5252
5253       DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5254         {
5255           return MEDCoupling_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5256         }
5257    
5258       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5259       {
5260         std::ostringstream oss;
5261         self->reprQuickOverview(oss);
5262         return oss.str();
5263       }
5264   
5265       int __int__() const throw(INTERP_KERNEL::Exception)
5266       {
5267         return (int) self->byteValue();
5268       }
5269
5270       DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
5271       {
5272         return self->iterator();
5273       }
5274
5275       int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5276       {
5277         return (int)self->getIJ(tupleId,compoId);
5278       }
5279       
5280       int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5281       {
5282         return (int)self->getIJSafe(tupleId,compoId);
5283       }
5284
5285       std::string __str__() const throw(INTERP_KERNEL::Exception)
5286       {
5287         return self->repr();
5288       }
5289
5290       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5291       {
5292         const char *vals=self->getConstPointer();
5293         int nbOfComp=self->getNumberOfComponents();
5294         int nbOfTuples=self->getNumberOfTuples();
5295         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5296       }
5297    
5298       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5299       {
5300         int sz=-1,sw=-1;
5301         int ival=-1; std::vector<int> ivval;
5302         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5303         std::vector<char> vals(sz);
5304         std::copy(pt,pt+sz,vals.begin());
5305         return self->presenceOfTuple(vals);
5306       }
5307
5308       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5309       {
5310         int sz=-1,sw=-1;
5311         int ival=-1; std::vector<int> ivval;
5312         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5313         std::vector<char> vals2(sz);
5314         std::copy(pt,pt+sz,vals2.begin());
5315         return self->presenceOfValue(vals2);
5316       }
5317
5318       int findIdFirstEqual(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5319       {
5320         int sz=-1,sw=-1;
5321         int ival=-1; std::vector<int> ivval;
5322         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5323         std::vector<char> vals2(sz);
5324         std::copy(pt,pt+sz,vals2.begin());
5325         return self->findIdFirstEqual(vals2);
5326       }
5327
5328       int findIdFirstEqualTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5329       {
5330         int sz=-1,sw=-1;
5331         int ival=-1; std::vector<int> ivval;
5332         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5333         std::vector<char> vals(sz);
5334         std::copy(pt,pt+sz,vals.begin());
5335         return self->findIdFirstEqualTuple(vals);
5336       }
5337
5338       int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5339       {
5340         int sz=-1,sw=-1;
5341         int ival=-1; std::vector<int> ivval;
5342         const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
5343         std::vector<char> vals(sz);
5344         std::copy(pt,pt+sz,vals.begin());
5345         return self->findIdSequence(vals);
5346       }
5347
5348       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5349       {
5350         int sz=self->getNumberOfComponents();
5351         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
5352         self->getTuple(tupleId,tmp);
5353         PyObject *ret=PyTuple_New(sz);
5354         for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
5355         return ret;
5356       }
5357
5358       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5359       {
5360         int tmp;
5361         int r1=(int)self->getMaxValue(tmp);
5362         PyObject *ret=PyTuple_New(2);
5363         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5364         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5365         return ret;
5366       }
5367
5368       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5369       {
5370         int tmp;
5371         int r1=(int)self->getMinValue(tmp);
5372         PyObject *ret=PyTuple_New(2);
5373         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5374         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5375         return ret;
5376       }
5377
5378       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5379       {
5380         int nbOfCompo=self->getNumberOfComponents();
5381         switch(nbOfCompo)
5382           {
5383           case 1:
5384             {
5385               if(PyInt_Check(obj))
5386                 {
5387                   int val=(int)PyInt_AS_LONG(obj);
5388                   return self->findIdFirstEqual(val);
5389                 }
5390               else
5391                 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
5392             }
5393           default:
5394             return MEDCoupling_DataArrayByte_findIdFirstEqualTuple(self,obj);
5395           }
5396       }
5397
5398       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5399       {
5400         int nbOfCompo=self->getNumberOfComponents();
5401         switch(nbOfCompo)
5402           {
5403           case 0:
5404             return false;
5405           case 1:
5406             {
5407               if(PyInt_Check(obj))
5408                 {
5409                   int val=(int)PyInt_AS_LONG(obj);
5410                   return self->presenceOfValue(val);
5411                 }
5412               else
5413                 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5414             }
5415           default:
5416             return MEDCoupling_DataArrayByte_presenceOfTuple(self,obj);
5417           }
5418       }
5419
5420       DataArrayByte *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5421       {
5422         self->checkAllocated();
5423         const char msg[]="Unexpected situation in __setitem__ !";
5424         int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
5425         int sw1,sw2;
5426         int i1;
5427         std::vector<int> v1;
5428         DataArrayInt *d1=0;
5429         DataArrayIntTuple *dd1=0;
5430         convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5431         int it1,ic1;
5432         std::vector<int> vt1,vc1;
5433         std::pair<int, std::pair<int,int> > pt1,pc1;
5434         DataArrayInt *dt1=0,*dc1=0;
5435         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5436         MCAuto<DataArrayInt> tmp;
5437         switch(sw2)
5438           {
5439           case 1:
5440             {
5441               switch(sw1)
5442                 {
5443                 case 1:
5444                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5445                   return self;
5446                 default:
5447                   throw INTERP_KERNEL::Exception(msg);
5448                 }
5449               break;
5450             }
5451           case 2:
5452             {
5453               switch(sw1)
5454                 {
5455                 case 1:
5456                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5457                   return self;
5458                 default:
5459                   throw INTERP_KERNEL::Exception(msg);
5460                 }
5461               break;
5462             }
5463           case 3:
5464             {
5465               switch(sw1)
5466                 {
5467                 case 1:
5468                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5469                   return self;
5470                 default:
5471                   throw INTERP_KERNEL::Exception(msg);
5472                 }
5473               break;
5474             }
5475           case 4:
5476             {
5477               switch(sw1)
5478                 {
5479                 case 1:
5480                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5481                   return self;
5482                 default:
5483                   throw INTERP_KERNEL::Exception(msg);
5484                 }
5485               break;
5486             }
5487           case 5:
5488             {
5489               switch(sw1)
5490                 {
5491                 case 1:
5492                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5493                   return self;
5494                 default:
5495                   throw INTERP_KERNEL::Exception(msg);
5496                 }
5497               break;
5498             }
5499           case 6:
5500             {
5501               switch(sw1)
5502                 {
5503                 case 1:
5504                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5505                   return self;
5506                 default:
5507                   throw INTERP_KERNEL::Exception(msg);
5508                 }
5509               break;
5510             }
5511           case 7:
5512             {
5513               switch(sw1)
5514                 {
5515                 case 1:
5516                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5517                   return self;
5518                 default:
5519                   throw INTERP_KERNEL::Exception(msg);
5520                 }
5521               break;
5522             }
5523           case 8:
5524             {
5525               switch(sw1)
5526                 {
5527                 case 1:
5528                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5529                   return self;
5530                 default:
5531                   throw INTERP_KERNEL::Exception(msg);
5532                 }
5533               break;
5534             }
5535           case 9:
5536             {
5537               switch(sw1)
5538                 {
5539                 case 1:
5540                   self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5541                   return self;
5542                 default:
5543                   throw INTERP_KERNEL::Exception(msg);
5544                 }
5545               break;
5546             }
5547           case 10:
5548             {
5549               switch(sw1)
5550                 {
5551                 case 1:
5552                   self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5553                   return self;
5554                 default:
5555                   throw INTERP_KERNEL::Exception(msg);
5556                 }
5557               break;
5558             }
5559           case 11:
5560             {
5561               switch(sw1)
5562                 {
5563                 case 1:
5564                   self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5565                   return self;
5566                 default:
5567                   throw INTERP_KERNEL::Exception(msg);
5568                 }
5569               break;
5570             }
5571           case 12:
5572             {
5573               switch(sw1)
5574                 {
5575                 case 1:
5576                   self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5577                   return self;
5578                 default:
5579                   throw INTERP_KERNEL::Exception(msg);
5580                 }
5581               break;
5582             }
5583           case 13:
5584             {
5585               switch(sw1)
5586                 {
5587                 case 1:
5588                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5589                   return self;
5590                 default:
5591                   throw INTERP_KERNEL::Exception(msg);
5592                 }
5593               break;
5594             }
5595           case 14:
5596             {
5597               switch(sw1)
5598                 {
5599                 case 1:
5600                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5601                   return self;
5602                 default:
5603                   throw INTERP_KERNEL::Exception(msg);
5604                 }
5605               break;
5606             }
5607           case 15:
5608             {
5609               switch(sw1)
5610                 {
5611                 case 1:
5612                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5613                   return self;
5614                 default:
5615                   throw INTERP_KERNEL::Exception(msg);
5616                 }
5617               break;
5618             }
5619           case 16:
5620             {
5621               switch(sw1)
5622                 {
5623                 case 1:
5624                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5625                   return self;
5626                 default:
5627                   throw INTERP_KERNEL::Exception(msg);
5628                 }
5629               break;
5630             }
5631           default:
5632             throw INTERP_KERNEL::Exception(msg);
5633           }
5634         return self;
5635       }
5636     }
5637   };
5638
5639   class DataArrayByteTuple;
5640
5641   class DataArrayByteIterator
5642   {
5643   public:
5644     DataArrayByteIterator(DataArrayByte *da);
5645     ~DataArrayByteIterator();
5646   };
5647
5648   class DataArrayByteTuple
5649   {
5650   public:
5651     std::string repr() const throw(INTERP_KERNEL::Exception);
5652     DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5653     %extend
5654     {
5655       std::string __str__() const throw(INTERP_KERNEL::Exception)
5656       {
5657         return self->repr();
5658       }
5659       
5660       char __int__() const throw(INTERP_KERNEL::Exception)
5661       {
5662         return self->byteValue();
5663       }
5664       
5665       DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5666       {
5667         return self->buildDAByte(1,self->getNumberOfCompo());
5668       }
5669     }
5670   };
5671   
5672   class DataArrayAsciiCharIterator;
5673   
5674   class DataArrayAsciiChar : public DataArrayChar
5675   {
5676   public:
5677     static DataArrayAsciiChar *New();
5678     DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5679     DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
5680     char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5681     %extend
5682     {
5683       DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5684         {
5685           return DataArrayAsciiChar::New();
5686         }
5687
5688       static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5689       {
5690         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) !";
5691         if(PyList_Check(elt0) || PyTuple_Check(elt0))
5692           {
5693             if(nbOfTuples)
5694               {
5695                 if(PyInt_Check(nbOfTuples))
5696                   {
5697                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5698                     if(nbOfTuples1<0)
5699                       throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5700                     if(nbOfComp)
5701                       {
5702                         if(PyInt_Check(nbOfComp))
5703                           {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5704                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5705                             if(nbOfCompo<0)
5706                               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5707                             MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5708                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5709                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5710                             return ret.retn();
5711                           }
5712                         else
5713                           throw INTERP_KERNEL::Exception(msg);
5714                       }
5715                     else
5716                       {//DataArrayAsciiChar.New([1,3,4],3)
5717                         MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5718                         int tmpp1=-1;
5719                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5720                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5721                         return ret.retn();
5722                       }
5723                   }
5724                 else if(PyString_Check(nbOfTuples))
5725                   {
5726                     if(PyString_Size(nbOfTuples)!=1)
5727                       throw INTERP_KERNEL::Exception(msg);
5728                     //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5729                     std::vector<std::string> tmp;
5730                     if(fillStringVector(elt0,tmp))
5731                       return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5732                     else
5733                       throw INTERP_KERNEL::Exception(msg);
5734                   }
5735                 else
5736                   throw INTERP_KERNEL::Exception(msg);
5737               }
5738             else
5739               {
5740                 std::vector<std::string> tmmp;
5741                 if(fillStringVector(elt0,tmmp))
5742                   //DataArrayAsciiChar.New(["abc","de","fghi"])
5743                   return DataArrayAsciiChar::New(tmmp,' ');
5744                 else
5745                   {
5746                     // DataArrayAsciiChar.New([1,3,4])
5747                     MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5748                     int tmpp1=-1,tmpp2=-1;
5749                     std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5750                     ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5751                     return ret.retn();
5752                   }
5753               }
5754           }
5755         else if(PyInt_Check(elt0))
5756           {
5757             int nbOfTuples1=PyInt_AS_LONG(elt0);
5758             if(nbOfTuples1<0)
5759               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5760             if(nbOfTuples)
5761               {
5762                 if(!nbOfComp)
5763                   {
5764                     if(PyInt_Check(nbOfTuples))
5765                       {//DataArrayAsciiChar.New(5,2)
5766                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5767                         if(nbOfCompo<0)
5768                           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5769                         MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5770                         ret->alloc(nbOfTuples1,nbOfCompo);
5771                         return ret.retn();
5772                       }
5773                     else
5774                       throw INTERP_KERNEL::Exception(msg);
5775                   }
5776                 else
5777                   throw INTERP_KERNEL::Exception(msg);
5778               }
5779             else
5780               {//DataArrayAsciiChar.New(5)
5781                 MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5782                 ret->alloc(nbOfTuples1,1);
5783                 return ret.retn();
5784               }
5785           }
5786         else
5787           throw INTERP_KERNEL::Exception(msg);
5788       }
5789
5790       DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5791         {
5792           return MEDCoupling_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5793         }
5794
5795       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5796       {
5797         std::ostringstream oss;
5798         self->reprQuickOverview(oss);
5799         return oss.str();
5800       }
5801
5802       DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5803       {
5804         return self->iterator();
5805       }
5806
5807       std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5808       {
5809         char tmp[2]; tmp[1]='\0';
5810         tmp[0]=self->getIJ(tupleId,compoId);
5811         return std::string(tmp);
5812       }
5813    
5814       std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5815       {
5816         char tmp[2]; tmp[1]='\0';
5817         tmp[0]=self->getIJSafe(tupleId,compoId);
5818         return std::string(tmp);
5819       }
5820
5821       std::string __str__() const throw(INTERP_KERNEL::Exception)
5822       {
5823         return self->repr();
5824       }
5825
5826       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5827       {
5828         const char *vals=self->getConstPointer();
5829         int nbOfComp=self->getNumberOfComponents();
5830         int nbOfTuples=self->getNumberOfTuples();
5831         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5832       }
5833
5834       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5835       {
5836         if(PyString_Check(tupl))
5837           {
5838             Py_ssize_t sz=PyString_Size(tupl);
5839             std::vector<char> vals(sz);
5840             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5841             return self->presenceOfTuple(vals);
5842           }
5843         else
5844           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5845       }
5846    
5847       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5848       {
5849         if(PyString_Check(vals))
5850           {
5851             Py_ssize_t sz=PyString_Size(vals);
5852             std::vector<char> vals2(sz);
5853             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5854             return self->presenceOfValue(vals2);
5855           }
5856         else
5857           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5858       }
5859
5860       int findIdFirstEqual(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5861       {
5862         if(PyString_Check(vals))
5863           {
5864             Py_ssize_t sz=PyString_Size(vals);
5865             std::vector<char> vals2(sz);
5866             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5867             return self->findIdFirstEqual(vals2);
5868           }
5869         else
5870           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqual : only strings in input supported !");
5871       }
5872
5873       int findIdFirstEqualTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5874       {
5875         if(PyString_Check(tupl))
5876           {
5877             Py_ssize_t sz=PyString_Size(tupl);
5878             std::vector<char> vals(sz);
5879             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5880             return self->findIdFirstEqualTuple(vals);
5881           }
5882         else
5883           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqualTuple : only strings in input supported !");
5884       }
5885
5886       int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5887       {
5888         if(PyString_Check(strOrListOfInt))
5889           {
5890             Py_ssize_t sz=PyString_Size(strOrListOfInt);
5891             std::vector<char> vals(sz);
5892             std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5893             return self->findIdSequence(vals);
5894           }
5895         else
5896           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5897       }
5898    
5899       PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5900       {
5901         int sz=self->getNumberOfComponents();
5902         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5903         self->getTuple(tupleId,tmp);
5904         return PyString_FromString(tmp);
5905       }
5906
5907       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5908       {
5909         int tmp;
5910         char tmp2[2]; tmp2[1]='\0';
5911         tmp2[0]=self->getMaxValue(tmp);
5912         PyObject *ret=PyTuple_New(2);
5913         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5914         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5915         return ret;
5916       }
5917
5918       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5919       {
5920         int tmp;
5921         char tmp2[2]; tmp2[1]='\0';
5922         tmp2[0]=self->getMinValue(tmp);
5923         PyObject *ret=PyTuple_New(2);
5924         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5925         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5926         return ret;
5927       }
5928
5929       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5930       {
5931         int nbOfCompo=self->getNumberOfComponents();
5932         switch(nbOfCompo)
5933           {
5934           case 1:
5935             {
5936               if(PyString_Check(obj))
5937                 {
5938                   Py_ssize_t sz=PyString_Size(obj);
5939                   char *pt=PyString_AsString(obj);
5940                   if(sz==1)
5941                     return self->findIdFirstEqual(pt[0]);
5942                   else
5943                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5944                 }
5945               else
5946                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5947             }
5948           default:
5949             return MEDCoupling_DataArrayAsciiChar_findIdFirstEqualTuple(self,obj);
5950           }
5951       }
5952
5953       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5954       {
5955         int nbOfCompo=self->getNumberOfComponents();
5956         switch(nbOfCompo)
5957           {
5958           case 0:
5959             return false;
5960           case 1:
5961             {
5962               if(PyString_Check(obj))
5963                 {
5964                   Py_ssize_t sz=PyString_Size(obj);
5965                   char *pt=PyString_AsString(obj);
5966                   if(sz==1)
5967                     return self->presenceOfValue(pt[0]);
5968                   else
5969                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5970                 }
5971               else
5972                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5973             }
5974           default:
5975             return MEDCoupling_DataArrayAsciiChar_presenceOfTuple(self,obj);
5976           }
5977       }
5978
5979       PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5980       {
5981         int sw,iTypppArr;
5982         std::vector<int> stdvecTyyppArr;
5983         std::pair<int, std::pair<int,int> > sTyyppArr;
5984         MEDCoupling::DataArrayInt *daIntTyypp=0;
5985         convertObjToPossibleCpp2WithNegIntInterp(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5986         switch(sw)
5987           {
5988           case 1:
5989             return MEDCoupling_DataArrayAsciiChar_getTuple(self,iTypppArr);
5990           case 2:
5991             return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5992           case 3:
5993             return convertDataArrayChar(self->selectByTupleIdSafeSlice(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5994           case 4:
5995             return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5996           default:
5997             throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5998           }
5999       }
6000
6001       DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
6002       {
6003         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.";
6004         int sw1,iTypppArr;
6005         std::vector<int> stdvecTyyppArr;
6006         std::pair<int, std::pair<int,int> > sTyyppArr;
6007         MEDCoupling::DataArrayInt *daIntTyypp=0;
6008         int nbOfCompo=self->getNumberOfComponents();
6009         int nbOfTuples=self->getNumberOfTuples();
6010         convertObjToPossibleCpp2WithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
6011         int sw2;
6012         char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
6013         convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
6014         switch(sw1)
6015           {
6016           case 1:
6017             {//obj int
6018               switch(sw2)
6019                 {//value char
6020                 case 1:
6021                   {
6022                     self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
6023                     return self;
6024                   }
6025                   //value string
6026                 case 2:
6027                   {
6028                     MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
6029                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
6030                     return self;
6031                   }
6032                   //value vector<string>
6033                 case 3:
6034                   {
6035                     MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
6036                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
6037                     return self;
6038                   }
6039                   //value DataArrayChar
6040                 case 4:
6041                   {
6042                     self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
6043                     return self;
6044                   }
6045                 default:
6046                   throw INTERP_KERNEL::Exception(msg);
6047                 }
6048             }
6049           case 2:
6050             {//obj list-tuple[int]
6051               switch(sw2)
6052                 {
6053                   {//value char
6054                   case 1:
6055                     {
6056                       self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
6057                       return self;
6058                     }
6059                     //value string
6060                   case 2:
6061                     {
6062                       MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
6063                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
6064                       return self;
6065                     }
6066                     //value vector<string>
6067                   case 3:
6068                     {
6069                       MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
6070                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
6071                       return self;
6072                     }
6073                     //value DataArrayChar
6074                   case 4:
6075                     {
6076                       self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
6077                       return self;
6078                     }
6079                   default:
6080                     throw INTERP_KERNEL::Exception(msg);
6081                   }
6082                 }
6083             }
6084           case 3:
6085             {//slice
6086               switch(sw2)
6087                 {
6088                   {//value char
6089                   case 1:
6090                     {
6091                       self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
6092                       return self;
6093                     }
6094                     //value string
6095                   case 2:
6096                     {
6097                       MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
6098                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
6099                       return self;
6100                     }
6101                     //value vector<string>
6102                   case 3:
6103                     {
6104                       MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
6105                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
6106                       return self;
6107                     }
6108                     //value DataArrayChar
6109                   case 4:
6110                     {
6111                       self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
6112                       return self;
6113                     }
6114                   default:
6115                     throw INTERP_KERNEL::Exception(msg);
6116                   }
6117                 }
6118             }
6119           case 4:
6120             {//DataArrayInt
6121               switch(sw2)
6122                 {
6123                   {//value char
6124                   case 1:
6125                     {
6126                       self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
6127                       return self;
6128                     }
6129                     //value string
6130                   case 2:
6131                     {
6132                       MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
6133                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
6134                       return self;
6135                     }
6136                     //value vector<string>
6137                   case 3:
6138                     {
6139                       MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
6140                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
6141                       return self;
6142                     }
6143                     //value DataArrayChar
6144                   case 4:
6145                     {
6146                       self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
6147                       return self;
6148                     }
6149                   default:
6150                     throw INTERP_KERNEL::Exception(msg);
6151                   }
6152                 }
6153             }
6154           default:
6155             throw INTERP_KERNEL::Exception(msg);
6156           }
6157       }
6158     }
6159   };
6160
6161   class DataArrayAsciiCharTuple;
6162
6163   class DataArrayAsciiCharIterator
6164   {
6165   public:
6166     DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
6167     ~DataArrayAsciiCharIterator();
6168     %extend
6169     {
6170       PyObject *next()
6171       {
6172         DataArrayAsciiCharTuple *ret=self->nextt();
6173         if(ret)
6174           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
6175         else
6176           {
6177             PyErr_SetString(PyExc_StopIteration,"No more data.");
6178             return 0;
6179           }
6180       }
6181     }
6182   };
6183
6184   class DataArrayAsciiCharTuple
6185   {
6186   public:
6187     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
6188     DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
6189     %extend
6190     {
6191       std::string __str__() const throw(INTERP_KERNEL::Exception)
6192       {
6193         return self->repr();
6194       }
6195       
6196       DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
6197       {
6198         return self->buildDAAsciiChar(1,self->getNumberOfCompo());
6199       }
6200     }
6201   };
6202 }