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