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