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