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