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