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