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