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