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