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