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