Salome HOME
f2837c8da45d7da0e9d62dcea6b3f749367cc543
[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     DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2385     DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2386     DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2387     DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2388     DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2389     DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2390     DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2391     void computeOffsets() throw(INTERP_KERNEL::Exception);
2392     void computeOffsets2() throw(INTERP_KERNEL::Exception);
2393     DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2394     DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2395     DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2396     DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2397     DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2398     static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2399     void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2400     static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2401     void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2402     static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2403     void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2404     static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2405     void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2406     static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2407     void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2408     static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2409     void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2410   public:
2411     static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2412     %extend
2413     {
2414       DataArrayInt() throw(INTERP_KERNEL::Exception)
2415         {
2416           return DataArrayInt::New();
2417         }
2418
2419       static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2420       {
2421         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)";
2422         std::string msg(msgBase);
2423 #ifdef WITH_NUMPY
2424         msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2425 #endif
2426         msg+=" !";
2427         if(PyList_Check(elt0) || PyTuple_Check(elt0))
2428           {
2429             if(nbOfTuples)
2430               {
2431                 if(PyInt_Check(nbOfTuples))
2432                   {
2433                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2434                     if(nbOfTuples1<0)
2435                       throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2436                     if(nbOfComp)
2437                       {
2438                         if(PyInt_Check(nbOfComp))
2439                           {//DataArrayInt.New([1,3,4,5],2,2)
2440                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2441                             if(nbOfCompo<0)
2442                               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2443                             MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2444                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2445                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2446                             return ret.retn();
2447                           }
2448                         else
2449                           throw INTERP_KERNEL::Exception(msg.c_str());
2450                       }
2451                     else
2452                       {//DataArrayInt.New([1,3,4],3)
2453                         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2454                         int tmpp1=-1;
2455                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2456                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2457                         return ret.retn();
2458                       }
2459                   }
2460                 else
2461                   throw INTERP_KERNEL::Exception(msg.c_str());
2462               }
2463             else
2464               {// DataArrayInt.New([1,3,4])
2465                 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2466                 int tmpp1=-1,tmpp2=-1;
2467                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2468                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2469                 return ret.retn();
2470               }
2471           }
2472         else if(PyInt_Check(elt0))
2473           {
2474             int nbOfTuples1=PyInt_AS_LONG(elt0);
2475             if(nbOfTuples1<0)
2476               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2477             if(nbOfTuples)
2478               {
2479                 if(!nbOfComp)
2480                   {
2481                     if(PyInt_Check(nbOfTuples))
2482                       {//DataArrayInt.New(5,2)
2483                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2484                         if(nbOfCompo<0)
2485                           throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2486                         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2487                         ret->alloc(nbOfTuples1,nbOfCompo);
2488                         return ret.retn();
2489                       }
2490                     else
2491                       throw INTERP_KERNEL::Exception(msg.c_str());
2492                   }
2493                 else
2494                   throw INTERP_KERNEL::Exception(msg.c_str());
2495               }
2496             else
2497               {//DataArrayInt.New(5)
2498                 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2499                 ret->alloc(nbOfTuples1,1);
2500                 return ret.retn();
2501               }
2502           }
2503 #ifdef WITH_NUMPY
2504         else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2505           {//DataArrayInt.New(numpyArray)
2506             return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2507           }
2508 #endif
2509         else
2510           throw INTERP_KERNEL::Exception(msg.c_str());
2511       }
2512
2513       DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2514         {
2515           return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2516         }
2517
2518       std::string __str__() const throw(INTERP_KERNEL::Exception)
2519       {
2520         return self->repr();
2521       }
2522
2523       int __len__() const throw(INTERP_KERNEL::Exception)
2524       {
2525         if(self->isAllocated())
2526           {
2527             return self->getNumberOfTuples();
2528           }
2529         else
2530           {
2531             throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2532           }
2533       }
2534
2535       int __int__() const throw(INTERP_KERNEL::Exception)
2536       {
2537         return self->intValue();
2538       }
2539
2540       DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2541       {
2542         return self->iterator();
2543       }
2544    
2545       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2546       {
2547         int sz=self->getNumberOfComponents();
2548         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2549         self->accumulate(tmp);
2550         return convertIntArrToPyList(tmp,sz);
2551       }
2552
2553       DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2554       {
2555         int sw,sz,val;
2556         std::vector<int> val2;
2557         const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2558         return self->accumulatePerChunck(bg,bg+sz);
2559       }
2560    
2561       static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2562       {
2563         int newNbOfTuples=-1;
2564         int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2565         std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2566         const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2567         const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2568         DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2569         PyObject *ret=PyTuple_New(2);
2570         PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2571         PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2572         return ret;
2573       }
2574
2575       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2576       {
2577         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 !";
2578         if(PyList_Check(li) || PyTuple_Check(li))
2579           {
2580             if(nbOfTuples)
2581               {
2582                 if(PyInt_Check(nbOfTuples))
2583                   {
2584                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2585                     if(nbOfTuples<0)
2586                       throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2587                     if(nbOfComp)
2588                       {
2589                         if(PyInt_Check(nbOfComp))
2590                           {//DataArrayInt.setValues([1,3,4,5],2,2)
2591                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2592                             if(nbOfCompo<0)
2593                               throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2594                             std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2595                             self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2596                           }
2597                         else
2598                           throw INTERP_KERNEL::Exception(msg);
2599                       }
2600                     else
2601                       {//DataArrayInt.setValues([1,3,4],3)
2602                         int tmpp1=-1;
2603                         std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2604                         self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2605                       }
2606                   }
2607                 else
2608                   throw INTERP_KERNEL::Exception(msg);
2609               }
2610             else
2611               {// DataArrayInt.setValues([1,3,4])
2612                 int tmpp1=-1,tmpp2=-1;
2613                 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2614                 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2615               }
2616           }
2617         else
2618           throw INTERP_KERNEL::Exception(msg);
2619       }
2620
2621       PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2622       {
2623         const int *vals=self->getConstPointer();
2624         return convertIntArrToPyList(vals,self->getNbOfElems());
2625       }
2626
2627 #ifdef WITH_NUMPY
2628       PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2629       {
2630         return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2631       }
2632 #endif
2633
2634       PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2635       {
2636         std::string ret1;
2637         bool ret0=self->isEqualIfNotWhy(other,ret1);
2638         PyObject *ret=PyTuple_New(2);
2639         PyObject *ret0Py=ret0?Py_True:Py_False;
2640         Py_XINCREF(ret0Py);
2641         PyTuple_SetItem(ret,0,ret0Py);
2642         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2643         return ret;
2644       }
2645
2646       PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2647       {
2648         const int *vals=self->getConstPointer();
2649         int nbOfComp=self->getNumberOfComponents();
2650         int nbOfTuples=self->getNumberOfTuples();
2651         return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2652       }
2653
2654       static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2655       {
2656         std::vector<const DataArrayInt *> groups;
2657         std::vector< std::vector<int> > fidsOfGroups;
2658         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2659         ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2660         PyObject *ret = PyList_New(2);
2661         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2662         int sz=fidsOfGroups.size();
2663         PyObject *ret1 = PyList_New(sz);
2664         for(int i=0;i<sz;i++)
2665           PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2666         PyList_SetItem(ret,1,ret1);
2667         return ret;
2668       }
2669
2670       void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2671       {
2672         void *da=0;
2673         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2674         if (!SWIG_IsOK(res1))
2675           {
2676             int size;
2677             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2678             self->transformWithIndArr(tmp,tmp+size);
2679           }
2680         else
2681           {
2682             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2683             self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2684           }
2685       }
2686
2687       DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2688       {
2689         int sw;
2690         int singleVal;
2691         std::vector<int> multiVal;
2692         std::pair<int, std::pair<int,int> > slic;
2693         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2694         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2695         switch(sw)
2696           {
2697           case 1:
2698             return self->getIdsEqualList(&singleVal,&singleVal+1);
2699           case 2:
2700             return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2701           case 4:
2702             return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2703           default:
2704             throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2705           }
2706       }
2707
2708       DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2709       {
2710         int sw;
2711         int singleVal;
2712         std::vector<int> multiVal;
2713         std::pair<int, std::pair<int,int> > slic;
2714         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2715         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2716         switch(sw)
2717           {
2718           case 1:
2719             return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2720           case 2:
2721             return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2722           case 4:
2723             return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2724           default:
2725             throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2726           }
2727       }
2728
2729       PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2730       {
2731         DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2732         void *da=0;
2733         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2734         if (!SWIG_IsOK(res1))
2735           {
2736             int size;
2737             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2738             self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2739           }
2740         else
2741           {
2742             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2743             if(!da2)
2744               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2745             da2->checkAllocated();
2746             int size=self->getNumberOfTuples();
2747             self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2748           }
2749         PyObject *ret = PyList_New(3);
2750         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2751         PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2752         PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2753         return ret;
2754       }
2755
2756       DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2757       {
2758         void *da=0;
2759         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2760         if (!SWIG_IsOK(res1))
2761           {
2762             int size;
2763             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2764             return self->transformWithIndArrR(tmp,tmp+size);
2765           }
2766         else
2767           {
2768             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2769             return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2770           }
2771       }
2772
2773       DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2774       {
2775         void *da=0;
2776         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2777         if (!SWIG_IsOK(res1))
2778           {
2779             int size;
2780             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2781             if(size!=self->getNumberOfTuples())
2782               {
2783                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2784               }
2785             return self->renumberAndReduce(tmp,newNbOfTuple);
2786           }
2787         else
2788           {
2789             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2790             if(!da2)
2791               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2792             da2->checkAllocated();
2793             int size=self->getNumberOfTuples();
2794             if(size!=self->getNumberOfTuples())
2795               {
2796                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2797               }
2798             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
2799           }
2800       }
2801
2802       DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
2803       {
2804         void *da=0;
2805         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2806         if (!SWIG_IsOK(res1))
2807           {
2808             int size;
2809             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2810             if(size!=self->getNumberOfTuples())
2811               {
2812                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2813               }
2814             return self->renumber(tmp);
2815           }
2816         else
2817           {
2818             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2819             if(!da2)
2820               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2821             da2->checkAllocated();
2822             int size=self->getNumberOfTuples();
2823             if(size!=self->getNumberOfTuples())
2824               {
2825                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2826               }
2827             return self->renumber(da2->getConstPointer());
2828           }
2829       }
2830
2831       DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
2832       {
2833         void *da=0;
2834         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2835         if (!SWIG_IsOK(res1))
2836           {
2837             int size;
2838             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2839             if(size!=self->getNumberOfTuples())
2840               {
2841                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2842               }
2843             return self->renumberR(tmp);
2844           }
2845         else
2846           {
2847             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2848             if(!da2)
2849               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2850             da2->checkAllocated();
2851             int size=self->getNumberOfTuples();
2852             if(size!=self->getNumberOfTuples())
2853               {
2854                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2855               }
2856             return self->renumberR(da2->getConstPointer());
2857           }
2858       }
2859
2860       void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
2861       {
2862         std::vector<int> tmp;
2863         convertPyToNewIntArr3(li,tmp);
2864         self->setSelectedComponents(a,tmp);
2865       }
2866
2867       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
2868       {
2869         int sz=self->getNumberOfComponents();
2870         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2871         self->getTuple(tupleId,tmp);
2872         return convertIntArrToPyList(tmp,sz);
2873       }
2874
2875       PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
2876       {
2877         DataArrayInt *arr=0;
2878         DataArrayInt *arrI=0;
2879         self->changeSurjectiveFormat(targetNb,arr,arrI);
2880         PyObject *res = PyList_New(2);
2881         PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2882         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2883         return res;
2884       }
2885
2886       static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
2887       {
2888         std::vector<const DataArrayInt *> tmp;
2889         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2890         return DataArrayInt::Meld(tmp);
2891       }
2892
2893       static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
2894       {
2895         std::vector<const DataArrayInt *> tmp;
2896         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2897         return DataArrayInt::Aggregate(tmp);
2898       }
2899
2900       static DataArrayInt *AggregateIndexes(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::AggregateIndexes(tmp);
2905       }
2906
2907       static DataArrayInt *BuildUnion(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::BuildUnion(tmp);
2912       }
2913
2914       static DataArrayInt *BuildIntersection(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::BuildIntersection(tmp);
2919       }
2920
2921       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
2922       {
2923         int tmp;
2924         int r1=self->getMaxValue(tmp);
2925         PyObject *ret=PyTuple_New(2);
2926         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2927         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2928         return ret;
2929       }
2930
2931       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
2932       {
2933         int tmp;
2934         int r1=self->getMinValue(tmp);
2935         PyObject *ret=PyTuple_New(2);
2936         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2937         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2938         return ret;
2939       }
2940
2941       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2942       {
2943         int nbOfCompo=self->getNumberOfComponents();
2944         switch(nbOfCompo)
2945           {
2946           case 1:
2947             {
2948               if(PyInt_Check(obj))
2949                 {
2950                   int val=(int)PyInt_AS_LONG(obj);
2951                   return self->locateValue(val);
2952                 }
2953               else
2954                 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
2955             }
2956           default:
2957             {
2958               std::vector<int> arr;
2959               convertPyToNewIntArr3(obj,arr);
2960               return self->locateTuple(arr);
2961             }
2962           }
2963       }
2964
2965       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2966       {
2967         int nbOfCompo=self->getNumberOfComponents();
2968         switch(nbOfCompo)
2969           {
2970           case 0:
2971             return false;
2972           case 1:
2973             {
2974               if(PyInt_Check(obj))
2975                 {
2976                   int val=(int)PyInt_AS_LONG(obj);
2977                   return self->presenceOfValue(val);
2978                 }
2979               else
2980                 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
2981             }
2982           default:
2983             {
2984               std::vector<int> arr;
2985               convertPyToNewIntArr3(obj,arr);
2986               return self->presenceOfTuple(arr);
2987             }
2988           }
2989       }
2990
2991       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2992       {
2993         const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
2994         const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2995         self->checkAllocated();
2996         int nbOfTuples=self->getNumberOfTuples();
2997         int nbOfComponents=self->getNumberOfComponents();
2998         int it1,ic1;
2999         std::vector<int> vt1,vc1;
3000         std::pair<int, std::pair<int,int> > pt1,pc1;
3001         DataArrayInt *dt1=0,*dc1=0;
3002         int sw;
3003         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3004         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3005         switch(sw)
3006           {
3007           case 1:
3008             {
3009               if(nbOfComponents==1)
3010                 return PyInt_FromLong(self->getIJSafe(it1,0));
3011               return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3012             }
3013           case 2:
3014             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3015           case 3:
3016             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3017           case 4:
3018             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3019           case 5:
3020             return PyInt_FromLong(self->getIJSafe(it1,ic1));
3021           case 6:
3022             {
3023               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3024               std::vector<int> v2(1,ic1);
3025               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3026             }
3027           case 7:
3028             {
3029               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3030               std::vector<int> v2(1,ic1);
3031               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3032             }
3033           case 8:
3034             {
3035               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3036               std::vector<int> v2(1,ic1);
3037               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3038             }
3039           case 9:
3040             {
3041               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3042               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3043             }
3044           case 10:
3045             {
3046               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3047               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3048             }
3049           case 11:
3050             {
3051               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3052               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3053             }
3054           case 12:
3055             {
3056               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3057               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3058             }
3059           case 13:
3060             {
3061               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3062               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3063               std::vector<int> v2(nbOfComp);
3064               for(int i=0;i<nbOfComp;i++)
3065                 v2[i]=pc1.first+i*pc1.second.second;
3066               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3067             }
3068           case 14:
3069             {
3070               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3071               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3072               std::vector<int> v2(nbOfComp);
3073               for(int i=0;i<nbOfComp;i++)
3074                 v2[i]=pc1.first+i*pc1.second.second;
3075               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3076             }
3077           case 15:
3078             {
3079               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3080               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3081               std::vector<int> v2(nbOfComp);
3082               for(int i=0;i<nbOfComp;i++)
3083                 v2[i]=pc1.first+i*pc1.second.second;
3084               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3085             }
3086           case 16:
3087             {
3088               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3089               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3090               std::vector<int> v2(nbOfComp);
3091               for(int i=0;i<nbOfComp;i++)
3092                 v2[i]=pc1.first+i*pc1.second.second;
3093               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3094             }
3095           default:
3096             throw INTERP_KERNEL::Exception(msg);
3097           }
3098       }
3099
3100       DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3101       {
3102         self->checkAllocated();
3103         const char msg[]="Unexpected situation in __setitem__ !";
3104         int nbOfTuples=self->getNumberOfTuples();
3105         int nbOfComponents=self->getNumberOfComponents();
3106         int sw1,sw2;
3107         int i1;
3108         std::vector<int> v1;
3109         DataArrayInt *d1=0;
3110         DataArrayIntTuple *dd1=0;
3111         convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3112         int it1,ic1;
3113         std::vector<int> vt1,vc1;
3114         std::pair<int, std::pair<int,int> > pt1,pc1;
3115         DataArrayInt *dt1=0,*dc1=0;
3116         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3117         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3118         switch(sw2)
3119           {
3120           case 1:
3121             {
3122               switch(sw1)
3123                 {
3124                 case 1:
3125                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3126                   return self;
3127                 case 2:
3128                   tmp=DataArrayInt::New();
3129                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3130                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3131                   return self;
3132                 case 3:
3133                   self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3134                   return self;
3135                 case 4:
3136                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3137                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3138                   return self;
3139                 default:
3140                   throw INTERP_KERNEL::Exception(msg);
3141                 }
3142               break;
3143             }
3144           case 2:
3145             {
3146               switch(sw1)
3147                 {
3148                 case 1:
3149                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3150                   return self;
3151                 case 2:
3152                   tmp=DataArrayInt::New();
3153                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3154                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3155                   return self;
3156                 case 3:
3157                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3158                   return self;
3159                 case 4:
3160                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3161                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3162                   return self;
3163                 default:
3164                   throw INTERP_KERNEL::Exception(msg);
3165                 }
3166               break;
3167             }
3168           case 3:
3169             {
3170               switch(sw1)
3171                 {
3172                 case 1:
3173                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3174                   return self;
3175                 case 2:
3176                   tmp=DataArrayInt::New();
3177                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3178                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3179                   return self;
3180                 case 3:
3181                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3182                   return self;
3183                 case 4:
3184                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3185                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3186                   return self;
3187                 default:
3188                   throw INTERP_KERNEL::Exception(msg);
3189                 }
3190               break;
3191             }
3192           case 4:
3193             {
3194               switch(sw1)
3195                 {
3196                 case 1:
3197                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3198                   return self;
3199                 case 2:
3200                   tmp=DataArrayInt::New();
3201                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3202                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3203                   return self;
3204                 case 3:
3205                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3206                   return self;
3207                 case 4:
3208                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3209                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3210                   return self;
3211                 default:
3212                   throw INTERP_KERNEL::Exception(msg);
3213                 }
3214               break;
3215             }
3216           case 5:
3217             {
3218               switch(sw1)
3219                 {
3220                 case 1:
3221                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3222                   return self;
3223                 case 2:
3224                   tmp=DataArrayInt::New();
3225                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3226                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3227                   return self;
3228                 case 3:
3229                   self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3230                   return self;
3231                 case 4:
3232                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3233                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3234                   return self;
3235                 default:
3236                   throw INTERP_KERNEL::Exception(msg);
3237                 }
3238               break;
3239             }
3240           case 6:
3241             {
3242               switch(sw1)
3243                 {
3244                 case 1:
3245                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3246                   return self;
3247                 case 2:
3248                   tmp=DataArrayInt::New();
3249                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3250                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3251                   return self;
3252                 case 3:
3253                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3254                   return self;
3255                 case 4:
3256                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3257                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3258                   return self;
3259                 default:
3260                   throw INTERP_KERNEL::Exception(msg);
3261                 }
3262               break;
3263             }
3264           case 7:
3265             {
3266               switch(sw1)
3267                 {
3268                 case 1:
3269                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3270                   return self;
3271                 case 2:
3272                   tmp=DataArrayInt::New();
3273                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3274                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3275                   return self;
3276                 case 3:
3277                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3278                   return self;
3279                 case 4:
3280                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3281                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3282                   return self;
3283                 default:
3284                   throw INTERP_KERNEL::Exception(msg);
3285                 }
3286               break;
3287             }
3288           case 8:
3289             {
3290               switch(sw1)
3291                 {
3292                 case 1:
3293                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3294                   return self;
3295                 case 2:
3296                   tmp=DataArrayInt::New();
3297                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3298                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3299                   return self;
3300                 case 3:
3301                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3302                   return self;
3303                 case 4:
3304                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3305                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3306                   return self;
3307                 default:
3308                   throw INTERP_KERNEL::Exception(msg);
3309                 }
3310               break;
3311             }
3312           case 9:
3313             {
3314               switch(sw1)
3315                 {
3316                 case 1:
3317                   self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3318                   return self;
3319                 case 2:
3320                   tmp=DataArrayInt::New();
3321                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3322                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3323                   return self;
3324                 case 3:
3325                   self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3326                   return self;
3327                 case 4:
3328                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3329                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3330                   return self;
3331                 default:
3332                   throw INTERP_KERNEL::Exception(msg);
3333                 }
3334               break;
3335             }
3336           case 10:
3337             {
3338               switch(sw1)
3339                 {
3340                 case 1:
3341                   self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3342                   return self;
3343                 case 2:
3344                   tmp=DataArrayInt::New();
3345                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3346                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3347                   return self;
3348                 case 3:
3349                   self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3350                   return self;
3351                 case 4:
3352                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3353                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3354                   return self;
3355                 default:
3356                   throw INTERP_KERNEL::Exception(msg);
3357                 }
3358               break;
3359             }
3360           case 11:
3361             {
3362               switch(sw1)
3363                 {
3364                 case 1:
3365                   self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3366                   return self;
3367                 case 2:
3368                   tmp=DataArrayInt::New();
3369                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3370                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3371                   return self;
3372                 case 3:
3373                   self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3374                   return self;
3375                 case 4:
3376                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3377                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3378                   return self;
3379                 default:
3380                   throw INTERP_KERNEL::Exception(msg);
3381                 }
3382               break;
3383             }
3384           case 12:
3385             {
3386               switch(sw1)
3387                 {
3388                 case 1:
3389                   self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3390                   return self;
3391                 case 2:
3392                   tmp=DataArrayInt::New();
3393                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3394                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3395                   return self;
3396                 case 3:
3397                   self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3398                   return self;
3399                 case 4:
3400                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3401                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3402                   return self;
3403                 default:
3404                   throw INTERP_KERNEL::Exception(msg);
3405                 }
3406               break;
3407             }
3408           case 13:
3409             {
3410               switch(sw1)
3411                 {
3412                 case 1:
3413                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3414                   return self;
3415                 case 2:
3416                   tmp=DataArrayInt::New();
3417                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3418                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3419                   return self;
3420                 case 3:
3421                   self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3422                   return self;
3423                 case 4:
3424                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3425                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3426                   return self;
3427                 default:
3428                   throw INTERP_KERNEL::Exception(msg);
3429                 }
3430               break;
3431             }
3432           case 14:
3433             {
3434               switch(sw1)
3435                 {
3436                 case 1:
3437                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3438                   return self;
3439                 case 2:
3440                   tmp=DataArrayInt::New();
3441                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3442                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3443                   return self;
3444                 case 3:
3445                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3446                   return self;
3447                 case 4:
3448                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3449                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3450                   return self;
3451                 default:
3452                   throw INTERP_KERNEL::Exception(msg);
3453                 }
3454               break;
3455             }
3456           case 15:
3457             {
3458               switch(sw1)
3459                 {
3460                 case 1:
3461                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3462                   return self;
3463                 case 2:
3464                   tmp=DataArrayInt::New();
3465                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3466                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3467                   return self;
3468                 case 3:
3469                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3470                   return self;
3471                 case 4:
3472                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3473                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3474                   return self;
3475                 default:
3476                   throw INTERP_KERNEL::Exception(msg);
3477                 }
3478               break;
3479             }
3480           case 16:
3481             {
3482               switch(sw1)
3483                 {
3484                 case 1:
3485                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3486                   return self;
3487                 case 2:
3488                   tmp=DataArrayInt::New();
3489                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3490                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3491                   return self;
3492                 case 3:
3493                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3494                   return self;
3495                 case 4:
3496                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3497                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3498                   return self;
3499                 default:
3500                   throw INTERP_KERNEL::Exception(msg);
3501                 }
3502               break;
3503             }
3504           default:
3505             throw INTERP_KERNEL::Exception(msg);
3506           }
3507         return self;
3508       }
3509
3510       DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3511       {
3512         return self->negate();
3513       }
3514  
3515       DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3516       {
3517         const char msg[]="Unexpected situation in __add__ !";
3518         int val;
3519         DataArrayInt *a;
3520         std::vector<int> aa;
3521         DataArrayIntTuple *aaa;
3522         int sw;
3523         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3524         switch(sw)
3525           {
3526           case 1:
3527             {
3528               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3529               ret->applyLin(1,val);
3530               return ret.retn();
3531             }
3532           case 2:
3533             {
3534               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3535               return DataArrayInt::Add(self,aaaa);
3536             }
3537           case 3:
3538             {
3539               return DataArrayInt::Add(self,a);
3540             }
3541           case 4:
3542             {
3543               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3544               return DataArrayInt::Add(self,aaaa);
3545             }
3546           default:
3547             throw INTERP_KERNEL::Exception(msg);
3548           }
3549       }
3550
3551       DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3552       {
3553         const char msg[]="Unexpected situation in __radd__ !";
3554         int val;
3555         DataArrayInt *a;
3556         std::vector<int> aa;
3557         DataArrayIntTuple *aaa;
3558         int sw;
3559         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3560         switch(sw)
3561           {
3562           case 1:
3563             {
3564               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3565               ret->applyLin(1,val);
3566               return ret.retn();
3567             }
3568           case 2:
3569             {
3570               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3571               return DataArrayInt::Add(self,aaaa);
3572             }
3573           case 4:
3574             {
3575               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3576               return DataArrayInt::Add(self,aaaa);
3577             }
3578           default:
3579             throw INTERP_KERNEL::Exception(msg);
3580           }
3581       }
3582
3583       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3584       {
3585         const char msg[]="Unexpected situation in __iadd__ !";
3586         int val;
3587         DataArrayInt *a;
3588         std::vector<int> aa;
3589         DataArrayIntTuple *aaa;
3590         int sw;
3591         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3592         switch(sw)
3593           {
3594           case 1:
3595             {
3596               self->applyLin(1,val);
3597               Py_XINCREF(trueSelf);
3598               return trueSelf;
3599             }
3600           case 2:
3601             {
3602               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3603               self->addEqual(bb);
3604               Py_XINCREF(trueSelf);
3605               return trueSelf;
3606             }
3607           case 3:
3608             {
3609               self->addEqual(a);
3610               Py_XINCREF(trueSelf);
3611               return trueSelf;
3612             }
3613           case 4:
3614             {
3615               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3616               self->addEqual(aaaa);
3617               Py_XINCREF(trueSelf);
3618               return trueSelf;
3619             }
3620           default:
3621             throw INTERP_KERNEL::Exception(msg);
3622           }
3623       }
3624
3625       DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3626       {
3627         const char msg[]="Unexpected situation in __sub__ !";
3628         int val;
3629         DataArrayInt *a;
3630         std::vector<int> aa;
3631         DataArrayIntTuple *aaa;
3632         int sw;
3633         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3634         switch(sw)
3635           {
3636           case 1:
3637             {
3638               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3639               ret->applyLin(1,-val);
3640               return ret.retn();
3641             }
3642           case 2:
3643             {
3644               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3645               return DataArrayInt::Substract(self,aaaa);
3646             }
3647           case 3:
3648             {
3649               return DataArrayInt::Substract(self,a);
3650             }
3651           case 4:
3652             {
3653               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3654               return DataArrayInt::Substract(self,aaaa);
3655             }
3656           default:
3657             throw INTERP_KERNEL::Exception(msg);
3658           }
3659       }
3660
3661       DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3662       {
3663         const char msg[]="Unexpected situation in __rsub__ !";
3664         int val;
3665         DataArrayInt *a;
3666         std::vector<int> aa;
3667         DataArrayIntTuple *aaa;
3668         int sw;
3669         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3670         switch(sw)
3671           {
3672           case 1:
3673             {
3674               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3675               ret->applyLin(-1,val);
3676               return ret.retn();
3677             }
3678           case 2:
3679             {
3680               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3681               return DataArrayInt::Substract(aaaa,self);
3682             }
3683           case 4:
3684             {
3685               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3686               return DataArrayInt::Substract(aaaa,self);
3687             }
3688           default:
3689             throw INTERP_KERNEL::Exception(msg);
3690           }
3691       }
3692
3693       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3694       {
3695         const char msg[]="Unexpected situation in __isub__ !";
3696         int val;
3697         DataArrayInt *a;
3698         std::vector<int> aa;
3699         DataArrayIntTuple *aaa;
3700         int sw;
3701         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3702         switch(sw)
3703           {
3704           case 1:
3705             {
3706               self->applyLin(1,-val);
3707               Py_XINCREF(trueSelf);
3708               return trueSelf;
3709             }
3710           case 2:
3711             {
3712               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3713               self->substractEqual(bb);
3714               Py_XINCREF(trueSelf);
3715               return trueSelf;
3716             }
3717           case 3:
3718             {
3719               self->substractEqual(a);
3720               Py_XINCREF(trueSelf);
3721               return trueSelf;
3722             }
3723           case 4:
3724             {
3725               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3726               self->substractEqual(aaaa);
3727               Py_XINCREF(trueSelf);
3728               return trueSelf;
3729             }
3730           default:
3731             throw INTERP_KERNEL::Exception(msg);
3732           }
3733       }
3734
3735       DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3736       {
3737         const char msg[]="Unexpected situation in __mul__ !";
3738         int val;
3739         DataArrayInt *a;
3740         std::vector<int> aa;
3741         DataArrayIntTuple *aaa;
3742         int sw;
3743         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3744         switch(sw)
3745           {
3746           case 1:
3747             {
3748               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3749               ret->applyLin(val,0);
3750               return ret.retn();
3751             }
3752           case 2:
3753             {
3754               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3755               return DataArrayInt::Multiply(self,aaaa);
3756             }
3757           case 3:
3758             {
3759               return DataArrayInt::Multiply(self,a);
3760             }
3761           case 4:
3762             {
3763               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3764               return DataArrayInt::Multiply(self,aaaa);
3765             }
3766           default:
3767             throw INTERP_KERNEL::Exception(msg);
3768           }
3769       }
3770
3771       DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3772       {
3773         const char msg[]="Unexpected situation in __rmul__ !";
3774         int val;
3775         DataArrayInt *a;
3776         std::vector<int> aa;
3777         DataArrayIntTuple *aaa;
3778         int sw;
3779         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3780         switch(sw)
3781           {
3782           case 1:
3783             {
3784               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3785               ret->applyLin(val,0);
3786               return ret.retn();
3787             }
3788           case 2:
3789             {
3790               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3791               return DataArrayInt::Multiply(self,aaaa);
3792             }
3793           case 4:
3794             {
3795               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3796               return DataArrayInt::Multiply(self,aaaa);
3797             }
3798           default:
3799             throw INTERP_KERNEL::Exception(msg);
3800           }
3801       }
3802
3803       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3804       {
3805         const char msg[]="Unexpected situation in __imul__ !";
3806         int val;
3807         DataArrayInt *a;
3808         std::vector<int> aa;
3809         DataArrayIntTuple *aaa;
3810         int sw;
3811         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3812         switch(sw)
3813           {
3814           case 1:
3815             {
3816               self->applyLin(val,0);
3817               Py_XINCREF(trueSelf);
3818               return trueSelf;
3819             }
3820           case 2:
3821             {
3822               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3823               self->multiplyEqual(bb);
3824               Py_XINCREF(trueSelf);
3825               return trueSelf;
3826             }
3827           case 3:
3828             {
3829               self->multiplyEqual(a);
3830               Py_XINCREF(trueSelf);
3831               return trueSelf;
3832             }
3833           case 4:
3834             {
3835               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3836               self->multiplyEqual(aaaa);
3837               Py_XINCREF(trueSelf);
3838               return trueSelf;
3839             }
3840           default:
3841             throw INTERP_KERNEL::Exception(msg);
3842           }
3843       }
3844
3845       DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3846       {
3847         const char msg[]="Unexpected situation in __div__ !";
3848         int val;
3849         DataArrayInt *a;
3850         std::vector<int> aa;
3851         DataArrayIntTuple *aaa;
3852         int sw;
3853         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3854         switch(sw)
3855           {
3856           case 1:
3857             {
3858               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3859               ret->applyDivideBy(val);
3860               return ret.retn();
3861             }
3862           case 2:
3863             {
3864               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3865               return DataArrayInt::Divide(self,aaaa);
3866             }
3867           case 3:
3868             {
3869               return DataArrayInt::Divide(self,a);
3870             }
3871           case 4:
3872             {
3873               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3874               return DataArrayInt::Divide(self,aaaa);
3875             }
3876           default:
3877             throw INTERP_KERNEL::Exception(msg);
3878           }
3879       }
3880
3881       DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3882       {
3883         const char msg[]="Unexpected situation in __rdiv__ !";
3884         int val;
3885         DataArrayInt *a;
3886         std::vector<int> aa;
3887         DataArrayIntTuple *aaa;
3888         int sw;
3889         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3890         switch(sw)
3891           {
3892           case 1:
3893             {
3894               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3895               ret->applyInv(val);
3896               return ret.retn();
3897             }
3898           case 2:
3899             {
3900               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3901               return DataArrayInt::Divide(aaaa,self);
3902             }
3903           case 4:
3904             {
3905               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3906               return DataArrayInt::Divide(aaaa,self);
3907             }
3908           default:
3909             throw INTERP_KERNEL::Exception(msg);
3910           }
3911       }
3912
3913       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3914       {
3915         const char msg[]="Unexpected situation in __idiv__ !";
3916         int val;
3917         DataArrayInt *a;
3918         std::vector<int> aa;
3919         DataArrayIntTuple *aaa;
3920         int sw;
3921         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3922         switch(sw)
3923           {
3924           case 1:
3925             {
3926               self->applyDivideBy(val);
3927               Py_XINCREF(trueSelf);
3928               return trueSelf;
3929             }
3930           case 2:
3931             {
3932               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3933               self->divideEqual(bb);
3934               Py_XINCREF(trueSelf);
3935               return trueSelf;
3936             }
3937           case 3:
3938             {
3939               self->divideEqual(a);
3940               Py_XINCREF(trueSelf);
3941               return trueSelf;
3942             }
3943           case 4:
3944             {
3945               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3946               self->divideEqual(aaaa);
3947               Py_XINCREF(trueSelf);
3948               return trueSelf;
3949             }
3950           default:
3951             throw INTERP_KERNEL::Exception(msg);
3952           }
3953       }
3954
3955       DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3956       {
3957         const char msg[]="Unexpected situation in __mod__ !";
3958         int val;
3959         DataArrayInt *a;
3960         std::vector<int> aa;
3961         DataArrayIntTuple *aaa;
3962         int sw;
3963         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3964         switch(sw)
3965           {
3966           case 1:
3967             {
3968               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3969               ret->applyModulus(val);
3970               return ret.retn();
3971             }
3972           case 2:
3973             {
3974               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3975               return DataArrayInt::Modulus(self,aaaa);
3976             }
3977           case 3:
3978             {
3979               return DataArrayInt::Modulus(self,a);
3980             }
3981           case 4:
3982             {
3983               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3984               return DataArrayInt::Modulus(self,aaaa);
3985             }
3986           default:
3987             throw INTERP_KERNEL::Exception(msg);
3988           }
3989       }
3990
3991       DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3992       {
3993         const char msg[]="Unexpected situation in __rmod__ !";
3994         int val;
3995         DataArrayInt *a;
3996         std::vector<int> aa;
3997         DataArrayIntTuple *aaa;
3998         int sw;
3999         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4000         switch(sw)
4001           {
4002           case 1:
4003             {
4004               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4005               ret->applyRModulus(val);
4006               return ret.retn();
4007             }
4008           case 2:
4009             {
4010               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4011               return DataArrayInt::Modulus(aaaa,self);
4012             }
4013           case 3:
4014             {
4015               return DataArrayInt::Modulus(a,self);
4016             }
4017           case 4:
4018             {
4019               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4020               return DataArrayInt::Modulus(aaaa,self);
4021             }
4022           default:
4023             throw INTERP_KERNEL::Exception(msg);
4024           }
4025       }
4026
4027       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4028       {
4029         const char msg[]="Unexpected situation in __imod__ !";
4030         int val;
4031         DataArrayInt *a;
4032         std::vector<int> aa;
4033         DataArrayIntTuple *aaa;
4034         int sw;
4035         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4036         switch(sw)
4037           {
4038           case 1:
4039             {
4040               self->applyModulus(val);
4041               Py_XINCREF(trueSelf);
4042               return trueSelf;
4043             }
4044           case 3:
4045             {
4046               self->modulusEqual(a);
4047               Py_XINCREF(trueSelf);
4048               return trueSelf;
4049             }
4050           case 4:
4051             {
4052               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4053               self->modulusEqual(aaaa);
4054               Py_XINCREF(trueSelf);
4055               return trueSelf;
4056             }
4057           default:
4058             throw INTERP_KERNEL::Exception(msg);
4059           }
4060       }
4061
4062       DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4063       {
4064         const char msg[]="Unexpected situation in __pow__ !";
4065         int val;
4066         DataArrayInt *a;
4067         std::vector<int> aa;
4068         DataArrayIntTuple *aaa;
4069         int sw;
4070         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4071         switch(sw)
4072           {
4073           case 1:
4074             {
4075               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4076               ret->applyPow(val);
4077               return ret.retn();
4078             }
4079           case 2:
4080             {
4081               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4082               return DataArrayInt::Pow(self,aaaa);
4083             }
4084           case 3:
4085             {
4086               return DataArrayInt::Pow(self,a);
4087             }
4088           case 4:
4089             {
4090               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4091               return DataArrayInt::Pow(self,aaaa);
4092             }
4093           default:
4094             throw INTERP_KERNEL::Exception(msg);
4095           }
4096       }
4097
4098       DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4099       {
4100         const char msg[]="Unexpected situation in __rpow__ !";
4101         int val;
4102         DataArrayInt *a;
4103         std::vector<int> aa;
4104         DataArrayIntTuple *aaa;
4105         int sw;
4106         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4107         switch(sw)
4108           {
4109           case 1:
4110             {
4111               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4112               ret->applyRPow(val);
4113               return ret.retn();
4114             }
4115           case 2:
4116             {
4117               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4118               return DataArrayInt::Pow(aaaa,self);
4119             }
4120           case 3:
4121             {
4122               return DataArrayInt::Pow(a,self);
4123             }
4124           case 4:
4125             {
4126               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4127               return DataArrayInt::Pow(aaaa,self);
4128             }
4129           default:
4130             throw INTERP_KERNEL::Exception(msg);
4131           }
4132       }
4133    
4134       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4135       {
4136         const char msg[]="Unexpected situation in __ipow__ !";
4137         int val;
4138         DataArrayInt *a;
4139         std::vector<int> aa;
4140         DataArrayIntTuple *aaa;
4141         int sw;
4142         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4143         switch(sw)
4144           {
4145           case 1:
4146             {
4147               self->applyPow(val);
4148               Py_XINCREF(trueSelf);
4149               return trueSelf;
4150             }
4151           case 3:
4152             {
4153               self->powEqual(a);
4154               Py_XINCREF(trueSelf);
4155               return trueSelf;
4156             }
4157           case 4:
4158             {
4159               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4160               self->powEqual(aaaa);
4161               Py_XINCREF(trueSelf);
4162               return trueSelf;
4163             }
4164           default:
4165             throw INTERP_KERNEL::Exception(msg);
4166           }
4167       }
4168
4169       std::string __repr__() const throw(INTERP_KERNEL::Exception)
4170       {
4171         std::ostringstream oss;
4172         self->reprQuickOverview(oss);
4173         return oss.str();
4174       }
4175       
4176       void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4177       {
4178         int szArr,sw,iTypppArr;
4179         std::vector<int> stdvecTyyppArr;
4180         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4181         self->pushBackValsSilent(tmp,tmp+szArr);
4182       }
4183       
4184       PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4185       {
4186         std::vector<int> ret1;
4187         std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4188         std::size_t sz=ret0.size();
4189         PyObject *pyRet=PyTuple_New(2);
4190         PyObject *pyRet0=PyList_New((int)sz);
4191         PyObject *pyRet1=PyList_New((int)sz);
4192         for(std::size_t i=0;i<sz;i++)
4193           {
4194             PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4195             PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4196           }
4197         PyTuple_SetItem(pyRet,0,pyRet0);
4198         PyTuple_SetItem(pyRet,1,pyRet1);
4199         return pyRet;
4200       }
4201       
4202       PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4203       {
4204         DataArrayInt *ret0=0,*ret1=0;
4205         self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4206         PyObject *pyRet=PyTuple_New(2);
4207         PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4208         PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4209         return pyRet;
4210       }
4211     }
4212   };
4213
4214   class DataArrayIntTuple;
4215
4216   class DataArrayIntIterator
4217   {
4218   public:
4219     DataArrayIntIterator(DataArrayInt *da);
4220     ~DataArrayIntIterator();
4221     %extend
4222     {
4223       PyObject *next()
4224       {
4225         DataArrayIntTuple *ret=self->nextt();
4226         if(ret)
4227           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4228         else
4229           {
4230             PyErr_SetString(PyExc_StopIteration,"No more data.");
4231             return 0;
4232           }
4233       }
4234     }
4235   };
4236
4237   class DataArrayIntTuple
4238   {
4239   public:
4240     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4241     DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4242     %extend
4243     {
4244       std::string __str__() const throw(INTERP_KERNEL::Exception)
4245       {
4246         return self->repr();
4247       }
4248
4249       int __int__() const throw(INTERP_KERNEL::Exception)
4250       {
4251         return self->intValue();
4252       }
4253
4254       DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4255       {
4256         return self->buildDAInt(1,self->getNumberOfCompo());
4257       }
4258
4259       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4260       {
4261         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4262         ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4263         Py_XINCREF(trueSelf);
4264         return trueSelf;
4265       }
4266   
4267       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4268       {
4269         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4270         ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4271         Py_XINCREF(trueSelf);
4272         return trueSelf;
4273       }
4274   
4275       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4276       {
4277         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4278         ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4279         Py_XINCREF(trueSelf);
4280         return trueSelf;
4281       }
4282
4283       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4284       {
4285         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4286         ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4287         Py_XINCREF(trueSelf);
4288         return trueSelf;
4289       }
4290
4291       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4292       {
4293         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4294         ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4295         Py_XINCREF(trueSelf);
4296         return trueSelf;
4297       }
4298   
4299       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4300       {
4301         const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4302         int sw;
4303         int singleVal;
4304         std::vector<int> multiVal;
4305         std::pair<int, std::pair<int,int> > slic;
4306         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4307         const int *pt=self->getConstPointer();
4308         int nbc=self->getNumberOfCompo();
4309         convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4310         switch(sw)
4311           {
4312           case 1:
4313             {
4314               if(singleVal>=nbc)
4315                 {
4316                   std::ostringstream oss;
4317                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4318                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4319                 }
4320               if(singleVal>=0)
4321                 return PyInt_FromLong(pt[singleVal]);
4322               else
4323                 {
4324                   if(nbc+singleVal>0)
4325                     return PyInt_FromLong(pt[nbc+singleVal]);
4326                   else
4327                     {
4328                       std::ostringstream oss;
4329                       oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4330                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4331                     }
4332                 }
4333             }
4334           case 2:
4335             {
4336               PyObject *t=PyTuple_New(multiVal.size());
4337               for(int j=0;j<(int)multiVal.size();j++)
4338                 {
4339                   int cid=multiVal[j];
4340                   if(cid>=nbc)
4341                     {
4342                       std::ostringstream oss;
4343                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4344                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4345                     }
4346                   PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4347                 }
4348               return t;
4349             }
4350           case 3:
4351             {
4352               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4353               PyObject *t=PyTuple_New(sz);
4354               for(int j=0;j<sz;j++)
4355                 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4356               return t;
4357             }
4358           default:
4359             throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4360           }
4361       }
4362
4363       DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4364       {
4365         const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4366         const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4367         int sw1,sw2;
4368         int singleValV;
4369         std::vector<int> multiValV;
4370         std::pair<int, std::pair<int,int> > slicV;
4371         ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4372         int nbc=self->getNumberOfCompo();
4373         convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4374         int singleVal;
4375         std::vector<int> multiVal;
4376         std::pair<int, std::pair<int,int> > slic;
4377         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4378         int *pt=self->getPointer();
4379         convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4380         switch(sw2)
4381           {
4382           case 1:
4383             {
4384               if(singleVal>=nbc)
4385                 {
4386                   std::ostringstream oss;
4387                   oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4388                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4389                 }
4390               switch(sw1)
4391                 {
4392                 case 1:
4393                   {
4394                     pt[singleVal]=singleValV;
4395                     return self;
4396                   }
4397                 case 2:
4398                   {
4399                     if(multiValV.size()!=1)
4400                       {
4401                         std::ostringstream oss;
4402                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4403                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4404                       }
4405                     pt[singleVal]=multiValV[0];
4406                     return self;
4407                   }
4408                 case 4:
4409                   {
4410                     pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4411                     return self;
4412                   }
4413                 default:
4414                   throw INTERP_KERNEL::Exception(msg);
4415                 }
4416             }
4417           case 2:
4418             {
4419               switch(sw1)
4420                 {
4421                 case 1:
4422                   {
4423                     for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4424                       {
4425                         if(*it>=nbc)
4426                           {
4427                             std::ostringstream oss;
4428                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4429                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4430                           }
4431                         pt[*it]=singleValV;
4432                       }
4433                     return self;
4434                   }
4435                 case 2:
4436                   {
4437                     if(multiVal.size()!=multiValV.size())
4438                       {
4439                         std::ostringstream oss;
4440                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4441                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4442                       }
4443                     for(int i=0;i<(int)multiVal.size();i++)
4444                       {
4445                         int pos=multiVal[i];
4446                         if(pos>=nbc)
4447                           {
4448                             std::ostringstream oss;
4449                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4450                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4451                           }
4452                         pt[multiVal[i]]=multiValV[i];
4453                       }
4454                     return self;
4455                   }
4456                 case 4:
4457                   {
4458                     const int *ptV=daIntTyyppV->getConstPointer();
4459                     if(nbc>daIntTyyppV->getNumberOfCompo())
4460                       {
4461                         std::ostringstream oss;
4462                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4463                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4464                       }
4465                     std::copy(ptV,ptV+nbc,pt);
4466                     return self;
4467                   }
4468                 default:
4469                   throw INTERP_KERNEL::Exception(msg);
4470                 }
4471             }
4472           case 3:
4473             {
4474               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4475               switch(sw1)
4476                 {
4477                 case 1:
4478                   {
4479                     for(int j=0;j<sz;j++)
4480                       pt[slic.first+j*slic.second.second]=singleValV;
4481                     return self;
4482                   }
4483                 case 2:
4484                   {
4485                     if(sz!=(int)multiValV.size())
4486                       {
4487                         std::ostringstream oss;
4488                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4489                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4490                       }
4491                     for(int j=0;j<sz;j++)
4492                       pt[slic.first+j*slic.second.second]=multiValV[j];
4493                     return self;
4494                   }
4495                 case 4:
4496                   {
4497                     const int *ptV=daIntTyyppV->getConstPointer();
4498                     if(sz>daIntTyyppV->getNumberOfCompo())
4499                       {
4500                         std::ostringstream oss;
4501                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4502                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4503                       }
4504                     for(int j=0;j<sz;j++)
4505                       pt[slic.first+j*slic.second.second]=ptV[j];
4506                     return self;
4507                   }
4508                 default:
4509                   throw INTERP_KERNEL::Exception(msg);
4510                 }
4511             }
4512           default:
4513             throw INTERP_KERNEL::Exception(msg);
4514           }
4515       }
4516     }
4517   };
4518
4519   class DataArrayChar : public DataArray
4520   {
4521   public:
4522     virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4523     int getHashCode() const throw(INTERP_KERNEL::Exception);
4524     bool empty() const throw(INTERP_KERNEL::Exception);
4525     void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4526     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4527     void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4528     void pushBackValsSilent(const char *valsBg, const char *valsEnd) throw(INTERP_KERNEL::Exception);
4529     char popBackSilent() throw(INTERP_KERNEL::Exception);
4530     void pack() const throw(INTERP_KERNEL::Exception);
4531     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4532     bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4533     bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4534     void reverse() throw(INTERP_KERNEL::Exception);
4535     void fillWithZero() throw(INTERP_KERNEL::Exception);
4536     void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4537     std::string repr() const throw(INTERP_KERNEL::Exception);
4538     std::string reprZip() const throw(INTERP_KERNEL::Exception);
4539     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4540     DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4541     DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4542     DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4543     bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4544     DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4545     DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4546     void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4547     void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4548     char front() const throw(INTERP_KERNEL::Exception);
4549     char back() const throw(INTERP_KERNEL::Exception);
4550     void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4551     void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4552     char *getPointer() throw(INTERP_KERNEL::Exception);
4553     DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4554     DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4555     int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4556     bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4557     char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4558     char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4559     char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4560     char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4561     DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4562     static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4563     static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4564     %extend
4565     {
4566       int __len__() const throw(INTERP_KERNEL::Exception)
4567       {
4568         if(self->isAllocated())
4569           {
4570             return self->getNumberOfTuples();
4571           }
4572         else
4573           {
4574             throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4575           }
4576       }
4577       
4578       PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4579       {
4580         std::string ret1;
4581         bool ret0=self->isEqualIfNotWhy(other,ret1);
4582         PyObject *ret=PyTuple_New(2);
4583         PyObject *ret0Py=ret0?Py_True:Py_False;
4584         Py_XINCREF(ret0Py);
4585         PyTuple_SetItem(ret,0,ret0Py);
4586         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4587         return ret;
4588       }
4589       
4590       DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4591       {
4592         void *da=0;
4593         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4594         if (!SWIG_IsOK(res1))
4595           {
4596             int size;
4597             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4598             if(size!=self->getNumberOfTuples())
4599               {
4600                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4601               }
4602             return self->renumber(tmp);
4603           }
4604         else
4605           {
4606             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4607             if(!da2)
4608               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4609             da2->checkAllocated();
4610             int size=self->getNumberOfTuples();
4611             if(size!=self->getNumberOfTuples())
4612               {
4613                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4614               }
4615             return self->renumber(da2->getConstPointer());
4616           }
4617       }
4618       
4619       DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4620       {
4621         void *da=0;
4622         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4623         if (!SWIG_IsOK(res1))
4624           {
4625             int size;
4626             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4627             if(size!=self->getNumberOfTuples())
4628               {
4629                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4630               }
4631             return self->renumberR(tmp);
4632           }
4633         else
4634           {
4635             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4636             if(!da2)
4637               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4638             da2->checkAllocated();
4639             int size=self->getNumberOfTuples();
4640             if(size!=self->getNumberOfTuples())
4641               {
4642                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4643               }
4644             return self->renumberR(da2->getConstPointer());
4645           }
4646       }
4647       
4648       DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4649       {
4650         void *da=0;
4651         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4652         if (!SWIG_IsOK(res1))
4653           {
4654             int size;
4655             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4656             if(size!=self->getNumberOfTuples())
4657               {
4658                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4659               }
4660             return self->renumberAndReduce(tmp,newNbOfTuple);
4661           }
4662         else
4663           {
4664             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4665             if(!da2)
4666               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4667             da2->checkAllocated();
4668             int size=self->getNumberOfTuples();
4669             if(size!=self->getNumberOfTuples())
4670               {
4671                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4672               }
4673             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4674           }
4675       }
4676       
4677       static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4678       {
4679         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4680         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4681         return DataArrayChar::Aggregate(tmp);
4682       }
4683       
4684       static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4685       {
4686         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4687         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4688         return DataArrayChar::Meld(tmp);
4689       }
4690     }
4691   };
4692   
4693   class DataArrayByteIterator;
4694
4695   class DataArrayByte : public DataArrayChar
4696   {
4697   public:
4698     static DataArrayByte *New();
4699     DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4700     DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4701     char byteValue() const throw(INTERP_KERNEL::Exception);
4702     %extend
4703     {
4704       DataArrayByte() throw(INTERP_KERNEL::Exception)
4705         {
4706           return DataArrayByte::New();
4707         }
4708
4709       static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4710       {
4711         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) !";
4712         if(PyList_Check(elt0) || PyTuple_Check(elt0))
4713           {
4714             if(nbOfTuples)
4715               {
4716                 if(PyInt_Check(nbOfTuples))
4717                   {
4718                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4719                     if(nbOfTuples1<0)
4720                       throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4721                     if(nbOfComp)
4722                       {
4723                         if(PyInt_Check(nbOfComp))
4724                           {//DataArrayByte.New([1,3,4,5],2,2)
4725                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4726                             if(nbOfCompo<0)
4727                               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4728                             MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4729                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4730                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4731                             return ret.retn();
4732                           }
4733                         else
4734                           throw INTERP_KERNEL::Exception(msg);
4735                       }
4736                     else
4737                       {//DataArrayByte.New([1,3,4],3)
4738                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4739                         int tmpp1=-1;
4740                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4741                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4742                         return ret.retn();
4743                       }
4744                   }
4745                 else
4746                   throw INTERP_KERNEL::Exception(msg);
4747               }
4748             else
4749               {// DataArrayByte.New([1,3,4])
4750                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4751                 int tmpp1=-1,tmpp2=-1;
4752                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4753                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4754                 return ret.retn();
4755               }
4756           }
4757         else if(PyInt_Check(elt0))
4758           {
4759             int nbOfTuples1=PyInt_AS_LONG(elt0);
4760             if(nbOfTuples1<0)
4761               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4762             if(nbOfTuples)
4763               {
4764                 if(!nbOfComp)
4765                   {
4766                     if(PyInt_Check(nbOfTuples))
4767                       {//DataArrayByte.New(5,2)
4768                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4769                         if(nbOfCompo<0)
4770                           throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4771                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4772                         ret->alloc(nbOfTuples1,nbOfCompo);
4773                         return ret.retn();
4774                       }
4775                     else
4776                       throw INTERP_KERNEL::Exception(msg);
4777                   }
4778                 else
4779                   throw INTERP_KERNEL::Exception(msg);
4780               }
4781             else
4782               {//DataArrayByte.New(5)
4783                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4784                 ret->alloc(nbOfTuples1,1);
4785                 return ret.retn();
4786               }
4787           }
4788         else
4789           throw INTERP_KERNEL::Exception(msg);
4790       }
4791
4792       DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4793         {
4794           return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4795         }
4796    
4797       std::string __repr__() const throw(INTERP_KERNEL::Exception)
4798       {
4799         std::ostringstream oss;
4800         self->reprQuickOverview(oss);
4801         return oss.str();
4802       }
4803   
4804       int __int__() const throw(INTERP_KERNEL::Exception)
4805       {
4806         return (int) self->byteValue();
4807       }
4808
4809       DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
4810       {
4811         return self->iterator();
4812       }
4813
4814       int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4815       {
4816         return (int)self->getIJ(tupleId,compoId);
4817       }
4818       
4819       int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4820       {
4821         return (int)self->getIJSafe(tupleId,compoId);
4822       }
4823
4824       std::string __str__() const throw(INTERP_KERNEL::Exception)
4825       {
4826         return self->repr();
4827       }
4828
4829       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
4830       {
4831         const char *vals=self->getConstPointer();
4832         int nbOfComp=self->getNumberOfComponents();
4833         int nbOfTuples=self->getNumberOfTuples();
4834         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4835       }
4836    
4837       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4838       {
4839         int sz=-1,sw=-1;
4840         int ival=-1; std::vector<int> ivval;
4841         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4842         std::vector<char> vals(sz);
4843         std::copy(pt,pt+sz,vals.begin());
4844         return self->presenceOfTuple(vals);
4845       }
4846
4847       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4848       {
4849         int sz=-1,sw=-1;
4850         int ival=-1; std::vector<int> ivval;
4851         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4852         std::vector<char> vals2(sz);
4853         std::copy(pt,pt+sz,vals2.begin());
4854         return self->presenceOfValue(vals2);
4855       }
4856
4857       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4858       {
4859         int sz=-1,sw=-1;
4860         int ival=-1; std::vector<int> ivval;
4861         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4862         std::vector<char> vals2(sz);
4863         std::copy(pt,pt+sz,vals2.begin());
4864         return self->locateValue(vals2);
4865       }
4866
4867       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4868       {
4869         int sz=-1,sw=-1;
4870         int ival=-1; std::vector<int> ivval;
4871         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4872         std::vector<char> vals(sz);
4873         std::copy(pt,pt+sz,vals.begin());
4874         return self->locateTuple(vals);
4875       }
4876
4877       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
4878       {
4879         int sz=-1,sw=-1;
4880         int ival=-1; std::vector<int> ivval;
4881         const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
4882         std::vector<char> vals(sz);
4883         std::copy(pt,pt+sz,vals.begin());
4884         return self->search(vals);
4885       }
4886
4887       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
4888       {
4889         int sz=self->getNumberOfComponents();
4890         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
4891         self->getTuple(tupleId,tmp);
4892         PyObject *ret=PyTuple_New(sz);
4893         for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
4894         return ret;
4895       }
4896
4897       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
4898       {
4899         int tmp;
4900         int r1=(int)self->getMaxValue(tmp);
4901         PyObject *ret=PyTuple_New(2);
4902         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4903         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4904         return ret;
4905       }
4906
4907       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
4908       {
4909         int tmp;
4910         int r1=(int)self->getMinValue(tmp);
4911         PyObject *ret=PyTuple_New(2);
4912         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4913         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4914         return ret;
4915       }
4916
4917       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4918       {
4919         int nbOfCompo=self->getNumberOfComponents();
4920         switch(nbOfCompo)
4921           {
4922           case 1:
4923             {
4924               if(PyInt_Check(obj))
4925                 {
4926                   int val=(int)PyInt_AS_LONG(obj);
4927                   return self->locateValue(val);
4928                 }
4929               else
4930                 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
4931             }
4932           default:
4933             return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
4934           }
4935       }
4936
4937       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4938       {
4939         int nbOfCompo=self->getNumberOfComponents();
4940         switch(nbOfCompo)
4941           {
4942           case 0:
4943             return false;
4944           case 1:
4945             {
4946               if(PyInt_Check(obj))
4947                 {
4948                   int val=(int)PyInt_AS_LONG(obj);
4949                   return self->presenceOfValue(val);
4950                 }
4951               else
4952                 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
4953             }
4954           default:
4955             return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
4956           }
4957       }
4958     }
4959   };
4960
4961   class DataArrayByteTuple;
4962
4963   class DataArrayByteIterator
4964   {
4965   public:
4966     DataArrayByteIterator(DataArrayByte *da);
4967     ~DataArrayByteIterator();
4968   };
4969
4970   class DataArrayByteTuple
4971   {
4972   public:
4973     std::string repr() const throw(INTERP_KERNEL::Exception);
4974     DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4975     %extend
4976     {
4977       std::string __str__() const throw(INTERP_KERNEL::Exception)
4978       {
4979         return self->repr();
4980       }
4981       
4982       char __int__() const throw(INTERP_KERNEL::Exception)
4983       {
4984         return self->byteValue();
4985       }
4986       
4987       DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
4988       {
4989         return self->buildDAByte(1,self->getNumberOfCompo());
4990       }
4991     }
4992   };
4993   
4994   class DataArrayAsciiCharIterator;
4995   
4996   class DataArrayAsciiChar : public DataArrayChar
4997   {
4998   public:
4999     static DataArrayAsciiChar *New();
5000     DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5001     DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5002     char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5003     %extend
5004     {
5005       DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5006         {
5007           return DataArrayAsciiChar::New();
5008         }
5009
5010       static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5011       {
5012         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) !";
5013         if(PyList_Check(elt0) || PyTuple_Check(elt0))
5014           {
5015             if(nbOfTuples)
5016               {
5017                 if(PyInt_Check(nbOfTuples))
5018                   {
5019                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5020                     if(nbOfTuples1<0)
5021                       throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5022                     if(nbOfComp)
5023                       {
5024                         if(PyInt_Check(nbOfComp))
5025                           {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5026                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5027                             if(nbOfCompo<0)
5028                               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5029                             MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5030                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5031                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5032                             return ret.retn();
5033                           }
5034                         else
5035                           throw INTERP_KERNEL::Exception(msg);
5036                       }
5037                     else
5038                       {//DataArrayAsciiChar.New([1,3,4],3)
5039                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5040                         int tmpp1=-1;
5041                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5042                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5043                         return ret.retn();
5044                       }
5045                   }
5046                 else if(PyString_Check(nbOfTuples))
5047                   {
5048                     if(PyString_Size(nbOfTuples)!=1)
5049                       throw INTERP_KERNEL::Exception(msg);
5050                     //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5051                     std::vector<std::string> tmp;
5052                     if(fillStringVector(elt0,tmp))
5053                       return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5054                     else
5055                       throw INTERP_KERNEL::Exception(msg);
5056                   }
5057                 else
5058                   throw INTERP_KERNEL::Exception(msg);
5059               }
5060             else
5061               {
5062                 std::vector<std::string> tmmp;
5063                 if(fillStringVector(elt0,tmmp))
5064                   //DataArrayAsciiChar.New(["abc","de","fghi"])
5065                   return DataArrayAsciiChar::New(tmmp,' ');
5066                 else
5067                   {
5068                     // DataArrayAsciiChar.New([1,3,4])
5069                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5070                     int tmpp1=-1,tmpp2=-1;
5071                     std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5072                     ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5073                     return ret.retn();
5074                   }
5075               }
5076           }
5077         else if(PyInt_Check(elt0))
5078           {
5079             int nbOfTuples1=PyInt_AS_LONG(elt0);
5080             if(nbOfTuples1<0)
5081               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5082             if(nbOfTuples)
5083               {
5084                 if(!nbOfComp)
5085                   {
5086                     if(PyInt_Check(nbOfTuples))
5087                       {//DataArrayAsciiChar.New(5,2)
5088                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5089                         if(nbOfCompo<0)
5090                           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5091                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5092                         ret->alloc(nbOfTuples1,nbOfCompo);
5093                         return ret.retn();
5094                       }
5095                     else
5096                       throw INTERP_KERNEL::Exception(msg);
5097                   }
5098                 else
5099                   throw INTERP_KERNEL::Exception(msg);
5100               }
5101             else
5102               {//DataArrayAsciiChar.New(5)
5103                 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5104                 ret->alloc(nbOfTuples1,1);
5105                 return ret.retn();
5106               }
5107           }
5108         else
5109           throw INTERP_KERNEL::Exception(msg);
5110       }
5111
5112       DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5113         {
5114           return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5115         }
5116
5117       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5118       {
5119         std::ostringstream oss;
5120         self->reprQuickOverview(oss);
5121         return oss.str();
5122       }
5123
5124       DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5125       {
5126         return self->iterator();
5127       }
5128
5129       std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5130       {
5131         char tmp[2]; tmp[1]='\0';
5132         tmp[0]=self->getIJ(tupleId,compoId);
5133         return std::string(tmp);
5134       }
5135    
5136       std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5137       {
5138         char tmp[2]; tmp[1]='\0';
5139         tmp[0]=self->getIJSafe(tupleId,compoId);
5140         return std::string(tmp);
5141       }
5142
5143       std::string __str__() const throw(INTERP_KERNEL::Exception)
5144       {
5145         return self->repr();
5146       }
5147
5148       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5149       {
5150         const char *vals=self->getConstPointer();
5151         int nbOfComp=self->getNumberOfComponents();
5152         int nbOfTuples=self->getNumberOfTuples();
5153         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5154       }
5155
5156       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5157       {
5158         if(PyString_Check(tupl))
5159           {
5160             Py_ssize_t sz=PyString_Size(tupl);
5161             std::vector<char> vals(sz);
5162             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5163             return self->presenceOfTuple(vals);
5164           }
5165         else
5166           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5167       }
5168    
5169       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5170       {
5171         if(PyString_Check(vals))
5172           {
5173             Py_ssize_t sz=PyString_Size(vals);
5174             std::vector<char> vals2(sz);
5175             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5176             return self->presenceOfValue(vals2);
5177           }
5178         else
5179           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5180       }
5181
5182       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5183       {
5184         if(PyString_Check(vals))
5185           {
5186             Py_ssize_t sz=PyString_Size(vals);
5187             std::vector<char> vals2(sz);
5188             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5189             return self->locateValue(vals2);
5190           }
5191         else
5192           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5193       }
5194
5195       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5196       {
5197         if(PyString_Check(tupl))
5198           {
5199             Py_ssize_t sz=PyString_Size(tupl);
5200             std::vector<char> vals(sz);
5201             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5202             return self->locateTuple(vals);
5203           }
5204         else
5205           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5206       }
5207
5208       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5209       {
5210         if(PyString_Check(strOrListOfInt))
5211           {
5212             Py_ssize_t sz=PyString_Size(strOrListOfInt);
5213             std::vector<char> vals(sz);
5214             std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5215             return self->search(vals);
5216           }
5217         else
5218           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5219       }
5220    
5221       PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5222       {
5223         int sz=self->getNumberOfComponents();
5224         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5225         self->getTuple(tupleId,tmp);
5226         return PyString_FromString(tmp);
5227       }
5228
5229       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5230       {
5231         int tmp;
5232         char tmp2[2]; tmp2[1]='\0';
5233         tmp2[0]=self->getMaxValue(tmp);
5234         PyObject *ret=PyTuple_New(2);
5235         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5236         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5237         return ret;
5238       }
5239
5240       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5241       {
5242         int tmp;
5243         char tmp2[2]; tmp2[1]='\0';
5244         tmp2[0]=self->getMinValue(tmp);
5245         PyObject *ret=PyTuple_New(2);
5246         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5247         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5248         return ret;
5249       }
5250
5251       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5252       {
5253         int nbOfCompo=self->getNumberOfComponents();
5254         switch(nbOfCompo)
5255           {
5256           case 1:
5257             {
5258               if(PyString_Check(obj))
5259                 {
5260                   Py_ssize_t sz=PyString_Size(obj);
5261                   char *pt=PyString_AsString(obj);
5262                   if(sz==1)
5263                     return self->locateValue(pt[0]);
5264                   else
5265                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5266                 }
5267               else
5268                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5269             }
5270           default:
5271             return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5272           }
5273       }
5274
5275       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5276       {
5277         int nbOfCompo=self->getNumberOfComponents();
5278         switch(nbOfCompo)
5279           {
5280           case 0:
5281             return false;
5282           case 1:
5283             {
5284               if(PyString_Check(obj))
5285                 {
5286                   Py_ssize_t sz=PyString_Size(obj);
5287                   char *pt=PyString_AsString(obj);
5288                   if(sz==1)
5289                     return self->presenceOfValue(pt[0]);
5290                   else
5291                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5292                 }
5293               else
5294                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5295             }
5296           default:
5297             return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5298           }
5299       }
5300
5301       PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5302       {
5303         int sw,iTypppArr;
5304         std::vector<int> stdvecTyyppArr;
5305         std::pair<int, std::pair<int,int> > sTyyppArr;
5306         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5307         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5308         switch(sw)
5309           {
5310           case 1:
5311             return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5312           case 2:
5313             return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5314           case 3:
5315             return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5316           case 4:
5317             return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5318           default:
5319             throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5320           }
5321       }
5322
5323       DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5324       {
5325         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.";
5326         int sw1,iTypppArr;
5327         std::vector<int> stdvecTyyppArr;
5328         std::pair<int, std::pair<int,int> > sTyyppArr;
5329         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5330         int nbOfCompo=self->getNumberOfComponents();
5331         int nbOfTuples=self->getNumberOfTuples();
5332         convertObjToPossibleCpp2(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5333         int sw2;
5334         char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5335         convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5336         switch(sw1)
5337           {
5338           case 1:
5339             {//obj int
5340               switch(sw2)
5341                 {//value char
5342                 case 1:
5343                   {
5344                     self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5345                     return self;
5346                   }
5347                   //value string
5348                 case 2:
5349                   {
5350                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5351                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5352                     return self;
5353                   }
5354                   //value vector<string>
5355                 case 3:
5356                   {
5357                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5358                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5359                     return self;
5360                   }
5361                   //value DataArrayChar
5362                 case 4:
5363                   {
5364                     self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5365                     return self;
5366                   }
5367                 default:
5368                   throw INTERP_KERNEL::Exception(msg);
5369                 }
5370             }
5371           case 2:
5372             {//obj list-tuple[int]
5373               switch(sw2)
5374                 {
5375                   {//value char
5376                   case 1:
5377                     {
5378                       self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5379                       return self;
5380                     }
5381                     //value string
5382                   case 2:
5383                     {
5384                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5385                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5386                       return self;
5387                     }
5388                     //value vector<string>
5389                   case 3:
5390                     {
5391                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5392                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5393                       return self;
5394                     }
5395                     //value DataArrayChar
5396                   case 4:
5397                     {
5398                       self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5399                       return self;
5400                     }
5401                   default:
5402                     throw INTERP_KERNEL::Exception(msg);
5403                   }
5404                 }
5405             }
5406           case 3:
5407             {//slice
5408               switch(sw2)
5409                 {
5410                   {//value char
5411                   case 1:
5412                     {
5413                       self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5414                       return self;
5415                     }
5416                     //value string
5417                   case 2:
5418                     {
5419                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5420                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5421                       return self;
5422                     }
5423                     //value vector<string>
5424                   case 3:
5425                     {
5426                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5427                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5428                       return self;
5429                     }
5430                     //value DataArrayChar
5431                   case 4:
5432                     {
5433                       self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5434                       return self;
5435                     }
5436                   default:
5437                     throw INTERP_KERNEL::Exception(msg);
5438                   }
5439                 }
5440             }
5441           case 4:
5442             {//DataArrayInt
5443               switch(sw2)
5444                 {
5445                   {//value char
5446                   case 1:
5447                     {
5448                       self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5449                       return self;
5450                     }
5451                     //value string
5452                   case 2:
5453                     {
5454                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5455                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5456                       return self;
5457                     }
5458                     //value vector<string>
5459                   case 3:
5460                     {
5461                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5462                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5463                       return self;
5464                     }
5465                     //value DataArrayChar
5466                   case 4:
5467                     {
5468                       self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5469                       return self;
5470                     }
5471                   default:
5472                     throw INTERP_KERNEL::Exception(msg);
5473                   }
5474                 }
5475             }
5476           default:
5477             throw INTERP_KERNEL::Exception(msg);
5478           }
5479       }
5480     }
5481   };
5482
5483   class DataArrayAsciiCharTuple;
5484
5485   class DataArrayAsciiCharIterator
5486   {
5487   public:
5488     DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5489     ~DataArrayAsciiCharIterator();
5490     %extend
5491     {
5492       PyObject *next()
5493       {
5494         DataArrayAsciiCharTuple *ret=self->nextt();
5495         if(ret)
5496           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5497         else
5498           {
5499             PyErr_SetString(PyExc_StopIteration,"No more data.");
5500             return 0;
5501           }
5502       }
5503     }
5504   };
5505
5506   class DataArrayAsciiCharTuple
5507   {
5508   public:
5509     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5510     DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5511     %extend
5512     {
5513       std::string __str__() const throw(INTERP_KERNEL::Exception)
5514       {
5515         return self->repr();
5516       }
5517       
5518       DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5519       {
5520         return self->buildDAAsciiChar(1,self->getNumberOfCompo());
5521       }
5522     }
5523   };
5524 }