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