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