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