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