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