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