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