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