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