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