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