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