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