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