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