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