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