Salome HOME
Some minor refactoring for swig
[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         void *argp;
1536         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1537           {
1538             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1539             if(other)
1540               {
1541                 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1542                 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1543                 Py_XDECREF(tmp);
1544                 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1545               }
1546             else
1547               throw INTERP_KERNEL::Exception(msg);
1548           }
1549         //
1550         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1551         switch(sw)
1552           {
1553           case 1:
1554             {
1555               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1556               ret->applyLin(1.,val);
1557               return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1558             }
1559           case 2:
1560             {
1561               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1562             }
1563           case 3:
1564             {
1565               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1566               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1567             }
1568           case 4:
1569             {
1570               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1571               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1572             }
1573           default:
1574             throw INTERP_KERNEL::Exception(msg);
1575           }
1576       }
1577
1578       DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1579       {
1580         const char msg[]="Unexpected situation in __radd__ !";
1581         double val;
1582         DataArrayDouble *a;
1583         DataArrayDoubleTuple *aa;
1584         std::vector<double> bb;
1585         int sw;
1586         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1587         switch(sw)
1588           {
1589           case 1:
1590             {
1591               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1592               ret->applyLin(1.,val);
1593               return ret.retn();
1594             }
1595           case 3:
1596             {
1597               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1598               return DataArrayDouble::Add(self,aaa);
1599             }
1600           case 4:
1601             {
1602               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1603               return DataArrayDouble::Add(self,aaa);
1604             }
1605           default:
1606             throw INTERP_KERNEL::Exception(msg);
1607           }
1608       }
1609    
1610       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1611       {
1612         const char msg[]="Unexpected situation in __iadd__ !";
1613         double val;
1614         DataArrayDouble *a;
1615         DataArrayDoubleTuple *aa;
1616         std::vector<double> bb;
1617         int sw;
1618         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1619         switch(sw)
1620           {
1621           case 1:
1622             {
1623               self->applyLin(1.,val);
1624               Py_XINCREF(trueSelf);
1625               return trueSelf;
1626             }
1627           case 2:
1628             {
1629               self->addEqual(a);
1630               Py_XINCREF(trueSelf);
1631               return trueSelf;
1632             }
1633           case 3:
1634             {
1635               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1636               self->addEqual(aaa);
1637               Py_XINCREF(trueSelf);
1638               return trueSelf;
1639             }
1640           case 4:
1641             {
1642               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1643               self->addEqual(aaa);
1644               Py_XINCREF(trueSelf);
1645               return trueSelf;
1646             }
1647           default:
1648             throw INTERP_KERNEL::Exception(msg);
1649           }
1650       }
1651
1652       PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1653       {
1654         const char msg[]="Unexpected situation in __sub__ !";
1655         double val;
1656         DataArrayDouble *a;
1657         DataArrayDoubleTuple *aa;
1658         std::vector<double> bb;
1659         int sw;
1660         //
1661         void *argp;
1662         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1663           {
1664             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1665             if(other)
1666               {
1667                 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1668                 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1669                 Py_XDECREF(tmp);
1670                 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1671               }
1672             else
1673               throw INTERP_KERNEL::Exception(msg);
1674           }
1675         //
1676         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1677         switch(sw)
1678           {
1679           case 1:
1680             {
1681               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1682               ret->applyLin(1.,-val);
1683               return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1684             }
1685           case 2:
1686             {
1687               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1688             }
1689           case 3:
1690             {
1691               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1692               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1693             }
1694           case 4:
1695             {
1696               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1697               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1698             }
1699           default:
1700             throw INTERP_KERNEL::Exception(msg);
1701           }
1702       }
1703
1704       DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1705       {
1706         const char msg[]="Unexpected situation in __rsub__ !";
1707         double val;
1708         DataArrayDouble *a;
1709         DataArrayDoubleTuple *aa;
1710         std::vector<double> bb;
1711         int sw;
1712         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1713         switch(sw)
1714           {
1715           case 1:
1716             {
1717               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1718               ret->applyLin(-1.,val);
1719               return ret.retn();
1720             }
1721           case 3:
1722             {
1723               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1724               return DataArrayDouble::Substract(aaa,self);
1725             }
1726           case 4:
1727             {
1728               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1729               return DataArrayDouble::Substract(aaa,self);
1730             }
1731           default:
1732             throw INTERP_KERNEL::Exception(msg);
1733           }
1734       }
1735
1736       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1737       {
1738         const char msg[]="Unexpected situation in __isub__ !";
1739         double val;
1740         DataArrayDouble *a;
1741         DataArrayDoubleTuple *aa;
1742         std::vector<double> bb;
1743         int sw;
1744         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1745         switch(sw)
1746           {
1747           case 1:
1748             {
1749               self->applyLin(1,-val);
1750               Py_XINCREF(trueSelf);
1751               return trueSelf;
1752             }
1753           case 2:
1754             {
1755               self->substractEqual(a);
1756               Py_XINCREF(trueSelf);
1757               return trueSelf;
1758             }
1759           case 3:
1760             {
1761               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1762               self->substractEqual(aaa);
1763               Py_XINCREF(trueSelf);
1764               return trueSelf;
1765             }
1766           case 4:
1767             {
1768               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1769               self->substractEqual(aaa);
1770               Py_XINCREF(trueSelf);
1771               return trueSelf;
1772             }
1773           default:
1774             throw INTERP_KERNEL::Exception(msg);
1775           }
1776       }
1777
1778       PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1779       {
1780         const char msg[]="Unexpected situation in __mul__ !";
1781         double val;
1782         DataArrayDouble *a;
1783         DataArrayDoubleTuple *aa;
1784         std::vector<double> bb;
1785         int sw;
1786         //
1787         void *argp;
1788         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1789           {
1790             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1791             if(other)
1792               {
1793                 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1794                 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1795                 Py_XDECREF(tmp);
1796                 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1797               }
1798             else
1799               throw INTERP_KERNEL::Exception(msg);
1800           }
1801         //
1802         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1803         switch(sw)
1804           {
1805           case 1:
1806             {
1807               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1808               ret->applyLin(val,0.);
1809               return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1810             }
1811           case 2:
1812             {
1813               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1814             }
1815           case 3:
1816             {
1817               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1818               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1819             }
1820           case 4:
1821             {
1822               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1823               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1824             }
1825           default:
1826             throw INTERP_KERNEL::Exception(msg);
1827           }
1828       }
1829
1830       DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1831       {
1832         const char msg[]="Unexpected situation in __rmul__ !";
1833         double val;
1834         DataArrayDouble *a;
1835         DataArrayDoubleTuple *aa;
1836         std::vector<double> bb;
1837         int sw;
1838         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1839         switch(sw)
1840           {
1841           case 1:
1842             {
1843               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1844               ret->applyLin(val,0.);
1845               return ret.retn();
1846             }
1847           case 3:
1848             {
1849               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1850               return DataArrayDouble::Multiply(self,aaa);
1851             }
1852           case 4:
1853             {
1854               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1855               return DataArrayDouble::Multiply(self,aaa);
1856             }
1857           default:
1858             throw INTERP_KERNEL::Exception(msg);
1859           }
1860       }
1861
1862       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1863       {
1864         const char msg[]="Unexpected situation in __imul__ !";
1865         double val;
1866         DataArrayDouble *a;
1867         DataArrayDoubleTuple *aa;
1868         std::vector<double> bb;
1869         int sw;
1870         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1871         switch(sw)
1872           {
1873           case 1:
1874             {
1875               self->applyLin(val,0.);
1876               Py_XINCREF(trueSelf);
1877               return trueSelf;
1878             }
1879           case 2:
1880             {
1881               self->multiplyEqual(a);
1882               Py_XINCREF(trueSelf);
1883               return trueSelf;
1884             }
1885           case 3:
1886             {
1887               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1888               self->multiplyEqual(aaa);
1889               Py_XINCREF(trueSelf);
1890               return trueSelf;
1891             }
1892           case 4:
1893             {
1894               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1895               self->multiplyEqual(aaa);
1896               Py_XINCREF(trueSelf);
1897               return trueSelf;
1898             }
1899           default:
1900             throw INTERP_KERNEL::Exception(msg);
1901           }
1902       }
1903
1904       PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1905       {
1906         const char msg[]="Unexpected situation in __div__ !";
1907         double val;
1908         DataArrayDouble *a;
1909         DataArrayDoubleTuple *aa;
1910         std::vector<double> bb;
1911         int sw;
1912         //
1913         void *argp;
1914         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1915           {
1916             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1917             if(other)
1918               {
1919                 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1920                 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1921                 Py_XDECREF(tmp);
1922                 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1923               }
1924             else
1925               throw INTERP_KERNEL::Exception(msg);
1926           }
1927         //
1928         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1929         switch(sw)
1930           {
1931           case 1:
1932             {
1933               if(val==0.)
1934                 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1935               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1936               ret->applyLin(1/val,0.);
1937               return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1938             }
1939           case 2:
1940             {
1941               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1942             }
1943           case 3:
1944             {
1945               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1946               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1947             }
1948           case 4:
1949             {
1950               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1951               return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1952             }
1953           default:
1954             throw INTERP_KERNEL::Exception(msg);
1955           }
1956       }
1957
1958       DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1959       {
1960         const char msg[]="Unexpected situation in __rdiv__ !";
1961         double val;
1962         DataArrayDouble *a;
1963         DataArrayDoubleTuple *aa;
1964         std::vector<double> bb;
1965         int sw;
1966         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1967         switch(sw)
1968           {
1969           case 1:
1970             {
1971               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1972               ret->applyInv(val);
1973               return ret.retn();
1974             }
1975           case 3:
1976             {
1977               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1978               return DataArrayDouble::Divide(aaa,self);
1979             }
1980           case 4:
1981             {
1982               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1983               return DataArrayDouble::Divide(aaa,self);
1984             }
1985           default:
1986             throw INTERP_KERNEL::Exception(msg);
1987           }
1988       }
1989
1990       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1991       {
1992         const char msg[]="Unexpected situation in __idiv__ !";
1993         double val;
1994         DataArrayDouble *a;
1995         DataArrayDoubleTuple *aa;
1996         std::vector<double> bb;
1997         int sw;
1998         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1999         switch(sw)
2000           {
2001           case 1:
2002             {
2003               if(val==0.)
2004                 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
2005               self->applyLin(1./val,0.);
2006               Py_XINCREF(trueSelf);
2007               return trueSelf;
2008             }
2009           case 2:
2010             {
2011               self->divideEqual(a);
2012               Py_XINCREF(trueSelf);
2013               return trueSelf;
2014             }
2015           case 3:
2016             {
2017               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2018               self->divideEqual(aaa);
2019               Py_XINCREF(trueSelf);
2020               return trueSelf;
2021             }
2022           case 4:
2023             {
2024               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2025               self->divideEqual(aaa);
2026               Py_XINCREF(trueSelf);
2027               return trueSelf;
2028             }
2029           default:
2030             throw INTERP_KERNEL::Exception(msg);
2031           }
2032       }
2033    
2034       DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2035       {
2036         const char msg[]="Unexpected situation in __pow__ !";
2037         double val;
2038         DataArrayDouble *a;
2039         DataArrayDoubleTuple *aa;
2040         std::vector<double> bb;
2041         int sw;
2042         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2043         switch(sw)
2044           {
2045           case 1:
2046             {
2047               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2048               ret->applyPow(val);
2049               return ret.retn();
2050             }
2051           case 2:
2052             {
2053               return DataArrayDouble::Pow(self,a);
2054             }
2055           case 3:
2056             {
2057               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2058               return DataArrayDouble::Pow(self,aaa);
2059             }
2060           case 4:
2061             {
2062               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2063               return DataArrayDouble::Pow(self,aaa);
2064             }
2065           default:
2066             throw INTERP_KERNEL::Exception(msg);
2067           }
2068       }
2069
2070       DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2071       {
2072         const char msg[]="Unexpected situation in __rpow__ !";
2073         double val;
2074         DataArrayDouble *a;
2075         DataArrayDoubleTuple *aa;
2076         std::vector<double> bb;
2077         int sw;
2078         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2079         switch(sw)
2080           {
2081           case 1:
2082             {
2083               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2084               ret->applyRPow(val);
2085               return ret.retn();
2086             }
2087           case 3:
2088             {
2089               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2090               return DataArrayDouble::Pow(aaa,self);
2091             }
2092           case 4:
2093             {
2094               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2095               return DataArrayDouble::Pow(aaa,self);
2096             }
2097           default:
2098             throw INTERP_KERNEL::Exception(msg);
2099           }
2100       }
2101
2102       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2103       {
2104         const char msg[]="Unexpected situation in __ipow__ !";
2105         double val;
2106         DataArrayDouble *a;
2107         DataArrayDoubleTuple *aa;
2108         std::vector<double> bb;
2109         int sw;
2110         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2111         switch(sw)
2112           {
2113           case 1:
2114             {
2115               self->applyPow(val);
2116               Py_XINCREF(trueSelf);
2117               return trueSelf;
2118             }
2119           case 2:
2120             {
2121               self->powEqual(a);
2122               Py_XINCREF(trueSelf);
2123               return trueSelf;
2124             }
2125           case 3:
2126             {
2127               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2128               self->powEqual(aaa);
2129               Py_XINCREF(trueSelf);
2130               return trueSelf;
2131             }
2132           case 4:
2133             {
2134               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2135               self->powEqual(aaa);
2136               Py_XINCREF(trueSelf);
2137               return trueSelf;
2138             }
2139           default:
2140             throw INTERP_KERNEL::Exception(msg);
2141           }
2142       }
2143    
2144       PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
2145       {
2146         DataArrayInt *c=0,*cI=0;
2147         //
2148         self->computeTupleIdsNearTuples(other,eps,c,cI);
2149         PyObject *ret=PyTuple_New(2);
2150         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2151         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2152         return ret;
2153       }
2154
2155       PyObject *maxPerTupleWithCompoId() const throw(INTERP_KERNEL::Exception)
2156       {
2157         DataArrayInt *ret1=0;
2158         DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
2159         PyObject *ret=PyTuple_New(2);
2160         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2161         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162         return ret;
2163       }
2164     }
2165   };
2166
2167   class DataArrayDoubleTuple;
2168
2169   class DataArrayDoubleIterator
2170   {
2171   public:
2172     DataArrayDoubleIterator(DataArrayDouble *da);
2173     ~DataArrayDoubleIterator();
2174     %extend
2175     {
2176       PyObject *next()
2177       {
2178         DataArrayDoubleTuple *ret=self->nextt();
2179         if(ret)
2180           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2181         else
2182           {
2183             PyErr_SetString(PyExc_StopIteration,"No more data.");
2184             return 0;
2185           }
2186       }
2187     }
2188   };
2189
2190   class DataArrayDoubleTuple
2191   {
2192   public:
2193     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
2194     DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
2195     %extend
2196     {
2197       std::string __str__() const throw(INTERP_KERNEL::Exception)
2198       {
2199         return self->repr();
2200       }
2201
2202       double __float__() const throw(INTERP_KERNEL::Exception)
2203       {
2204         return self->doubleValue();
2205       }
2206
2207       DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
2208       {
2209         return self->buildDADouble(1,self->getNumberOfCompo());
2210       }
2211
2212       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2213       {
2214         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2215         ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2216         Py_XINCREF(trueSelf);
2217         return trueSelf;
2218       }
2219   
2220       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2221       {
2222         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2223         ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2224         Py_XINCREF(trueSelf);
2225         return trueSelf;
2226       }
2227   
2228       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2229       {
2230         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2231         ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2232         Py_XINCREF(trueSelf);
2233         return trueSelf;
2234       }
2235
2236       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2237       {
2238         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2239         ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2240         Py_XINCREF(trueSelf);
2241         return trueSelf;
2242       }
2243
2244       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2245       {
2246         const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2247         int sw;
2248         int singleVal;
2249         std::vector<int> multiVal;
2250         std::pair<int, std::pair<int,int> > slic;
2251         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2252         const double *pt=self->getConstPointer();
2253         int nbc=self->getNumberOfCompo();
2254         convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2255         switch(sw)
2256           {
2257           case 1:
2258             {
2259               if(singleVal>=nbc)
2260                 {
2261                   std::ostringstream oss;
2262                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2263                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2264                 }
2265               if(singleVal>=0)
2266                 return PyFloat_FromDouble(pt[singleVal]);
2267               else
2268                 {
2269                   if(nbc+singleVal>0)
2270                     return PyFloat_FromDouble(pt[nbc+singleVal]);
2271                   else
2272                     {
2273                       std::ostringstream oss;
2274                       oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2275                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2276                     }
2277                 }
2278             }
2279           case 2:
2280             {
2281               PyObject *t=PyTuple_New(multiVal.size());
2282               for(int j=0;j<(int)multiVal.size();j++)
2283                 {
2284                   int cid=multiVal[j];
2285                   if(cid>=nbc)
2286                     {
2287                       std::ostringstream oss;
2288                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2289                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2290                     }
2291                   PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2292                 }
2293               return t;
2294             }
2295           case 3:
2296             {
2297               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2298               PyObject *t=PyTuple_New(sz);
2299               for(int j=0;j<sz;j++)
2300                 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2301               return t;
2302             }
2303           default:
2304             throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2305           }
2306       }
2307
2308       DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2309       {
2310         const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2311         const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2312         int sw1,sw2;
2313         double singleValV;
2314         std::vector<double> multiValV;
2315         ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2316         int nbc=self->getNumberOfCompo();
2317         convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2318         int singleVal;
2319         std::vector<int> multiVal;
2320         std::pair<int, std::pair<int,int> > slic;
2321         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2322         double *pt=self->getPointer();
2323         convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2324         switch(sw2)
2325           {
2326           case 1:
2327             {
2328               if(singleVal>=nbc)
2329                 {
2330                   std::ostringstream oss;
2331                   oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2332                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2333                 }
2334               switch(sw1)
2335                 {
2336                 case 1:
2337                   {
2338                     pt[singleVal]=singleValV;
2339                     return self;
2340                   }
2341                 case 2:
2342                   {
2343                     if(multiValV.size()!=1)
2344                       {
2345                         std::ostringstream oss;
2346                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2347                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2348                       }
2349                     pt[singleVal]=multiValV[0];
2350                     return self;
2351                   }
2352                 case 3:
2353                   {
2354                     pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2355                     return self;
2356                   }
2357                 default:
2358                   throw INTERP_KERNEL::Exception(msg);
2359                 }
2360             }
2361           case 2:
2362             {
2363               switch(sw1)
2364                 {
2365                 case 1:
2366                   {
2367                     for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2368                       {
2369                         if(*it>=nbc)
2370                           {
2371                             std::ostringstream oss;
2372                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2373                             throw INTERP_KERNEL::Exception(oss.str().c_str());
2374                           }
2375                         pt[*it]=singleValV;
2376                       }
2377                     return self;
2378                   }
2379                 case 2:
2380                   {
2381                     if(multiVal.size()!=multiValV.size())
2382                       {
2383                         std::ostringstream oss;
2384                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2385                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2386                       }
2387                     for(int i=0;i<(int)multiVal.size();i++)
2388                       {
2389                         int pos=multiVal[i];
2390                         if(pos>=nbc)
2391                           {
2392                             std::ostringstream oss;
2393                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2394                             throw INTERP_KERNEL::Exception(oss.str().c_str());
2395                           }
2396                         pt[multiVal[i]]=multiValV[i];
2397                       }
2398                     return self;
2399                   }
2400                 case 3:
2401                   {
2402                     const double *ptV=daIntTyyppV->getConstPointer();
2403                     if(nbc>daIntTyyppV->getNumberOfCompo())
2404                       {
2405                         std::ostringstream oss;
2406                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2407                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2408                       }
2409                     std::copy(ptV,ptV+nbc,pt);
2410                     return self;
2411                   }
2412                 default:
2413                   throw INTERP_KERNEL::Exception(msg);
2414                 }
2415             }
2416           case 3:
2417             {
2418               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2419               switch(sw1)
2420                 {
2421                 case 1:
2422                   {
2423                     for(int j=0;j<sz;j++)
2424                       pt[slic.first+j*slic.second.second]=singleValV;
2425                     return self;
2426                   }
2427                 case 2:
2428                   {
2429                     if(sz!=(int)multiValV.size())
2430                       {
2431                         std::ostringstream oss;
2432                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2433                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2434                       }
2435                     for(int j=0;j<sz;j++)
2436                       pt[slic.first+j*slic.second.second]=multiValV[j];
2437                     return self;
2438                   }
2439                 case 3:
2440                   {
2441                     const double *ptV=daIntTyyppV->getConstPointer();
2442                     if(sz>daIntTyyppV->getNumberOfCompo())
2443                       {
2444                         std::ostringstream oss;
2445                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2446                         throw INTERP_KERNEL::Exception(oss.str().c_str());
2447                       }
2448                     for(int j=0;j<sz;j++)
2449                       pt[slic.first+j*slic.second.second]=ptV[j];
2450                     return self;
2451                   }
2452                 default:
2453                   throw INTERP_KERNEL::Exception(msg);
2454                 }
2455             }
2456           default:
2457             throw INTERP_KERNEL::Exception(msg);
2458           }
2459       }
2460     }
2461   };
2462
2463   class DataArrayIntIterator;
2464
2465   class DataArrayInt : public DataArray
2466   {
2467   public:
2468     static DataArrayInt *New();
2469     int intValue() const throw(INTERP_KERNEL::Exception);
2470     int getHashCode() const throw(INTERP_KERNEL::Exception);
2471     bool empty() const throw(INTERP_KERNEL::Exception);
2472     DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2473     void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2474     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2475     void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2476     int popBackSilent() throw(INTERP_KERNEL::Exception);
2477     void pack() const throw(INTERP_KERNEL::Exception);
2478     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2479     bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2480     bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2481     bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2482     DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2483     void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2484     void reverse() throw(INTERP_KERNEL::Exception);
2485     void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2486     bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2487     void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2488     bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2489     void fillWithZero() throw(INTERP_KERNEL::Exception);
2490     void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2491     void iota(int init=0) throw(INTERP_KERNEL::Exception);
2492     std::string repr() const throw(INTERP_KERNEL::Exception);
2493     std::string reprZip() const throw(INTERP_KERNEL::Exception);
2494     DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2495     DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2496     DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2497     DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
2498     DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2499     DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2500     DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2501     DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2502     DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2503     bool isIdentity() const throw(INTERP_KERNEL::Exception);
2504     bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2505     DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2506     void transpose() throw(INTERP_KERNEL::Exception);
2507     DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2508     void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2509     void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2510     void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2511     void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2512     void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2513     int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2514     int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2515     int front() const throw(INTERP_KERNEL::Exception);
2516     int back() const throw(INTERP_KERNEL::Exception);
2517     void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2518     void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2519     int *getPointer() throw(INTERP_KERNEL::Exception);
2520     const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2521     DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2522     const int *begin() const throw(INTERP_KERNEL::Exception);
2523     const int *end() const throw(INTERP_KERNEL::Exception);
2524     DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2525     DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2526     int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2527     int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2528     int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2529     int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2530     int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2531     bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2532     bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2533     bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2534     int count(int value) const throw(INTERP_KERNEL::Exception);
2535     int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2536     int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2537     int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2538     int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2539     int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2540     void abs() throw(INTERP_KERNEL::Exception);
2541     void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2542     void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2543     void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2544     DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2545     void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2546     void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2547     void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2548     void applyPow(int val) throw(INTERP_KERNEL::Exception);
2549     void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2550     DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2551     bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2552     static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2553     static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2554     static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2555     static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2556     static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2557     static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2) throw(INTERP_KERNEL::Exception);
2558     DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2559     DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2560     DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2561     DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2562     DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2563     DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2564     DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2565     void computeOffsets() throw(INTERP_KERNEL::Exception);
2566     void computeOffsets2() throw(INTERP_KERNEL::Exception);
2567     DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2568     DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2569     DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2570     DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2571     DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2572     static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2573     void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2574     static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2575     void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2576     static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2577     void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2578     static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2579     void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2580     static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2581     void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2582     static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2583     void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2584   public:
2585     static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2586     %extend
2587     {
2588       DataArrayInt() throw(INTERP_KERNEL::Exception)
2589         {
2590           return DataArrayInt::New();
2591         }
2592
2593       static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2594       {
2595         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)";
2596         std::string msg(msgBase);
2597 #ifdef WITH_NUMPY
2598         msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2599 #endif
2600         msg+=" !";
2601         if(PyList_Check(elt0) || PyTuple_Check(elt0))
2602           {
2603             if(nbOfTuples)
2604               {
2605                 if(PyInt_Check(nbOfTuples))
2606                   {
2607                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2608                     if(nbOfTuples1<0)
2609                       throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2610                     if(nbOfComp)
2611                       {
2612                         if(PyInt_Check(nbOfComp))
2613                           {//DataArrayInt.New([1,3,4,5],2,2)
2614                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2615                             if(nbOfCompo<0)
2616                               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2617                             MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2618                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2619                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2620                             return ret.retn();
2621                           }
2622                         else
2623                           throw INTERP_KERNEL::Exception(msg.c_str());
2624                       }
2625                     else
2626                       {//DataArrayInt.New([1,3,4],3)
2627                         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2628                         int tmpp1=-1;
2629                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2630                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2631                         return ret.retn();
2632                       }
2633                   }
2634                 else
2635                   throw INTERP_KERNEL::Exception(msg.c_str());
2636               }
2637             else
2638               {// DataArrayInt.New([1,3,4])
2639                 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2640                 int tmpp1=-1,tmpp2=-1;
2641                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2642                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2643                 return ret.retn();
2644               }
2645           }
2646         else if(PyInt_Check(elt0))
2647           {
2648             int nbOfTuples1=PyInt_AS_LONG(elt0);
2649             if(nbOfTuples1<0)
2650               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2651             if(nbOfTuples)
2652               {
2653                 if(!nbOfComp)
2654                   {
2655                     if(PyInt_Check(nbOfTuples))
2656                       {//DataArrayInt.New(5,2)
2657                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2658                         if(nbOfCompo<0)
2659                           throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2660                         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2661                         ret->alloc(nbOfTuples1,nbOfCompo);
2662                         return ret.retn();
2663                       }
2664                     else
2665                       throw INTERP_KERNEL::Exception(msg.c_str());
2666                   }
2667                 else
2668                   throw INTERP_KERNEL::Exception(msg.c_str());
2669               }
2670             else
2671               {//DataArrayInt.New(5)
2672                 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2673                 ret->alloc(nbOfTuples1,1);
2674                 return ret.retn();
2675               }
2676           }
2677 #ifdef WITH_NUMPY
2678         else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2679           {//DataArrayInt.New(numpyArray)
2680             return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2681           }
2682 #endif
2683         else
2684           throw INTERP_KERNEL::Exception(msg.c_str());
2685       }
2686
2687       DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2688         {
2689           return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2690         }
2691
2692       std::string __str__() const throw(INTERP_KERNEL::Exception)
2693       {
2694         return self->repr();
2695       }
2696
2697       int __len__() const throw(INTERP_KERNEL::Exception)
2698       {
2699         if(self->isAllocated())
2700           {
2701             return self->getNumberOfTuples();
2702           }
2703         else
2704           {
2705             throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2706           }
2707       }
2708
2709       int __int__() const throw(INTERP_KERNEL::Exception)
2710       {
2711         return self->intValue();
2712       }
2713
2714       DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2715       {
2716         return self->iterator();
2717       }
2718    
2719       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2720       {
2721         int sz=self->getNumberOfComponents();
2722         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2723         self->accumulate(tmp);
2724         return convertIntArrToPyList(tmp,sz);
2725       }
2726
2727       DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2728       {
2729         int sw,sz,val;
2730         std::vector<int> val2;
2731         const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2732         return self->accumulatePerChunck(bg,bg+sz);
2733       }
2734
2735       PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
2736       {
2737         std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
2738         PyObject *ret=PyList_New(slcs.size());
2739         for(std::size_t i=0;i<slcs.size();i++)
2740           PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
2741         return ret;
2742       }
2743
2744       DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const throw(INTERP_KERNEL::Exception)
2745       {
2746         if(!PySlice_Check(slic))
2747           throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
2748         Py_ssize_t strt=2,stp=2,step=2;
2749         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
2750         if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
2751           throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
2752         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
2753           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 !");
2754         return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
2755       }
2756    
2757       static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2758       {
2759         int newNbOfTuples=-1;
2760         int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2761         std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2762         const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2763         const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2764         DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2765         PyObject *ret=PyTuple_New(2);
2766         PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2767         PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2768         return ret;
2769       }
2770
2771       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2772       {
2773         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 !";
2774         if(PyList_Check(li) || PyTuple_Check(li))
2775           {
2776             if(nbOfTuples)
2777               {
2778                 if(PyInt_Check(nbOfTuples))
2779                   {
2780                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2781                     if(nbOfTuples<0)
2782                       throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2783                     if(nbOfComp)
2784                       {
2785                         if(PyInt_Check(nbOfComp))
2786                           {//DataArrayInt.setValues([1,3,4,5],2,2)
2787                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2788                             if(nbOfCompo<0)
2789                               throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2790                             std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2791                             self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2792                           }
2793                         else
2794                           throw INTERP_KERNEL::Exception(msg);
2795                       }
2796                     else
2797                       {//DataArrayInt.setValues([1,3,4],3)
2798                         int tmpp1=-1;
2799                         std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2800                         self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2801                       }
2802                   }
2803                 else
2804                   throw INTERP_KERNEL::Exception(msg);
2805               }
2806             else
2807               {// DataArrayInt.setValues([1,3,4])
2808                 int tmpp1=-1,tmpp2=-1;
2809                 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2810                 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2811               }
2812           }
2813         else
2814           throw INTERP_KERNEL::Exception(msg);
2815       }
2816
2817       PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2818       {
2819         const int *vals=self->getConstPointer();
2820         return convertIntArrToPyList(vals,self->getNbOfElems());
2821       }
2822
2823 #ifdef WITH_NUMPY
2824       PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2825       {
2826         return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2827       }
2828 #endif
2829
2830       PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2831       {
2832         std::string ret1;
2833         bool ret0=self->isEqualIfNotWhy(other,ret1);
2834         PyObject *ret=PyTuple_New(2);
2835         PyObject *ret0Py=ret0?Py_True:Py_False;
2836         Py_XINCREF(ret0Py);
2837         PyTuple_SetItem(ret,0,ret0Py);
2838         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2839         return ret;
2840       }
2841
2842       PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2843       {
2844         const int *vals=self->getConstPointer();
2845         int nbOfComp=self->getNumberOfComponents();
2846         int nbOfTuples=self->getNumberOfTuples();
2847         return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2848       }
2849
2850       static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2851       {
2852         std::vector<const DataArrayInt *> groups;
2853         std::vector< std::vector<int> > fidsOfGroups;
2854         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2855         ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2856         PyObject *ret = PyList_New(2);
2857         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2858         int sz=fidsOfGroups.size();
2859         PyObject *ret1 = PyList_New(sz);
2860         for(int i=0;i<sz;i++)
2861           PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2862         PyList_SetItem(ret,1,ret1);
2863         return ret;
2864       }
2865
2866       void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2867       {
2868         void *da=0;
2869         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2870         if (!SWIG_IsOK(res1))
2871           {
2872             int size;
2873             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2874             self->transformWithIndArr(tmp,tmp+size);
2875           }
2876         else
2877           {
2878             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2879             self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2880           }
2881       }
2882
2883       DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2884       {
2885         int sw;
2886         int singleVal;
2887         std::vector<int> multiVal;
2888         std::pair<int, std::pair<int,int> > slic;
2889         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2890         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2891         switch(sw)
2892           {
2893           case 1:
2894             return self->getIdsEqualList(&singleVal,&singleVal+1);
2895           case 2:
2896             return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2897           case 4:
2898             return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2899           default:
2900             throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2901           }
2902       }
2903
2904       DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2905       {
2906         int sw;
2907         int singleVal;
2908         std::vector<int> multiVal;
2909         std::pair<int, std::pair<int,int> > slic;
2910         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2911         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2912         switch(sw)
2913           {
2914           case 1:
2915             return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2916           case 2:
2917             return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2918           case 4:
2919             return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2920           default:
2921             throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2922           }
2923       }
2924
2925       PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2926       {
2927         DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2928         void *da=0;
2929         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2930         if (!SWIG_IsOK(res1))
2931           {
2932             int size;
2933             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2934             self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2935           }
2936         else
2937           {
2938             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2939             if(!da2)
2940               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2941             da2->checkAllocated();
2942             int size=self->getNumberOfTuples();
2943             self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2944           }
2945         PyObject *ret = PyList_New(3);
2946         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2947         PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2948         PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2949         return ret;
2950       }
2951
2952       DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2953       {
2954         void *da=0;
2955         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2956         if (!SWIG_IsOK(res1))
2957           {
2958             int size;
2959             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2960             return self->transformWithIndArrR(tmp,tmp+size);
2961           }
2962         else
2963           {
2964             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2965             return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2966           }
2967       }
2968
2969       DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2970       {
2971         void *da=0;
2972         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2973         if (!SWIG_IsOK(res1))
2974           {
2975             int size;
2976             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2977             if(size!=self->getNumberOfTuples())
2978               {
2979                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2980               }
2981             return self->renumberAndReduce(tmp,newNbOfTuple);
2982           }
2983         else
2984           {
2985             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2986             if(!da2)
2987               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2988             da2->checkAllocated();
2989             int size=self->getNumberOfTuples();
2990             if(size!=self->getNumberOfTuples())
2991               {
2992                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2993               }
2994             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
2995           }
2996       }
2997
2998       DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
2999       {
3000         void *da=0;
3001         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3002         if (!SWIG_IsOK(res1))
3003           {
3004             int size;
3005             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3006             if(size!=self->getNumberOfTuples())
3007               {
3008                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3009               }
3010             return self->renumber(tmp);
3011           }
3012         else
3013           {
3014             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3015             if(!da2)
3016               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3017             da2->checkAllocated();
3018             int size=self->getNumberOfTuples();
3019             if(size!=self->getNumberOfTuples())
3020               {
3021                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3022               }
3023             return self->renumber(da2->getConstPointer());
3024           }
3025       }
3026
3027       DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3028       {
3029         void *da=0;
3030         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3031         if (!SWIG_IsOK(res1))
3032           {
3033             int size;
3034             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3035             if(size!=self->getNumberOfTuples())
3036               {
3037                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3038               }
3039             return self->renumberR(tmp);
3040           }
3041         else
3042           {
3043             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3044             if(!da2)
3045               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3046             da2->checkAllocated();
3047             int size=self->getNumberOfTuples();
3048             if(size!=self->getNumberOfTuples())
3049               {
3050                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3051               }
3052             return self->renumberR(da2->getConstPointer());
3053           }
3054       }
3055
3056       void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3057       {
3058         std::vector<int> tmp;
3059         convertPyToNewIntArr3(li,tmp);
3060         self->setSelectedComponents(a,tmp);
3061       }
3062
3063       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3064       {
3065         int sz=self->getNumberOfComponents();
3066         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
3067         self->getTuple(tupleId,tmp);
3068         return convertIntArrToPyList(tmp,sz);
3069       }
3070
3071       PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
3072       {
3073         DataArrayInt *arr=0;
3074         DataArrayInt *arrI=0;
3075         self->changeSurjectiveFormat(targetNb,arr,arrI);
3076         PyObject *res = PyList_New(2);
3077         PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3078         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3079         return res;
3080       }
3081
3082       static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3083       {
3084         std::vector<const DataArrayInt *> tmp;
3085         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3086         return DataArrayInt::Meld(tmp);
3087       }
3088
3089       static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3090       {
3091         std::vector<const DataArrayInt *> tmp;
3092         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3093         return DataArrayInt::Aggregate(tmp);
3094       }
3095
3096       static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
3097       {
3098         std::vector<const DataArrayInt *> tmp;
3099         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3100         return DataArrayInt::AggregateIndexes(tmp);
3101       }
3102
3103       static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
3104       {
3105         std::vector<const DataArrayInt *> tmp;
3106         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3107         return DataArrayInt::BuildUnion(tmp);
3108       }
3109
3110       static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
3111       {
3112         std::vector<const DataArrayInt *> tmp;
3113         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3114         return DataArrayInt::BuildIntersection(tmp);
3115       }
3116
3117       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3118       {
3119         int tmp;
3120         int r1=self->getMaxValue(tmp);
3121         PyObject *ret=PyTuple_New(2);
3122         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3123         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3124         return ret;
3125       }
3126
3127       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3128       {
3129         int tmp;
3130         int r1=self->getMinValue(tmp);
3131         PyObject *ret=PyTuple_New(2);
3132         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3133         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3134         return ret;
3135       }
3136
3137       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3138       {
3139         int nbOfCompo=self->getNumberOfComponents();
3140         switch(nbOfCompo)
3141           {
3142           case 1:
3143             {
3144               if(PyInt_Check(obj))
3145                 {
3146                   int val=(int)PyInt_AS_LONG(obj);
3147                   return self->locateValue(val);
3148                 }
3149               else
3150                 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
3151             }
3152           default:
3153             {
3154               std::vector<int> arr;
3155               convertPyToNewIntArr3(obj,arr);
3156               return self->locateTuple(arr);
3157             }
3158           }
3159       }
3160
3161       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3162       {
3163         int nbOfCompo=self->getNumberOfComponents();
3164         switch(nbOfCompo)
3165           {
3166           case 0:
3167             return false;
3168           case 1:
3169             {
3170               if(PyInt_Check(obj))
3171                 {
3172                   int val=(int)PyInt_AS_LONG(obj);
3173                   return self->presenceOfValue(val);
3174                 }
3175               else
3176                 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
3177             }
3178           default:
3179             {
3180               std::vector<int> arr;
3181               convertPyToNewIntArr3(obj,arr);
3182               return self->presenceOfTuple(arr);
3183             }
3184           }
3185       }
3186
3187       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3188       {
3189         const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
3190         const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
3191         self->checkAllocated();
3192         int nbOfTuples=self->getNumberOfTuples();
3193         int nbOfComponents=self->getNumberOfComponents();
3194         int it1,ic1;
3195         std::vector<int> vt1,vc1;
3196         std::pair<int, std::pair<int,int> > pt1,pc1;
3197         DataArrayInt *dt1=0,*dc1=0;
3198         int sw;
3199         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3200         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3201         switch(sw)
3202           {
3203           case 1:
3204             {
3205               if(nbOfComponents==1)
3206                 return PyInt_FromLong(self->getIJSafe(it1,0));
3207               return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3208             }
3209           case 2:
3210             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3211           case 3:
3212             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3213           case 4:
3214             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3215           case 5:
3216             return PyInt_FromLong(self->getIJSafe(it1,ic1));
3217           case 6:
3218             {
3219               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3220               std::vector<int> v2(1,ic1);
3221               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3222             }
3223           case 7:
3224             {
3225               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3226               std::vector<int> v2(1,ic1);
3227               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3228             }
3229           case 8:
3230             {
3231               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3232               std::vector<int> v2(1,ic1);
3233               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3234             }
3235           case 9:
3236             {
3237               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3238               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3239             }
3240           case 10:
3241             {
3242               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3243               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3244             }
3245           case 11:
3246             {
3247               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3248               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3249             }
3250           case 12:
3251             {
3252               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3253               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3254             }
3255           case 13:
3256             {
3257               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3258               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3259               std::vector<int> v2(nbOfComp);
3260               for(int i=0;i<nbOfComp;i++)
3261                 v2[i]=pc1.first+i*pc1.second.second;
3262               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3263             }
3264           case 14:
3265             {
3266               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3267               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3268               std::vector<int> v2(nbOfComp);
3269               for(int i=0;i<nbOfComp;i++)
3270                 v2[i]=pc1.first+i*pc1.second.second;
3271               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3272             }
3273           case 15:
3274             {
3275               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3276               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3277               std::vector<int> v2(nbOfComp);
3278               for(int i=0;i<nbOfComp;i++)
3279                 v2[i]=pc1.first+i*pc1.second.second;
3280               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3281             }
3282           case 16:
3283             {
3284               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3285               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3286               std::vector<int> v2(nbOfComp);
3287               for(int i=0;i<nbOfComp;i++)
3288                 v2[i]=pc1.first+i*pc1.second.second;
3289               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3290             }
3291           default:
3292             throw INTERP_KERNEL::Exception(msg);
3293           }
3294       }
3295
3296       DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3297       {
3298         self->checkAllocated();
3299         const char msg[]="Unexpected situation in __setitem__ !";
3300         int nbOfTuples=self->getNumberOfTuples();
3301         int nbOfComponents=self->getNumberOfComponents();
3302         int sw1,sw2;
3303         int i1;
3304         std::vector<int> v1;
3305         DataArrayInt *d1=0;
3306         DataArrayIntTuple *dd1=0;
3307         convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3308         int it1,ic1;
3309         std::vector<int> vt1,vc1;
3310         std::pair<int, std::pair<int,int> > pt1,pc1;
3311         DataArrayInt *dt1=0,*dc1=0;
3312         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3313         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3314         switch(sw2)
3315           {
3316           case 1:
3317             {
3318               switch(sw1)
3319                 {
3320                 case 1:
3321                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3322                   return self;
3323                 case 2:
3324                   tmp=DataArrayInt::New();
3325                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3326                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3327                   return self;
3328                 case 3:
3329                   self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3330                   return self;
3331                 case 4:
3332                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3333                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3334                   return self;
3335                 default:
3336                   throw INTERP_KERNEL::Exception(msg);
3337                 }
3338               break;
3339             }
3340           case 2:
3341             {
3342               switch(sw1)
3343                 {
3344                 case 1:
3345                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3346                   return self;
3347                 case 2:
3348                   tmp=DataArrayInt::New();
3349                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3350                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3351                   return self;
3352                 case 3:
3353                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3354                   return self;
3355                 case 4:
3356                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3357                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3358                   return self;
3359                 default:
3360                   throw INTERP_KERNEL::Exception(msg);
3361                 }
3362               break;
3363             }
3364           case 3:
3365             {
3366               switch(sw1)
3367                 {
3368                 case 1:
3369                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3370                   return self;
3371                 case 2:
3372                   tmp=DataArrayInt::New();
3373                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3374                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3375                   return self;
3376                 case 3:
3377                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3378                   return self;
3379                 case 4:
3380                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3381                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3382                   return self;
3383                 default:
3384                   throw INTERP_KERNEL::Exception(msg);
3385                 }
3386               break;
3387             }
3388           case 4:
3389             {
3390               switch(sw1)
3391                 {
3392                 case 1:
3393                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3394                   return self;
3395                 case 2:
3396                   tmp=DataArrayInt::New();
3397                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3398                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3399                   return self;
3400                 case 3:
3401                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3402                   return self;
3403                 case 4:
3404                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3405                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3406                   return self;
3407                 default:
3408                   throw INTERP_KERNEL::Exception(msg);
3409                 }
3410               break;
3411             }
3412           case 5:
3413             {
3414               switch(sw1)
3415                 {
3416                 case 1:
3417                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3418                   return self;
3419                 case 2:
3420                   tmp=DataArrayInt::New();
3421                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3422                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3423                   return self;
3424                 case 3:
3425                   self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3426                   return self;
3427                 case 4:
3428                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3429                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3430                   return self;
3431                 default:
3432                   throw INTERP_KERNEL::Exception(msg);
3433                 }
3434               break;
3435             }
3436           case 6:
3437             {
3438               switch(sw1)
3439                 {
3440                 case 1:
3441                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3442                   return self;
3443                 case 2:
3444                   tmp=DataArrayInt::New();
3445                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3446                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3447                   return self;
3448                 case 3:
3449                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3450                   return self;
3451                 case 4:
3452                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3453                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3454                   return self;
3455                 default:
3456                   throw INTERP_KERNEL::Exception(msg);
3457                 }
3458               break;
3459             }
3460           case 7:
3461             {
3462               switch(sw1)
3463                 {
3464                 case 1:
3465                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3466                   return self;
3467                 case 2:
3468                   tmp=DataArrayInt::New();
3469                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3470                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3471                   return self;
3472                 case 3:
3473                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3474                   return self;
3475                 case 4:
3476                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3477                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3478                   return self;
3479                 default:
3480                   throw INTERP_KERNEL::Exception(msg);
3481                 }
3482               break;
3483             }
3484           case 8:
3485             {
3486               switch(sw1)
3487                 {
3488                 case 1:
3489                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3490                   return self;
3491                 case 2:
3492                   tmp=DataArrayInt::New();
3493                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3494                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3495                   return self;
3496                 case 3:
3497                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3498                   return self;
3499                 case 4:
3500                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3501                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3502                   return self;
3503                 default:
3504                   throw INTERP_KERNEL::Exception(msg);
3505                 }
3506               break;
3507             }
3508           case 9:
3509             {
3510               switch(sw1)
3511                 {
3512                 case 1:
3513                   self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3514                   return self;
3515                 case 2:
3516                   tmp=DataArrayInt::New();
3517                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3518                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3519                   return self;
3520                 case 3:
3521                   self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3522                   return self;
3523                 case 4:
3524                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3525                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3526                   return self;
3527                 default:
3528                   throw INTERP_KERNEL::Exception(msg);
3529                 }
3530               break;
3531             }
3532           case 10:
3533             {
3534               switch(sw1)
3535                 {
3536                 case 1:
3537                   self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3538                   return self;
3539                 case 2:
3540                   tmp=DataArrayInt::New();
3541                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3542                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3543                   return self;
3544                 case 3:
3545                   self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3546                   return self;
3547                 case 4:
3548                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3549                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3550                   return self;
3551                 default:
3552                   throw INTERP_KERNEL::Exception(msg);
3553                 }
3554               break;
3555             }
3556           case 11:
3557             {
3558               switch(sw1)
3559                 {
3560                 case 1:
3561                   self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3562                   return self;
3563                 case 2:
3564                   tmp=DataArrayInt::New();
3565                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3566                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3567                   return self;
3568                 case 3:
3569                   self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3570                   return self;
3571                 case 4:
3572                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3573                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3574                   return self;
3575                 default:
3576                   throw INTERP_KERNEL::Exception(msg);
3577                 }
3578               break;
3579             }
3580           case 12:
3581             {
3582               switch(sw1)
3583                 {
3584                 case 1:
3585                   self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3586                   return self;
3587                 case 2:
3588                   tmp=DataArrayInt::New();
3589                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3590                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3591                   return self;
3592                 case 3:
3593                   self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3594                   return self;
3595                 case 4:
3596                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3597                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3598                   return self;
3599                 default:
3600                   throw INTERP_KERNEL::Exception(msg);
3601                 }
3602               break;
3603             }
3604           case 13:
3605             {
3606               switch(sw1)
3607                 {
3608                 case 1:
3609                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3610                   return self;
3611                 case 2:
3612                   tmp=DataArrayInt::New();
3613                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3614                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3615                   return self;
3616                 case 3:
3617                   self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3618                   return self;
3619                 case 4:
3620                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3621                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3622                   return self;
3623                 default:
3624                   throw INTERP_KERNEL::Exception(msg);
3625                 }
3626               break;
3627             }
3628           case 14:
3629             {
3630               switch(sw1)
3631                 {
3632                 case 1:
3633                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3634                   return self;
3635                 case 2:
3636                   tmp=DataArrayInt::New();
3637                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3638                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3639                   return self;
3640                 case 3:
3641                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3642                   return self;
3643                 case 4:
3644                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3645                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3646                   return self;
3647                 default:
3648                   throw INTERP_KERNEL::Exception(msg);
3649                 }
3650               break;
3651             }
3652           case 15:
3653             {
3654               switch(sw1)
3655                 {
3656                 case 1:
3657                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3658                   return self;
3659                 case 2:
3660                   tmp=DataArrayInt::New();
3661                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3662                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3663                   return self;
3664                 case 3:
3665                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3666                   return self;
3667                 case 4:
3668                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3669                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3670                   return self;
3671                 default:
3672                   throw INTERP_KERNEL::Exception(msg);
3673                 }
3674               break;
3675             }
3676           case 16:
3677             {
3678               switch(sw1)
3679                 {
3680                 case 1:
3681                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3682                   return self;
3683                 case 2:
3684                   tmp=DataArrayInt::New();
3685                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3686                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3687                   return self;
3688                 case 3:
3689                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3690                   return self;
3691                 case 4:
3692                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3693                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3694                   return self;
3695                 default:
3696                   throw INTERP_KERNEL::Exception(msg);
3697                 }
3698               break;
3699             }
3700           default:
3701             throw INTERP_KERNEL::Exception(msg);
3702           }
3703         return self;
3704       }
3705
3706       DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3707       {
3708         return self->negate();
3709       }
3710  
3711       DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3712       {
3713         const char msg[]="Unexpected situation in __add__ !";
3714         int val;
3715         DataArrayInt *a;
3716         std::vector<int> aa;
3717         DataArrayIntTuple *aaa;
3718         int sw;
3719         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3720         switch(sw)
3721           {
3722           case 1:
3723             {
3724               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3725               ret->applyLin(1,val);
3726               return ret.retn();
3727             }
3728           case 2:
3729             {
3730               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3731               return DataArrayInt::Add(self,aaaa);
3732             }
3733           case 3:
3734             {
3735               return DataArrayInt::Add(self,a);
3736             }
3737           case 4:
3738             {
3739               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3740               return DataArrayInt::Add(self,aaaa);
3741             }
3742           default:
3743             throw INTERP_KERNEL::Exception(msg);
3744           }
3745       }
3746
3747       DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3748       {
3749         const char msg[]="Unexpected situation in __radd__ !";
3750         int val;
3751         DataArrayInt *a;
3752         std::vector<int> aa;
3753         DataArrayIntTuple *aaa;
3754         int sw;
3755         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3756         switch(sw)
3757           {
3758           case 1:
3759             {
3760               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3761               ret->applyLin(1,val);
3762               return ret.retn();
3763             }
3764           case 2:
3765             {
3766               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3767               return DataArrayInt::Add(self,aaaa);
3768             }
3769           case 4:
3770             {
3771               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3772               return DataArrayInt::Add(self,aaaa);
3773             }
3774           default:
3775             throw INTERP_KERNEL::Exception(msg);
3776           }
3777       }
3778
3779       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3780       {
3781         const char msg[]="Unexpected situation in __iadd__ !";
3782         int val;
3783         DataArrayInt *a;
3784         std::vector<int> aa;
3785         DataArrayIntTuple *aaa;
3786         int sw;
3787         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3788         switch(sw)
3789           {
3790           case 1:
3791             {
3792               self->applyLin(1,val);
3793               Py_XINCREF(trueSelf);
3794               return trueSelf;
3795             }
3796           case 2:
3797             {
3798               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3799               self->addEqual(bb);
3800               Py_XINCREF(trueSelf);
3801               return trueSelf;
3802             }
3803           case 3:
3804             {
3805               self->addEqual(a);
3806               Py_XINCREF(trueSelf);
3807               return trueSelf;
3808             }
3809           case 4:
3810             {
3811               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3812               self->addEqual(aaaa);
3813               Py_XINCREF(trueSelf);
3814               return trueSelf;
3815             }
3816           default:
3817             throw INTERP_KERNEL::Exception(msg);
3818           }
3819       }
3820
3821       DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3822       {
3823         const char msg[]="Unexpected situation in __sub__ !";
3824         int val;
3825         DataArrayInt *a;
3826         std::vector<int> aa;
3827         DataArrayIntTuple *aaa;
3828         int sw;
3829         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3830         switch(sw)
3831           {
3832           case 1:
3833             {
3834               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3835               ret->applyLin(1,-val);
3836               return ret.retn();
3837             }
3838           case 2:
3839             {
3840               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3841               return DataArrayInt::Substract(self,aaaa);
3842             }
3843           case 3:
3844             {
3845               return DataArrayInt::Substract(self,a);
3846             }
3847           case 4:
3848             {
3849               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3850               return DataArrayInt::Substract(self,aaaa);
3851             }
3852           default:
3853             throw INTERP_KERNEL::Exception(msg);
3854           }
3855       }
3856
3857       DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3858       {
3859         const char msg[]="Unexpected situation in __rsub__ !";
3860         int val;
3861         DataArrayInt *a;
3862         std::vector<int> aa;
3863         DataArrayIntTuple *aaa;
3864         int sw;
3865         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3866         switch(sw)
3867           {
3868           case 1:
3869             {
3870               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3871               ret->applyLin(-1,val);
3872               return ret.retn();
3873             }
3874           case 2:
3875             {
3876               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3877               return DataArrayInt::Substract(aaaa,self);
3878             }
3879           case 4:
3880             {
3881               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3882               return DataArrayInt::Substract(aaaa,self);
3883             }
3884           default:
3885             throw INTERP_KERNEL::Exception(msg);
3886           }
3887       }
3888
3889       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3890       {
3891         const char msg[]="Unexpected situation in __isub__ !";
3892         int val;
3893         DataArrayInt *a;
3894         std::vector<int> aa;
3895         DataArrayIntTuple *aaa;
3896         int sw;
3897         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3898         switch(sw)
3899           {
3900           case 1:
3901             {
3902               self->applyLin(1,-val);
3903               Py_XINCREF(trueSelf);
3904               return trueSelf;
3905             }
3906           case 2:
3907             {
3908               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3909               self->substractEqual(bb);
3910               Py_XINCREF(trueSelf);
3911               return trueSelf;
3912             }
3913           case 3:
3914             {
3915               self->substractEqual(a);
3916               Py_XINCREF(trueSelf);
3917               return trueSelf;
3918             }
3919           case 4:
3920             {
3921               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3922               self->substractEqual(aaaa);
3923               Py_XINCREF(trueSelf);
3924               return trueSelf;
3925             }
3926           default:
3927             throw INTERP_KERNEL::Exception(msg);
3928           }
3929       }
3930
3931       DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3932       {
3933         const char msg[]="Unexpected situation in __mul__ !";
3934         int val;
3935         DataArrayInt *a;
3936         std::vector<int> aa;
3937         DataArrayIntTuple *aaa;
3938         int sw;
3939         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3940         switch(sw)
3941           {
3942           case 1:
3943             {
3944               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3945               ret->applyLin(val,0);
3946               return ret.retn();
3947             }
3948           case 2:
3949             {
3950               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3951               return DataArrayInt::Multiply(self,aaaa);
3952             }
3953           case 3:
3954             {
3955               return DataArrayInt::Multiply(self,a);
3956             }
3957           case 4:
3958             {
3959               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3960               return DataArrayInt::Multiply(self,aaaa);
3961             }
3962           default:
3963             throw INTERP_KERNEL::Exception(msg);
3964           }
3965       }
3966
3967       DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3968       {
3969         const char msg[]="Unexpected situation in __rmul__ !";
3970         int val;
3971         DataArrayInt *a;
3972         std::vector<int> aa;
3973         DataArrayIntTuple *aaa;
3974         int sw;
3975         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3976         switch(sw)
3977           {
3978           case 1:
3979             {
3980               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3981               ret->applyLin(val,0);
3982               return ret.retn();
3983             }
3984           case 2:
3985             {
3986               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3987               return DataArrayInt::Multiply(self,aaaa);
3988             }
3989           case 4:
3990             {
3991               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3992               return DataArrayInt::Multiply(self,aaaa);
3993             }
3994           default:
3995             throw INTERP_KERNEL::Exception(msg);
3996           }
3997       }
3998
3999       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4000       {
4001         const char msg[]="Unexpected situation in __imul__ !";
4002         int val;
4003         DataArrayInt *a;
4004         std::vector<int> aa;
4005         DataArrayIntTuple *aaa;
4006         int sw;
4007         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4008         switch(sw)
4009           {
4010           case 1:
4011             {
4012               self->applyLin(val,0);
4013               Py_XINCREF(trueSelf);
4014               return trueSelf;
4015             }
4016           case 2:
4017             {
4018               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4019               self->multiplyEqual(bb);
4020               Py_XINCREF(trueSelf);
4021               return trueSelf;
4022             }
4023           case 3:
4024             {
4025               self->multiplyEqual(a);
4026               Py_XINCREF(trueSelf);
4027               return trueSelf;
4028             }
4029           case 4:
4030             {
4031               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4032               self->multiplyEqual(aaaa);
4033               Py_XINCREF(trueSelf);
4034               return trueSelf;
4035             }
4036           default:
4037             throw INTERP_KERNEL::Exception(msg);
4038           }
4039       }
4040
4041       DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4042       {
4043         const char msg[]="Unexpected situation in __div__ !";
4044         int val;
4045         DataArrayInt *a;
4046         std::vector<int> aa;
4047         DataArrayIntTuple *aaa;
4048         int sw;
4049         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4050         switch(sw)
4051           {
4052           case 1:
4053             {
4054               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4055               ret->applyDivideBy(val);
4056               return ret.retn();
4057             }
4058           case 2:
4059             {
4060               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4061               return DataArrayInt::Divide(self,aaaa);
4062             }
4063           case 3:
4064             {
4065               return DataArrayInt::Divide(self,a);
4066             }
4067           case 4:
4068             {
4069               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4070               return DataArrayInt::Divide(self,aaaa);
4071             }
4072           default:
4073             throw INTERP_KERNEL::Exception(msg);
4074           }
4075       }
4076
4077       DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4078       {
4079         const char msg[]="Unexpected situation in __rdiv__ !";
4080         int val;
4081         DataArrayInt *a;
4082         std::vector<int> aa;
4083         DataArrayIntTuple *aaa;
4084         int sw;
4085         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4086         switch(sw)
4087           {
4088           case 1:
4089             {
4090               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4091               ret->applyInv(val);
4092               return ret.retn();
4093             }
4094           case 2:
4095             {
4096               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4097               return DataArrayInt::Divide(aaaa,self);
4098             }
4099           case 4:
4100             {
4101               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4102               return DataArrayInt::Divide(aaaa,self);
4103             }
4104           default:
4105             throw INTERP_KERNEL::Exception(msg);
4106           }
4107       }
4108
4109       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4110       {
4111         const char msg[]="Unexpected situation in __idiv__ !";
4112         int val;
4113         DataArrayInt *a;
4114         std::vector<int> aa;
4115         DataArrayIntTuple *aaa;
4116         int sw;
4117         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4118         switch(sw)
4119           {
4120           case 1:
4121             {
4122               self->applyDivideBy(val);
4123               Py_XINCREF(trueSelf);
4124               return trueSelf;
4125             }
4126           case 2:
4127             {
4128               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4129               self->divideEqual(bb);
4130               Py_XINCREF(trueSelf);
4131               return trueSelf;
4132             }
4133           case 3:
4134             {
4135               self->divideEqual(a);
4136               Py_XINCREF(trueSelf);
4137               return trueSelf;
4138             }
4139           case 4:
4140             {
4141               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4142               self->divideEqual(aaaa);
4143               Py_XINCREF(trueSelf);
4144               return trueSelf;
4145             }
4146           default:
4147             throw INTERP_KERNEL::Exception(msg);
4148           }
4149       }
4150
4151       DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4152       {
4153         const char msg[]="Unexpected situation in __mod__ !";
4154         int val;
4155         DataArrayInt *a;
4156         std::vector<int> aa;
4157         DataArrayIntTuple *aaa;
4158         int sw;
4159         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4160         switch(sw)
4161           {
4162           case 1:
4163             {
4164               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4165               ret->applyModulus(val);
4166               return ret.retn();
4167             }
4168           case 2:
4169             {
4170               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4171               return DataArrayInt::Modulus(self,aaaa);
4172             }
4173           case 3:
4174             {
4175               return DataArrayInt::Modulus(self,a);
4176             }
4177           case 4:
4178             {
4179               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4180               return DataArrayInt::Modulus(self,aaaa);
4181             }
4182           default:
4183             throw INTERP_KERNEL::Exception(msg);
4184           }
4185       }
4186
4187       DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4188       {
4189         const char msg[]="Unexpected situation in __rmod__ !";
4190         int val;
4191         DataArrayInt *a;
4192         std::vector<int> aa;
4193         DataArrayIntTuple *aaa;
4194         int sw;
4195         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4196         switch(sw)
4197           {
4198           case 1:
4199             {
4200               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4201               ret->applyRModulus(val);
4202               return ret.retn();
4203             }
4204           case 2:
4205             {
4206               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4207               return DataArrayInt::Modulus(aaaa,self);
4208             }
4209           case 3:
4210             {
4211               return DataArrayInt::Modulus(a,self);
4212             }
4213           case 4:
4214             {
4215               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4216               return DataArrayInt::Modulus(aaaa,self);
4217             }
4218           default:
4219             throw INTERP_KERNEL::Exception(msg);
4220           }
4221       }
4222
4223       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4224       {
4225         const char msg[]="Unexpected situation in __imod__ !";
4226         int val;
4227         DataArrayInt *a;
4228         std::vector<int> aa;
4229         DataArrayIntTuple *aaa;
4230         int sw;
4231         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4232         switch(sw)
4233           {
4234           case 1:
4235             {
4236               self->applyModulus(val);
4237               Py_XINCREF(trueSelf);
4238               return trueSelf;
4239             }
4240           case 3:
4241             {
4242               self->modulusEqual(a);
4243               Py_XINCREF(trueSelf);
4244               return trueSelf;
4245             }
4246           case 4:
4247             {
4248               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4249               self->modulusEqual(aaaa);
4250               Py_XINCREF(trueSelf);
4251               return trueSelf;
4252             }
4253           default:
4254             throw INTERP_KERNEL::Exception(msg);
4255           }
4256       }
4257
4258       DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4259       {
4260         const char msg[]="Unexpected situation in __pow__ !";
4261         int val;
4262         DataArrayInt *a;
4263         std::vector<int> aa;
4264         DataArrayIntTuple *aaa;
4265         int sw;
4266         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4267         switch(sw)
4268           {
4269           case 1:
4270             {
4271               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4272               ret->applyPow(val);
4273               return ret.retn();
4274             }
4275           case 2:
4276             {
4277               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4278               return DataArrayInt::Pow(self,aaaa);
4279             }
4280           case 3:
4281             {
4282               return DataArrayInt::Pow(self,a);
4283             }
4284           case 4:
4285             {
4286               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4287               return DataArrayInt::Pow(self,aaaa);
4288             }
4289           default:
4290             throw INTERP_KERNEL::Exception(msg);
4291           }
4292       }
4293
4294       DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4295       {
4296         const char msg[]="Unexpected situation in __rpow__ !";
4297         int val;
4298         DataArrayInt *a;
4299         std::vector<int> aa;
4300         DataArrayIntTuple *aaa;
4301         int sw;
4302         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4303         switch(sw)
4304           {
4305           case 1:
4306             {
4307               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4308               ret->applyRPow(val);
4309               return ret.retn();
4310             }
4311           case 2:
4312             {
4313               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4314               return DataArrayInt::Pow(aaaa,self);
4315             }
4316           case 3:
4317             {
4318               return DataArrayInt::Pow(a,self);
4319             }
4320           case 4:
4321             {
4322               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4323               return DataArrayInt::Pow(aaaa,self);
4324             }
4325           default:
4326             throw INTERP_KERNEL::Exception(msg);
4327           }
4328       }
4329    
4330       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4331       {
4332         const char msg[]="Unexpected situation in __ipow__ !";
4333         int val;
4334         DataArrayInt *a;
4335         std::vector<int> aa;
4336         DataArrayIntTuple *aaa;
4337         int sw;
4338         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4339         switch(sw)
4340           {
4341           case 1:
4342             {
4343               self->applyPow(val);
4344               Py_XINCREF(trueSelf);
4345               return trueSelf;
4346             }
4347           case 3:
4348             {
4349               self->powEqual(a);
4350               Py_XINCREF(trueSelf);
4351               return trueSelf;
4352             }
4353           case 4:
4354             {
4355               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4356               self->powEqual(aaaa);
4357               Py_XINCREF(trueSelf);
4358               return trueSelf;
4359             }
4360           default:
4361             throw INTERP_KERNEL::Exception(msg);
4362           }
4363       }
4364
4365       std::string __repr__() const throw(INTERP_KERNEL::Exception)
4366       {
4367         std::ostringstream oss;
4368         self->reprQuickOverview(oss);
4369         return oss.str();
4370       }
4371       
4372       void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4373       {
4374         int szArr,sw,iTypppArr;
4375         std::vector<int> stdvecTyyppArr;
4376         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4377         self->pushBackValsSilent(tmp,tmp+szArr);
4378       }
4379       
4380       PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4381       {
4382         std::vector<int> ret1;
4383         std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4384         std::size_t sz=ret0.size();
4385         PyObject *pyRet=PyTuple_New(2);
4386         PyObject *pyRet0=PyList_New((int)sz);
4387         PyObject *pyRet1=PyList_New((int)sz);
4388         for(std::size_t i=0;i<sz;i++)
4389           {
4390             PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4391             PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4392           }
4393         PyTuple_SetItem(pyRet,0,pyRet0);
4394         PyTuple_SetItem(pyRet,1,pyRet1);
4395         return pyRet;
4396       }
4397       
4398       PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4399       {
4400         DataArrayInt *ret0=0,*ret1=0;
4401         self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4402         PyObject *pyRet=PyTuple_New(2);
4403         PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4404         PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4405         return pyRet;
4406       }
4407     }
4408   };
4409
4410   class DataArrayIntTuple;
4411
4412   class DataArrayIntIterator
4413   {
4414   public:
4415     DataArrayIntIterator(DataArrayInt *da);
4416     ~DataArrayIntIterator();
4417     %extend
4418     {
4419       PyObject *next()
4420       {
4421         DataArrayIntTuple *ret=self->nextt();
4422         if(ret)
4423           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4424         else
4425           {
4426             PyErr_SetString(PyExc_StopIteration,"No more data.");
4427             return 0;
4428           }
4429       }
4430     }
4431   };
4432
4433   class DataArrayIntTuple
4434   {
4435   public:
4436     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4437     DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4438     %extend
4439     {
4440       std::string __str__() const throw(INTERP_KERNEL::Exception)
4441       {
4442         return self->repr();
4443       }
4444
4445       int __int__() const throw(INTERP_KERNEL::Exception)
4446       {
4447         return self->intValue();
4448       }
4449
4450       DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4451       {
4452         return self->buildDAInt(1,self->getNumberOfCompo());
4453       }
4454
4455       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4456       {
4457         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4458         ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4459         Py_XINCREF(trueSelf);
4460         return trueSelf;
4461       }
4462   
4463       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4464       {
4465         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4466         ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4467         Py_XINCREF(trueSelf);
4468         return trueSelf;
4469       }
4470   
4471       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4472       {
4473         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4474         ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4475         Py_XINCREF(trueSelf);
4476         return trueSelf;
4477       }
4478
4479       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4480       {
4481         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4482         ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4483         Py_XINCREF(trueSelf);
4484         return trueSelf;
4485       }
4486
4487       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4488       {
4489         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4490         ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4491         Py_XINCREF(trueSelf);
4492         return trueSelf;
4493       }
4494   
4495       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4496       {
4497         const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4498         int sw;
4499         int singleVal;
4500         std::vector<int> multiVal;
4501         std::pair<int, std::pair<int,int> > slic;
4502         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4503         const int *pt=self->getConstPointer();
4504         int nbc=self->getNumberOfCompo();
4505         convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4506         switch(sw)
4507           {
4508           case 1:
4509             {
4510               if(singleVal>=nbc)
4511                 {
4512                   std::ostringstream oss;
4513                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4514                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4515                 }
4516               if(singleVal>=0)
4517                 return PyInt_FromLong(pt[singleVal]);
4518               else
4519                 {
4520                   if(nbc+singleVal>0)
4521                     return PyInt_FromLong(pt[nbc+singleVal]);
4522                   else
4523                     {
4524                       std::ostringstream oss;
4525                       oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4526                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4527                     }
4528                 }
4529             }
4530           case 2:
4531             {
4532               PyObject *t=PyTuple_New(multiVal.size());
4533               for(int j=0;j<(int)multiVal.size();j++)
4534                 {
4535                   int cid=multiVal[j];
4536                   if(cid>=nbc)
4537                     {
4538                       std::ostringstream oss;
4539                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4540                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4541                     }
4542                   PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4543                 }
4544               return t;
4545             }
4546           case 3:
4547             {
4548               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4549               PyObject *t=PyTuple_New(sz);
4550               for(int j=0;j<sz;j++)
4551                 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4552               return t;
4553             }
4554           default:
4555             throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4556           }
4557       }
4558
4559       DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4560       {
4561         const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4562         const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4563         int sw1,sw2;
4564         int singleValV;
4565         std::vector<int> multiValV;
4566         std::pair<int, std::pair<int,int> > slicV;
4567         ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4568         int nbc=self->getNumberOfCompo();
4569         convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4570         int singleVal;
4571         std::vector<int> multiVal;
4572         std::pair<int, std::pair<int,int> > slic;
4573         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4574         int *pt=self->getPointer();
4575         convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4576         switch(sw2)
4577           {
4578           case 1:
4579             {
4580               if(singleVal>=nbc)
4581                 {
4582                   std::ostringstream oss;
4583                   oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4584                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4585                 }
4586               switch(sw1)
4587                 {
4588                 case 1:
4589                   {
4590                     pt[singleVal]=singleValV;
4591                     return self;
4592                   }
4593                 case 2:
4594                   {
4595                     if(multiValV.size()!=1)
4596                       {
4597                         std::ostringstream oss;
4598                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4599                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4600                       }
4601                     pt[singleVal]=multiValV[0];
4602                     return self;
4603                   }
4604                 case 4:
4605                   {
4606                     pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4607                     return self;
4608                   }
4609                 default:
4610                   throw INTERP_KERNEL::Exception(msg);
4611                 }
4612             }
4613           case 2:
4614             {
4615               switch(sw1)
4616                 {
4617                 case 1:
4618                   {
4619                     for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4620                       {
4621                         if(*it>=nbc)
4622                           {
4623                             std::ostringstream oss;
4624                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4625                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4626                           }
4627                         pt[*it]=singleValV;
4628                       }
4629                     return self;
4630                   }
4631                 case 2:
4632                   {
4633                     if(multiVal.size()!=multiValV.size())
4634                       {
4635                         std::ostringstream oss;
4636                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4637                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4638                       }
4639                     for(int i=0;i<(int)multiVal.size();i++)
4640                       {
4641                         int pos=multiVal[i];
4642                         if(pos>=nbc)
4643                           {
4644                             std::ostringstream oss;
4645                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4646                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4647                           }
4648                         pt[multiVal[i]]=multiValV[i];
4649                       }
4650                     return self;
4651                   }
4652                 case 4:
4653                   {
4654                     const int *ptV=daIntTyyppV->getConstPointer();
4655                     if(nbc>daIntTyyppV->getNumberOfCompo())
4656                       {
4657                         std::ostringstream oss;
4658                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4659                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4660                       }
4661                     std::copy(ptV,ptV+nbc,pt);
4662                     return self;
4663                   }
4664                 default:
4665                   throw INTERP_KERNEL::Exception(msg);
4666                 }
4667             }
4668           case 3:
4669             {
4670               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4671               switch(sw1)
4672                 {
4673                 case 1:
4674                   {
4675                     for(int j=0;j<sz;j++)
4676                       pt[slic.first+j*slic.second.second]=singleValV;
4677                     return self;
4678                   }
4679                 case 2:
4680                   {
4681                     if(sz!=(int)multiValV.size())
4682                       {
4683                         std::ostringstream oss;
4684                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4685                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4686                       }
4687                     for(int j=0;j<sz;j++)
4688                       pt[slic.first+j*slic.second.second]=multiValV[j];
4689                     return self;
4690                   }
4691                 case 4:
4692                   {
4693                     const int *ptV=daIntTyyppV->getConstPointer();
4694                     if(sz>daIntTyyppV->getNumberOfCompo())
4695                       {
4696                         std::ostringstream oss;
4697                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4698                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4699                       }
4700                     for(int j=0;j<sz;j++)
4701                       pt[slic.first+j*slic.second.second]=ptV[j];
4702                     return self;
4703                   }
4704                 default:
4705                   throw INTERP_KERNEL::Exception(msg);
4706                 }
4707             }
4708           default:
4709             throw INTERP_KERNEL::Exception(msg);
4710           }
4711       }
4712     }
4713   };
4714
4715   class DataArrayChar : public DataArray
4716   {
4717   public:
4718     virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4719     int getHashCode() const throw(INTERP_KERNEL::Exception);
4720     bool empty() const throw(INTERP_KERNEL::Exception);
4721     void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4722     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4723     void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4724     char popBackSilent() throw(INTERP_KERNEL::Exception);
4725     void pack() const throw(INTERP_KERNEL::Exception);
4726     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4727     bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4728     bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4729     void reverse() throw(INTERP_KERNEL::Exception);
4730     void fillWithZero() throw(INTERP_KERNEL::Exception);
4731     void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4732     std::string repr() const throw(INTERP_KERNEL::Exception);
4733     std::string reprZip() const throw(INTERP_KERNEL::Exception);
4734     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4735     DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4736     DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4737     DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4738     bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4739     DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4740     DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4741     void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4742     void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4743     char front() const throw(INTERP_KERNEL::Exception);
4744     char back() const throw(INTERP_KERNEL::Exception);
4745     void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4746     void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4747     char *getPointer() throw(INTERP_KERNEL::Exception);
4748     DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4749     DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4750     int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4751     bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4752     char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4753     char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4754     char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4755     char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4756     DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4757     static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4758     static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4759     %extend
4760     {
4761       int __len__() const throw(INTERP_KERNEL::Exception)
4762       {
4763         if(self->isAllocated())
4764           {
4765             return self->getNumberOfTuples();
4766           }
4767         else
4768           {
4769             throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4770           }
4771       }
4772       
4773       PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4774       {
4775         std::string ret1;
4776         bool ret0=self->isEqualIfNotWhy(other,ret1);
4777         PyObject *ret=PyTuple_New(2);
4778         PyObject *ret0Py=ret0?Py_True:Py_False;
4779         Py_XINCREF(ret0Py);
4780         PyTuple_SetItem(ret,0,ret0Py);
4781         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4782         return ret;
4783       }
4784       
4785       DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4786       {
4787         void *da=0;
4788         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4789         if (!SWIG_IsOK(res1))
4790           {
4791             int size;
4792             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4793             if(size!=self->getNumberOfTuples())
4794               {
4795                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4796               }
4797             return self->renumber(tmp);
4798           }
4799         else
4800           {
4801             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4802             if(!da2)
4803               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4804             da2->checkAllocated();
4805             int size=self->getNumberOfTuples();
4806             if(size!=self->getNumberOfTuples())
4807               {
4808                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4809               }
4810             return self->renumber(da2->getConstPointer());
4811           }
4812       }
4813       
4814       DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4815       {
4816         void *da=0;
4817         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4818         if (!SWIG_IsOK(res1))
4819           {
4820             int size;
4821             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4822             if(size!=self->getNumberOfTuples())
4823               {
4824                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4825               }
4826             return self->renumberR(tmp);
4827           }
4828         else
4829           {
4830             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4831             if(!da2)
4832               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4833             da2->checkAllocated();
4834             int size=self->getNumberOfTuples();
4835             if(size!=self->getNumberOfTuples())
4836               {
4837                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4838               }
4839             return self->renumberR(da2->getConstPointer());
4840           }
4841       }
4842       
4843       DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4844       {
4845         void *da=0;
4846         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4847         if (!SWIG_IsOK(res1))
4848           {
4849             int size;
4850             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4851             if(size!=self->getNumberOfTuples())
4852               {
4853                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4854               }
4855             return self->renumberAndReduce(tmp,newNbOfTuple);
4856           }
4857         else
4858           {
4859             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4860             if(!da2)
4861               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4862             da2->checkAllocated();
4863             int size=self->getNumberOfTuples();
4864             if(size!=self->getNumberOfTuples())
4865               {
4866                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4867               }
4868             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4869           }
4870       }
4871       
4872       static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4873       {
4874         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4875         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4876         return DataArrayChar::Aggregate(tmp);
4877       }
4878       
4879       static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4880       {
4881         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4882         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4883         return DataArrayChar::Meld(tmp);
4884       }
4885     }
4886   };
4887   
4888   class DataArrayByteIterator;
4889
4890   class DataArrayByte : public DataArrayChar
4891   {
4892   public:
4893     static DataArrayByte *New();
4894     DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4895     DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4896     char byteValue() const throw(INTERP_KERNEL::Exception);
4897     %extend
4898     {
4899       DataArrayByte() throw(INTERP_KERNEL::Exception)
4900         {
4901           return DataArrayByte::New();
4902         }
4903
4904       static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4905       {
4906         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) !";
4907         if(PyList_Check(elt0) || PyTuple_Check(elt0))
4908           {
4909             if(nbOfTuples)
4910               {
4911                 if(PyInt_Check(nbOfTuples))
4912                   {
4913                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4914                     if(nbOfTuples1<0)
4915                       throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4916                     if(nbOfComp)
4917                       {
4918                         if(PyInt_Check(nbOfComp))
4919                           {//DataArrayByte.New([1,3,4,5],2,2)
4920                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4921                             if(nbOfCompo<0)
4922                               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4923                             MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4924                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4925                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4926                             return ret.retn();
4927                           }
4928                         else
4929                           throw INTERP_KERNEL::Exception(msg);
4930                       }
4931                     else
4932                       {//DataArrayByte.New([1,3,4],3)
4933                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4934                         int tmpp1=-1;
4935                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4936                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4937                         return ret.retn();
4938                       }
4939                   }
4940                 else
4941                   throw INTERP_KERNEL::Exception(msg);
4942               }
4943             else
4944               {// DataArrayByte.New([1,3,4])
4945                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4946                 int tmpp1=-1,tmpp2=-1;
4947                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4948                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4949                 return ret.retn();
4950               }
4951           }
4952         else if(PyInt_Check(elt0))
4953           {
4954             int nbOfTuples1=PyInt_AS_LONG(elt0);
4955             if(nbOfTuples1<0)
4956               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4957             if(nbOfTuples)
4958               {
4959                 if(!nbOfComp)
4960                   {
4961                     if(PyInt_Check(nbOfTuples))
4962                       {//DataArrayByte.New(5,2)
4963                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4964                         if(nbOfCompo<0)
4965                           throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4966                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4967                         ret->alloc(nbOfTuples1,nbOfCompo);
4968                         return ret.retn();
4969                       }
4970                     else
4971                       throw INTERP_KERNEL::Exception(msg);
4972                   }
4973                 else
4974                   throw INTERP_KERNEL::Exception(msg);
4975               }
4976             else
4977               {//DataArrayByte.New(5)
4978                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4979                 ret->alloc(nbOfTuples1,1);
4980                 return ret.retn();
4981               }
4982           }
4983         else
4984           throw INTERP_KERNEL::Exception(msg);
4985       }
4986
4987       DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4988         {
4989           return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4990         }
4991    
4992       std::string __repr__() const throw(INTERP_KERNEL::Exception)
4993       {
4994         std::ostringstream oss;
4995         self->reprQuickOverview(oss);
4996         return oss.str();
4997       }
4998   
4999       int __int__() const throw(INTERP_KERNEL::Exception)
5000       {
5001         return (int) self->byteValue();
5002       }
5003
5004       DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
5005       {
5006         return self->iterator();
5007       }
5008
5009       int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5010       {
5011         return (int)self->getIJ(tupleId,compoId);
5012       }
5013       
5014       int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5015       {
5016         return (int)self->getIJSafe(tupleId,compoId);
5017       }
5018
5019       std::string __str__() const throw(INTERP_KERNEL::Exception)
5020       {
5021         return self->repr();
5022       }
5023
5024       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5025       {
5026         const char *vals=self->getConstPointer();
5027         int nbOfComp=self->getNumberOfComponents();
5028         int nbOfTuples=self->getNumberOfTuples();
5029         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5030       }
5031    
5032       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5033       {
5034         int sz=-1,sw=-1;
5035         int ival=-1; std::vector<int> ivval;
5036         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5037         std::vector<char> vals(sz);
5038         std::copy(pt,pt+sz,vals.begin());
5039         return self->presenceOfTuple(vals);
5040       }
5041
5042       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5043       {
5044         int sz=-1,sw=-1;
5045         int ival=-1; std::vector<int> ivval;
5046         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5047         std::vector<char> vals2(sz);
5048         std::copy(pt,pt+sz,vals2.begin());
5049         return self->presenceOfValue(vals2);
5050       }
5051
5052       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5053       {
5054         int sz=-1,sw=-1;
5055         int ival=-1; std::vector<int> ivval;
5056         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5057         std::vector<char> vals2(sz);
5058         std::copy(pt,pt+sz,vals2.begin());
5059         return self->locateValue(vals2);
5060       }
5061
5062       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5063       {
5064         int sz=-1,sw=-1;
5065         int ival=-1; std::vector<int> ivval;
5066         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5067         std::vector<char> vals(sz);
5068         std::copy(pt,pt+sz,vals.begin());
5069         return self->locateTuple(vals);
5070       }
5071
5072       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5073       {
5074         int sz=-1,sw=-1;
5075         int ival=-1; std::vector<int> ivval;
5076         const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
5077         std::vector<char> vals(sz);
5078         std::copy(pt,pt+sz,vals.begin());
5079         return self->search(vals);
5080       }
5081
5082       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5083       {
5084         int sz=self->getNumberOfComponents();
5085         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
5086         self->getTuple(tupleId,tmp);
5087         PyObject *ret=PyTuple_New(sz);
5088         for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
5089         return ret;
5090       }
5091
5092       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5093       {
5094         int tmp;
5095         int r1=(int)self->getMaxValue(tmp);
5096         PyObject *ret=PyTuple_New(2);
5097         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5098         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5099         return ret;
5100       }
5101
5102       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5103       {
5104         int tmp;
5105         int r1=(int)self->getMinValue(tmp);
5106         PyObject *ret=PyTuple_New(2);
5107         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5108         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5109         return ret;
5110       }
5111
5112       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5113       {
5114         int nbOfCompo=self->getNumberOfComponents();
5115         switch(nbOfCompo)
5116           {
5117           case 1:
5118             {
5119               if(PyInt_Check(obj))
5120                 {
5121                   int val=(int)PyInt_AS_LONG(obj);
5122                   return self->locateValue(val);
5123                 }
5124               else
5125                 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
5126             }
5127           default:
5128             return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
5129           }
5130       }
5131
5132       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5133       {
5134         int nbOfCompo=self->getNumberOfComponents();
5135         switch(nbOfCompo)
5136           {
5137           case 0:
5138             return false;
5139           case 1:
5140             {
5141               if(PyInt_Check(obj))
5142                 {
5143                   int val=(int)PyInt_AS_LONG(obj);
5144                   return self->presenceOfValue(val);
5145                 }
5146               else
5147                 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5148             }
5149           default:
5150             return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
5151           }
5152       }
5153     }
5154   };
5155
5156   class DataArrayByteTuple;
5157
5158   class DataArrayByteIterator
5159   {
5160   public:
5161     DataArrayByteIterator(DataArrayByte *da);
5162     ~DataArrayByteIterator();
5163   };
5164
5165   class DataArrayByteTuple
5166   {
5167   public:
5168     std::string repr() const throw(INTERP_KERNEL::Exception);
5169     DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5170     %extend
5171     {
5172       std::string __str__() const throw(INTERP_KERNEL::Exception)
5173       {
5174         return self->repr();
5175       }
5176       
5177       char __int__() const throw(INTERP_KERNEL::Exception)
5178       {
5179         return self->byteValue();
5180       }
5181       
5182       DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5183       {
5184         return self->buildDAByte(1,self->getNumberOfCompo());
5185       }
5186     }
5187   };
5188   
5189   class DataArrayAsciiCharIterator;
5190   
5191   class DataArrayAsciiChar : public DataArrayChar
5192   {
5193   public:
5194     static DataArrayAsciiChar *New();
5195     DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5196     DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5197     char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5198     %extend
5199     {
5200       DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5201         {
5202           return DataArrayAsciiChar::New();
5203         }
5204
5205       static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5206       {
5207         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) !";
5208         if(PyList_Check(elt0) || PyTuple_Check(elt0))
5209           {
5210             if(nbOfTuples)
5211               {
5212                 if(PyInt_Check(nbOfTuples))
5213                   {
5214                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5215                     if(nbOfTuples1<0)
5216                       throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5217                     if(nbOfComp)
5218                       {
5219                         if(PyInt_Check(nbOfComp))
5220                           {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5221                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5222                             if(nbOfCompo<0)
5223                               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5224                             MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5225                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5226                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5227                             return ret.retn();
5228                           }
5229                         else
5230                           throw INTERP_KERNEL::Exception(msg);
5231                       }
5232                     else
5233                       {//DataArrayAsciiChar.New([1,3,4],3)
5234                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5235                         int tmpp1=-1;
5236                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5237                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5238                         return ret.retn();
5239                       }
5240                   }
5241                 else if(PyString_Check(nbOfTuples))
5242                   {
5243                     if(PyString_Size(nbOfTuples)!=1)
5244                       throw INTERP_KERNEL::Exception(msg);
5245                     //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5246                     std::vector<std::string> tmp;
5247                     if(fillStringVector(elt0,tmp))
5248                       return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5249                     else
5250                       throw INTERP_KERNEL::Exception(msg);
5251                   }
5252                 else
5253                   throw INTERP_KERNEL::Exception(msg);
5254               }
5255             else
5256               {
5257                 std::vector<std::string> tmmp;
5258                 if(fillStringVector(elt0,tmmp))
5259                   //DataArrayAsciiChar.New(["abc","de","fghi"])
5260                   return DataArrayAsciiChar::New(tmmp,' ');
5261                 else
5262                   {
5263                     // DataArrayAsciiChar.New([1,3,4])
5264                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5265                     int tmpp1=-1,tmpp2=-1;
5266                     std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5267                     ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5268                     return ret.retn();
5269                   }
5270               }
5271           }
5272         else if(PyInt_Check(elt0))
5273           {
5274             int nbOfTuples1=PyInt_AS_LONG(elt0);
5275             if(nbOfTuples1<0)
5276               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5277             if(nbOfTuples)
5278               {
5279                 if(!nbOfComp)
5280                   {
5281                     if(PyInt_Check(nbOfTuples))
5282                       {//DataArrayAsciiChar.New(5,2)
5283                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5284                         if(nbOfCompo<0)
5285                           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5286                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5287                         ret->alloc(nbOfTuples1,nbOfCompo);
5288                         return ret.retn();
5289                       }
5290                     else
5291                       throw INTERP_KERNEL::Exception(msg);
5292                   }
5293                 else
5294                   throw INTERP_KERNEL::Exception(msg);
5295               }
5296             else
5297               {//DataArrayAsciiChar.New(5)
5298                 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5299                 ret->alloc(nbOfTuples1,1);
5300                 return ret.retn();
5301               }
5302           }
5303         else
5304           throw INTERP_KERNEL::Exception(msg);
5305       }
5306
5307       DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5308         {
5309           return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5310         }
5311
5312       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5313       {
5314         std::ostringstream oss;
5315         self->reprQuickOverview(oss);
5316         return oss.str();
5317       }
5318
5319       DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5320       {
5321         return self->iterator();
5322       }
5323
5324       std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5325       {
5326         char tmp[2]; tmp[1]='\0';
5327         tmp[0]=self->getIJ(tupleId,compoId);
5328         return std::string(tmp);
5329       }
5330    
5331       std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5332       {
5333         char tmp[2]; tmp[1]='\0';
5334         tmp[0]=self->getIJSafe(tupleId,compoId);
5335         return std::string(tmp);
5336       }
5337
5338       std::string __str__() const throw(INTERP_KERNEL::Exception)
5339       {
5340         return self->repr();
5341       }
5342
5343       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5344       {
5345         const char *vals=self->getConstPointer();
5346         int nbOfComp=self->getNumberOfComponents();
5347         int nbOfTuples=self->getNumberOfTuples();
5348         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5349       }
5350
5351       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5352       {
5353         if(PyString_Check(tupl))
5354           {
5355             Py_ssize_t sz=PyString_Size(tupl);
5356             std::vector<char> vals(sz);
5357             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5358             return self->presenceOfTuple(vals);
5359           }
5360         else
5361           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5362       }
5363    
5364       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5365       {
5366         if(PyString_Check(vals))
5367           {
5368             Py_ssize_t sz=PyString_Size(vals);
5369             std::vector<char> vals2(sz);
5370             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5371             return self->presenceOfValue(vals2);
5372           }
5373         else
5374           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5375       }
5376
5377       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5378       {
5379         if(PyString_Check(vals))
5380           {
5381             Py_ssize_t sz=PyString_Size(vals);
5382             std::vector<char> vals2(sz);
5383             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5384             return self->locateValue(vals2);
5385           }
5386         else
5387           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5388       }
5389
5390       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5391       {
5392         if(PyString_Check(tupl))
5393           {
5394             Py_ssize_t sz=PyString_Size(tupl);
5395             std::vector<char> vals(sz);
5396             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5397             return self->locateTuple(vals);
5398           }
5399         else
5400           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5401       }
5402
5403       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5404       {
5405         if(PyString_Check(strOrListOfInt))
5406           {
5407             Py_ssize_t sz=PyString_Size(strOrListOfInt);
5408             std::vector<char> vals(sz);
5409             std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5410             return self->search(vals);
5411           }
5412         else
5413           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5414       }
5415    
5416       PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5417       {
5418         int sz=self->getNumberOfComponents();
5419         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5420         self->getTuple(tupleId,tmp);
5421         return PyString_FromString(tmp);
5422       }
5423
5424       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5425       {
5426         int tmp;
5427         char tmp2[2]; tmp2[1]='\0';
5428         tmp2[0]=self->getMaxValue(tmp);
5429         PyObject *ret=PyTuple_New(2);
5430         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5431         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5432         return ret;
5433       }
5434
5435       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5436       {
5437         int tmp;
5438         char tmp2[2]; tmp2[1]='\0';
5439         tmp2[0]=self->getMinValue(tmp);
5440         PyObject *ret=PyTuple_New(2);
5441         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5442         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5443         return ret;
5444       }
5445
5446       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5447       {
5448         int nbOfCompo=self->getNumberOfComponents();
5449         switch(nbOfCompo)
5450           {
5451           case 1:
5452             {
5453               if(PyString_Check(obj))
5454                 {
5455                   Py_ssize_t sz=PyString_Size(obj);
5456                   char *pt=PyString_AsString(obj);
5457                   if(sz==1)
5458                     return self->locateValue(pt[0]);
5459                   else
5460                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5461                 }
5462               else
5463                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5464             }
5465           default:
5466             return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5467           }
5468       }
5469
5470       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5471       {
5472         int nbOfCompo=self->getNumberOfComponents();
5473         switch(nbOfCompo)
5474           {
5475           case 0:
5476             return false;
5477           case 1:
5478             {
5479               if(PyString_Check(obj))
5480                 {
5481                   Py_ssize_t sz=PyString_Size(obj);
5482                   char *pt=PyString_AsString(obj);
5483                   if(sz==1)
5484                     return self->presenceOfValue(pt[0]);
5485                   else
5486                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5487                 }
5488               else
5489                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5490             }
5491           default:
5492             return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5493           }
5494       }
5495
5496       PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5497       {
5498         int sw,iTypppArr;
5499         std::vector<int> stdvecTyyppArr;
5500         std::pair<int, std::pair<int,int> > sTyyppArr;
5501         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5502         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5503         switch(sw)
5504           {
5505           case 1:
5506             return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5507           case 2:
5508             return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5509           case 3:
5510             return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5511           case 4:
5512             return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5513           default:
5514             throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5515           }
5516       }
5517
5518       DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5519       {
5520         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.";
5521         int sw1,iTypppArr;
5522         std::vector<int> stdvecTyyppArr;
5523         std::pair<int, std::pair<int,int> > sTyyppArr;
5524         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5525         int nbOfCompo=self->getNumberOfComponents();
5526         int nbOfTuples=self->getNumberOfTuples();
5527         convertObjToPossibleCpp2(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5528         int sw2;
5529         char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5530         convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5531         switch(sw1)
5532           {
5533           case 1:
5534             {//obj int
5535               switch(sw2)
5536                 {//value char
5537                 case 1:
5538                   {
5539                     self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5540                     return self;
5541                   }
5542                   //value string
5543                 case 2:
5544                   {
5545                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5546                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5547                     return self;
5548                   }
5549                   //value vector<string>
5550                 case 3:
5551                   {
5552                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5553                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5554                     return self;
5555                   }
5556                   //value DataArrayChar
5557                 case 4:
5558                   {
5559                     self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5560                     return self;
5561                   }
5562                 default:
5563                   throw INTERP_KERNEL::Exception(msg);
5564                 }
5565             }
5566           case 2:
5567             {//obj list-tuple[int]
5568               switch(sw2)
5569                 {
5570                   {//value char
5571                   case 1:
5572                     {
5573                       self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5574                       return self;
5575                     }
5576                     //value string
5577                   case 2:
5578                     {
5579                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5580                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5581                       return self;
5582                     }
5583                     //value vector<string>
5584                   case 3:
5585                     {
5586                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5587                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5588                       return self;
5589                     }
5590                     //value DataArrayChar
5591                   case 4:
5592                     {
5593                       self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5594                       return self;
5595                     }
5596                   default:
5597                     throw INTERP_KERNEL::Exception(msg);
5598                   }
5599                 }
5600             }
5601           case 3:
5602             {//slice
5603               switch(sw2)
5604                 {
5605                   {//value char
5606                   case 1:
5607                     {
5608                       self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5609                       return self;
5610                     }
5611                     //value string
5612                   case 2:
5613                     {
5614                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5615                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5616                       return self;
5617                     }
5618                     //value vector<string>
5619                   case 3:
5620                     {
5621                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5622                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5623                       return self;
5624                     }
5625                     //value DataArrayChar
5626                   case 4:
5627                     {
5628                       self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5629                       return self;
5630                     }
5631                   default:
5632                     throw INTERP_KERNEL::Exception(msg);
5633                   }
5634                 }
5635             }
5636           case 4:
5637             {//DataArrayInt
5638               switch(sw2)
5639                 {
5640                   {//value char
5641                   case 1:
5642                     {
5643                       self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5644                       return self;
5645                     }
5646                     //value string
5647                   case 2:
5648                     {
5649                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5650                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5651                       return self;
5652                     }
5653                     //value vector<string>
5654                   case 3:
5655                     {
5656                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5657                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5658                       return self;
5659                     }
5660                     //value DataArrayChar
5661                   case 4:
5662                     {
5663                       self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5664                       return self;
5665                     }
5666                   default:
5667                     throw INTERP_KERNEL::Exception(msg);
5668                   }
5669                 }
5670             }
5671           default:
5672             throw INTERP_KERNEL::Exception(msg);
5673           }
5674       }
5675     }
5676   };
5677
5678   class DataArrayAsciiCharTuple;
5679
5680   class DataArrayAsciiCharIterator
5681   {
5682   public:
5683     DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5684     ~DataArrayAsciiCharIterator();
5685     %extend
5686     {
5687       PyObject *next()
5688       {
5689         DataArrayAsciiCharTuple *ret=self->nextt();
5690         if(ret)
5691           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5692         else
5693           {
5694             PyErr_SetString(PyExc_StopIteration,"No more data.");
5695             return 0;
5696           }
5697       }
5698     }
5699   };
5700
5701   class DataArrayAsciiCharTuple
5702   {
5703   public:
5704     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5705     DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5706     %extend
5707     {
5708       std::string __str__() const throw(INTERP_KERNEL::Exception)
5709       {
5710         return self->repr();
5711       }
5712       
5713       DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5714       {
5715         return self->buildDAAsciiChar(1,self->getNumberOfCompo());
5716       }
5717     }
5718   };
5719 }