Salome HOME
705d80db2fb8bc8a609b7899bf1fa1d300b24bc9
[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   };
4449
4450   class DataArrayIntTuple;
4451
4452   class DataArrayIntIterator
4453   {
4454   public:
4455     DataArrayIntIterator(DataArrayInt *da);
4456     ~DataArrayIntIterator();
4457     %extend
4458     {
4459       PyObject *next()
4460       {
4461         DataArrayIntTuple *ret=self->nextt();
4462         if(ret)
4463           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4464         else
4465           {
4466             PyErr_SetString(PyExc_StopIteration,"No more data.");
4467             return 0;
4468           }
4469       }
4470     }
4471   };
4472
4473   class DataArrayIntTuple
4474   {
4475   public:
4476     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4477     DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4478     %extend
4479     {
4480       std::string __str__() const throw(INTERP_KERNEL::Exception)
4481       {
4482         return self->repr();
4483       }
4484
4485       int __int__() const throw(INTERP_KERNEL::Exception)
4486       {
4487         return self->intValue();
4488       }
4489
4490       DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4491       {
4492         return self->buildDAInt(1,self->getNumberOfCompo());
4493       }
4494
4495       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4496       {
4497         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4498         ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4499         Py_XINCREF(trueSelf);
4500         return trueSelf;
4501       }
4502   
4503       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4504       {
4505         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4506         ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4507         Py_XINCREF(trueSelf);
4508         return trueSelf;
4509       }
4510   
4511       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4512       {
4513         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4514         ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4515         Py_XINCREF(trueSelf);
4516         return trueSelf;
4517       }
4518
4519       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4520       {
4521         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4522         ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4523         Py_XINCREF(trueSelf);
4524         return trueSelf;
4525       }
4526
4527       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4528       {
4529         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4530         ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4531         Py_XINCREF(trueSelf);
4532         return trueSelf;
4533       }
4534
4535       PyObject *__len__() throw(INTERP_KERNEL::Exception)
4536       {
4537         return PyInt_FromLong(self->getNumberOfCompo());
4538       }
4539   
4540       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4541       {
4542         const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4543         int sw;
4544         int singleVal;
4545         std::vector<int> multiVal;
4546         std::pair<int, std::pair<int,int> > slic;
4547         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4548         const int *pt=self->getConstPointer();
4549         int nbc=self->getNumberOfCompo();
4550         convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4551         switch(sw)
4552           {
4553           case 1:
4554             {
4555               if(singleVal>=nbc)
4556                 {
4557                   std::ostringstream oss;
4558                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4559                   PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4560                   return 0;
4561                 }
4562               if(singleVal>=0)
4563                 return PyInt_FromLong(pt[singleVal]);
4564               else
4565                 {
4566                   if(nbc+singleVal>0)
4567                     return PyInt_FromLong(pt[nbc+singleVal]);
4568                   else
4569                     {
4570                       std::ostringstream oss;
4571                       oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4572                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4573                     }
4574                 }
4575             }
4576           case 2:
4577             {
4578               PyObject *t=PyTuple_New(multiVal.size());
4579               for(int j=0;j<(int)multiVal.size();j++)
4580                 {
4581                   int cid=multiVal[j];
4582                   if(cid>=nbc)
4583                     {
4584                       std::ostringstream oss;
4585                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4586                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4587                     }
4588                   PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4589                 }
4590               return t;
4591             }
4592           case 3:
4593             {
4594               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4595               PyObject *t=PyTuple_New(sz);
4596               for(int j=0;j<sz;j++)
4597                 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4598               return t;
4599             }
4600           default:
4601             throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4602           }
4603       }
4604
4605       DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4606       {
4607         const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4608         const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4609         int sw1,sw2;
4610         int singleValV;
4611         std::vector<int> multiValV;
4612         std::pair<int, std::pair<int,int> > slicV;
4613         ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4614         int nbc=self->getNumberOfCompo();
4615         convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4616         int singleVal;
4617         std::vector<int> multiVal;
4618         std::pair<int, std::pair<int,int> > slic;
4619         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4620         int *pt=self->getPointer();
4621         convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4622         switch(sw2)
4623           {
4624           case 1:
4625             {
4626               if(singleVal>=nbc)
4627                 {
4628                   std::ostringstream oss;
4629                   oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4630                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4631                 }
4632               switch(sw1)
4633                 {
4634                 case 1:
4635                   {
4636                     pt[singleVal]=singleValV;
4637                     return self;
4638                   }
4639                 case 2:
4640                   {
4641                     if(multiValV.size()!=1)
4642                       {
4643                         std::ostringstream oss;
4644                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4645                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4646                       }
4647                     pt[singleVal]=multiValV[0];
4648                     return self;
4649                   }
4650                 case 4:
4651                   {
4652                     pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4653                     return self;
4654                   }
4655                 default:
4656                   throw INTERP_KERNEL::Exception(msg);
4657                 }
4658             }
4659           case 2:
4660             {
4661               switch(sw1)
4662                 {
4663                 case 1:
4664                   {
4665                     for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4666                       {
4667                         if(*it>=nbc)
4668                           {
4669                             std::ostringstream oss;
4670                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4671                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4672                           }
4673                         pt[*it]=singleValV;
4674                       }
4675                     return self;
4676                   }
4677                 case 2:
4678                   {
4679                     if(multiVal.size()!=multiValV.size())
4680                       {
4681                         std::ostringstream oss;
4682                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4683                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4684                       }
4685                     for(int i=0;i<(int)multiVal.size();i++)
4686                       {
4687                         int pos=multiVal[i];
4688                         if(pos>=nbc)
4689                           {
4690                             std::ostringstream oss;
4691                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4692                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4693                           }
4694                         pt[multiVal[i]]=multiValV[i];
4695                       }
4696                     return self;
4697                   }
4698                 case 4:
4699                   {
4700                     const int *ptV=daIntTyyppV->getConstPointer();
4701                     if(nbc>daIntTyyppV->getNumberOfCompo())
4702                       {
4703                         std::ostringstream oss;
4704                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4705                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4706                       }
4707                     std::copy(ptV,ptV+nbc,pt);
4708                     return self;
4709                   }
4710                 default:
4711                   throw INTERP_KERNEL::Exception(msg);
4712                 }
4713             }
4714           case 3:
4715             {
4716               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4717               switch(sw1)
4718                 {
4719                 case 1:
4720                   {
4721                     for(int j=0;j<sz;j++)
4722                       pt[slic.first+j*slic.second.second]=singleValV;
4723                     return self;
4724                   }
4725                 case 2:
4726                   {
4727                     if(sz!=(int)multiValV.size())
4728                       {
4729                         std::ostringstream oss;
4730                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4731                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4732                       }
4733                     for(int j=0;j<sz;j++)
4734                       pt[slic.first+j*slic.second.second]=multiValV[j];
4735                     return self;
4736                   }
4737                 case 4:
4738                   {
4739                     const int *ptV=daIntTyyppV->getConstPointer();
4740                     if(sz>daIntTyyppV->getNumberOfCompo())
4741                       {
4742                         std::ostringstream oss;
4743                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4744                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4745                       }
4746                     for(int j=0;j<sz;j++)
4747                       pt[slic.first+j*slic.second.second]=ptV[j];
4748                     return self;
4749                   }
4750                 default:
4751                   throw INTERP_KERNEL::Exception(msg);
4752                 }
4753             }
4754           default:
4755             throw INTERP_KERNEL::Exception(msg);
4756           }
4757       }
4758     }
4759   };
4760
4761   class DataArrayChar : public DataArray
4762   {
4763   public:
4764     virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4765     int getHashCode() const throw(INTERP_KERNEL::Exception);
4766     bool empty() const throw(INTERP_KERNEL::Exception);
4767     void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4768     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4769     void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4770     char popBackSilent() throw(INTERP_KERNEL::Exception);
4771     void pack() const throw(INTERP_KERNEL::Exception);
4772     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4773     bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4774     bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4775     void reverse() throw(INTERP_KERNEL::Exception);
4776     void fillWithZero() throw(INTERP_KERNEL::Exception);
4777     void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4778     std::string repr() const throw(INTERP_KERNEL::Exception);
4779     std::string reprZip() const throw(INTERP_KERNEL::Exception);
4780     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4781     DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4782     DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4783     DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4784     bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4785     DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4786     DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4787     void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4788     void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4789     char front() const throw(INTERP_KERNEL::Exception);
4790     char back() const throw(INTERP_KERNEL::Exception);
4791     void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4792     void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4793     char *getPointer() throw(INTERP_KERNEL::Exception);
4794     DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4795     DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4796     int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4797     bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4798     char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4799     char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4800     char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4801     char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4802     DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4803     static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4804     static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4805     %extend
4806     {
4807       int __len__() const throw(INTERP_KERNEL::Exception)
4808       {
4809         if(self->isAllocated())
4810           {
4811             return self->getNumberOfTuples();
4812           }
4813         else
4814           {
4815             throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4816           }
4817       }
4818       
4819       PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4820       {
4821         std::string ret1;
4822         bool ret0=self->isEqualIfNotWhy(other,ret1);
4823         PyObject *ret=PyTuple_New(2);
4824         PyObject *ret0Py=ret0?Py_True:Py_False;
4825         Py_XINCREF(ret0Py);
4826         PyTuple_SetItem(ret,0,ret0Py);
4827         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4828         return ret;
4829       }
4830       
4831       DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4832       {
4833         void *da=0;
4834         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4835         if (!SWIG_IsOK(res1))
4836           {
4837             int size;
4838             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4839             if(size!=self->getNumberOfTuples())
4840               {
4841                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4842               }
4843             return self->renumber(tmp);
4844           }
4845         else
4846           {
4847             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4848             if(!da2)
4849               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4850             da2->checkAllocated();
4851             int size=self->getNumberOfTuples();
4852             if(size!=self->getNumberOfTuples())
4853               {
4854                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4855               }
4856             return self->renumber(da2->getConstPointer());
4857           }
4858       }
4859       
4860       DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4861       {
4862         void *da=0;
4863         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4864         if (!SWIG_IsOK(res1))
4865           {
4866             int size;
4867             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4868             if(size!=self->getNumberOfTuples())
4869               {
4870                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4871               }
4872             return self->renumberR(tmp);
4873           }
4874         else
4875           {
4876             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4877             if(!da2)
4878               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4879             da2->checkAllocated();
4880             int size=self->getNumberOfTuples();
4881             if(size!=self->getNumberOfTuples())
4882               {
4883                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4884               }
4885             return self->renumberR(da2->getConstPointer());
4886           }
4887       }
4888       
4889       DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4890       {
4891         void *da=0;
4892         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4893         if (!SWIG_IsOK(res1))
4894           {
4895             int size;
4896             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4897             if(size!=self->getNumberOfTuples())
4898               {
4899                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4900               }
4901             return self->renumberAndReduce(tmp,newNbOfTuple);
4902           }
4903         else
4904           {
4905             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4906             if(!da2)
4907               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4908             da2->checkAllocated();
4909             int size=self->getNumberOfTuples();
4910             if(size!=self->getNumberOfTuples())
4911               {
4912                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4913               }
4914             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4915           }
4916       }
4917       
4918       static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4919       {
4920         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4921         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4922         return DataArrayChar::Aggregate(tmp);
4923       }
4924       
4925       static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4926       {
4927         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4928         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4929         return DataArrayChar::Meld(tmp);
4930       }
4931     }
4932   };
4933   
4934   class DataArrayByteIterator;
4935
4936   class DataArrayByte : public DataArrayChar
4937   {
4938   public:
4939     static DataArrayByte *New();
4940     DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4941     DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4942     char byteValue() const throw(INTERP_KERNEL::Exception);
4943     %extend
4944     {
4945       DataArrayByte() throw(INTERP_KERNEL::Exception)
4946         {
4947           return DataArrayByte::New();
4948         }
4949
4950       static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4951       {
4952         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) !";
4953         if(PyList_Check(elt0) || PyTuple_Check(elt0))
4954           {
4955             if(nbOfTuples)
4956               {
4957                 if(PyInt_Check(nbOfTuples))
4958                   {
4959                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4960                     if(nbOfTuples1<0)
4961                       throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4962                     if(nbOfComp)
4963                       {
4964                         if(PyInt_Check(nbOfComp))
4965                           {//DataArrayByte.New([1,3,4,5],2,2)
4966                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4967                             if(nbOfCompo<0)
4968                               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4969                             MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4970                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4971                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4972                             return ret.retn();
4973                           }
4974                         else
4975                           throw INTERP_KERNEL::Exception(msg);
4976                       }
4977                     else
4978                       {//DataArrayByte.New([1,3,4],3)
4979                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4980                         int tmpp1=-1;
4981                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4982                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4983                         return ret.retn();
4984                       }
4985                   }
4986                 else
4987                   throw INTERP_KERNEL::Exception(msg);
4988               }
4989             else
4990               {// DataArrayByte.New([1,3,4])
4991                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4992                 int tmpp1=-1,tmpp2=-1;
4993                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4994                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4995                 return ret.retn();
4996               }
4997           }
4998         else if(PyInt_Check(elt0))
4999           {
5000             int nbOfTuples1=PyInt_AS_LONG(elt0);
5001             if(nbOfTuples1<0)
5002               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
5003             if(nbOfTuples)
5004               {
5005                 if(!nbOfComp)
5006                   {
5007                     if(PyInt_Check(nbOfTuples))
5008                       {//DataArrayByte.New(5,2)
5009                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5010                         if(nbOfCompo<0)
5011                           throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
5012                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5013                         ret->alloc(nbOfTuples1,nbOfCompo);
5014                         return ret.retn();
5015                       }
5016                     else
5017                       throw INTERP_KERNEL::Exception(msg);
5018                   }
5019                 else
5020                   throw INTERP_KERNEL::Exception(msg);
5021               }
5022             else
5023               {//DataArrayByte.New(5)
5024                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5025                 ret->alloc(nbOfTuples1,1);
5026                 return ret.retn();
5027               }
5028           }
5029         else
5030           throw INTERP_KERNEL::Exception(msg);
5031       }
5032
5033       DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5034         {
5035           return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5036         }
5037    
5038       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5039       {
5040         std::ostringstream oss;
5041         self->reprQuickOverview(oss);
5042         return oss.str();
5043       }
5044   
5045       int __int__() const throw(INTERP_KERNEL::Exception)
5046       {
5047         return (int) self->byteValue();
5048       }
5049
5050       DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
5051       {
5052         return self->iterator();
5053       }
5054
5055       int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5056       {
5057         return (int)self->getIJ(tupleId,compoId);
5058       }
5059       
5060       int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5061       {
5062         return (int)self->getIJSafe(tupleId,compoId);
5063       }
5064
5065       std::string __str__() const throw(INTERP_KERNEL::Exception)
5066       {
5067         return self->repr();
5068       }
5069
5070       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5071       {
5072         const char *vals=self->getConstPointer();
5073         int nbOfComp=self->getNumberOfComponents();
5074         int nbOfTuples=self->getNumberOfTuples();
5075         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5076       }
5077    
5078       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5079       {
5080         int sz=-1,sw=-1;
5081         int ival=-1; std::vector<int> ivval;
5082         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5083         std::vector<char> vals(sz);
5084         std::copy(pt,pt+sz,vals.begin());
5085         return self->presenceOfTuple(vals);
5086       }
5087
5088       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5089       {
5090         int sz=-1,sw=-1;
5091         int ival=-1; std::vector<int> ivval;
5092         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5093         std::vector<char> vals2(sz);
5094         std::copy(pt,pt+sz,vals2.begin());
5095         return self->presenceOfValue(vals2);
5096       }
5097
5098       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5099       {
5100         int sz=-1,sw=-1;
5101         int ival=-1; std::vector<int> ivval;
5102         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5103         std::vector<char> vals2(sz);
5104         std::copy(pt,pt+sz,vals2.begin());
5105         return self->locateValue(vals2);
5106       }
5107
5108       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5109       {
5110         int sz=-1,sw=-1;
5111         int ival=-1; std::vector<int> ivval;
5112         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5113         std::vector<char> vals(sz);
5114         std::copy(pt,pt+sz,vals.begin());
5115         return self->locateTuple(vals);
5116       }
5117
5118       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5119       {
5120         int sz=-1,sw=-1;
5121         int ival=-1; std::vector<int> ivval;
5122         const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
5123         std::vector<char> vals(sz);
5124         std::copy(pt,pt+sz,vals.begin());
5125         return self->search(vals);
5126       }
5127
5128       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5129       {
5130         int sz=self->getNumberOfComponents();
5131         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
5132         self->getTuple(tupleId,tmp);
5133         PyObject *ret=PyTuple_New(sz);
5134         for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
5135         return ret;
5136       }
5137
5138       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5139       {
5140         int tmp;
5141         int r1=(int)self->getMaxValue(tmp);
5142         PyObject *ret=PyTuple_New(2);
5143         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5144         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5145         return ret;
5146       }
5147
5148       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5149       {
5150         int tmp;
5151         int r1=(int)self->getMinValue(tmp);
5152         PyObject *ret=PyTuple_New(2);
5153         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5154         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5155         return ret;
5156       }
5157
5158       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5159       {
5160         int nbOfCompo=self->getNumberOfComponents();
5161         switch(nbOfCompo)
5162           {
5163           case 1:
5164             {
5165               if(PyInt_Check(obj))
5166                 {
5167                   int val=(int)PyInt_AS_LONG(obj);
5168                   return self->locateValue(val);
5169                 }
5170               else
5171                 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
5172             }
5173           default:
5174             return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
5175           }
5176       }
5177
5178       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5179       {
5180         int nbOfCompo=self->getNumberOfComponents();
5181         switch(nbOfCompo)
5182           {
5183           case 0:
5184             return false;
5185           case 1:
5186             {
5187               if(PyInt_Check(obj))
5188                 {
5189                   int val=(int)PyInt_AS_LONG(obj);
5190                   return self->presenceOfValue(val);
5191                 }
5192               else
5193                 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5194             }
5195           default:
5196             return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
5197           }
5198       }
5199
5200       DataArrayByte *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5201       {
5202         self->checkAllocated();
5203         const char msg[]="Unexpected situation in __setitem__ !";
5204         int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
5205         int sw1,sw2;
5206         int i1;
5207         std::vector<int> v1;
5208         DataArrayInt *d1=0;
5209         DataArrayIntTuple *dd1=0;
5210         convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5211         int it1,ic1;
5212         std::vector<int> vt1,vc1;
5213         std::pair<int, std::pair<int,int> > pt1,pc1;
5214         DataArrayInt *dt1=0,*dc1=0;
5215         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5216         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5217         switch(sw2)
5218           {
5219           case 1:
5220             {
5221               switch(sw1)
5222                 {
5223                 case 1:
5224                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5225                   return self;
5226                 default:
5227                   throw INTERP_KERNEL::Exception(msg);
5228                 }
5229               break;
5230             }
5231           case 2:
5232             {
5233               switch(sw1)
5234                 {
5235                 case 1:
5236                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5237                   return self;
5238                 default:
5239                   throw INTERP_KERNEL::Exception(msg);
5240                 }
5241               break;
5242             }
5243           case 3:
5244             {
5245               switch(sw1)
5246                 {
5247                 case 1:
5248                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5249                   return self;
5250                 default:
5251                   throw INTERP_KERNEL::Exception(msg);
5252                 }
5253               break;
5254             }
5255           case 4:
5256             {
5257               switch(sw1)
5258                 {
5259                 case 1:
5260                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5261                   return self;
5262                 default:
5263                   throw INTERP_KERNEL::Exception(msg);
5264                 }
5265               break;
5266             }
5267           case 5:
5268             {
5269               switch(sw1)
5270                 {
5271                 case 1:
5272                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5273                   return self;
5274                 default:
5275                   throw INTERP_KERNEL::Exception(msg);
5276                 }
5277               break;
5278             }
5279           case 6:
5280             {
5281               switch(sw1)
5282                 {
5283                 case 1:
5284                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5285                   return self;
5286                 default:
5287                   throw INTERP_KERNEL::Exception(msg);
5288                 }
5289               break;
5290             }
5291           case 7:
5292             {
5293               switch(sw1)
5294                 {
5295                 case 1:
5296                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5297                   return self;
5298                 default:
5299                   throw INTERP_KERNEL::Exception(msg);
5300                 }
5301               break;
5302             }
5303           case 8:
5304             {
5305               switch(sw1)
5306                 {
5307                 case 1:
5308                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5309                   return self;
5310                 default:
5311                   throw INTERP_KERNEL::Exception(msg);
5312                 }
5313               break;
5314             }
5315           case 9:
5316             {
5317               switch(sw1)
5318                 {
5319                 case 1:
5320                   self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5321                   return self;
5322                 default:
5323                   throw INTERP_KERNEL::Exception(msg);
5324                 }
5325               break;
5326             }
5327           case 10:
5328             {
5329               switch(sw1)
5330                 {
5331                 case 1:
5332                   self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5333                   return self;
5334                 default:
5335                   throw INTERP_KERNEL::Exception(msg);
5336                 }
5337               break;
5338             }
5339           case 11:
5340             {
5341               switch(sw1)
5342                 {
5343                 case 1:
5344                   self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5345                   return self;
5346                 default:
5347                   throw INTERP_KERNEL::Exception(msg);
5348                 }
5349               break;
5350             }
5351           case 12:
5352             {
5353               switch(sw1)
5354                 {
5355                 case 1:
5356                   self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5357                   return self;
5358                 default:
5359                   throw INTERP_KERNEL::Exception(msg);
5360                 }
5361               break;
5362             }
5363           case 13:
5364             {
5365               switch(sw1)
5366                 {
5367                 case 1:
5368                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5369                   return self;
5370                 default:
5371                   throw INTERP_KERNEL::Exception(msg);
5372                 }
5373               break;
5374             }
5375           case 14:
5376             {
5377               switch(sw1)
5378                 {
5379                 case 1:
5380                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5381                   return self;
5382                 default:
5383                   throw INTERP_KERNEL::Exception(msg);
5384                 }
5385               break;
5386             }
5387           case 15:
5388             {
5389               switch(sw1)
5390                 {
5391                 case 1:
5392                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5393                   return self;
5394                 default:
5395                   throw INTERP_KERNEL::Exception(msg);
5396                 }
5397               break;
5398             }
5399           case 16:
5400             {
5401               switch(sw1)
5402                 {
5403                 case 1:
5404                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5405                   return self;
5406                 default:
5407                   throw INTERP_KERNEL::Exception(msg);
5408                 }
5409               break;
5410             }
5411           default:
5412             throw INTERP_KERNEL::Exception(msg);
5413           }
5414         return self;
5415       }
5416     }
5417   };
5418
5419   class DataArrayByteTuple;
5420
5421   class DataArrayByteIterator
5422   {
5423   public:
5424     DataArrayByteIterator(DataArrayByte *da);
5425     ~DataArrayByteIterator();
5426   };
5427
5428   class DataArrayByteTuple
5429   {
5430   public:
5431     std::string repr() const throw(INTERP_KERNEL::Exception);
5432     DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5433     %extend
5434     {
5435       std::string __str__() const throw(INTERP_KERNEL::Exception)
5436       {
5437         return self->repr();
5438       }
5439       
5440       char __int__() const throw(INTERP_KERNEL::Exception)
5441       {
5442         return self->byteValue();
5443       }
5444       
5445       DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5446       {
5447         return self->buildDAByte(1,self->getNumberOfCompo());
5448       }
5449     }
5450   };
5451   
5452   class DataArrayAsciiCharIterator;
5453   
5454   class DataArrayAsciiChar : public DataArrayChar
5455   {
5456   public:
5457     static DataArrayAsciiChar *New();
5458     DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5459     DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5460     char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5461     %extend
5462     {
5463       DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5464         {
5465           return DataArrayAsciiChar::New();
5466         }
5467
5468       static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5469       {
5470         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) !";
5471         if(PyList_Check(elt0) || PyTuple_Check(elt0))
5472           {
5473             if(nbOfTuples)
5474               {
5475                 if(PyInt_Check(nbOfTuples))
5476                   {
5477                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5478                     if(nbOfTuples1<0)
5479                       throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5480                     if(nbOfComp)
5481                       {
5482                         if(PyInt_Check(nbOfComp))
5483                           {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5484                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5485                             if(nbOfCompo<0)
5486                               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5487                             MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5488                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5489                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5490                             return ret.retn();
5491                           }
5492                         else
5493                           throw INTERP_KERNEL::Exception(msg);
5494                       }
5495                     else
5496                       {//DataArrayAsciiChar.New([1,3,4],3)
5497                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5498                         int tmpp1=-1;
5499                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5500                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5501                         return ret.retn();
5502                       }
5503                   }
5504                 else if(PyString_Check(nbOfTuples))
5505                   {
5506                     if(PyString_Size(nbOfTuples)!=1)
5507                       throw INTERP_KERNEL::Exception(msg);
5508                     //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5509                     std::vector<std::string> tmp;
5510                     if(fillStringVector(elt0,tmp))
5511                       return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5512                     else
5513                       throw INTERP_KERNEL::Exception(msg);
5514                   }
5515                 else
5516                   throw INTERP_KERNEL::Exception(msg);
5517               }
5518             else
5519               {
5520                 std::vector<std::string> tmmp;
5521                 if(fillStringVector(elt0,tmmp))
5522                   //DataArrayAsciiChar.New(["abc","de","fghi"])
5523                   return DataArrayAsciiChar::New(tmmp,' ');
5524                 else
5525                   {
5526                     // DataArrayAsciiChar.New([1,3,4])
5527                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5528                     int tmpp1=-1,tmpp2=-1;
5529                     std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5530                     ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5531                     return ret.retn();
5532                   }
5533               }
5534           }
5535         else if(PyInt_Check(elt0))
5536           {
5537             int nbOfTuples1=PyInt_AS_LONG(elt0);
5538             if(nbOfTuples1<0)
5539               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5540             if(nbOfTuples)
5541               {
5542                 if(!nbOfComp)
5543                   {
5544                     if(PyInt_Check(nbOfTuples))
5545                       {//DataArrayAsciiChar.New(5,2)
5546                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5547                         if(nbOfCompo<0)
5548                           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5549                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5550                         ret->alloc(nbOfTuples1,nbOfCompo);
5551                         return ret.retn();
5552                       }
5553                     else
5554                       throw INTERP_KERNEL::Exception(msg);
5555                   }
5556                 else
5557                   throw INTERP_KERNEL::Exception(msg);
5558               }
5559             else
5560               {//DataArrayAsciiChar.New(5)
5561                 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5562                 ret->alloc(nbOfTuples1,1);
5563                 return ret.retn();
5564               }
5565           }
5566         else
5567           throw INTERP_KERNEL::Exception(msg);
5568       }
5569
5570       DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5571         {
5572           return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5573         }
5574
5575       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5576       {
5577         std::ostringstream oss;
5578         self->reprQuickOverview(oss);
5579         return oss.str();
5580       }
5581
5582       DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5583       {
5584         return self->iterator();
5585       }
5586
5587       std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5588       {
5589         char tmp[2]; tmp[1]='\0';
5590         tmp[0]=self->getIJ(tupleId,compoId);
5591         return std::string(tmp);
5592       }
5593    
5594       std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5595       {
5596         char tmp[2]; tmp[1]='\0';
5597         tmp[0]=self->getIJSafe(tupleId,compoId);
5598         return std::string(tmp);
5599       }
5600
5601       std::string __str__() const throw(INTERP_KERNEL::Exception)
5602       {
5603         return self->repr();
5604       }
5605
5606       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5607       {
5608         const char *vals=self->getConstPointer();
5609         int nbOfComp=self->getNumberOfComponents();
5610         int nbOfTuples=self->getNumberOfTuples();
5611         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5612       }
5613
5614       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5615       {
5616         if(PyString_Check(tupl))
5617           {
5618             Py_ssize_t sz=PyString_Size(tupl);
5619             std::vector<char> vals(sz);
5620             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5621             return self->presenceOfTuple(vals);
5622           }
5623         else
5624           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5625       }
5626    
5627       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5628       {
5629         if(PyString_Check(vals))
5630           {
5631             Py_ssize_t sz=PyString_Size(vals);
5632             std::vector<char> vals2(sz);
5633             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5634             return self->presenceOfValue(vals2);
5635           }
5636         else
5637           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5638       }
5639
5640       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5641       {
5642         if(PyString_Check(vals))
5643           {
5644             Py_ssize_t sz=PyString_Size(vals);
5645             std::vector<char> vals2(sz);
5646             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5647             return self->locateValue(vals2);
5648           }
5649         else
5650           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5651       }
5652
5653       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5654       {
5655         if(PyString_Check(tupl))
5656           {
5657             Py_ssize_t sz=PyString_Size(tupl);
5658             std::vector<char> vals(sz);
5659             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5660             return self->locateTuple(vals);
5661           }
5662         else
5663           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5664       }
5665
5666       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5667       {
5668         if(PyString_Check(strOrListOfInt))
5669           {
5670             Py_ssize_t sz=PyString_Size(strOrListOfInt);
5671             std::vector<char> vals(sz);
5672             std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5673             return self->search(vals);
5674           }
5675         else
5676           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5677       }
5678    
5679       PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5680       {
5681         int sz=self->getNumberOfComponents();
5682         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5683         self->getTuple(tupleId,tmp);
5684         return PyString_FromString(tmp);
5685       }
5686
5687       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5688       {
5689         int tmp;
5690         char tmp2[2]; tmp2[1]='\0';
5691         tmp2[0]=self->getMaxValue(tmp);
5692         PyObject *ret=PyTuple_New(2);
5693         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5694         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5695         return ret;
5696       }
5697
5698       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5699       {
5700         int tmp;
5701         char tmp2[2]; tmp2[1]='\0';
5702         tmp2[0]=self->getMinValue(tmp);
5703         PyObject *ret=PyTuple_New(2);
5704         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5705         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5706         return ret;
5707       }
5708
5709       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5710       {
5711         int nbOfCompo=self->getNumberOfComponents();
5712         switch(nbOfCompo)
5713           {
5714           case 1:
5715             {
5716               if(PyString_Check(obj))
5717                 {
5718                   Py_ssize_t sz=PyString_Size(obj);
5719                   char *pt=PyString_AsString(obj);
5720                   if(sz==1)
5721                     return self->locateValue(pt[0]);
5722                   else
5723                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5724                 }
5725               else
5726                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5727             }
5728           default:
5729             return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5730           }
5731       }
5732
5733       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5734       {
5735         int nbOfCompo=self->getNumberOfComponents();
5736         switch(nbOfCompo)
5737           {
5738           case 0:
5739             return false;
5740           case 1:
5741             {
5742               if(PyString_Check(obj))
5743                 {
5744                   Py_ssize_t sz=PyString_Size(obj);
5745                   char *pt=PyString_AsString(obj);
5746                   if(sz==1)
5747                     return self->presenceOfValue(pt[0]);
5748                   else
5749                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5750                 }
5751               else
5752                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5753             }
5754           default:
5755             return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5756           }
5757       }
5758
5759       PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5760       {
5761         int sw,iTypppArr;
5762         std::vector<int> stdvecTyyppArr;
5763         std::pair<int, std::pair<int,int> > sTyyppArr;
5764         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5765         convertObjToPossibleCpp2WithNegIntInterp(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5766         switch(sw)
5767           {
5768           case 1:
5769             return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5770           case 2:
5771             return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5772           case 3:
5773             return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5774           case 4:
5775             return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5776           default:
5777             throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5778           }
5779       }
5780
5781       DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5782       {
5783         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.";
5784         int sw1,iTypppArr;
5785         std::vector<int> stdvecTyyppArr;
5786         std::pair<int, std::pair<int,int> > sTyyppArr;
5787         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5788         int nbOfCompo=self->getNumberOfComponents();
5789         int nbOfTuples=self->getNumberOfTuples();
5790         convertObjToPossibleCpp2WithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5791         int sw2;
5792         char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5793         convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5794         switch(sw1)
5795           {
5796           case 1:
5797             {//obj int
5798               switch(sw2)
5799                 {//value char
5800                 case 1:
5801                   {
5802                     self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5803                     return self;
5804                   }
5805                   //value string
5806                 case 2:
5807                   {
5808                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5809                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5810                     return self;
5811                   }
5812                   //value vector<string>
5813                 case 3:
5814                   {
5815                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5816                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5817                     return self;
5818                   }
5819                   //value DataArrayChar
5820                 case 4:
5821                   {
5822                     self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5823                     return self;
5824                   }
5825                 default:
5826                   throw INTERP_KERNEL::Exception(msg);
5827                 }
5828             }
5829           case 2:
5830             {//obj list-tuple[int]
5831               switch(sw2)
5832                 {
5833                   {//value char
5834                   case 1:
5835                     {
5836                       self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5837                       return self;
5838                     }
5839                     //value string
5840                   case 2:
5841                     {
5842                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5843                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5844                       return self;
5845                     }
5846                     //value vector<string>
5847                   case 3:
5848                     {
5849                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5850                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5851                       return self;
5852                     }
5853                     //value DataArrayChar
5854                   case 4:
5855                     {
5856                       self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5857                       return self;
5858                     }
5859                   default:
5860                     throw INTERP_KERNEL::Exception(msg);
5861                   }
5862                 }
5863             }
5864           case 3:
5865             {//slice
5866               switch(sw2)
5867                 {
5868                   {//value char
5869                   case 1:
5870                     {
5871                       self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5872                       return self;
5873                     }
5874                     //value string
5875                   case 2:
5876                     {
5877                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5878                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5879                       return self;
5880                     }
5881                     //value vector<string>
5882                   case 3:
5883                     {
5884                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5885                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5886                       return self;
5887                     }
5888                     //value DataArrayChar
5889                   case 4:
5890                     {
5891                       self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5892                       return self;
5893                     }
5894                   default:
5895                     throw INTERP_KERNEL::Exception(msg);
5896                   }
5897                 }
5898             }
5899           case 4:
5900             {//DataArrayInt
5901               switch(sw2)
5902                 {
5903                   {//value char
5904                   case 1:
5905                     {
5906                       self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5907                       return self;
5908                     }
5909                     //value string
5910                   case 2:
5911                     {
5912                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5913                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5914                       return self;
5915                     }
5916                     //value vector<string>
5917                   case 3:
5918                     {
5919                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5920                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5921                       return self;
5922                     }
5923                     //value DataArrayChar
5924                   case 4:
5925                     {
5926                       self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5927                       return self;
5928                     }
5929                   default:
5930                     throw INTERP_KERNEL::Exception(msg);
5931                   }
5932                 }
5933             }
5934           default:
5935             throw INTERP_KERNEL::Exception(msg);
5936           }
5937       }
5938     }
5939   };
5940
5941   class DataArrayAsciiCharTuple;
5942
5943   class DataArrayAsciiCharIterator
5944   {
5945   public:
5946     DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5947     ~DataArrayAsciiCharIterator();
5948     %extend
5949     {
5950       PyObject *next()
5951       {
5952         DataArrayAsciiCharTuple *ret=self->nextt();
5953         if(ret)
5954           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5955         else
5956           {
5957             PyErr_SetString(PyExc_StopIteration,"No more data.");
5958             return 0;
5959           }
5960       }
5961     }
5962   };
5963
5964   class DataArrayAsciiCharTuple
5965   {
5966   public:
5967     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5968     DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5969     %extend
5970     {
5971       std::string __str__() const throw(INTERP_KERNEL::Exception)
5972       {
5973         return self->repr();
5974       }
5975       
5976       DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5977       {
5978         return self->buildDAAsciiChar(1,self->getNumberOfCompo());
5979       }
5980     }
5981   };
5982 }