Salome HOME
620c02a0f48530b1dc45354860958a4c3566bdd6
[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     void checkNbOfTuples(int nbOfTuples, const char *msg) const throw(INTERP_KERNEL::Exception);
52     void checkNbOfComps(int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
53     void checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const throw(INTERP_KERNEL::Exception);
54     void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
55     void checkNbOfElems(std::size_t nbOfElems, const char *msg) const throw(INTERP_KERNEL::Exception);
56     static int GetNumberOfItemGivenBES(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
57     static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
58     static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
59     static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
60     static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
61     void updateTime() const;
62     %extend
63     {
64       PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
65       {
66         const std::vector<std::string>& comps=self->getInfoOnComponents();
67         PyObject *ret=PyList_New((int)comps.size());
68         for(int i=0;i<(int)comps.size();i++)
69           PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
70         return ret;
71       }
72       
73       void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
74       {
75         std::vector<int> tmp;
76         convertPyToNewIntArr3(li,tmp);
77         self->copyPartOfStringInfoFrom(other,tmp);
78       }
79
80       void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
81       {
82         std::vector<int> tmp;
83         convertPyToNewIntArr3(li,tmp);
84         self->copyPartOfStringInfoFrom2(tmp,other);
85       }
86
87       virtual void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
88       {
89         void *da=0;
90         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
91         if (!SWIG_IsOK(res1))
92           {
93             int size;
94             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
95             if(size!=self->getNumberOfTuples())
96               {
97                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
98               }
99             self->renumberInPlace(tmp);
100           }
101         else
102           {
103             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
104             if(!da2)
105               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
106             da2->checkAllocated();
107             int size=self->getNumberOfTuples();
108             if(size!=self->getNumberOfTuples())
109               {
110                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
111               }
112             self->renumberInPlace(da2->getConstPointer());
113           }
114       }
115
116       virtual void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
117       {
118         void *da=0;
119         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
120         if (!SWIG_IsOK(res1))
121           {
122             int size;
123             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
124             if(size!=self->getNumberOfTuples())
125               {
126                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
127               }
128             self->renumberInPlaceR(tmp);
129           }
130         else
131           {
132             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
133             if(!da2)
134               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
135             da2->checkAllocated();
136             int size=self->getNumberOfTuples();
137             if(size!=self->getNumberOfTuples())
138               {
139                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
140               }
141             self->renumberInPlaceR(da2->getConstPointer());
142           }
143       }
144
145       //tuplesSelec in PyObject * because DataArrayInt is not already existing !
146       virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec) throw(INTERP_KERNEL::Exception)
147       {
148         static const char msg[]="DataArray::setContigPartOfSelectedValues2 : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
149           DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 3rd parameter \"aBase\" should be of type DataArray");
150         DataArray *tuplesSelecPtr=CheckAndRetrieveDataArrayInstance(tuplesSelec,msg);
151         DataArrayInt *tuplesSelecPtr2=0;
152         if(tuplesSelecPtr)
153           {
154             tuplesSelecPtr2=dynamic_cast<DataArrayInt *>(tuplesSelecPtr);
155             if(!tuplesSelecPtr2)
156               throw INTERP_KERNEL::Exception(msg);
157           }
158         self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
159       }
160       
161       virtual void setContigPartOfSelectedValues2(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
162       {
163         DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 2nd parameter \"aBase\" should be of type DataArray");
164         self->setContigPartOfSelectedValues2(tupleIdStart,a,bg,end2,step);
165       }
166
167       virtual DataArray *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
168       {
169         std::vector<std::pair<int,int> > ranges;
170         convertPyToVectorPairInt(li,ranges);
171         return self->selectByTupleRanges(ranges);
172       }
173
174       virtual PyObject *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
175       {
176         std::vector<int> tmp;
177         convertPyToNewIntArr3(li,tmp);
178         DataArray *ret=self->keepSelectedComponents(tmp);
179         return convertDataArray(ret,SWIG_POINTER_OWN | 0 );
180       }
181
182       static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices) throw(INTERP_KERNEL::Exception)
183       {
184         if(!PySlice_Check(slic))
185           throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
186         Py_ssize_t strt=2,stp=2,step=2;
187         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
188         if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
189           throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : the input slice is invalid !");
190         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
191           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 !");
192         int a,b;
193         DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
194         return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
195       }
196
197       PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
198       {
199         if(!PySlice_Check(slic))
200           throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
201         Py_ssize_t strt=2,stp=2,step=2;
202         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
203         if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
204           throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : the input slice is invalid !");
205         int a,b;
206         DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
207         return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
208       }
209
210       static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
211       {
212         if(!PySlice_Check(slic))
213           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
214         Py_ssize_t strt=2,stp=2,step=2;
215         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
216         if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
217           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
218         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
219           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : the input slice contains some unknowns that can't be determined in static method !");
220         return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
221       }
222
223       static int GetNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
224       {
225         if(!PySlice_Check(slic))
226           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
227         Py_ssize_t strt=2,stp=2,step=2;
228         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
229         if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
230           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
231         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
232           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice contains some unknowns that can't be determined in static method !");
233         return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
234       }
235
236       int getNumberOfItemGivenBES(PyObject *slic) const throw(INTERP_KERNEL::Exception)
237       {
238         if(!PySlice_Check(slic))
239           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
240         Py_ssize_t strt=2,stp=2,step=2;
241         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
242         if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
243           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
244         return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
245       }
246
247       int getNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
248       {
249         if(!PySlice_Check(slic))
250           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
251         Py_ssize_t strt=2,stp=2,step=2;
252         PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
253         if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
254           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
255         return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
256       }
257     }
258   };
259   
260   class DataArrayInt;
261   class DataArrayDoubleIterator;
262   
263   class DataArrayDouble : public DataArray
264   {
265   public:
266     static DataArrayDouble *New();
267     double doubleValue() const throw(INTERP_KERNEL::Exception);
268     bool empty() const throw(INTERP_KERNEL::Exception);
269     DataArrayDouble *deepCpy() const throw(INTERP_KERNEL::Exception);
270     DataArrayDouble *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
271     void cpyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
272     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
273     void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
274     void pushBackValsSilent(const double *valsBg, const double *valsEnd) throw(INTERP_KERNEL::Exception);
275     double popBackSilent() throw(INTERP_KERNEL::Exception);
276     void pack() const throw(INTERP_KERNEL::Exception);
277     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
278     void fillWithZero() throw(INTERP_KERNEL::Exception);
279     void fillWithValue(double val) throw(INTERP_KERNEL::Exception);
280     void iota(double init=0.) throw(INTERP_KERNEL::Exception);
281     bool isUniform(double val, double eps) const throw(INTERP_KERNEL::Exception);
282     void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
283     void reverse() throw(INTERP_KERNEL::Exception);
284     void checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
285     bool isMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
286     std::string repr() const throw(INTERP_KERNEL::Exception);
287     std::string reprZip() const throw(INTERP_KERNEL::Exception);
288     bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
289     bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
290     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
291     DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
292     DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
293     DataArrayDouble *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
294     DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
295     void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
296     void transpose() throw(INTERP_KERNEL::Exception);
297     DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
298     void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
299     DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
300     DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception);
301     DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
302     void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
303     void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
304     void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
305     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
306     double front() const throw(INTERP_KERNEL::Exception);
307     double back() const throw(INTERP_KERNEL::Exception);
308     double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
309     void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
310     void setIJSilent(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
311     double *getPointer() throw(INTERP_KERNEL::Exception);
312     void checkNoNullValues() const throw(INTERP_KERNEL::Exception);
313     DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const throw(INTERP_KERNEL::Exception);
314     void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
315     double getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
316     double getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
317     double getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
318     double getMinValueInArray() const throw(INTERP_KERNEL::Exception);
319     int count(double value, double eps) const throw(INTERP_KERNEL::Exception);
320     double getAverageValue() const throw(INTERP_KERNEL::Exception);
321     double norm2() const throw(INTERP_KERNEL::Exception);
322     double normMax() const throw(INTERP_KERNEL::Exception);
323     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
324     DataArrayDouble *fromPolarToCart() const throw(INTERP_KERNEL::Exception);
325     DataArrayDouble *fromCylToCart() const throw(INTERP_KERNEL::Exception);
326     DataArrayDouble *fromSpherToCart() const throw(INTERP_KERNEL::Exception);
327     DataArrayDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
328     DataArrayDouble *determinant() const throw(INTERP_KERNEL::Exception);
329     DataArrayDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
330     DataArrayDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
331     DataArrayDouble *inverse() const throw(INTERP_KERNEL::Exception);
332     DataArrayDouble *trace() const throw(INTERP_KERNEL::Exception);
333     DataArrayDouble *deviator() const throw(INTERP_KERNEL::Exception);
334     DataArrayDouble *magnitude() const throw(INTERP_KERNEL::Exception);
335     DataArrayDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
336     DataArrayDouble *buildEuclidianDistanceDenseMatrix() const throw(INTERP_KERNEL::Exception);
337     DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
338     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
339     void abs() throw(INTERP_KERNEL::Exception);
340     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
341     void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
342     void applyInv(double numerator) throw(INTERP_KERNEL::Exception);
343     void applyPow(double val) throw(INTERP_KERNEL::Exception);
344     void applyRPow(double val) throw(INTERP_KERNEL::Exception);
345     DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
346     DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
347     DataArrayDouble *applyFunc(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
348     DataArrayDouble *applyFunc(const char *func) const throw(INTERP_KERNEL::Exception);
349     DataArrayDouble *applyFunc2(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
350     DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
351     void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
352     void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
353     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
354     static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
355     static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
356     static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
357     static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
358     static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
359     static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
360     static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
361     void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
362     static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
363     void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
364     static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
365     void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
366     static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
367     void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
368     static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
369     void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
370     %extend
371     {
372       DataArrayDouble() throw(INTERP_KERNEL::Exception)
373         {
374           return DataArrayDouble::New();
375         }
376
377       static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
378       {
379         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)";
380         std::string msg(msgBase);
381 #ifdef WITH_NUMPY
382         msg+="\n-DataArrayDouble.New(numpy array with dtype=float64)";
383 #endif
384         msg+=" !";
385         if(PyList_Check(elt0) || PyTuple_Check(elt0))
386           {
387             if(nbOfTuples)
388               {
389                 if(PyInt_Check(nbOfTuples))
390                   {
391                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
392                     if(nbOfTuples1<0)
393                       throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
394                     if(elt2)
395                       {
396                         if(PyInt_Check(elt2))
397                           {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
398                             int nbOfCompo=PyInt_AS_LONG(elt2);
399                             if(nbOfCompo<0)
400                               throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
401                             MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
402                             std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
403                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
404                             return ret.retn();
405                           }
406                         else
407                           throw INTERP_KERNEL::Exception(msg.c_str());
408                       }
409                     else
410                       {//DataArrayDouble.New([1.,3.,4.],3)
411                         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
412                         int tmpp1=-1;
413                         std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
414                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
415                         return ret.retn();
416                       }
417                   }
418                 else
419                   throw INTERP_KERNEL::Exception(msg.c_str());
420               }
421             else
422               {// DataArrayDouble.New([1.,3.,4.])
423                 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
424                 int tmpp1=-1,tmpp2=-1;
425                 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
426                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
427                 return ret.retn();
428               }
429           }
430         else if(PyInt_Check(elt0))
431           {
432             int nbOfTuples1=PyInt_AS_LONG(elt0);
433             if(nbOfTuples1<0)
434               throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
435             if(nbOfTuples)
436               {
437                 if(!elt2)
438                   {
439                     if(PyInt_Check(nbOfTuples))
440                       {//DataArrayDouble.New(5,2)
441                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
442                         if(nbOfCompo<0)
443                           throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
444                         MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
445                         ret->alloc(nbOfTuples1,nbOfCompo);
446                         return ret.retn();
447                       }
448                     else
449                       throw INTERP_KERNEL::Exception(msg.c_str());
450                   }
451                 else
452                   throw INTERP_KERNEL::Exception(msg.c_str());
453               }
454             else
455               {//DataArrayDouble.New(5)
456                 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
457                 ret->alloc(nbOfTuples1,1);
458                 return ret.retn();
459               }
460           }
461 #ifdef WITH_NUMPY
462         else if(PyArray_Check(elt0) && nbOfTuples==NULL && elt2==NULL)
463           {//DataArrayDouble.New(numpyArray)
464             return BuildNewInstance<DataArrayDouble,double>(elt0,NPY_DOUBLE,&PyCallBackDataArrayDouble_RefType,"FLOAT64");
465           }
466 #endif
467         else
468           throw INTERP_KERNEL::Exception(msg.c_str());
469       }
470    
471       DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
472         {
473           return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
474         }
475
476       void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
477       {
478         double val;
479         std::vector<double> bb;
480         int sw,nbTuples=-1;
481         const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
482         const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
483         self->pushBackValsSilent(tmp,tmp+nbTuples);
484       }
485
486       std::string __repr__() const throw(INTERP_KERNEL::Exception)
487       {
488         std::ostringstream oss;
489         self->reprQuickOverview(oss);
490         return oss.str();
491       }
492
493       std::string __str__() const throw(INTERP_KERNEL::Exception)
494       {
495         return self->repr();
496       }
497
498       double __float__() const throw(INTERP_KERNEL::Exception)
499       {
500         return self->doubleValue();
501       }
502
503       int __len__() const throw(INTERP_KERNEL::Exception)
504       {
505         if(self->isAllocated())
506           {
507             return self->getNumberOfTuples();
508           }
509         else
510           {
511             throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
512           }
513       }
514
515       DataArrayDoubleIterator *__iter__() throw(INTERP_KERNEL::Exception)
516       {
517         return self->iterator();
518       }
519    
520       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
521       {
522         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 !";
523         if(PyList_Check(li) || PyTuple_Check(li))
524           {
525             if(nbOfTuples)
526               {
527                 if(PyInt_Check(nbOfTuples))
528                   {
529                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
530                     if(nbOfTuples1<0)
531                       throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
532                     if(nbOfComp)
533                       {
534                         if(PyInt_Check(nbOfComp))
535                           {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
536                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
537                             if(nbOfCompo<0)
538                               throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
539                             std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
540                             self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
541                           }
542                         else
543                           throw INTERP_KERNEL::Exception(msg);
544                       }
545                     else
546                       {//DataArrayDouble.setValues([1.,3.,4.],3)
547                         int tmpp1=-1;
548                         std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
549                         self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
550                       }
551                   }
552                 else
553                   throw INTERP_KERNEL::Exception(msg);
554               }
555             else
556               {// DataArrayDouble.setValues([1.,3.,4.])
557                 int tmpp1=-1,tmpp2=-1;
558                 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
559                 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
560               }
561           }
562         else
563           throw INTERP_KERNEL::Exception(msg);
564       }
565
566       PyObject *getValues() const throw(INTERP_KERNEL::Exception)
567       {
568         const double *vals=self->getConstPointer();
569         return convertDblArrToPyList(vals,self->getNbOfElems());
570       }
571
572 #ifdef WITH_NUMPY
573       PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
574       {
575         return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
576       }
577 #endif
578
579       PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
580       {
581         std::string ret1;
582         bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
583         PyObject *ret=PyTuple_New(2);
584         PyObject *ret0Py=ret0?Py_True:Py_False;
585         Py_XINCREF(ret0Py);
586         PyTuple_SetItem(ret,0,ret0Py);
587         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
588         return ret;
589       }
590
591       PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
592       {
593         const double *vals=self->getConstPointer();
594         int nbOfComp=self->getNumberOfComponents();
595         int nbOfTuples=self->getNumberOfTuples();
596         return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
597       }
598
599       DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
600       {
601         void *da=0;
602         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
603         if (!SWIG_IsOK(res1))
604           {
605             int size;
606             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
607             if(size!=self->getNumberOfTuples())
608               {
609                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
610               }
611             return self->renumber(tmp);
612           }
613         else
614           {
615             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
616             if(!da2)
617               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
618             da2->checkAllocated();
619             int size=self->getNumberOfTuples();
620             if(size!=self->getNumberOfTuples())
621               {
622                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
623               }
624             return self->renumber(da2->getConstPointer());
625           }
626       }
627
628       DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
629       {
630         void *da=0;
631         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
632         if (!SWIG_IsOK(res1))
633           {
634             int size;
635             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
636             if(size!=self->getNumberOfTuples())
637               {
638                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
639               }
640             return self->renumberR(tmp);
641           }
642         else
643           {
644             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
645             if(!da2)
646               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
647             da2->checkAllocated();
648             int size=self->getNumberOfTuples();
649             if(size!=self->getNumberOfTuples())
650               {
651                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
652               }
653             return self->renumberR(da2->getConstPointer());
654           }
655       }
656
657       DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
658       {
659         void *da=0;
660         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
661         if (!SWIG_IsOK(res1))
662           {
663             int size;
664             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
665             if(size!=self->getNumberOfTuples())
666               {
667                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
668               }
669             return self->renumberAndReduce(tmp,newNbOfTuple);
670           }
671         else
672           {
673             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
674             if(!da2)
675               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
676             da2->checkAllocated();
677             int size=self->getNumberOfTuples();
678             if(size!=self->getNumberOfTuples())
679               {
680                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
681               }
682             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
683           }
684       }
685
686       DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
687       {
688         void *da=0;
689         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
690         if (!SWIG_IsOK(res1))
691           {
692             int size;
693             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
694             return self->selectByTupleId(tmp,tmp+size);
695           }
696         else
697           {
698             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
699             if(!da2)
700               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
701             da2->checkAllocated();
702             return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
703           }
704       }
705
706       DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
707       {
708         void *da=0;
709         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
710         if (!SWIG_IsOK(res1))
711           {
712             int size;
713             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
714             return self->selectByTupleIdSafe(tmp,tmp+size);
715           }
716         else
717           {
718             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
719             if(!da2)
720               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
721             da2->checkAllocated();
722             return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
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 *deepCpy() const throw(INTERP_KERNEL::Exception);
2293     DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2294     void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2295     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2296     void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2297     int popBackSilent() throw(INTERP_KERNEL::Exception);
2298     void pack() const throw(INTERP_KERNEL::Exception);
2299     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2300     bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2301     bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2302     bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2303     DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2304     void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2305     void reverse() throw(INTERP_KERNEL::Exception);
2306     void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2307     bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2308     void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2309     bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2310     void fillWithZero() throw(INTERP_KERNEL::Exception);
2311     void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2312     void iota(int init=0) throw(INTERP_KERNEL::Exception);
2313     std::string repr() const throw(INTERP_KERNEL::Exception);
2314     std::string reprZip() const throw(INTERP_KERNEL::Exception);
2315     DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2316     DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2317     DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2318     DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
2319     DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2320     DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2321     DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2322     DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2323     DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2324     bool isIdentity() const throw(INTERP_KERNEL::Exception);
2325     bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2326     DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2327     void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
2328     void transpose() throw(INTERP_KERNEL::Exception);
2329     DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2330     void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2331     void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2332     void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2333     void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2334     void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2335     int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2336     int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2337     int front() const throw(INTERP_KERNEL::Exception);
2338     int back() const throw(INTERP_KERNEL::Exception);
2339     void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2340     void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2341     int *getPointer() throw(INTERP_KERNEL::Exception);
2342     const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2343     DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2344     const int *begin() const throw(INTERP_KERNEL::Exception);
2345     const int *end() const throw(INTERP_KERNEL::Exception);
2346     DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2347     DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2348     int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2349     int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2350     int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2351     int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2352     int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2353     bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2354     bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2355     bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2356     int count(int value) const throw(INTERP_KERNEL::Exception);
2357     int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2358     int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2359     int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2360     int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2361     int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2362     void abs() throw(INTERP_KERNEL::Exception);
2363     void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2364     void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2365     void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2366     DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2367     void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2368     void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2369     void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2370     void applyPow(int val) throw(INTERP_KERNEL::Exception);
2371     void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2372     DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2373     bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2374     static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2375     static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2376     static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2377     static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2378     static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2379     DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2380     DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2381     DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2382     DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2383     DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2384     DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2385     DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2386     void computeOffsets() throw(INTERP_KERNEL::Exception);
2387     void computeOffsets2() throw(INTERP_KERNEL::Exception);
2388     DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2389     DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2390     DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2391     DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2392     DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2393     static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2394     void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2395     static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2396     void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2397     static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2398     void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2399     static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2400     void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2401     static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2402     void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2403     static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2404     void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2405   public:
2406     static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2407     %extend
2408     {
2409       DataArrayInt() throw(INTERP_KERNEL::Exception)
2410         {
2411           return DataArrayInt::New();
2412         }
2413
2414       static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2415       {
2416         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)";
2417         std::string msg(msgBase);
2418 #ifdef WITH_NUMPY
2419         msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2420 #endif
2421         msg+=" !";
2422         if(PyList_Check(elt0) || PyTuple_Check(elt0))
2423           {
2424             if(nbOfTuples)
2425               {
2426                 if(PyInt_Check(nbOfTuples))
2427                   {
2428                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2429                     if(nbOfTuples1<0)
2430                       throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2431                     if(nbOfComp)
2432                       {
2433                         if(PyInt_Check(nbOfComp))
2434                           {//DataArrayInt.New([1,3,4,5],2,2)
2435                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2436                             if(nbOfCompo<0)
2437                               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2438                             MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2439                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2440                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2441                             return ret.retn();
2442                           }
2443                         else
2444                           throw INTERP_KERNEL::Exception(msg.c_str());
2445                       }
2446                     else
2447                       {//DataArrayInt.New([1,3,4],3)
2448                         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2449                         int tmpp1=-1;
2450                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2451                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2452                         return ret.retn();
2453                       }
2454                   }
2455                 else
2456                   throw INTERP_KERNEL::Exception(msg.c_str());
2457               }
2458             else
2459               {// DataArrayInt.New([1,3,4])
2460                 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2461                 int tmpp1=-1,tmpp2=-1;
2462                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2463                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2464                 return ret.retn();
2465               }
2466           }
2467         else if(PyInt_Check(elt0))
2468           {
2469             int nbOfTuples1=PyInt_AS_LONG(elt0);
2470             if(nbOfTuples1<0)
2471               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2472             if(nbOfTuples)
2473               {
2474                 if(!nbOfComp)
2475                   {
2476                     if(PyInt_Check(nbOfTuples))
2477                       {//DataArrayInt.New(5,2)
2478                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2479                         if(nbOfCompo<0)
2480                           throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2481                         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2482                         ret->alloc(nbOfTuples1,nbOfCompo);
2483                         return ret.retn();
2484                       }
2485                     else
2486                       throw INTERP_KERNEL::Exception(msg.c_str());
2487                   }
2488                 else
2489                   throw INTERP_KERNEL::Exception(msg.c_str());
2490               }
2491             else
2492               {//DataArrayInt.New(5)
2493                 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2494                 ret->alloc(nbOfTuples1,1);
2495                 return ret.retn();
2496               }
2497           }
2498 #ifdef WITH_NUMPY
2499         else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2500           {//DataArrayInt.New(numpyArray)
2501             return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT,&PyCallBackDataArrayInt_RefType,"INT32");
2502           }
2503 #endif
2504         else
2505           throw INTERP_KERNEL::Exception(msg.c_str());
2506       }
2507
2508       DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2509         {
2510           return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2511         }
2512
2513       std::string __str__() const throw(INTERP_KERNEL::Exception)
2514       {
2515         return self->repr();
2516       }
2517
2518       int __len__() const throw(INTERP_KERNEL::Exception)
2519       {
2520         if(self->isAllocated())
2521           {
2522             return self->getNumberOfTuples();
2523           }
2524         else
2525           {
2526             throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2527           }
2528       }
2529
2530       int __int__() const throw(INTERP_KERNEL::Exception)
2531       {
2532         return self->intValue();
2533       }
2534
2535       DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2536       {
2537         return self->iterator();
2538       }
2539    
2540       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2541       {
2542         int sz=self->getNumberOfComponents();
2543         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2544         self->accumulate(tmp);
2545         return convertIntArrToPyList(tmp,sz);
2546       }
2547
2548       DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2549       {
2550         int sw,sz,val;
2551         std::vector<int> val2;
2552         const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2553         return self->accumulatePerChunck(bg,bg+sz);
2554       }
2555    
2556       static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2557       {
2558         int newNbOfTuples=-1;
2559         int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2560         std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2561         const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2562         const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2563         DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2564         PyObject *ret=PyTuple_New(2);
2565         PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2566         PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2567         return ret;
2568       }
2569
2570       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2571       {
2572         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 !";
2573         if(PyList_Check(li) || PyTuple_Check(li))
2574           {
2575             if(nbOfTuples)
2576               {
2577                 if(PyInt_Check(nbOfTuples))
2578                   {
2579                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2580                     if(nbOfTuples<0)
2581                       throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2582                     if(nbOfComp)
2583                       {
2584                         if(PyInt_Check(nbOfComp))
2585                           {//DataArrayInt.setValues([1,3,4,5],2,2)
2586                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2587                             if(nbOfCompo<0)
2588                               throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2589                             std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2590                             self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2591                           }
2592                         else
2593                           throw INTERP_KERNEL::Exception(msg);
2594                       }
2595                     else
2596                       {//DataArrayInt.setValues([1,3,4],3)
2597                         int tmpp1=-1;
2598                         std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2599                         self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2600                       }
2601                   }
2602                 else
2603                   throw INTERP_KERNEL::Exception(msg);
2604               }
2605             else
2606               {// DataArrayInt.setValues([1,3,4])
2607                 int tmpp1=-1,tmpp2=-1;
2608                 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2609                 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2610               }
2611           }
2612         else
2613           throw INTERP_KERNEL::Exception(msg);
2614       }
2615
2616       PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2617       {
2618         const int *vals=self->getConstPointer();
2619         return convertIntArrToPyList(vals,self->getNbOfElems());
2620       }
2621
2622 #ifdef WITH_NUMPY
2623       PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2624       {
2625         return ToNumPyArray<DataArrayInt,int>(self,NPY_INT,"DataArrayInt");
2626       }
2627 #endif
2628
2629       PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2630       {
2631         std::string ret1;
2632         bool ret0=self->isEqualIfNotWhy(other,ret1);
2633         PyObject *ret=PyTuple_New(2);
2634         PyObject *ret0Py=ret0?Py_True:Py_False;
2635         Py_XINCREF(ret0Py);
2636         PyTuple_SetItem(ret,0,ret0Py);
2637         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2638         return ret;
2639       }
2640
2641       PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2642       {
2643         const int *vals=self->getConstPointer();
2644         int nbOfComp=self->getNumberOfComponents();
2645         int nbOfTuples=self->getNumberOfTuples();
2646         return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2647       }
2648
2649       static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2650       {
2651         std::vector<const DataArrayInt *> groups;
2652         std::vector< std::vector<int> > fidsOfGroups;
2653         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2654         ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2655         PyObject *ret = PyList_New(2);
2656         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2657         int sz=fidsOfGroups.size();
2658         PyObject *ret1 = PyList_New(sz);
2659         for(int i=0;i<sz;i++)
2660           PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2661         PyList_SetItem(ret,1,ret1);
2662         return ret;
2663       }
2664
2665       void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2666       {
2667         void *da=0;
2668         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2669         if (!SWIG_IsOK(res1))
2670           {
2671             int size;
2672             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2673             self->transformWithIndArr(tmp,tmp+size);
2674           }
2675         else
2676           {
2677             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2678             self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2679           }
2680       }
2681
2682       DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2683       {
2684         int sw;
2685         int singleVal;
2686         std::vector<int> multiVal;
2687         std::pair<int, std::pair<int,int> > slic;
2688         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2689         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2690         switch(sw)
2691           {
2692           case 1:
2693             return self->getIdsEqualList(&singleVal,&singleVal+1);
2694           case 2:
2695             return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2696           case 4:
2697             return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2698           default:
2699             throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2700           }
2701       }
2702
2703       DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2704       {
2705         int sw;
2706         int singleVal;
2707         std::vector<int> multiVal;
2708         std::pair<int, std::pair<int,int> > slic;
2709         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2710         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2711         switch(sw)
2712           {
2713           case 1:
2714             return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2715           case 2:
2716             return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2717           case 4:
2718             return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2719           default:
2720             throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2721           }
2722       }
2723
2724       PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2725       {
2726         DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2727         void *da=0;
2728         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2729         if (!SWIG_IsOK(res1))
2730           {
2731             int size;
2732             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2733             self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2734           }
2735         else
2736           {
2737             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2738             if(!da2)
2739               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2740             da2->checkAllocated();
2741             int size=self->getNumberOfTuples();
2742             self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2743           }
2744         PyObject *ret = PyList_New(3);
2745         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2746         PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2747         PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2748         return ret;
2749       }
2750
2751       DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2752       {
2753         void *da=0;
2754         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2755         if (!SWIG_IsOK(res1))
2756           {
2757             int size;
2758             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2759             return self->transformWithIndArrR(tmp,tmp+size);
2760           }
2761         else
2762           {
2763             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2764             return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2765           }
2766       }
2767
2768       DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2769       {
2770         void *da=0;
2771         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2772         if (!SWIG_IsOK(res1))
2773           {
2774             int size;
2775             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2776             if(size!=self->getNumberOfTuples())
2777               {
2778                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2779               }
2780             return self->renumberAndReduce(tmp,newNbOfTuple);
2781           }
2782         else
2783           {
2784             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2785             if(!da2)
2786               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2787             da2->checkAllocated();
2788             int size=self->getNumberOfTuples();
2789             if(size!=self->getNumberOfTuples())
2790               {
2791                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2792               }
2793             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
2794           }
2795       }
2796
2797       DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
2798       {
2799         void *da=0;
2800         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2801         if (!SWIG_IsOK(res1))
2802           {
2803             int size;
2804             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2805             if(size!=self->getNumberOfTuples())
2806               {
2807                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2808               }
2809             return self->renumber(tmp);
2810           }
2811         else
2812           {
2813             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2814             if(!da2)
2815               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2816             da2->checkAllocated();
2817             int size=self->getNumberOfTuples();
2818             if(size!=self->getNumberOfTuples())
2819               {
2820                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2821               }
2822             return self->renumber(da2->getConstPointer());
2823           }
2824       }
2825
2826       DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
2827       {
2828         void *da=0;
2829         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2830         if (!SWIG_IsOK(res1))
2831           {
2832             int size;
2833             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2834             if(size!=self->getNumberOfTuples())
2835               {
2836                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2837               }
2838             return self->renumberR(tmp);
2839           }
2840         else
2841           {
2842             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2843             if(!da2)
2844               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2845             da2->checkAllocated();
2846             int size=self->getNumberOfTuples();
2847             if(size!=self->getNumberOfTuples())
2848               {
2849                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2850               }
2851             return self->renumberR(da2->getConstPointer());
2852           }
2853       }
2854
2855       DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
2856       {
2857         void *da=0;
2858         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2859         if (!SWIG_IsOK(res1))
2860           {
2861             int size;
2862             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2863             return self->selectByTupleId(tmp,tmp+size);
2864           }
2865         else
2866           {
2867             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2868             if(!da2)
2869               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2870             da2->checkAllocated();
2871             return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2872           }
2873       }
2874
2875       DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
2876       {
2877         void *da=0;
2878         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2879         if (!SWIG_IsOK(res1))
2880           {
2881             int size;
2882             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2883             return self->selectByTupleIdSafe(tmp,tmp+size);
2884           }
2885         else
2886           {
2887             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2888             if(!da2)
2889               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2890             da2->checkAllocated();
2891             return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2892           }
2893       }
2894
2895       void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
2896       {
2897         std::vector<int> tmp;
2898         convertPyToNewIntArr3(li,tmp);
2899         self->setSelectedComponents(a,tmp);
2900       }
2901
2902       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
2903       {
2904         int sz=self->getNumberOfComponents();
2905         INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2906         self->getTuple(tupleId,tmp);
2907         return convertIntArrToPyList(tmp,sz);
2908       }
2909
2910       PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
2911       {
2912         DataArrayInt *arr=0;
2913         DataArrayInt *arrI=0;
2914         self->changeSurjectiveFormat(targetNb,arr,arrI);
2915         PyObject *res = PyList_New(2);
2916         PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2917         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2918         return res;
2919       }
2920
2921       static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
2922       {
2923         std::vector<const DataArrayInt *> tmp;
2924         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2925         return DataArrayInt::Meld(tmp);
2926       }
2927
2928       static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
2929       {
2930         std::vector<const DataArrayInt *> tmp;
2931         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2932         return DataArrayInt::Aggregate(tmp);
2933       }
2934
2935       static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
2936       {
2937         std::vector<const DataArrayInt *> tmp;
2938         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2939         return DataArrayInt::AggregateIndexes(tmp);
2940       }
2941
2942       static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
2943       {
2944         std::vector<const DataArrayInt *> tmp;
2945         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2946         return DataArrayInt::BuildUnion(tmp);
2947       }
2948
2949       static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
2950       {
2951         std::vector<const DataArrayInt *> tmp;
2952         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2953         return DataArrayInt::BuildIntersection(tmp);
2954       }
2955
2956       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
2957       {
2958         int tmp;
2959         int r1=self->getMaxValue(tmp);
2960         PyObject *ret=PyTuple_New(2);
2961         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2962         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2963         return ret;
2964       }
2965
2966       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
2967       {
2968         int tmp;
2969         int r1=self->getMinValue(tmp);
2970         PyObject *ret=PyTuple_New(2);
2971         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2972         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2973         return ret;
2974       }
2975
2976       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2977       {
2978         int nbOfCompo=self->getNumberOfComponents();
2979         switch(nbOfCompo)
2980           {
2981           case 1:
2982             {
2983               if(PyInt_Check(obj))
2984                 {
2985                   int val=(int)PyInt_AS_LONG(obj);
2986                   return self->locateValue(val);
2987                 }
2988               else
2989                 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
2990             }
2991           default:
2992             {
2993               std::vector<int> arr;
2994               convertPyToNewIntArr3(obj,arr);
2995               return self->locateTuple(arr);
2996             }
2997           }
2998       }
2999
3000       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3001       {
3002         int nbOfCompo=self->getNumberOfComponents();
3003         switch(nbOfCompo)
3004           {
3005           case 0:
3006             return false;
3007           case 1:
3008             {
3009               if(PyInt_Check(obj))
3010                 {
3011                   int val=(int)PyInt_AS_LONG(obj);
3012                   return self->presenceOfValue(val);
3013                 }
3014               else
3015                 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
3016             }
3017           default:
3018             {
3019               std::vector<int> arr;
3020               convertPyToNewIntArr3(obj,arr);
3021               return self->presenceOfTuple(arr);
3022             }
3023           }
3024       }
3025
3026       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3027       {
3028         const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
3029         const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
3030         self->checkAllocated();
3031         int nbOfTuples=self->getNumberOfTuples();
3032         int nbOfComponents=self->getNumberOfComponents();
3033         int it1,ic1;
3034         std::vector<int> vt1,vc1;
3035         std::pair<int, std::pair<int,int> > pt1,pc1;
3036         DataArrayInt *dt1=0,*dc1=0;
3037         int sw;
3038         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3039         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3040         switch(sw)
3041           {
3042           case 1:
3043             {
3044               if(nbOfComponents==1)
3045                 return PyInt_FromLong(self->getIJSafe(it1,0));
3046               return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3047             }
3048           case 2:
3049             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3050           case 3:
3051             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3052           case 4:
3053             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3054           case 5:
3055             return PyInt_FromLong(self->getIJSafe(it1,ic1));
3056           case 6:
3057             {
3058               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3059               std::vector<int> v2(1,ic1);
3060               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3061             }
3062           case 7:
3063             {
3064               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3065               std::vector<int> v2(1,ic1);
3066               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3067             }
3068           case 8:
3069             {
3070               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3071               std::vector<int> v2(1,ic1);
3072               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3073             }
3074           case 9:
3075             {
3076               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3077               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3078             }
3079           case 10:
3080             {
3081               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3082               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3083             }
3084           case 11:
3085             {
3086               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3087               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3088             }
3089           case 12:
3090             {
3091               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3092               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3093             }
3094           case 13:
3095             {
3096               ret=self->selectByTupleIdSafe(&it1,&it1+1);
3097               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3098               std::vector<int> v2(nbOfComp);
3099               for(int i=0;i<nbOfComp;i++)
3100                 v2[i]=pc1.first+i*pc1.second.second;
3101               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3102             }
3103           case 14:
3104             {
3105               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3106               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3107               std::vector<int> v2(nbOfComp);
3108               for(int i=0;i<nbOfComp;i++)
3109                 v2[i]=pc1.first+i*pc1.second.second;
3110               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3111             }
3112           case 15:
3113             {
3114               ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3115               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3116               std::vector<int> v2(nbOfComp);
3117               for(int i=0;i<nbOfComp;i++)
3118                 v2[i]=pc1.first+i*pc1.second.second;
3119               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3120             }
3121           case 16:
3122             {
3123               ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3124               int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3125               std::vector<int> v2(nbOfComp);
3126               for(int i=0;i<nbOfComp;i++)
3127                 v2[i]=pc1.first+i*pc1.second.second;
3128               return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3129             }
3130           default:
3131             throw INTERP_KERNEL::Exception(msg);
3132           }
3133       }
3134
3135       DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3136       {
3137         self->checkAllocated();
3138         const char msg[]="Unexpected situation in __setitem__ !";
3139         int nbOfTuples=self->getNumberOfTuples();
3140         int nbOfComponents=self->getNumberOfComponents();
3141         int sw1,sw2;
3142         int i1;
3143         std::vector<int> v1;
3144         DataArrayInt *d1=0;
3145         DataArrayIntTuple *dd1=0;
3146         convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3147         int it1,ic1;
3148         std::vector<int> vt1,vc1;
3149         std::pair<int, std::pair<int,int> > pt1,pc1;
3150         DataArrayInt *dt1=0,*dc1=0;
3151         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3152         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3153         switch(sw2)
3154           {
3155           case 1:
3156             {
3157               switch(sw1)
3158                 {
3159                 case 1:
3160                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3161                   return self;
3162                 case 2:
3163                   tmp=DataArrayInt::New();
3164                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3165                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3166                   return self;
3167                 case 3:
3168                   self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3169                   return self;
3170                 case 4:
3171                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3172                   self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3173                   return self;
3174                 default:
3175                   throw INTERP_KERNEL::Exception(msg);
3176                 }
3177               break;
3178             }
3179           case 2:
3180             {
3181               switch(sw1)
3182                 {
3183                 case 1:
3184                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3185                   return self;
3186                 case 2:
3187                   tmp=DataArrayInt::New();
3188                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3189                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3190                   return self;
3191                 case 3:
3192                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3193                   return self;
3194                 case 4:
3195                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3196                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3197                   return self;
3198                 default:
3199                   throw INTERP_KERNEL::Exception(msg);
3200                 }
3201               break;
3202             }
3203           case 3:
3204             {
3205               switch(sw1)
3206                 {
3207                 case 1:
3208                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3209                   return self;
3210                 case 2:
3211                   tmp=DataArrayInt::New();
3212                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3213                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3214                   return self;
3215                 case 3:
3216                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3217                   return self;
3218                 case 4:
3219                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3220                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3221                   return self;
3222                 default:
3223                   throw INTERP_KERNEL::Exception(msg);
3224                 }
3225               break;
3226             }
3227           case 4:
3228             {
3229               switch(sw1)
3230                 {
3231                 case 1:
3232                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3233                   return self;
3234                 case 2:
3235                   tmp=DataArrayInt::New();
3236                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3237                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3238                   return self;
3239                 case 3:
3240                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3241                   return self;
3242                 case 4:
3243                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3244                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3245                   return self;
3246                 default:
3247                   throw INTERP_KERNEL::Exception(msg);
3248                 }
3249               break;
3250             }
3251           case 5:
3252             {
3253               switch(sw1)
3254                 {
3255                 case 1:
3256                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3257                   return self;
3258                 case 2:
3259                   tmp=DataArrayInt::New();
3260                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3261                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3262                   return self;
3263                 case 3:
3264                   self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3265                   return self;
3266                 case 4:
3267                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3268                   self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3269                   return self;
3270                 default:
3271                   throw INTERP_KERNEL::Exception(msg);
3272                 }
3273               break;
3274             }
3275           case 6:
3276             {
3277               switch(sw1)
3278                 {
3279                 case 1:
3280                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3281                   return self;
3282                 case 2:
3283                   tmp=DataArrayInt::New();
3284                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3285                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3286                   return self;
3287                 case 3:
3288                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3289                   return self;
3290                 case 4:
3291                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3292                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3293                   return self;
3294                 default:
3295                   throw INTERP_KERNEL::Exception(msg);
3296                 }
3297               break;
3298             }
3299           case 7:
3300             {
3301               switch(sw1)
3302                 {
3303                 case 1:
3304                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3305                   return self;
3306                 case 2:
3307                   tmp=DataArrayInt::New();
3308                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3309                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3310                   return self;
3311                 case 3:
3312                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3313                   return self;
3314                 case 4:
3315                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3316                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3317                   return self;
3318                 default:
3319                   throw INTERP_KERNEL::Exception(msg);
3320                 }
3321               break;
3322             }
3323           case 8:
3324             {
3325               switch(sw1)
3326                 {
3327                 case 1:
3328                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3329                   return self;
3330                 case 2:
3331                   tmp=DataArrayInt::New();
3332                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3333                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3334                   return self;
3335                 case 3:
3336                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3337                   return self;
3338                 case 4:
3339                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3340                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3341                   return self;
3342                 default:
3343                   throw INTERP_KERNEL::Exception(msg);
3344                 }
3345               break;
3346             }
3347           case 9:
3348             {
3349               switch(sw1)
3350                 {
3351                 case 1:
3352                   self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3353                   return self;
3354                 case 2:
3355                   tmp=DataArrayInt::New();
3356                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3357                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3358                   return self;
3359                 case 3:
3360                   self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3361                   return self;
3362                 case 4:
3363                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3364                   self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3365                   return self;
3366                 default:
3367                   throw INTERP_KERNEL::Exception(msg);
3368                 }
3369               break;
3370             }
3371           case 10:
3372             {
3373               switch(sw1)
3374                 {
3375                 case 1:
3376                   self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3377                   return self;
3378                 case 2:
3379                   tmp=DataArrayInt::New();
3380                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3381                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3382                   return self;
3383                 case 3:
3384                   self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3385                   return self;
3386                 case 4:
3387                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3388                   self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3389                   return self;
3390                 default:
3391                   throw INTERP_KERNEL::Exception(msg);
3392                 }
3393               break;
3394             }
3395           case 11:
3396             {
3397               switch(sw1)
3398                 {
3399                 case 1:
3400                   self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3401                   return self;
3402                 case 2:
3403                   tmp=DataArrayInt::New();
3404                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3405                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3406                   return self;
3407                 case 3:
3408                   self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3409                   return self;
3410                 case 4:
3411                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3412                   self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3413                   return self;
3414                 default:
3415                   throw INTERP_KERNEL::Exception(msg);
3416                 }
3417               break;
3418             }
3419           case 12:
3420             {
3421               switch(sw1)
3422                 {
3423                 case 1:
3424                   self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3425                   return self;
3426                 case 2:
3427                   tmp=DataArrayInt::New();
3428                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3429                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3430                   return self;
3431                 case 3:
3432                   self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3433                   return self;
3434                 case 4:
3435                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3436                   self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3437                   return self;
3438                 default:
3439                   throw INTERP_KERNEL::Exception(msg);
3440                 }
3441               break;
3442             }
3443           case 13:
3444             {
3445               switch(sw1)
3446                 {
3447                 case 1:
3448                   self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3449                   return self;
3450                 case 2:
3451                   tmp=DataArrayInt::New();
3452                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3453                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3454                   return self;
3455                 case 3:
3456                   self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3457                   return self;
3458                 case 4:
3459                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3460                   self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3461                   return self;
3462                 default:
3463                   throw INTERP_KERNEL::Exception(msg);
3464                 }
3465               break;
3466             }
3467           case 14:
3468             {
3469               switch(sw1)
3470                 {
3471                 case 1:
3472                   self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3473                   return self;
3474                 case 2:
3475                   tmp=DataArrayInt::New();
3476                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3477                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3478                   return self;
3479                 case 3:
3480                   self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3481                   return self;
3482                 case 4:
3483                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3484                   self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3485                   return self;
3486                 default:
3487                   throw INTERP_KERNEL::Exception(msg);
3488                 }
3489               break;
3490             }
3491           case 15:
3492             {
3493               switch(sw1)
3494                 {
3495                 case 1:
3496                   self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3497                   return self;
3498                 case 2:
3499                   tmp=DataArrayInt::New();
3500                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3501                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3502                   return self;
3503                 case 3:
3504                   self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3505                   return self;
3506                 case 4:
3507                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3508                   self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3509                   return self;
3510                 default:
3511                   throw INTERP_KERNEL::Exception(msg);
3512                 }
3513               break;
3514             }
3515           case 16:
3516             {
3517               switch(sw1)
3518                 {
3519                 case 1:
3520                   self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3521                   return self;
3522                 case 2:
3523                   tmp=DataArrayInt::New();
3524                   tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3525                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3526                   return self;
3527                 case 3:
3528                   self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3529                   return self;
3530                 case 4:
3531                   tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3532                   self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3533                   return self;
3534                 default:
3535                   throw INTERP_KERNEL::Exception(msg);
3536                 }
3537               break;
3538             }
3539           default:
3540             throw INTERP_KERNEL::Exception(msg);
3541           }
3542         return self;
3543       }
3544
3545       DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3546       {
3547         return self->negate();
3548       }
3549  
3550       DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3551       {
3552         const char msg[]="Unexpected situation in __add__ !";
3553         int val;
3554         DataArrayInt *a;
3555         std::vector<int> aa;
3556         DataArrayIntTuple *aaa;
3557         int sw;
3558         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3559         switch(sw)
3560           {
3561           case 1:
3562             {
3563               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3564               ret->applyLin(1,val);
3565               return ret.retn();
3566             }
3567           case 2:
3568             {
3569               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3570               return DataArrayInt::Add(self,aaaa);
3571             }
3572           case 3:
3573             {
3574               return DataArrayInt::Add(self,a);
3575             }
3576           case 4:
3577             {
3578               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3579               return DataArrayInt::Add(self,aaaa);
3580             }
3581           default:
3582             throw INTERP_KERNEL::Exception(msg);
3583           }
3584       }
3585
3586       DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3587       {
3588         const char msg[]="Unexpected situation in __radd__ !";
3589         int val;
3590         DataArrayInt *a;
3591         std::vector<int> aa;
3592         DataArrayIntTuple *aaa;
3593         int sw;
3594         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3595         switch(sw)
3596           {
3597           case 1:
3598             {
3599               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3600               ret->applyLin(1,val);
3601               return ret.retn();
3602             }
3603           case 2:
3604             {
3605               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3606               return DataArrayInt::Add(self,aaaa);
3607             }
3608           case 4:
3609             {
3610               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3611               return DataArrayInt::Add(self,aaaa);
3612             }
3613           default:
3614             throw INTERP_KERNEL::Exception(msg);
3615           }
3616       }
3617
3618       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3619       {
3620         const char msg[]="Unexpected situation in __iadd__ !";
3621         int val;
3622         DataArrayInt *a;
3623         std::vector<int> aa;
3624         DataArrayIntTuple *aaa;
3625         int sw;
3626         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3627         switch(sw)
3628           {
3629           case 1:
3630             {
3631               self->applyLin(1,val);
3632               Py_XINCREF(trueSelf);
3633               return trueSelf;
3634             }
3635           case 2:
3636             {
3637               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3638               self->addEqual(bb);
3639               Py_XINCREF(trueSelf);
3640               return trueSelf;
3641             }
3642           case 3:
3643             {
3644               self->addEqual(a);
3645               Py_XINCREF(trueSelf);
3646               return trueSelf;
3647             }
3648           case 4:
3649             {
3650               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3651               self->addEqual(aaaa);
3652               Py_XINCREF(trueSelf);
3653               return trueSelf;
3654             }
3655           default:
3656             throw INTERP_KERNEL::Exception(msg);
3657           }
3658       }
3659
3660       DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3661       {
3662         const char msg[]="Unexpected situation in __sub__ !";
3663         int val;
3664         DataArrayInt *a;
3665         std::vector<int> aa;
3666         DataArrayIntTuple *aaa;
3667         int sw;
3668         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3669         switch(sw)
3670           {
3671           case 1:
3672             {
3673               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3674               ret->applyLin(1,-val);
3675               return ret.retn();
3676             }
3677           case 2:
3678             {
3679               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3680               return DataArrayInt::Substract(self,aaaa);
3681             }
3682           case 3:
3683             {
3684               return DataArrayInt::Substract(self,a);
3685             }
3686           case 4:
3687             {
3688               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3689               return DataArrayInt::Substract(self,aaaa);
3690             }
3691           default:
3692             throw INTERP_KERNEL::Exception(msg);
3693           }
3694       }
3695
3696       DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3697       {
3698         const char msg[]="Unexpected situation in __rsub__ !";
3699         int val;
3700         DataArrayInt *a;
3701         std::vector<int> aa;
3702         DataArrayIntTuple *aaa;
3703         int sw;
3704         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3705         switch(sw)
3706           {
3707           case 1:
3708             {
3709               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3710               ret->applyLin(-1,val);
3711               return ret.retn();
3712             }
3713           case 2:
3714             {
3715               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3716               return DataArrayInt::Substract(aaaa,self);
3717             }
3718           case 4:
3719             {
3720               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3721               return DataArrayInt::Substract(aaaa,self);
3722             }
3723           default:
3724             throw INTERP_KERNEL::Exception(msg);
3725           }
3726       }
3727
3728       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3729       {
3730         const char msg[]="Unexpected situation in __isub__ !";
3731         int val;
3732         DataArrayInt *a;
3733         std::vector<int> aa;
3734         DataArrayIntTuple *aaa;
3735         int sw;
3736         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3737         switch(sw)
3738           {
3739           case 1:
3740             {
3741               self->applyLin(1,-val);
3742               Py_XINCREF(trueSelf);
3743               return trueSelf;
3744             }
3745           case 2:
3746             {
3747               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3748               self->substractEqual(bb);
3749               Py_XINCREF(trueSelf);
3750               return trueSelf;
3751             }
3752           case 3:
3753             {
3754               self->substractEqual(a);
3755               Py_XINCREF(trueSelf);
3756               return trueSelf;
3757             }
3758           case 4:
3759             {
3760               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3761               self->substractEqual(aaaa);
3762               Py_XINCREF(trueSelf);
3763               return trueSelf;
3764             }
3765           default:
3766             throw INTERP_KERNEL::Exception(msg);
3767           }
3768       }
3769
3770       DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3771       {
3772         const char msg[]="Unexpected situation in __mul__ !";
3773         int val;
3774         DataArrayInt *a;
3775         std::vector<int> aa;
3776         DataArrayIntTuple *aaa;
3777         int sw;
3778         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3779         switch(sw)
3780           {
3781           case 1:
3782             {
3783               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3784               ret->applyLin(val,0);
3785               return ret.retn();
3786             }
3787           case 2:
3788             {
3789               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3790               return DataArrayInt::Multiply(self,aaaa);
3791             }
3792           case 3:
3793             {
3794               return DataArrayInt::Multiply(self,a);
3795             }
3796           case 4:
3797             {
3798               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3799               return DataArrayInt::Multiply(self,aaaa);
3800             }
3801           default:
3802             throw INTERP_KERNEL::Exception(msg);
3803           }
3804       }
3805
3806       DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3807       {
3808         const char msg[]="Unexpected situation in __rmul__ !";
3809         int val;
3810         DataArrayInt *a;
3811         std::vector<int> aa;
3812         DataArrayIntTuple *aaa;
3813         int sw;
3814         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3815         switch(sw)
3816           {
3817           case 1:
3818             {
3819               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3820               ret->applyLin(val,0);
3821               return ret.retn();
3822             }
3823           case 2:
3824             {
3825               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3826               return DataArrayInt::Multiply(self,aaaa);
3827             }
3828           case 4:
3829             {
3830               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3831               return DataArrayInt::Multiply(self,aaaa);
3832             }
3833           default:
3834             throw INTERP_KERNEL::Exception(msg);
3835           }
3836       }
3837
3838       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3839       {
3840         const char msg[]="Unexpected situation in __imul__ !";
3841         int val;
3842         DataArrayInt *a;
3843         std::vector<int> aa;
3844         DataArrayIntTuple *aaa;
3845         int sw;
3846         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3847         switch(sw)
3848           {
3849           case 1:
3850             {
3851               self->applyLin(val,0);
3852               Py_XINCREF(trueSelf);
3853               return trueSelf;
3854             }
3855           case 2:
3856             {
3857               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3858               self->multiplyEqual(bb);
3859               Py_XINCREF(trueSelf);
3860               return trueSelf;
3861             }
3862           case 3:
3863             {
3864               self->multiplyEqual(a);
3865               Py_XINCREF(trueSelf);
3866               return trueSelf;
3867             }
3868           case 4:
3869             {
3870               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3871               self->multiplyEqual(aaaa);
3872               Py_XINCREF(trueSelf);
3873               return trueSelf;
3874             }
3875           default:
3876             throw INTERP_KERNEL::Exception(msg);
3877           }
3878       }
3879
3880       DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3881       {
3882         const char msg[]="Unexpected situation in __div__ !";
3883         int val;
3884         DataArrayInt *a;
3885         std::vector<int> aa;
3886         DataArrayIntTuple *aaa;
3887         int sw;
3888         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3889         switch(sw)
3890           {
3891           case 1:
3892             {
3893               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3894               ret->applyDivideBy(val);
3895               return ret.retn();
3896             }
3897           case 2:
3898             {
3899               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3900               return DataArrayInt::Divide(self,aaaa);
3901             }
3902           case 3:
3903             {
3904               return DataArrayInt::Divide(self,a);
3905             }
3906           case 4:
3907             {
3908               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3909               return DataArrayInt::Divide(self,aaaa);
3910             }
3911           default:
3912             throw INTERP_KERNEL::Exception(msg);
3913           }
3914       }
3915
3916       DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3917       {
3918         const char msg[]="Unexpected situation in __rdiv__ !";
3919         int val;
3920         DataArrayInt *a;
3921         std::vector<int> aa;
3922         DataArrayIntTuple *aaa;
3923         int sw;
3924         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3925         switch(sw)
3926           {
3927           case 1:
3928             {
3929               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3930               ret->applyInv(val);
3931               return ret.retn();
3932             }
3933           case 2:
3934             {
3935               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3936               return DataArrayInt::Divide(aaaa,self);
3937             }
3938           case 4:
3939             {
3940               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3941               return DataArrayInt::Divide(aaaa,self);
3942             }
3943           default:
3944             throw INTERP_KERNEL::Exception(msg);
3945           }
3946       }
3947
3948       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3949       {
3950         const char msg[]="Unexpected situation in __idiv__ !";
3951         int val;
3952         DataArrayInt *a;
3953         std::vector<int> aa;
3954         DataArrayIntTuple *aaa;
3955         int sw;
3956         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3957         switch(sw)
3958           {
3959           case 1:
3960             {
3961               self->applyDivideBy(val);
3962               Py_XINCREF(trueSelf);
3963               return trueSelf;
3964             }
3965           case 2:
3966             {
3967               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3968               self->divideEqual(bb);
3969               Py_XINCREF(trueSelf);
3970               return trueSelf;
3971             }
3972           case 3:
3973             {
3974               self->divideEqual(a);
3975               Py_XINCREF(trueSelf);
3976               return trueSelf;
3977             }
3978           case 4:
3979             {
3980               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3981               self->divideEqual(aaaa);
3982               Py_XINCREF(trueSelf);
3983               return trueSelf;
3984             }
3985           default:
3986             throw INTERP_KERNEL::Exception(msg);
3987           }
3988       }
3989
3990       DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3991       {
3992         const char msg[]="Unexpected situation in __mod__ !";
3993         int val;
3994         DataArrayInt *a;
3995         std::vector<int> aa;
3996         DataArrayIntTuple *aaa;
3997         int sw;
3998         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3999         switch(sw)
4000           {
4001           case 1:
4002             {
4003               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4004               ret->applyModulus(val);
4005               return ret.retn();
4006             }
4007           case 2:
4008             {
4009               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4010               return DataArrayInt::Modulus(self,aaaa);
4011             }
4012           case 3:
4013             {
4014               return DataArrayInt::Modulus(self,a);
4015             }
4016           case 4:
4017             {
4018               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4019               return DataArrayInt::Modulus(self,aaaa);
4020             }
4021           default:
4022             throw INTERP_KERNEL::Exception(msg);
4023           }
4024       }
4025
4026       DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4027       {
4028         const char msg[]="Unexpected situation in __rmod__ !";
4029         int val;
4030         DataArrayInt *a;
4031         std::vector<int> aa;
4032         DataArrayIntTuple *aaa;
4033         int sw;
4034         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4035         switch(sw)
4036           {
4037           case 1:
4038             {
4039               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4040               ret->applyRModulus(val);
4041               return ret.retn();
4042             }
4043           case 2:
4044             {
4045               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4046               return DataArrayInt::Modulus(aaaa,self);
4047             }
4048           case 3:
4049             {
4050               return DataArrayInt::Modulus(a,self);
4051             }
4052           case 4:
4053             {
4054               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4055               return DataArrayInt::Modulus(aaaa,self);
4056             }
4057           default:
4058             throw INTERP_KERNEL::Exception(msg);
4059           }
4060       }
4061
4062       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4063       {
4064         const char msg[]="Unexpected situation in __imod__ !";
4065         int val;
4066         DataArrayInt *a;
4067         std::vector<int> aa;
4068         DataArrayIntTuple *aaa;
4069         int sw;
4070         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4071         switch(sw)
4072           {
4073           case 1:
4074             {
4075               self->applyModulus(val);
4076               Py_XINCREF(trueSelf);
4077               return trueSelf;
4078             }
4079           case 3:
4080             {
4081               self->modulusEqual(a);
4082               Py_XINCREF(trueSelf);
4083               return trueSelf;
4084             }
4085           case 4:
4086             {
4087               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4088               self->modulusEqual(aaaa);
4089               Py_XINCREF(trueSelf);
4090               return trueSelf;
4091             }
4092           default:
4093             throw INTERP_KERNEL::Exception(msg);
4094           }
4095       }
4096
4097       DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4098       {
4099         const char msg[]="Unexpected situation in __pow__ !";
4100         int val;
4101         DataArrayInt *a;
4102         std::vector<int> aa;
4103         DataArrayIntTuple *aaa;
4104         int sw;
4105         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4106         switch(sw)
4107           {
4108           case 1:
4109             {
4110               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4111               ret->applyPow(val);
4112               return ret.retn();
4113             }
4114           case 2:
4115             {
4116               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4117               return DataArrayInt::Pow(self,aaaa);
4118             }
4119           case 3:
4120             {
4121               return DataArrayInt::Pow(self,a);
4122             }
4123           case 4:
4124             {
4125               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4126               return DataArrayInt::Pow(self,aaaa);
4127             }
4128           default:
4129             throw INTERP_KERNEL::Exception(msg);
4130           }
4131       }
4132
4133       DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4134       {
4135         const char msg[]="Unexpected situation in __rpow__ !";
4136         int val;
4137         DataArrayInt *a;
4138         std::vector<int> aa;
4139         DataArrayIntTuple *aaa;
4140         int sw;
4141         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4142         switch(sw)
4143           {
4144           case 1:
4145             {
4146               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4147               ret->applyRPow(val);
4148               return ret.retn();
4149             }
4150           case 2:
4151             {
4152               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4153               return DataArrayInt::Pow(aaaa,self);
4154             }
4155           case 3:
4156             {
4157               return DataArrayInt::Pow(a,self);
4158             }
4159           case 4:
4160             {
4161               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4162               return DataArrayInt::Pow(aaaa,self);
4163             }
4164           default:
4165             throw INTERP_KERNEL::Exception(msg);
4166           }
4167       }
4168    
4169       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4170       {
4171         const char msg[]="Unexpected situation in __ipow__ !";
4172         int val;
4173         DataArrayInt *a;
4174         std::vector<int> aa;
4175         DataArrayIntTuple *aaa;
4176         int sw;
4177         convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4178         switch(sw)
4179           {
4180           case 1:
4181             {
4182               self->applyPow(val);
4183               Py_XINCREF(trueSelf);
4184               return trueSelf;
4185             }
4186           case 3:
4187             {
4188               self->powEqual(a);
4189               Py_XINCREF(trueSelf);
4190               return trueSelf;
4191             }
4192           case 4:
4193             {
4194               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4195               self->powEqual(aaaa);
4196               Py_XINCREF(trueSelf);
4197               return trueSelf;
4198             }
4199           default:
4200             throw INTERP_KERNEL::Exception(msg);
4201           }
4202       }
4203
4204       std::string __repr__() const throw(INTERP_KERNEL::Exception)
4205       {
4206         std::ostringstream oss;
4207         self->reprQuickOverview(oss);
4208         return oss.str();
4209       }
4210       
4211       void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4212       {
4213         int szArr,sw,iTypppArr;
4214         std::vector<int> stdvecTyyppArr;
4215         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4216         self->pushBackValsSilent(tmp,tmp+szArr);
4217       }
4218       
4219       PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4220       {
4221         std::vector<int> ret1;
4222         std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4223         std::size_t sz=ret0.size();
4224         PyObject *pyRet=PyTuple_New(2);
4225         PyObject *pyRet0=PyList_New((int)sz);
4226         PyObject *pyRet1=PyList_New((int)sz);
4227         for(std::size_t i=0;i<sz;i++)
4228           {
4229             PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4230             PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4231           }
4232         PyTuple_SetItem(pyRet,0,pyRet0);
4233         PyTuple_SetItem(pyRet,1,pyRet1);
4234         return pyRet;
4235       }
4236       
4237       PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4238       {
4239         DataArrayInt *ret0=0,*ret1=0;
4240         self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4241         PyObject *pyRet=PyTuple_New(2);
4242         PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4243         PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4244         return pyRet;
4245       }
4246     }
4247   };
4248
4249   class DataArrayIntTuple;
4250
4251   class DataArrayIntIterator
4252   {
4253   public:
4254     DataArrayIntIterator(DataArrayInt *da);
4255     ~DataArrayIntIterator();
4256     %extend
4257     {
4258       PyObject *next()
4259       {
4260         DataArrayIntTuple *ret=self->nextt();
4261         if(ret)
4262           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4263         else
4264           {
4265             PyErr_SetString(PyExc_StopIteration,"No more data.");
4266             return 0;
4267           }
4268       }
4269     }
4270   };
4271
4272   class DataArrayIntTuple
4273   {
4274   public:
4275     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4276     DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4277     %extend
4278     {
4279       std::string __str__() const throw(INTERP_KERNEL::Exception)
4280       {
4281         return self->repr();
4282       }
4283
4284       int __int__() const throw(INTERP_KERNEL::Exception)
4285       {
4286         return self->intValue();
4287       }
4288
4289       DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4290       {
4291         return self->buildDAInt(1,self->getNumberOfCompo());
4292       }
4293
4294       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4295       {
4296         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4297         ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4298         Py_XINCREF(trueSelf);
4299         return trueSelf;
4300       }
4301   
4302       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4303       {
4304         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4305         ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4306         Py_XINCREF(trueSelf);
4307         return trueSelf;
4308       }
4309   
4310       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4311       {
4312         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4313         ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4314         Py_XINCREF(trueSelf);
4315         return trueSelf;
4316       }
4317
4318       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4319       {
4320         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4321         ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4322         Py_XINCREF(trueSelf);
4323         return trueSelf;
4324       }
4325
4326       PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4327       {
4328         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4329         ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4330         Py_XINCREF(trueSelf);
4331         return trueSelf;
4332       }
4333   
4334       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4335       {
4336         const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4337         int sw;
4338         int singleVal;
4339         std::vector<int> multiVal;
4340         std::pair<int, std::pair<int,int> > slic;
4341         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4342         const int *pt=self->getConstPointer();
4343         int nbc=self->getNumberOfCompo();
4344         convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4345         switch(sw)
4346           {
4347           case 1:
4348             {
4349               if(singleVal>=nbc)
4350                 {
4351                   std::ostringstream oss;
4352                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4353                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4354                 }
4355               if(singleVal>=0)
4356                 return PyInt_FromLong(pt[singleVal]);
4357               else
4358                 {
4359                   if(nbc+singleVal>0)
4360                     return PyInt_FromLong(pt[nbc+singleVal]);
4361                   else
4362                     {
4363                       std::ostringstream oss;
4364                       oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4365                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4366                     }
4367                 }
4368             }
4369           case 2:
4370             {
4371               PyObject *t=PyTuple_New(multiVal.size());
4372               for(int j=0;j<(int)multiVal.size();j++)
4373                 {
4374                   int cid=multiVal[j];
4375                   if(cid>=nbc)
4376                     {
4377                       std::ostringstream oss;
4378                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4379                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4380                     }
4381                   PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4382                 }
4383               return t;
4384             }
4385           case 3:
4386             {
4387               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4388               PyObject *t=PyTuple_New(sz);
4389               for(int j=0;j<sz;j++)
4390                 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4391               return t;
4392             }
4393           default:
4394             throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4395           }
4396       }
4397
4398       DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4399       {
4400         const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4401         const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4402         int sw1,sw2;
4403         int singleValV;
4404         std::vector<int> multiValV;
4405         std::pair<int, std::pair<int,int> > slicV;
4406         ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4407         int nbc=self->getNumberOfCompo();
4408         convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4409         int singleVal;
4410         std::vector<int> multiVal;
4411         std::pair<int, std::pair<int,int> > slic;
4412         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4413         int *pt=self->getPointer();
4414         convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4415         switch(sw2)
4416           {
4417           case 1:
4418             {
4419               if(singleVal>=nbc)
4420                 {
4421                   std::ostringstream oss;
4422                   oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4423                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4424                 }
4425               switch(sw1)
4426                 {
4427                 case 1:
4428                   {
4429                     pt[singleVal]=singleValV;
4430                     return self;
4431                   }
4432                 case 2:
4433                   {
4434                     if(multiValV.size()!=1)
4435                       {
4436                         std::ostringstream oss;
4437                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4438                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4439                       }
4440                     pt[singleVal]=multiValV[0];
4441                     return self;
4442                   }
4443                 case 4:
4444                   {
4445                     pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4446                     return self;
4447                   }
4448                 default:
4449                   throw INTERP_KERNEL::Exception(msg);
4450                 }
4451             }
4452           case 2:
4453             {
4454               switch(sw1)
4455                 {
4456                 case 1:
4457                   {
4458                     for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4459                       {
4460                         if(*it>=nbc)
4461                           {
4462                             std::ostringstream oss;
4463                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4464                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4465                           }
4466                         pt[*it]=singleValV;
4467                       }
4468                     return self;
4469                   }
4470                 case 2:
4471                   {
4472                     if(multiVal.size()!=multiValV.size())
4473                       {
4474                         std::ostringstream oss;
4475                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4476                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4477                       }
4478                     for(int i=0;i<(int)multiVal.size();i++)
4479                       {
4480                         int pos=multiVal[i];
4481                         if(pos>=nbc)
4482                           {
4483                             std::ostringstream oss;
4484                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4485                             throw INTERP_KERNEL::Exception(oss.str().c_str());
4486                           }
4487                         pt[multiVal[i]]=multiValV[i];
4488                       }
4489                     return self;
4490                   }
4491                 case 4:
4492                   {
4493                     const int *ptV=daIntTyyppV->getConstPointer();
4494                     if(nbc>daIntTyyppV->getNumberOfCompo())
4495                       {
4496                         std::ostringstream oss;
4497                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4498                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4499                       }
4500                     std::copy(ptV,ptV+nbc,pt);
4501                     return self;
4502                   }
4503                 default:
4504                   throw INTERP_KERNEL::Exception(msg);
4505                 }
4506             }
4507           case 3:
4508             {
4509               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4510               switch(sw1)
4511                 {
4512                 case 1:
4513                   {
4514                     for(int j=0;j<sz;j++)
4515                       pt[slic.first+j*slic.second.second]=singleValV;
4516                     return self;
4517                   }
4518                 case 2:
4519                   {
4520                     if(sz!=(int)multiValV.size())
4521                       {
4522                         std::ostringstream oss;
4523                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4524                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4525                       }
4526                     for(int j=0;j<sz;j++)
4527                       pt[slic.first+j*slic.second.second]=multiValV[j];
4528                     return self;
4529                   }
4530                 case 4:
4531                   {
4532                     const int *ptV=daIntTyyppV->getConstPointer();
4533                     if(sz>daIntTyyppV->getNumberOfCompo())
4534                       {
4535                         std::ostringstream oss;
4536                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4537                         throw INTERP_KERNEL::Exception(oss.str().c_str());
4538                       }
4539                     for(int j=0;j<sz;j++)
4540                       pt[slic.first+j*slic.second.second]=ptV[j];
4541                     return self;
4542                   }
4543                 default:
4544                   throw INTERP_KERNEL::Exception(msg);
4545                 }
4546             }
4547           default:
4548             throw INTERP_KERNEL::Exception(msg);
4549           }
4550       }
4551     }
4552   };
4553
4554   class DataArrayChar : public DataArray
4555   {
4556   public:
4557     virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4558     virtual DataArrayChar *deepCpy() const throw(INTERP_KERNEL::Exception);
4559     int getHashCode() const throw(INTERP_KERNEL::Exception);
4560     bool empty() const throw(INTERP_KERNEL::Exception);
4561     void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4562     void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4563     void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4564     void pushBackValsSilent(const char *valsBg, const char *valsEnd) throw(INTERP_KERNEL::Exception);
4565     char popBackSilent() throw(INTERP_KERNEL::Exception);
4566     void pack() const throw(INTERP_KERNEL::Exception);
4567     void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4568     bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4569     bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4570     void reverse() throw(INTERP_KERNEL::Exception);
4571     void fillWithZero() throw(INTERP_KERNEL::Exception);
4572     void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4573     std::string repr() const throw(INTERP_KERNEL::Exception);
4574     std::string reprZip() const throw(INTERP_KERNEL::Exception);
4575     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4576     DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4577     DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4578     DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4579     DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const throw(INTERP_KERNEL::Exception);
4580     DataArrayChar *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
4581     bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4582     void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
4583     DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4584     DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4585     void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4586     void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4587     char front() const throw(INTERP_KERNEL::Exception);
4588     char back() const throw(INTERP_KERNEL::Exception);
4589     void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4590     void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4591     char *getPointer() throw(INTERP_KERNEL::Exception);
4592     DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4593     DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4594     int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4595     bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4596     char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4597     char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4598     char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4599     char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4600     DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4601     static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4602     static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4603     %extend
4604     {
4605       int __len__() const throw(INTERP_KERNEL::Exception)
4606       {
4607         if(self->isAllocated())
4608           {
4609             return self->getNumberOfTuples();
4610           }
4611         else
4612           {
4613             throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4614           }
4615       }
4616       
4617       PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4618       {
4619         std::string ret1;
4620         bool ret0=self->isEqualIfNotWhy(other,ret1);
4621         PyObject *ret=PyTuple_New(2);
4622         PyObject *ret0Py=ret0?Py_True:Py_False;
4623         Py_XINCREF(ret0Py);
4624         PyTuple_SetItem(ret,0,ret0Py);
4625         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4626         return ret;
4627       }
4628       
4629       DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4630       {
4631         void *da=0;
4632         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4633         if (!SWIG_IsOK(res1))
4634           {
4635             int size;
4636             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4637             if(size!=self->getNumberOfTuples())
4638               {
4639                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4640               }
4641             return self->renumber(tmp);
4642           }
4643         else
4644           {
4645             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4646             if(!da2)
4647               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4648             da2->checkAllocated();
4649             int size=self->getNumberOfTuples();
4650             if(size!=self->getNumberOfTuples())
4651               {
4652                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4653               }
4654             return self->renumber(da2->getConstPointer());
4655           }
4656       }
4657       
4658       DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4659       {
4660         void *da=0;
4661         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4662         if (!SWIG_IsOK(res1))
4663           {
4664             int size;
4665             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4666             if(size!=self->getNumberOfTuples())
4667               {
4668                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4669               }
4670             return self->renumberR(tmp);
4671           }
4672         else
4673           {
4674             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4675             if(!da2)
4676               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4677             da2->checkAllocated();
4678             int size=self->getNumberOfTuples();
4679             if(size!=self->getNumberOfTuples())
4680               {
4681                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4682               }
4683             return self->renumberR(da2->getConstPointer());
4684           }
4685       }
4686       
4687       DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4688       {
4689         void *da=0;
4690         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4691         if (!SWIG_IsOK(res1))
4692           {
4693             int size;
4694             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4695             if(size!=self->getNumberOfTuples())
4696               {
4697                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4698               }
4699             return self->renumberAndReduce(tmp,newNbOfTuple);
4700           }
4701         else
4702           {
4703             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4704             if(!da2)
4705               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4706             da2->checkAllocated();
4707             int size=self->getNumberOfTuples();
4708             if(size!=self->getNumberOfTuples())
4709               {
4710                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4711               }
4712             return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4713           }
4714       }
4715       
4716       DataArrayChar *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
4717       {
4718         void *da=0;
4719         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4720         if (!SWIG_IsOK(res1))
4721           {
4722             int size;
4723             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4724             return self->selectByTupleIdSafe(tmp,tmp+size);
4725           }
4726         else
4727           {
4728             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4729             if(!da2)
4730               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4731             da2->checkAllocated();
4732             return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4733           }
4734       }
4735       
4736       static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4737       {
4738         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4739         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4740         return DataArrayChar::Aggregate(tmp);
4741       }
4742       
4743       static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4744       {
4745         std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4746         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4747         return DataArrayChar::Meld(tmp);
4748       }
4749     }
4750   };
4751   
4752   class DataArrayByteIterator;
4753
4754   class DataArrayByte : public DataArrayChar
4755   {
4756   public:
4757     static DataArrayByte *New();
4758     DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4759     DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4760     char byteValue() const throw(INTERP_KERNEL::Exception);
4761     %extend
4762     {
4763       DataArrayByte() throw(INTERP_KERNEL::Exception)
4764         {
4765           return DataArrayByte::New();
4766         }
4767
4768       static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4769       {
4770         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) !";
4771         if(PyList_Check(elt0) || PyTuple_Check(elt0))
4772           {
4773             if(nbOfTuples)
4774               {
4775                 if(PyInt_Check(nbOfTuples))
4776                   {
4777                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4778                     if(nbOfTuples1<0)
4779                       throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4780                     if(nbOfComp)
4781                       {
4782                         if(PyInt_Check(nbOfComp))
4783                           {//DataArrayByte.New([1,3,4,5],2,2)
4784                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4785                             if(nbOfCompo<0)
4786                               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4787                             MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4788                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4789                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4790                             return ret.retn();
4791                           }
4792                         else
4793                           throw INTERP_KERNEL::Exception(msg);
4794                       }
4795                     else
4796                       {//DataArrayByte.New([1,3,4],3)
4797                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4798                         int tmpp1=-1;
4799                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4800                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4801                         return ret.retn();
4802                       }
4803                   }
4804                 else
4805                   throw INTERP_KERNEL::Exception(msg);
4806               }
4807             else
4808               {// DataArrayByte.New([1,3,4])
4809                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4810                 int tmpp1=-1,tmpp2=-1;
4811                 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4812                 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4813                 return ret.retn();
4814               }
4815           }
4816         else if(PyInt_Check(elt0))
4817           {
4818             int nbOfTuples1=PyInt_AS_LONG(elt0);
4819             if(nbOfTuples1<0)
4820               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4821             if(nbOfTuples)
4822               {
4823                 if(!nbOfComp)
4824                   {
4825                     if(PyInt_Check(nbOfTuples))
4826                       {//DataArrayByte.New(5,2)
4827                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4828                         if(nbOfCompo<0)
4829                           throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4830                         MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4831                         ret->alloc(nbOfTuples1,nbOfCompo);
4832                         return ret.retn();
4833                       }
4834                     else
4835                       throw INTERP_KERNEL::Exception(msg);
4836                   }
4837                 else
4838                   throw INTERP_KERNEL::Exception(msg);
4839               }
4840             else
4841               {//DataArrayByte.New(5)
4842                 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4843                 ret->alloc(nbOfTuples1,1);
4844                 return ret.retn();
4845               }
4846           }
4847         else
4848           throw INTERP_KERNEL::Exception(msg);
4849       }
4850
4851       DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4852         {
4853           return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4854         }
4855    
4856       std::string __repr__() const throw(INTERP_KERNEL::Exception)
4857       {
4858         std::ostringstream oss;
4859         self->reprQuickOverview(oss);
4860         return oss.str();
4861       }
4862   
4863       int __int__() const throw(INTERP_KERNEL::Exception)
4864       {
4865         return (int) self->byteValue();
4866       }
4867
4868       DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
4869       {
4870         return self->iterator();
4871       }
4872
4873       int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4874       {
4875         return (int)self->getIJ(tupleId,compoId);
4876       }
4877       
4878       int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4879       {
4880         return (int)self->getIJSafe(tupleId,compoId);
4881       }
4882
4883       std::string __str__() const throw(INTERP_KERNEL::Exception)
4884       {
4885         return self->repr();
4886       }
4887
4888       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
4889       {
4890         const char *vals=self->getConstPointer();
4891         int nbOfComp=self->getNumberOfComponents();
4892         int nbOfTuples=self->getNumberOfTuples();
4893         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4894       }
4895    
4896       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4897       {
4898         int sz=-1,sw=-1;
4899         int ival=-1; std::vector<int> ivval;
4900         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4901         std::vector<char> vals(sz);
4902         std::copy(pt,pt+sz,vals.begin());
4903         return self->presenceOfTuple(vals);
4904       }
4905
4906       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4907       {
4908         int sz=-1,sw=-1;
4909         int ival=-1; std::vector<int> ivval;
4910         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4911         std::vector<char> vals2(sz);
4912         std::copy(pt,pt+sz,vals2.begin());
4913         return self->presenceOfValue(vals2);
4914       }
4915
4916       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4917       {
4918         int sz=-1,sw=-1;
4919         int ival=-1; std::vector<int> ivval;
4920         const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4921         std::vector<char> vals2(sz);
4922         std::copy(pt,pt+sz,vals2.begin());
4923         return self->locateValue(vals2);
4924       }
4925
4926       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4927       {
4928         int sz=-1,sw=-1;
4929         int ival=-1; std::vector<int> ivval;
4930         const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4931         std::vector<char> vals(sz);
4932         std::copy(pt,pt+sz,vals.begin());
4933         return self->locateTuple(vals);
4934       }
4935
4936       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
4937       {
4938         int sz=-1,sw=-1;
4939         int ival=-1; std::vector<int> ivval;
4940         const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
4941         std::vector<char> vals(sz);
4942         std::copy(pt,pt+sz,vals.begin());
4943         return self->search(vals);
4944       }
4945
4946       PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
4947       {
4948         int sz=self->getNumberOfComponents();
4949         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
4950         self->getTuple(tupleId,tmp);
4951         PyObject *ret=PyTuple_New(sz);
4952         for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
4953         return ret;
4954       }
4955
4956       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
4957       {
4958         int tmp;
4959         int r1=(int)self->getMaxValue(tmp);
4960         PyObject *ret=PyTuple_New(2);
4961         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4962         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4963         return ret;
4964       }
4965
4966       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
4967       {
4968         int tmp;
4969         int r1=(int)self->getMinValue(tmp);
4970         PyObject *ret=PyTuple_New(2);
4971         PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4972         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4973         return ret;
4974       }
4975
4976       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4977       {
4978         int nbOfCompo=self->getNumberOfComponents();
4979         switch(nbOfCompo)
4980           {
4981           case 1:
4982             {
4983               if(PyInt_Check(obj))
4984                 {
4985                   int val=(int)PyInt_AS_LONG(obj);
4986                   return self->locateValue(val);
4987                 }
4988               else
4989                 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
4990             }
4991           default:
4992             return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
4993           }
4994       }
4995
4996       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4997       {
4998         int nbOfCompo=self->getNumberOfComponents();
4999         switch(nbOfCompo)
5000           {
5001           case 0:
5002             return false;
5003           case 1:
5004             {
5005               if(PyInt_Check(obj))
5006                 {
5007                   int val=(int)PyInt_AS_LONG(obj);
5008                   return self->presenceOfValue(val);
5009                 }
5010               else
5011                 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5012             }
5013           default:
5014             return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
5015           }
5016       }
5017     }
5018   };
5019
5020   class DataArrayByteTuple;
5021
5022   class DataArrayByteIterator
5023   {
5024   public:
5025     DataArrayByteIterator(DataArrayByte *da);
5026     ~DataArrayByteIterator();
5027   };
5028
5029   class DataArrayByteTuple
5030   {
5031   public:
5032     std::string repr() const throw(INTERP_KERNEL::Exception);
5033     DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5034     %extend
5035     {
5036       std::string __str__() const throw(INTERP_KERNEL::Exception)
5037       {
5038         return self->repr();
5039       }
5040       
5041       char __int__() const throw(INTERP_KERNEL::Exception)
5042       {
5043         return self->byteValue();
5044       }
5045       
5046       DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5047       {
5048         return self->buildDAByte(1,self->getNumberOfCompo());
5049       }
5050     }
5051   };
5052   
5053   class DataArrayAsciiCharIterator;
5054   
5055   class DataArrayAsciiChar : public DataArrayChar
5056   {
5057   public:
5058     static DataArrayAsciiChar *New();
5059     DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5060     DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5061     char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5062     %extend
5063     {
5064       DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5065         {
5066           return DataArrayAsciiChar::New();
5067         }
5068
5069       static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5070       {
5071         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) !";
5072         if(PyList_Check(elt0) || PyTuple_Check(elt0))
5073           {
5074             if(nbOfTuples)
5075               {
5076                 if(PyInt_Check(nbOfTuples))
5077                   {
5078                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5079                     if(nbOfTuples1<0)
5080                       throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5081                     if(nbOfComp)
5082                       {
5083                         if(PyInt_Check(nbOfComp))
5084                           {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5085                             int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5086                             if(nbOfCompo<0)
5087                               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5088                             MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5089                             std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5090                             ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5091                             return ret.retn();
5092                           }
5093                         else
5094                           throw INTERP_KERNEL::Exception(msg);
5095                       }
5096                     else
5097                       {//DataArrayAsciiChar.New([1,3,4],3)
5098                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5099                         int tmpp1=-1;
5100                         std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5101                         ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5102                         return ret.retn();
5103                       }
5104                   }
5105                 else if(PyString_Check(nbOfTuples))
5106                   {
5107                     if(PyString_Size(nbOfTuples)!=1)
5108                       throw INTERP_KERNEL::Exception(msg);
5109                     //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5110                     std::vector<std::string> tmp;
5111                     if(fillStringVector(elt0,tmp))
5112                       return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5113                     else
5114                       throw INTERP_KERNEL::Exception(msg);
5115                   }
5116                 else
5117                   throw INTERP_KERNEL::Exception(msg);
5118               }
5119             else
5120               {
5121                 std::vector<std::string> tmmp;
5122                 if(fillStringVector(elt0,tmmp))
5123                   //DataArrayAsciiChar.New(["abc","de","fghi"])
5124                   return DataArrayAsciiChar::New(tmmp,' ');
5125                 else
5126                   {
5127                     // DataArrayAsciiChar.New([1,3,4])
5128                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5129                     int tmpp1=-1,tmpp2=-1;
5130                     std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5131                     ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5132                     return ret.retn();
5133                   }
5134               }
5135           }
5136         else if(PyInt_Check(elt0))
5137           {
5138             int nbOfTuples1=PyInt_AS_LONG(elt0);
5139             if(nbOfTuples1<0)
5140               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5141             if(nbOfTuples)
5142               {
5143                 if(!nbOfComp)
5144                   {
5145                     if(PyInt_Check(nbOfTuples))
5146                       {//DataArrayAsciiChar.New(5,2)
5147                         int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5148                         if(nbOfCompo<0)
5149                           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5150                         MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5151                         ret->alloc(nbOfTuples1,nbOfCompo);
5152                         return ret.retn();
5153                       }
5154                     else
5155                       throw INTERP_KERNEL::Exception(msg);
5156                   }
5157                 else
5158                   throw INTERP_KERNEL::Exception(msg);
5159               }
5160             else
5161               {//DataArrayAsciiChar.New(5)
5162                 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5163                 ret->alloc(nbOfTuples1,1);
5164                 return ret.retn();
5165               }
5166           }
5167         else
5168           throw INTERP_KERNEL::Exception(msg);
5169       }
5170
5171       DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5172         {
5173           return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5174         }
5175
5176       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5177       {
5178         std::ostringstream oss;
5179         self->reprQuickOverview(oss);
5180         return oss.str();
5181       }
5182
5183       DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5184       {
5185         return self->iterator();
5186       }
5187
5188       std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5189       {
5190         char tmp[2]; tmp[1]='\0';
5191         tmp[0]=self->getIJ(tupleId,compoId);
5192         return std::string(tmp);
5193       }
5194    
5195       std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5196       {
5197         char tmp[2]; tmp[1]='\0';
5198         tmp[0]=self->getIJSafe(tupleId,compoId);
5199         return std::string(tmp);
5200       }
5201
5202       std::string __str__() const throw(INTERP_KERNEL::Exception)
5203       {
5204         return self->repr();
5205       }
5206
5207       PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5208       {
5209         const char *vals=self->getConstPointer();
5210         int nbOfComp=self->getNumberOfComponents();
5211         int nbOfTuples=self->getNumberOfTuples();
5212         return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5213       }
5214
5215       bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5216       {
5217         if(PyString_Check(tupl))
5218           {
5219             Py_ssize_t sz=PyString_Size(tupl);
5220             std::vector<char> vals(sz);
5221             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5222             return self->presenceOfTuple(vals);
5223           }
5224         else
5225           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5226       }
5227    
5228       bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5229       {
5230         if(PyString_Check(vals))
5231           {
5232             Py_ssize_t sz=PyString_Size(vals);
5233             std::vector<char> vals2(sz);
5234             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5235             return self->presenceOfValue(vals2);
5236           }
5237         else
5238           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5239       }
5240
5241       int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5242       {
5243         if(PyString_Check(vals))
5244           {
5245             Py_ssize_t sz=PyString_Size(vals);
5246             std::vector<char> vals2(sz);
5247             std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5248             return self->locateValue(vals2);
5249           }
5250         else
5251           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5252       }
5253
5254       int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5255       {
5256         if(PyString_Check(tupl))
5257           {
5258             Py_ssize_t sz=PyString_Size(tupl);
5259             std::vector<char> vals(sz);
5260             std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5261             return self->locateTuple(vals);
5262           }
5263         else
5264           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5265       }
5266
5267       int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5268       {
5269         if(PyString_Check(strOrListOfInt))
5270           {
5271             Py_ssize_t sz=PyString_Size(strOrListOfInt);
5272             std::vector<char> vals(sz);
5273             std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5274             return self->search(vals);
5275           }
5276         else
5277           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5278       }
5279    
5280       PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5281       {
5282         int sz=self->getNumberOfComponents();
5283         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5284         self->getTuple(tupleId,tmp);
5285         return PyString_FromString(tmp);
5286       }
5287
5288       PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5289       {
5290         int tmp;
5291         char tmp2[2]; tmp2[1]='\0';
5292         tmp2[0]=self->getMaxValue(tmp);
5293         PyObject *ret=PyTuple_New(2);
5294         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5295         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5296         return ret;
5297       }
5298
5299       PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5300       {
5301         int tmp;
5302         char tmp2[2]; tmp2[1]='\0';
5303         tmp2[0]=self->getMinValue(tmp);
5304         PyObject *ret=PyTuple_New(2);
5305         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5306         PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5307         return ret;
5308       }
5309
5310       int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5311       {
5312         int nbOfCompo=self->getNumberOfComponents();
5313         switch(nbOfCompo)
5314           {
5315           case 1:
5316             {
5317               if(PyString_Check(obj))
5318                 {
5319                   Py_ssize_t sz=PyString_Size(obj);
5320                   char *pt=PyString_AsString(obj);
5321                   if(sz==1)
5322                     return self->locateValue(pt[0]);
5323                   else
5324                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5325                 }
5326               else
5327                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5328             }
5329           default:
5330             return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5331           }
5332       }
5333
5334       bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5335       {
5336         int nbOfCompo=self->getNumberOfComponents();
5337         switch(nbOfCompo)
5338           {
5339           case 0:
5340             return false;
5341           case 1:
5342             {
5343               if(PyString_Check(obj))
5344                 {
5345                   Py_ssize_t sz=PyString_Size(obj);
5346                   char *pt=PyString_AsString(obj);
5347                   if(sz==1)
5348                     return self->presenceOfValue(pt[0]);
5349                   else
5350                     throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5351                 }
5352               else
5353                 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5354             }
5355           default:
5356             return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5357           }
5358       }
5359
5360       PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5361       {
5362         int sw,iTypppArr;
5363         std::vector<int> stdvecTyyppArr;
5364         std::pair<int, std::pair<int,int> > sTyyppArr;
5365         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5366         convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5367         switch(sw)
5368           {
5369           case 1:
5370             return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5371           case 2:
5372             return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5373           case 3:
5374             return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5375           case 4:
5376             return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5377           default:
5378             throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5379           }
5380       }
5381
5382       DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5383       {
5384         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.";
5385         int sw1,iTypppArr;
5386         std::vector<int> stdvecTyyppArr;
5387         std::pair<int, std::pair<int,int> > sTyyppArr;
5388         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5389         int nbOfCompo=self->getNumberOfComponents();
5390         int nbOfTuples=self->getNumberOfTuples();
5391         convertObjToPossibleCpp2(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5392         int sw2;
5393         char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5394         convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5395         switch(sw1)
5396           {
5397           case 1:
5398             {//obj int
5399               switch(sw2)
5400                 {//value char
5401                 case 1:
5402                   {
5403                     self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5404                     return self;
5405                   }
5406                   //value string
5407                 case 2:
5408                   {
5409                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5410                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5411                     return self;
5412                   }
5413                   //value vector<string>
5414                 case 3:
5415                   {
5416                     MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5417                     self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5418                     return self;
5419                   }
5420                   //value DataArrayChar
5421                 case 4:
5422                   {
5423                     self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5424                     return self;
5425                   }
5426                 default:
5427                   throw INTERP_KERNEL::Exception(msg);
5428                 }
5429             }
5430           case 2:
5431             {//obj list-tuple[int]
5432               switch(sw2)
5433                 {
5434                   {//value char
5435                   case 1:
5436                     {
5437                       self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5438                       return self;
5439                     }
5440                     //value string
5441                   case 2:
5442                     {
5443                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5444                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5445                       return self;
5446                     }
5447                     //value vector<string>
5448                   case 3:
5449                     {
5450                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5451                       self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5452                       return self;
5453                     }
5454                     //value DataArrayChar
5455                   case 4:
5456                     {
5457                       self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5458                       return self;
5459                     }
5460                   default:
5461                     throw INTERP_KERNEL::Exception(msg);
5462                   }
5463                 }
5464             }
5465           case 3:
5466             {//slice
5467               switch(sw2)
5468                 {
5469                   {//value char
5470                   case 1:
5471                     {
5472                       self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5473                       return self;
5474                     }
5475                     //value string
5476                   case 2:
5477                     {
5478                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5479                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5480                       return self;
5481                     }
5482                     //value vector<string>
5483                   case 3:
5484                     {
5485                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5486                       self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5487                       return self;
5488                     }
5489                     //value DataArrayChar
5490                   case 4:
5491                     {
5492                       self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5493                       return self;
5494                     }
5495                   default:
5496                     throw INTERP_KERNEL::Exception(msg);
5497                   }
5498                 }
5499             }
5500           case 4:
5501             {//DataArrayInt
5502               switch(sw2)
5503                 {
5504                   {//value char
5505                   case 1:
5506                     {
5507                       self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5508                       return self;
5509                     }
5510                     //value string
5511                   case 2:
5512                     {
5513                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5514                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5515                       return self;
5516                     }
5517                     //value vector<string>
5518                   case 3:
5519                     {
5520                       MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5521                       self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5522                       return self;
5523                     }
5524                     //value DataArrayChar
5525                   case 4:
5526                     {
5527                       self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5528                       return self;
5529                     }
5530                   default:
5531                     throw INTERP_KERNEL::Exception(msg);
5532                   }
5533                 }
5534             }
5535           default:
5536             throw INTERP_KERNEL::Exception(msg);
5537           }
5538       }
5539     }
5540   };
5541
5542   class DataArrayAsciiCharTuple;
5543
5544   class DataArrayAsciiCharIterator
5545   {
5546   public:
5547     DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5548     ~DataArrayAsciiCharIterator();
5549     %extend
5550     {
5551       PyObject *next()
5552       {
5553         DataArrayAsciiCharTuple *ret=self->nextt();
5554         if(ret)
5555           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5556         else
5557           {
5558             PyErr_SetString(PyExc_StopIteration,"No more data.");
5559             return 0;
5560           }
5561       }
5562     }
5563   };
5564
5565   class DataArrayAsciiCharTuple
5566   {
5567   public:
5568     int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5569     DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5570     %extend
5571     {
5572       std::string __str__() const throw(INTERP_KERNEL::Exception)
5573       {
5574         return self->repr();
5575       }
5576       
5577       DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5578       {
5579         return self->buildDAAsciiChar(1,self->getNumberOfCompo());
5580       }
5581     }
5582   };
5583 }