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