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