1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 class DataArray : public RefCountObject, public TimeLabel
26 void setName(const char *name);
27 void copyStringInfoFrom(const DataArray& other) throw(INTERP_KERNEL::Exception);
28 void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
29 void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other) throw(INTERP_KERNEL::Exception);
30 bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const throw(INTERP_KERNEL::Exception);
31 bool areInfoEquals(const DataArray& other) const throw(INTERP_KERNEL::Exception);
32 std::string cppRepr(const char *varName) const throw(INTERP_KERNEL::Exception);
33 std::string getName() const;
34 void setInfoOnComponents(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
35 void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
36 std::vector<std::string> getVarsOnComponent() const throw(INTERP_KERNEL::Exception);
37 std::vector<std::string> getUnitsOnComponent() const throw(INTERP_KERNEL::Exception);
38 std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);
39 std::string getVarOnComponent(int i) const throw(INTERP_KERNEL::Exception);
40 std::string getUnitOnComponent(int i) const throw(INTERP_KERNEL::Exception);
41 void setInfoOnComponent(int i, const char *info) throw(INTERP_KERNEL::Exception);
42 int getNumberOfComponents() const;
43 virtual void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
44 virtual void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
45 virtual bool isAllocated() const throw(INTERP_KERNEL::Exception);
46 virtual void checkAllocated() const throw(INTERP_KERNEL::Exception);
47 virtual void desallocate() throw(INTERP_KERNEL::Exception);
48 virtual int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
49 virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
50 virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
51 virtual DataArray *deepCpy() const throw(INTERP_KERNEL::Exception);
52 virtual DataArray *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
53 void checkNbOfTuples(int nbOfTuples, const char *msg) const throw(INTERP_KERNEL::Exception);
54 void checkNbOfComps(int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
55 void checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const throw(INTERP_KERNEL::Exception);
56 void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
57 void checkNbOfElems(std::size_t nbOfElems, const char *msg) const throw(INTERP_KERNEL::Exception);
58 static int GetNumberOfItemGivenBES(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
59 static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
60 static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
61 static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
62 static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
63 void updateTime() const;
66 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
68 const std::vector<std::string>& comps=self->getInfoOnComponents();
69 PyObject *ret=PyList_New((int)comps.size());
70 for(int i=0;i<(int)comps.size();i++)
71 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
75 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
78 convertPyToNewIntArr3(li,tmp);
79 self->copyPartOfStringInfoFrom(other,tmp);
82 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
85 convertPyToNewIntArr3(li,tmp);
86 self->copyPartOfStringInfoFrom2(tmp,other);
89 virtual void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
92 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
96 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
97 if(size!=self->getNumberOfTuples())
99 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
101 self->renumberInPlace(tmp);
105 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
107 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
108 da2->checkAllocated();
109 int size=self->getNumberOfTuples();
110 if(size!=self->getNumberOfTuples())
112 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
114 self->renumberInPlace(da2->getConstPointer());
118 virtual void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
121 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
122 if (!SWIG_IsOK(res1))
125 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
126 if(size!=self->getNumberOfTuples())
128 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
130 self->renumberInPlaceR(tmp);
134 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
136 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
137 da2->checkAllocated();
138 int size=self->getNumberOfTuples();
139 if(size!=self->getNumberOfTuples())
141 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
143 self->renumberInPlaceR(da2->getConstPointer());
147 //tuplesSelec in PyObject * because DataArrayInt is not already existing !
148 virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec) throw(INTERP_KERNEL::Exception)
150 static const char msg[]="DataArray::setContigPartOfSelectedValues2 : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
151 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 3rd parameter \"aBase\" should be of type DataArray");
152 DataArray *tuplesSelecPtr=CheckAndRetrieveDataArrayInstance(tuplesSelec,msg);
153 DataArrayInt *tuplesSelecPtr2=0;
156 tuplesSelecPtr2=dynamic_cast<DataArrayInt *>(tuplesSelecPtr);
158 throw INTERP_KERNEL::Exception(msg);
160 self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
163 virtual void setContigPartOfSelectedValues2(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
165 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 2nd parameter \"aBase\" should be of type DataArray");
166 self->setContigPartOfSelectedValues2(tupleIdStart,a,bg,end2,step);
169 virtual DataArray *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
171 std::vector<std::pair<int,int> > ranges;
172 convertPyToVectorPairInt(li,ranges);
173 return self->selectByTupleRanges(ranges);
176 virtual DataArray *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
179 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
180 if (!SWIG_IsOK(res1))
183 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
184 return self->selectByTupleId(tmp,tmp+size);
188 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
190 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
191 da2->checkAllocated();
192 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
196 virtual DataArray *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
199 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
200 if (!SWIG_IsOK(res1))
203 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
204 return self->selectByTupleIdSafe(tmp,tmp+size);
208 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
210 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
211 da2->checkAllocated();
212 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
216 virtual PyObject *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
218 std::vector<int> tmp;
219 convertPyToNewIntArr3(li,tmp);
220 DataArray *ret=self->keepSelectedComponents(tmp);
221 return convertDataArray(ret,SWIG_POINTER_OWN | 0 );
224 static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices) throw(INTERP_KERNEL::Exception)
226 if(!PySlice_Check(slic))
227 throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
228 Py_ssize_t strt=2,stp=2,step=2;
229 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
230 if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
231 throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : the input slice is invalid !");
232 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
233 throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : the input slice contains some unknowns that can't be determined in static method ! Call DataArray::getSlice (non static) instead !");
235 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
236 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
239 PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
241 if(!PySlice_Check(slic))
242 throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
243 Py_ssize_t strt=2,stp=2,step=2;
244 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
245 if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
246 throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : the input slice is invalid !");
248 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
249 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
252 static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
254 if(!PySlice_Check(slic))
255 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
256 Py_ssize_t strt=2,stp=2,step=2;
257 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
258 if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
259 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
260 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
261 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : the input slice contains some unknowns that can't be determined in static method !");
262 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
265 static int GetNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
267 if(!PySlice_Check(slic))
268 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
269 Py_ssize_t strt=2,stp=2,step=2;
270 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
271 if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
272 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
273 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
274 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice contains some unknowns that can't be determined in static method !");
275 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
278 int getNumberOfItemGivenBES(PyObject *slic) const throw(INTERP_KERNEL::Exception)
280 if(!PySlice_Check(slic))
281 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
282 Py_ssize_t strt=2,stp=2,step=2;
283 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
284 if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
285 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
286 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
289 int getNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
291 if(!PySlice_Check(slic))
292 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
293 Py_ssize_t strt=2,stp=2,step=2;
294 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
295 if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
296 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
297 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
303 class DataArrayDoubleIterator;
305 class DataArrayDouble : public DataArray
308 static DataArrayDouble *New();
309 double doubleValue() const throw(INTERP_KERNEL::Exception);
310 bool empty() const throw(INTERP_KERNEL::Exception);
311 DataArrayDouble *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
312 void cpyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
313 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
314 void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
315 void pushBackValsSilent(const double *valsBg, const double *valsEnd) throw(INTERP_KERNEL::Exception);
316 double popBackSilent() throw(INTERP_KERNEL::Exception);
317 void pack() const throw(INTERP_KERNEL::Exception);
318 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
319 void fillWithZero() throw(INTERP_KERNEL::Exception);
320 void fillWithValue(double val) throw(INTERP_KERNEL::Exception);
321 void iota(double init=0.) throw(INTERP_KERNEL::Exception);
322 bool isUniform(double val, double eps) const throw(INTERP_KERNEL::Exception);
323 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
324 void reverse() throw(INTERP_KERNEL::Exception);
325 void checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
326 bool isMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
327 std::string repr() const throw(INTERP_KERNEL::Exception);
328 std::string reprZip() const throw(INTERP_KERNEL::Exception);
329 bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
330 bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
331 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
332 DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
333 DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
334 DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
335 void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
336 void transpose() throw(INTERP_KERNEL::Exception);
337 DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
338 void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
339 DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
340 DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception);
341 DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
342 void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
343 void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
344 void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
345 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
346 double front() const throw(INTERP_KERNEL::Exception);
347 double back() const throw(INTERP_KERNEL::Exception);
348 double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
349 void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
350 void setIJSilent(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
351 double *getPointer() throw(INTERP_KERNEL::Exception);
352 void checkNoNullValues() const throw(INTERP_KERNEL::Exception);
353 DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const throw(INTERP_KERNEL::Exception);
354 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
355 double getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
356 double getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
357 double getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
358 double getMinValueInArray() const throw(INTERP_KERNEL::Exception);
359 int count(double value, double eps) const throw(INTERP_KERNEL::Exception);
360 double getAverageValue() const throw(INTERP_KERNEL::Exception);
361 double norm2() const throw(INTERP_KERNEL::Exception);
362 double normMax() const throw(INTERP_KERNEL::Exception);
363 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
364 DataArrayDouble *fromPolarToCart() const throw(INTERP_KERNEL::Exception);
365 DataArrayDouble *fromCylToCart() const throw(INTERP_KERNEL::Exception);
366 DataArrayDouble *fromSpherToCart() const throw(INTERP_KERNEL::Exception);
367 DataArrayDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
368 DataArrayDouble *determinant() const throw(INTERP_KERNEL::Exception);
369 DataArrayDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
370 DataArrayDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
371 DataArrayDouble *inverse() const throw(INTERP_KERNEL::Exception);
372 DataArrayDouble *trace() const throw(INTERP_KERNEL::Exception);
373 DataArrayDouble *deviator() const throw(INTERP_KERNEL::Exception);
374 DataArrayDouble *magnitude() const throw(INTERP_KERNEL::Exception);
375 DataArrayDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
376 DataArrayDouble *buildEuclidianDistanceDenseMatrix() const throw(INTERP_KERNEL::Exception);
377 DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
378 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
379 void abs() throw(INTERP_KERNEL::Exception);
380 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
381 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
382 void applyInv(double numerator) throw(INTERP_KERNEL::Exception);
383 void applyPow(double val) throw(INTERP_KERNEL::Exception);
384 void applyRPow(double val) throw(INTERP_KERNEL::Exception);
385 DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
386 DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
387 DataArrayDouble *applyFunc(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
388 DataArrayDouble *applyFunc(const char *func) const throw(INTERP_KERNEL::Exception);
389 DataArrayDouble *applyFunc2(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
390 DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
391 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
392 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
393 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
394 static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
395 static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
396 static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
397 static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
398 static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
399 static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
400 static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
401 void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
402 static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
403 void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
404 static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
405 void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
406 static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
407 void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
408 static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
409 void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
412 DataArrayDouble() throw(INTERP_KERNEL::Exception)
414 return DataArrayDouble::New();
417 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
419 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)";
420 std::string msg(msgBase);
422 msg+="\n-DataArrayDouble.New(numpy array with dtype=float64)";
425 if(PyList_Check(elt0) || PyTuple_Check(elt0))
429 if(PyInt_Check(nbOfTuples))
431 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
433 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
436 if(PyInt_Check(elt2))
437 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
438 int nbOfCompo=PyInt_AS_LONG(elt2);
440 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
441 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
442 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
443 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
447 throw INTERP_KERNEL::Exception(msg.c_str());
450 {//DataArrayDouble.New([1.,3.,4.],3)
451 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
453 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
454 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
459 throw INTERP_KERNEL::Exception(msg.c_str());
462 {// DataArrayDouble.New([1.,3.,4.])
463 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
464 int tmpp1=-1,tmpp2=-1;
465 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
466 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
470 else if(PyInt_Check(elt0))
472 int nbOfTuples1=PyInt_AS_LONG(elt0);
474 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
479 if(PyInt_Check(nbOfTuples))
480 {//DataArrayDouble.New(5,2)
481 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
483 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
484 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
485 ret->alloc(nbOfTuples1,nbOfCompo);
489 throw INTERP_KERNEL::Exception(msg.c_str());
492 throw INTERP_KERNEL::Exception(msg.c_str());
495 {//DataArrayDouble.New(5)
496 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
497 ret->alloc(nbOfTuples1,1);
502 else if(PyArray_Check(elt0) && nbOfTuples==NULL && elt2==NULL)
503 {//DataArrayDouble.New(numpyArray)
504 return BuildNewInstance<DataArrayDouble,double>(elt0,NPY_DOUBLE,&PyCallBackDataArrayDouble_RefType,"FLOAT64");
508 throw INTERP_KERNEL::Exception(msg.c_str());
511 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
513 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
516 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
519 std::vector<double> bb;
521 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
522 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
523 self->pushBackValsSilent(tmp,tmp+nbTuples);
526 std::string __repr__() const throw(INTERP_KERNEL::Exception)
528 std::ostringstream oss;
529 self->reprQuickOverview(oss);
533 std::string __str__() const throw(INTERP_KERNEL::Exception)
538 double __float__() const throw(INTERP_KERNEL::Exception)
540 return self->doubleValue();
543 int __len__() const throw(INTERP_KERNEL::Exception)
545 if(self->isAllocated())
547 return self->getNumberOfTuples();
551 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
555 DataArrayDoubleIterator *__iter__() throw(INTERP_KERNEL::Exception)
557 return self->iterator();
560 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
562 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 !";
563 if(PyList_Check(li) || PyTuple_Check(li))
567 if(PyInt_Check(nbOfTuples))
569 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
571 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
574 if(PyInt_Check(nbOfComp))
575 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
576 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
578 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
579 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
580 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
583 throw INTERP_KERNEL::Exception(msg);
586 {//DataArrayDouble.setValues([1.,3.,4.],3)
588 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
589 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
593 throw INTERP_KERNEL::Exception(msg);
596 {// DataArrayDouble.setValues([1.,3.,4.])
597 int tmpp1=-1,tmpp2=-1;
598 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
599 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
603 throw INTERP_KERNEL::Exception(msg);
606 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
608 const double *vals=self->getConstPointer();
609 return convertDblArrToPyList(vals,self->getNbOfElems());
613 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
615 return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
619 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
622 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
623 PyObject *ret=PyTuple_New(2);
624 PyObject *ret0Py=ret0?Py_True:Py_False;
626 PyTuple_SetItem(ret,0,ret0Py);
627 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
631 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
633 const double *vals=self->getConstPointer();
634 int nbOfComp=self->getNumberOfComponents();
635 int nbOfTuples=self->getNumberOfTuples();
636 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
639 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
642 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
643 if (!SWIG_IsOK(res1))
646 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
647 if(size!=self->getNumberOfTuples())
649 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
651 return self->renumber(tmp);
655 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
657 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
658 da2->checkAllocated();
659 int size=self->getNumberOfTuples();
660 if(size!=self->getNumberOfTuples())
662 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
664 return self->renumber(da2->getConstPointer());
668 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
671 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
672 if (!SWIG_IsOK(res1))
675 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
676 if(size!=self->getNumberOfTuples())
678 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
680 return self->renumberR(tmp);
684 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
686 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
687 da2->checkAllocated();
688 int size=self->getNumberOfTuples();
689 if(size!=self->getNumberOfTuples())
691 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
693 return self->renumberR(da2->getConstPointer());
697 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
700 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
701 if (!SWIG_IsOK(res1))
704 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
705 if(size!=self->getNumberOfTuples())
707 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
709 return self->renumberAndReduce(tmp,newNbOfTuple);
713 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
715 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
716 da2->checkAllocated();
717 int size=self->getNumberOfTuples();
718 if(size!=self->getNumberOfTuples())
720 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
722 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
726 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
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));
737 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
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));
747 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
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 ));
757 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
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));
767 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
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 ));
777 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
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);
786 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
788 int sz=self->getNumberOfComponents();
789 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
790 self->accumulate(tmp);
791 return convertDblArrToPyList(tmp,sz);
794 DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
797 std::vector<int> val2;
798 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
799 return self->accumulatePerChunck(bg,bg+sz);
802 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
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 ));
812 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
816 DataArrayDoubleTuple *aa;
817 std::vector<double> bb;
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);
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));
829 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
831 std::vector<int> tmp;
832 convertPyToNewIntArr3(li,tmp);
833 self->setSelectedComponents(a,tmp);
836 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
838 int sz=self->getNumberOfComponents();
839 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
840 self->getTuple(tupleId,tmp);
841 return convertDblArrToPyList(tmp,sz);
844 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
846 std::vector<const DataArrayDouble *> tmp;
847 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
848 return DataArrayDouble::Aggregate(tmp);
851 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
853 std::vector<const DataArrayDouble *> tmp;
854 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
855 return DataArrayDouble::Meld(tmp);
858 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
862 DataArrayDoubleTuple *aa;
863 std::vector<double> bb;
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 ));
877 PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const throw(INTERP_KERNEL::Exception)
879 DataArrayInt *ret1=0;
880 bool ret0=self->areIncludedInMe(other,prec,ret1);
881 PyObject *ret=PyTuple_New(2);
882 PyObject *ret0Py=ret0?Py_True:Py_False;
884 PyTuple_SetItem(ret,0,ret0Py);
885 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
889 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
891 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
892 const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
893 self->checkAllocated();
894 int nbOfTuples=self->getNumberOfTuples();
895 int nbOfComponents=self->getNumberOfComponents();
897 std::vector<int> vt1,vc1;
898 std::pair<int, std::pair<int,int> > pt1,pc1;
899 DataArrayInt *dt1=0,*dc1=0;
901 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
902 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
906 if(nbOfComponents==1)
907 return PyFloat_FromDouble(self->getIJSafe(it1,0));
908 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
910 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
912 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
914 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
916 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
919 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
920 std::vector<int> v2(1,ic1);
921 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
925 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
926 std::vector<int> v2(1,ic1);
927 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
931 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
932 std::vector<int> v2(1,ic1);
933 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
937 ret=self->selectByTupleIdSafe(&it1,&it1+1);
938 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
942 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
943 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
947 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
948 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
952 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
953 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
957 ret=self->selectByTupleIdSafe(&it1,&it1+1);
958 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
959 std::vector<int> v2(nbOfComp);
960 for(int i=0;i<nbOfComp;i++)
961 v2[i]=pc1.first+i*pc1.second.second;
962 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
966 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
967 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
968 std::vector<int> v2(nbOfComp);
969 for(int i=0;i<nbOfComp;i++)
970 v2[i]=pc1.first+i*pc1.second.second;
971 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
975 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
976 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
977 std::vector<int> v2(nbOfComp);
978 for(int i=0;i<nbOfComp;i++)
979 v2[i]=pc1.first+i*pc1.second.second;
980 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
984 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
985 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
986 std::vector<int> v2(nbOfComp);
987 for(int i=0;i<nbOfComp;i++)
988 v2[i]=pc1.first+i*pc1.second.second;
989 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
992 throw INTERP_KERNEL::Exception(msg);
996 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
998 self->checkAllocated();
999 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
1000 int nbOfTuples=self->getNumberOfTuples();
1001 int nbOfComponents=self->getNumberOfComponents();
1004 std::vector<double> v1;
1005 DataArrayDouble *d1=0;
1006 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
1008 std::vector<int> vt1,vc1;
1009 std::pair<int, std::pair<int,int> > pt1,pc1;
1010 DataArrayInt *dt1=0,*dc1=0;
1011 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1012 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
1020 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
1023 tmp=DataArrayDouble::New();
1024 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1025 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
1028 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
1031 throw INTERP_KERNEL::Exception(msg);
1040 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1043 tmp=DataArrayDouble::New();
1044 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1045 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
1048 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1051 throw INTERP_KERNEL::Exception(msg);
1060 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1063 tmp=DataArrayDouble::New();
1064 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1065 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
1068 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1071 throw INTERP_KERNEL::Exception(msg);
1080 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1083 tmp=DataArrayDouble::New();
1084 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1085 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
1088 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1091 throw INTERP_KERNEL::Exception(msg);
1100 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
1103 tmp=DataArrayDouble::New();
1104 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1105 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
1108 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
1111 throw INTERP_KERNEL::Exception(msg);
1120 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1123 tmp=DataArrayDouble::New();
1124 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1125 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
1128 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1131 throw INTERP_KERNEL::Exception(msg);
1140 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1143 tmp=DataArrayDouble::New();
1144 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1145 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
1148 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1151 throw INTERP_KERNEL::Exception(msg);
1160 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1163 tmp=DataArrayDouble::New();
1164 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1165 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
1168 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1171 throw INTERP_KERNEL::Exception(msg);
1180 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1183 tmp=DataArrayDouble::New();
1184 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1185 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
1188 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1191 throw INTERP_KERNEL::Exception(msg);
1200 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1203 tmp=DataArrayDouble::New();
1204 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1205 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
1208 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1211 throw INTERP_KERNEL::Exception(msg);
1220 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1223 tmp=DataArrayDouble::New();
1224 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1225 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
1228 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1231 throw INTERP_KERNEL::Exception(msg);
1240 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1243 tmp=DataArrayDouble::New();
1244 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1245 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
1248 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1251 throw INTERP_KERNEL::Exception(msg);
1260 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1263 tmp=DataArrayDouble::New();
1264 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1265 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
1268 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1271 throw INTERP_KERNEL::Exception(msg);
1280 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1283 tmp=DataArrayDouble::New();
1284 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1285 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
1288 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1291 throw INTERP_KERNEL::Exception(msg);
1300 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1303 tmp=DataArrayDouble::New();
1304 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1305 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
1308 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1311 throw INTERP_KERNEL::Exception(msg);
1320 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1323 tmp=DataArrayDouble::New();
1324 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1325 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
1328 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1331 throw INTERP_KERNEL::Exception(msg);
1336 throw INTERP_KERNEL::Exception(msg);
1341 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
1343 return self->negate();
1346 PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1348 const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
1351 DataArrayDoubleTuple *aa;
1352 std::vector<double> bb;
1356 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1358 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1361 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1362 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1364 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1367 throw INTERP_KERNEL::Exception(msg);
1370 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1375 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1376 ret->applyLin(1.,val);
1377 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1381 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1385 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1386 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1390 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1391 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1394 throw INTERP_KERNEL::Exception(msg);
1398 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1400 const char msg[]="Unexpected situation in __radd__ !";
1403 DataArrayDoubleTuple *aa;
1404 std::vector<double> bb;
1406 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1411 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1412 ret->applyLin(1.,val);
1417 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1418 return DataArrayDouble::Add(self,aaa);
1422 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1423 return DataArrayDouble::Add(self,aaa);
1426 throw INTERP_KERNEL::Exception(msg);
1430 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1432 const char msg[]="Unexpected situation in __iadd__ !";
1435 DataArrayDoubleTuple *aa;
1436 std::vector<double> bb;
1438 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1443 self->applyLin(1.,val);
1444 Py_XINCREF(trueSelf);
1450 Py_XINCREF(trueSelf);
1455 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1456 self->addEqual(aaa);
1457 Py_XINCREF(trueSelf);
1462 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1463 self->addEqual(aaa);
1464 Py_XINCREF(trueSelf);
1468 throw INTERP_KERNEL::Exception(msg);
1472 PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1474 const char msg[]="Unexpected situation in __sub__ !";
1477 DataArrayDoubleTuple *aa;
1478 std::vector<double> bb;
1482 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1484 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1487 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1488 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1490 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1493 throw INTERP_KERNEL::Exception(msg);
1496 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1501 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1502 ret->applyLin(1.,-val);
1503 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1507 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1511 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1512 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1516 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1517 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1520 throw INTERP_KERNEL::Exception(msg);
1524 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1526 const char msg[]="Unexpected situation in __rsub__ !";
1529 DataArrayDoubleTuple *aa;
1530 std::vector<double> bb;
1532 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1537 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1538 ret->applyLin(-1.,val);
1543 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1544 return DataArrayDouble::Substract(aaa,self);
1548 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1549 return DataArrayDouble::Substract(aaa,self);
1552 throw INTERP_KERNEL::Exception(msg);
1556 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1558 const char msg[]="Unexpected situation in __isub__ !";
1561 DataArrayDoubleTuple *aa;
1562 std::vector<double> bb;
1564 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1569 self->applyLin(1,-val);
1570 Py_XINCREF(trueSelf);
1575 self->substractEqual(a);
1576 Py_XINCREF(trueSelf);
1581 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1582 self->substractEqual(aaa);
1583 Py_XINCREF(trueSelf);
1588 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1589 self->substractEqual(aaa);
1590 Py_XINCREF(trueSelf);
1594 throw INTERP_KERNEL::Exception(msg);
1598 PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1600 const char msg[]="Unexpected situation in __mul__ !";
1603 DataArrayDoubleTuple *aa;
1604 std::vector<double> bb;
1608 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1610 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1613 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1614 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1616 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1619 throw INTERP_KERNEL::Exception(msg);
1622 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1627 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1628 ret->applyLin(val,0.);
1629 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1633 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1637 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1638 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1642 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1643 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1646 throw INTERP_KERNEL::Exception(msg);
1650 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1652 const char msg[]="Unexpected situation in __rmul__ !";
1655 DataArrayDoubleTuple *aa;
1656 std::vector<double> bb;
1658 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1663 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1664 ret->applyLin(val,0.);
1669 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1670 return DataArrayDouble::Multiply(self,aaa);
1674 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1675 return DataArrayDouble::Multiply(self,aaa);
1678 throw INTERP_KERNEL::Exception(msg);
1682 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1684 const char msg[]="Unexpected situation in __imul__ !";
1687 DataArrayDoubleTuple *aa;
1688 std::vector<double> bb;
1690 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1695 self->applyLin(val,0.);
1696 Py_XINCREF(trueSelf);
1701 self->multiplyEqual(a);
1702 Py_XINCREF(trueSelf);
1707 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1708 self->multiplyEqual(aaa);
1709 Py_XINCREF(trueSelf);
1714 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1715 self->multiplyEqual(aaa);
1716 Py_XINCREF(trueSelf);
1720 throw INTERP_KERNEL::Exception(msg);
1724 PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1726 const char msg[]="Unexpected situation in __div__ !";
1729 DataArrayDoubleTuple *aa;
1730 std::vector<double> bb;
1734 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1736 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1739 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1740 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1742 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1745 throw INTERP_KERNEL::Exception(msg);
1748 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1754 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1755 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1756 ret->applyLin(1/val,0.);
1757 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1761 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1765 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1766 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1770 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1771 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1774 throw INTERP_KERNEL::Exception(msg);
1778 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1780 const char msg[]="Unexpected situation in __rdiv__ !";
1783 DataArrayDoubleTuple *aa;
1784 std::vector<double> bb;
1786 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1791 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1797 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1798 return DataArrayDouble::Divide(aaa,self);
1802 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1803 return DataArrayDouble::Divide(aaa,self);
1806 throw INTERP_KERNEL::Exception(msg);
1810 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1812 const char msg[]="Unexpected situation in __idiv__ !";
1815 DataArrayDoubleTuple *aa;
1816 std::vector<double> bb;
1818 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1824 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1825 self->applyLin(1./val,0.);
1826 Py_XINCREF(trueSelf);
1831 self->divideEqual(a);
1832 Py_XINCREF(trueSelf);
1837 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1838 self->divideEqual(aaa);
1839 Py_XINCREF(trueSelf);
1844 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1845 self->divideEqual(aaa);
1846 Py_XINCREF(trueSelf);
1850 throw INTERP_KERNEL::Exception(msg);
1854 DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1856 const char msg[]="Unexpected situation in __pow__ !";
1859 DataArrayDoubleTuple *aa;
1860 std::vector<double> bb;
1862 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1867 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1873 return DataArrayDouble::Pow(self,a);
1877 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1878 return DataArrayDouble::Pow(self,aaa);
1882 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1883 return DataArrayDouble::Pow(self,aaa);
1886 throw INTERP_KERNEL::Exception(msg);
1890 DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1892 const char msg[]="Unexpected situation in __rpow__ !";
1895 DataArrayDoubleTuple *aa;
1896 std::vector<double> bb;
1898 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1903 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1904 ret->applyRPow(val);
1909 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1910 return DataArrayDouble::Pow(aaa,self);
1914 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1915 return DataArrayDouble::Pow(aaa,self);
1918 throw INTERP_KERNEL::Exception(msg);
1922 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1924 const char msg[]="Unexpected situation in __ipow__ !";
1927 DataArrayDoubleTuple *aa;
1928 std::vector<double> bb;
1930 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1935 self->applyPow(val);
1936 Py_XINCREF(trueSelf);
1942 Py_XINCREF(trueSelf);
1947 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1948 self->powEqual(aaa);
1949 Py_XINCREF(trueSelf);
1954 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1955 self->powEqual(aaa);
1956 Py_XINCREF(trueSelf);
1960 throw INTERP_KERNEL::Exception(msg);
1964 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
1966 DataArrayInt *c=0,*cI=0;
1968 self->computeTupleIdsNearTuples(other,eps,c,cI);
1969 PyObject *ret=PyTuple_New(2);
1970 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1971 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1975 PyObject *maxPerTupleWithCompoId() const throw(INTERP_KERNEL::Exception)
1977 DataArrayInt *ret1=0;
1978 DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
1979 PyObject *ret=PyTuple_New(2);
1980 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1981 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1987 class DataArrayDoubleTuple;
1989 class DataArrayDoubleIterator
1992 DataArrayDoubleIterator(DataArrayDouble *da);
1993 ~DataArrayDoubleIterator();
1998 DataArrayDoubleTuple *ret=self->nextt();
2000 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2003 PyErr_SetString(PyExc_StopIteration,"No more data.");
2010 class DataArrayDoubleTuple
2013 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
2014 DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
2017 std::string __str__() const throw(INTERP_KERNEL::Exception)
2019 return self->repr();
2022 double __float__() const throw(INTERP_KERNEL::Exception)
2024 return self->doubleValue();
2027 DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
2029 return self->buildDADouble(1,self->getNumberOfCompo());
2032 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2034 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2035 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2036 Py_XINCREF(trueSelf);
2040 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2042 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2043 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2044 Py_XINCREF(trueSelf);
2048 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2050 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2051 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2052 Py_XINCREF(trueSelf);
2056 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2058 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2059 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2060 Py_XINCREF(trueSelf);
2064 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2066 const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2069 std::vector<int> multiVal;
2070 std::pair<int, std::pair<int,int> > slic;
2071 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2072 const double *pt=self->getConstPointer();
2073 int nbc=self->getNumberOfCompo();
2074 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2081 std::ostringstream oss;
2082 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2083 throw INTERP_KERNEL::Exception(oss.str().c_str());
2086 return PyFloat_FromDouble(pt[singleVal]);
2090 return PyFloat_FromDouble(pt[nbc+singleVal]);
2093 std::ostringstream oss;
2094 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2095 throw INTERP_KERNEL::Exception(oss.str().c_str());
2101 PyObject *t=PyTuple_New(multiVal.size());
2102 for(int j=0;j<(int)multiVal.size();j++)
2104 int cid=multiVal[j];
2107 std::ostringstream oss;
2108 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2109 throw INTERP_KERNEL::Exception(oss.str().c_str());
2111 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2117 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2118 PyObject *t=PyTuple_New(sz);
2119 for(int j=0;j<sz;j++)
2120 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2124 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2128 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2130 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2131 const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2134 std::vector<double> multiValV;
2135 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2136 int nbc=self->getNumberOfCompo();
2137 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2139 std::vector<int> multiVal;
2140 std::pair<int, std::pair<int,int> > slic;
2141 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2142 double *pt=self->getPointer();
2143 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2150 std::ostringstream oss;
2151 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2152 throw INTERP_KERNEL::Exception(oss.str().c_str());
2158 pt[singleVal]=singleValV;
2163 if(multiValV.size()!=1)
2165 std::ostringstream oss;
2166 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2167 throw INTERP_KERNEL::Exception(oss.str().c_str());
2169 pt[singleVal]=multiValV[0];
2174 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2178 throw INTERP_KERNEL::Exception(msg);
2187 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2191 std::ostringstream oss;
2192 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2193 throw INTERP_KERNEL::Exception(oss.str().c_str());
2201 if(multiVal.size()!=multiValV.size())
2203 std::ostringstream oss;
2204 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2205 throw INTERP_KERNEL::Exception(oss.str().c_str());
2207 for(int i=0;i<(int)multiVal.size();i++)
2209 int pos=multiVal[i];
2212 std::ostringstream oss;
2213 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2214 throw INTERP_KERNEL::Exception(oss.str().c_str());
2216 pt[multiVal[i]]=multiValV[i];
2222 const double *ptV=daIntTyyppV->getConstPointer();
2223 if(nbc>daIntTyyppV->getNumberOfCompo())
2225 std::ostringstream oss;
2226 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2227 throw INTERP_KERNEL::Exception(oss.str().c_str());
2229 std::copy(ptV,ptV+nbc,pt);
2233 throw INTERP_KERNEL::Exception(msg);
2238 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2243 for(int j=0;j<sz;j++)
2244 pt[slic.first+j*slic.second.second]=singleValV;
2249 if(sz!=(int)multiValV.size())
2251 std::ostringstream oss;
2252 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2253 throw INTERP_KERNEL::Exception(oss.str().c_str());
2255 for(int j=0;j<sz;j++)
2256 pt[slic.first+j*slic.second.second]=multiValV[j];
2261 const double *ptV=daIntTyyppV->getConstPointer();
2262 if(sz>daIntTyyppV->getNumberOfCompo())
2264 std::ostringstream oss;
2265 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2266 throw INTERP_KERNEL::Exception(oss.str().c_str());
2268 for(int j=0;j<sz;j++)
2269 pt[slic.first+j*slic.second.second]=ptV[j];
2273 throw INTERP_KERNEL::Exception(msg);
2277 throw INTERP_KERNEL::Exception(msg);
2283 class DataArrayIntIterator;
2285 class DataArrayInt : public DataArray
2288 static DataArrayInt *New();
2289 int intValue() const throw(INTERP_KERNEL::Exception);
2290 int getHashCode() const throw(INTERP_KERNEL::Exception);
2291 bool empty() const throw(INTERP_KERNEL::Exception);
2292 DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2293 void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2294 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2295 void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2296 int popBackSilent() throw(INTERP_KERNEL::Exception);
2297 void pack() const throw(INTERP_KERNEL::Exception);
2298 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2299 bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2300 bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2301 bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2302 DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2303 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2304 void reverse() throw(INTERP_KERNEL::Exception);
2305 void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2306 bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2307 void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2308 bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2309 void fillWithZero() throw(INTERP_KERNEL::Exception);
2310 void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2311 void iota(int init=0) throw(INTERP_KERNEL::Exception);
2312 std::string repr() const throw(INTERP_KERNEL::Exception);
2313 std::string reprZip() const throw(INTERP_KERNEL::Exception);
2314 DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2315 DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2316 DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2317 DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
2318 DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2319 DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2320 DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2321 DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2322 DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2323 bool isIdentity() const throw(INTERP_KERNEL::Exception);
2324 bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2325 DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2326 void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
2327 void transpose() throw(INTERP_KERNEL::Exception);
2328 DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2329 void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2330 void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2331 void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2332 void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2333 void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2334 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2335 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2336 int front() const throw(INTERP_KERNEL::Exception);
2337 int back() const throw(INTERP_KERNEL::Exception);
2338 void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2339 void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2340 int *getPointer() throw(INTERP_KERNEL::Exception);
2341 const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2342 DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2343 const int *begin() const throw(INTERP_KERNEL::Exception);
2344 const int *end() const throw(INTERP_KERNEL::Exception);
2345 DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2346 DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2347 int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2348 int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2349 int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2350 int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2351 int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2352 bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2353 bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2354 bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2355 int count(int value) const throw(INTERP_KERNEL::Exception);
2356 int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2357 int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2358 int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2359 int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2360 int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2361 void abs() throw(INTERP_KERNEL::Exception);
2362 void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2363 void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2364 void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2365 DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2366 void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2367 void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2368 void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2369 void applyPow(int val) throw(INTERP_KERNEL::Exception);
2370 void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2371 DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2372 bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2373 static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2374 static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2375 static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2376 static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2377 static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2378 DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2379 DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2380 DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2381 DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2382 DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2383 DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2384 DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2385 void computeOffsets() throw(INTERP_KERNEL::Exception);
2386 void computeOffsets2() throw(INTERP_KERNEL::Exception);
2387 DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2388 DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2389 DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2390 DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2391 DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2392 static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2393 void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2394 static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2395 void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2396 static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2397 void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2398 static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2399 void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2400 static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2401 void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2402 static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2403 void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2405 static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2408 DataArrayInt() throw(INTERP_KERNEL::Exception)
2410 return DataArrayInt::New();
2413 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2415 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)";
2416 std::string msg(msgBase);
2418 msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2421 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2425 if(PyInt_Check(nbOfTuples))
2427 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2429 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2432 if(PyInt_Check(nbOfComp))
2433 {//DataArrayInt.New([1,3,4,5],2,2)
2434 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2436 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2437 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2438 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2439 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2443 throw INTERP_KERNEL::Exception(msg.c_str());
2446 {//DataArrayInt.New([1,3,4],3)
2447 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2449 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2450 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2455 throw INTERP_KERNEL::Exception(msg.c_str());
2458 {// DataArrayInt.New([1,3,4])
2459 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2460 int tmpp1=-1,tmpp2=-1;
2461 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2462 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2466 else if(PyInt_Check(elt0))
2468 int nbOfTuples1=PyInt_AS_LONG(elt0);
2470 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2475 if(PyInt_Check(nbOfTuples))
2476 {//DataArrayInt.New(5,2)
2477 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2479 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2480 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2481 ret->alloc(nbOfTuples1,nbOfCompo);
2485 throw INTERP_KERNEL::Exception(msg.c_str());
2488 throw INTERP_KERNEL::Exception(msg.c_str());
2491 {//DataArrayInt.New(5)
2492 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2493 ret->alloc(nbOfTuples1,1);
2498 else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2499 {//DataArrayInt.New(numpyArray)
2500 return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2504 throw INTERP_KERNEL::Exception(msg.c_str());
2507 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2509 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2512 std::string __str__() const throw(INTERP_KERNEL::Exception)
2514 return self->repr();
2517 int __len__() const throw(INTERP_KERNEL::Exception)
2519 if(self->isAllocated())
2521 return self->getNumberOfTuples();
2525 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2529 int __int__() const throw(INTERP_KERNEL::Exception)
2531 return self->intValue();
2534 DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2536 return self->iterator();
2539 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2541 int sz=self->getNumberOfComponents();
2542 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2543 self->accumulate(tmp);
2544 return convertIntArrToPyList(tmp,sz);
2547 DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2550 std::vector<int> val2;
2551 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2552 return self->accumulatePerChunck(bg,bg+sz);
2555 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2557 int newNbOfTuples=-1;
2558 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2559 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2560 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2561 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2562 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2563 PyObject *ret=PyTuple_New(2);
2564 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2565 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2569 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2571 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 !";
2572 if(PyList_Check(li) || PyTuple_Check(li))
2576 if(PyInt_Check(nbOfTuples))
2578 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2580 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2583 if(PyInt_Check(nbOfComp))
2584 {//DataArrayInt.setValues([1,3,4,5],2,2)
2585 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2587 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2588 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2589 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2592 throw INTERP_KERNEL::Exception(msg);
2595 {//DataArrayInt.setValues([1,3,4],3)
2597 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2598 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2602 throw INTERP_KERNEL::Exception(msg);
2605 {// DataArrayInt.setValues([1,3,4])
2606 int tmpp1=-1,tmpp2=-1;
2607 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2608 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2612 throw INTERP_KERNEL::Exception(msg);
2615 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2617 const int *vals=self->getConstPointer();
2618 return convertIntArrToPyList(vals,self->getNbOfElems());
2622 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2624 return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2628 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2631 bool ret0=self->isEqualIfNotWhy(other,ret1);
2632 PyObject *ret=PyTuple_New(2);
2633 PyObject *ret0Py=ret0?Py_True:Py_False;
2635 PyTuple_SetItem(ret,0,ret0Py);
2636 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2640 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2642 const int *vals=self->getConstPointer();
2643 int nbOfComp=self->getNumberOfComponents();
2644 int nbOfTuples=self->getNumberOfTuples();
2645 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2648 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2650 std::vector<const DataArrayInt *> groups;
2651 std::vector< std::vector<int> > fidsOfGroups;
2652 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2653 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2654 PyObject *ret = PyList_New(2);
2655 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2656 int sz=fidsOfGroups.size();
2657 PyObject *ret1 = PyList_New(sz);
2658 for(int i=0;i<sz;i++)
2659 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2660 PyList_SetItem(ret,1,ret1);
2664 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2667 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2668 if (!SWIG_IsOK(res1))
2671 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2672 self->transformWithIndArr(tmp,tmp+size);
2676 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2677 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2681 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2685 std::vector<int> multiVal;
2686 std::pair<int, std::pair<int,int> > slic;
2687 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2688 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2692 return self->getIdsEqualList(&singleVal,&singleVal+1);
2694 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2696 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2698 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2702 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2706 std::vector<int> multiVal;
2707 std::pair<int, std::pair<int,int> > slic;
2708 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2709 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2713 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2715 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2717 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2719 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2723 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2725 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2727 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2728 if (!SWIG_IsOK(res1))
2731 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2732 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2736 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2738 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2739 da2->checkAllocated();
2740 int size=self->getNumberOfTuples();
2741 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2743 PyObject *ret = PyList_New(3);
2744 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2745 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2746 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2750 DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2753 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2754 if (!SWIG_IsOK(res1))
2757 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2758 return self->transformWithIndArrR(tmp,tmp+size);
2762 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2763 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2767 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2770 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2771 if (!SWIG_IsOK(res1))
2774 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2775 if(size!=self->getNumberOfTuples())
2777 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2779 return self->renumberAndReduce(tmp,newNbOfTuple);
2783 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2785 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2786 da2->checkAllocated();
2787 int size=self->getNumberOfTuples();
2788 if(size!=self->getNumberOfTuples())
2790 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2792 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
2796 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
2799 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2800 if (!SWIG_IsOK(res1))
2803 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2804 if(size!=self->getNumberOfTuples())
2806 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2808 return self->renumber(tmp);
2812 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2814 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2815 da2->checkAllocated();
2816 int size=self->getNumberOfTuples();
2817 if(size!=self->getNumberOfTuples())
2819 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2821 return self->renumber(da2->getConstPointer());
2825 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
2828 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2829 if (!SWIG_IsOK(res1))
2832 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2833 if(size!=self->getNumberOfTuples())
2835 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2837 return self->renumberR(tmp);
2841 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2843 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2844 da2->checkAllocated();
2845 int size=self->getNumberOfTuples();
2846 if(size!=self->getNumberOfTuples())
2848 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2850 return self->renumberR(da2->getConstPointer());
2854 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
2856 std::vector<int> tmp;
2857 convertPyToNewIntArr3(li,tmp);
2858 self->setSelectedComponents(a,tmp);
2861 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
2863 int sz=self->getNumberOfComponents();
2864 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2865 self->getTuple(tupleId,tmp);
2866 return convertIntArrToPyList(tmp,sz);
2869 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
2871 DataArrayInt *arr=0;
2872 DataArrayInt *arrI=0;
2873 self->changeSurjectiveFormat(targetNb,arr,arrI);
2874 PyObject *res = PyList_New(2);
2875 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2876 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2880 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
2882 std::vector<const DataArrayInt *> tmp;
2883 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2884 return DataArrayInt::Meld(tmp);
2887 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
2889 std::vector<const DataArrayInt *> tmp;
2890 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2891 return DataArrayInt::Aggregate(tmp);
2894 static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
2896 std::vector<const DataArrayInt *> tmp;
2897 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2898 return DataArrayInt::AggregateIndexes(tmp);
2901 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
2903 std::vector<const DataArrayInt *> tmp;
2904 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2905 return DataArrayInt::BuildUnion(tmp);
2908 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
2910 std::vector<const DataArrayInt *> tmp;
2911 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2912 return DataArrayInt::BuildIntersection(tmp);
2915 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
2918 int r1=self->getMaxValue(tmp);
2919 PyObject *ret=PyTuple_New(2);
2920 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2921 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2925 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
2928 int r1=self->getMinValue(tmp);
2929 PyObject *ret=PyTuple_New(2);
2930 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2931 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2935 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2937 int nbOfCompo=self->getNumberOfComponents();
2942 if(PyInt_Check(obj))
2944 int val=(int)PyInt_AS_LONG(obj);
2945 return self->locateValue(val);
2948 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
2952 std::vector<int> arr;
2953 convertPyToNewIntArr3(obj,arr);
2954 return self->locateTuple(arr);
2959 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2961 int nbOfCompo=self->getNumberOfComponents();
2968 if(PyInt_Check(obj))
2970 int val=(int)PyInt_AS_LONG(obj);
2971 return self->presenceOfValue(val);
2974 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
2978 std::vector<int> arr;
2979 convertPyToNewIntArr3(obj,arr);
2980 return self->presenceOfTuple(arr);
2985 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2987 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
2988 const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2989 self->checkAllocated();
2990 int nbOfTuples=self->getNumberOfTuples();
2991 int nbOfComponents=self->getNumberOfComponents();
2993 std::vector<int> vt1,vc1;
2994 std::pair<int, std::pair<int,int> > pt1,pc1;
2995 DataArrayInt *dt1=0,*dc1=0;
2997 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
2998 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3003 if(nbOfComponents==1)
3004 return PyInt_FromLong(self->getIJSafe(it1,0));
3005 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3008 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3010 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3012 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3014 return PyInt_FromLong(self->getIJSafe(it1,ic1));
3017 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3018 std::vector<int> v2(1,ic1);
3019 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3023 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3024 std::vector<int> v2(1,ic1);
3025 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3029 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3030 std::vector<int> v2(1,ic1);
3031 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3035 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3036 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3040 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3041 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3045 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3046 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3050 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3051 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3055 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3056 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3057 std::vector<int> v2(nbOfComp);
3058 for(int i=0;i<nbOfComp;i++)
3059 v2[i]=pc1.first+i*pc1.second.second;
3060 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3064 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3065 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3066 std::vector<int> v2(nbOfComp);
3067 for(int i=0;i<nbOfComp;i++)
3068 v2[i]=pc1.first+i*pc1.second.second;
3069 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3073 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3074 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3075 std::vector<int> v2(nbOfComp);
3076 for(int i=0;i<nbOfComp;i++)
3077 v2[i]=pc1.first+i*pc1.second.second;
3078 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3082 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3083 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3084 std::vector<int> v2(nbOfComp);
3085 for(int i=0;i<nbOfComp;i++)
3086 v2[i]=pc1.first+i*pc1.second.second;
3087 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3090 throw INTERP_KERNEL::Exception(msg);
3094 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3096 self->checkAllocated();
3097 const char msg[]="Unexpected situation in __setitem__ !";
3098 int nbOfTuples=self->getNumberOfTuples();
3099 int nbOfComponents=self->getNumberOfComponents();
3102 std::vector<int> v1;
3104 DataArrayIntTuple *dd1=0;
3105 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3107 std::vector<int> vt1,vc1;
3108 std::pair<int, std::pair<int,int> > pt1,pc1;
3109 DataArrayInt *dt1=0,*dc1=0;
3110 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3111 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3119 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3122 tmp=DataArrayInt::New();
3123 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3124 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3127 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3130 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3131 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3134 throw INTERP_KERNEL::Exception(msg);
3143 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3146 tmp=DataArrayInt::New();
3147 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3148 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3151 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3154 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3155 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3158 throw INTERP_KERNEL::Exception(msg);
3167 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3170 tmp=DataArrayInt::New();
3171 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3172 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3175 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3178 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3179 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3182 throw INTERP_KERNEL::Exception(msg);
3191 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3194 tmp=DataArrayInt::New();
3195 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3196 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3199 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3202 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3203 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3206 throw INTERP_KERNEL::Exception(msg);
3215 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3218 tmp=DataArrayInt::New();
3219 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3220 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3223 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3226 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3227 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3230 throw INTERP_KERNEL::Exception(msg);
3239 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3242 tmp=DataArrayInt::New();
3243 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3244 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3247 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3250 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3251 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3254 throw INTERP_KERNEL::Exception(msg);
3263 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3266 tmp=DataArrayInt::New();
3267 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3268 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3271 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3274 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3275 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3278 throw INTERP_KERNEL::Exception(msg);
3287 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3290 tmp=DataArrayInt::New();
3291 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3292 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3295 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3298 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3299 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3302 throw INTERP_KERNEL::Exception(msg);
3311 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3314 tmp=DataArrayInt::New();
3315 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3316 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3319 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3322 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3323 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3326 throw INTERP_KERNEL::Exception(msg);
3335 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3338 tmp=DataArrayInt::New();
3339 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3340 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3343 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3346 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3347 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3350 throw INTERP_KERNEL::Exception(msg);
3359 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3362 tmp=DataArrayInt::New();
3363 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3364 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3367 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3370 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3371 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3374 throw INTERP_KERNEL::Exception(msg);
3383 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3386 tmp=DataArrayInt::New();
3387 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3388 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3391 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3394 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3395 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3398 throw INTERP_KERNEL::Exception(msg);
3407 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3410 tmp=DataArrayInt::New();
3411 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3412 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3415 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3418 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3419 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3422 throw INTERP_KERNEL::Exception(msg);
3431 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3434 tmp=DataArrayInt::New();
3435 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3436 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3439 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3442 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3443 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3446 throw INTERP_KERNEL::Exception(msg);
3455 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3458 tmp=DataArrayInt::New();
3459 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3460 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3463 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3466 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3467 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3470 throw INTERP_KERNEL::Exception(msg);
3479 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3482 tmp=DataArrayInt::New();
3483 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3484 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3487 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3490 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3491 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3494 throw INTERP_KERNEL::Exception(msg);
3499 throw INTERP_KERNEL::Exception(msg);
3504 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3506 return self->negate();
3509 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3511 const char msg[]="Unexpected situation in __add__ !";
3514 std::vector<int> aa;
3515 DataArrayIntTuple *aaa;
3517 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3522 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3523 ret->applyLin(1,val);
3528 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3529 return DataArrayInt::Add(self,aaaa);
3533 return DataArrayInt::Add(self,a);
3537 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3538 return DataArrayInt::Add(self,aaaa);
3541 throw INTERP_KERNEL::Exception(msg);
3545 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3547 const char msg[]="Unexpected situation in __radd__ !";
3550 std::vector<int> aa;
3551 DataArrayIntTuple *aaa;
3553 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3558 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3559 ret->applyLin(1,val);
3564 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3565 return DataArrayInt::Add(self,aaaa);
3569 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3570 return DataArrayInt::Add(self,aaaa);
3573 throw INTERP_KERNEL::Exception(msg);
3577 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3579 const char msg[]="Unexpected situation in __iadd__ !";
3582 std::vector<int> aa;
3583 DataArrayIntTuple *aaa;
3585 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3590 self->applyLin(1,val);
3591 Py_XINCREF(trueSelf);
3596 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3598 Py_XINCREF(trueSelf);
3604 Py_XINCREF(trueSelf);
3609 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3610 self->addEqual(aaaa);
3611 Py_XINCREF(trueSelf);
3615 throw INTERP_KERNEL::Exception(msg);
3619 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3621 const char msg[]="Unexpected situation in __sub__ !";
3624 std::vector<int> aa;
3625 DataArrayIntTuple *aaa;
3627 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3632 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3633 ret->applyLin(1,-val);
3638 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3639 return DataArrayInt::Substract(self,aaaa);
3643 return DataArrayInt::Substract(self,a);
3647 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3648 return DataArrayInt::Substract(self,aaaa);
3651 throw INTERP_KERNEL::Exception(msg);
3655 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3657 const char msg[]="Unexpected situation in __rsub__ !";
3660 std::vector<int> aa;
3661 DataArrayIntTuple *aaa;
3663 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3668 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3669 ret->applyLin(-1,val);
3674 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3675 return DataArrayInt::Substract(aaaa,self);
3679 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3680 return DataArrayInt::Substract(aaaa,self);
3683 throw INTERP_KERNEL::Exception(msg);
3687 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3689 const char msg[]="Unexpected situation in __isub__ !";
3692 std::vector<int> aa;
3693 DataArrayIntTuple *aaa;
3695 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3700 self->applyLin(1,-val);
3701 Py_XINCREF(trueSelf);
3706 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3707 self->substractEqual(bb);
3708 Py_XINCREF(trueSelf);
3713 self->substractEqual(a);
3714 Py_XINCREF(trueSelf);
3719 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3720 self->substractEqual(aaaa);
3721 Py_XINCREF(trueSelf);
3725 throw INTERP_KERNEL::Exception(msg);
3729 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3731 const char msg[]="Unexpected situation in __mul__ !";
3734 std::vector<int> aa;
3735 DataArrayIntTuple *aaa;
3737 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3742 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3743 ret->applyLin(val,0);
3748 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3749 return DataArrayInt::Multiply(self,aaaa);
3753 return DataArrayInt::Multiply(self,a);
3757 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3758 return DataArrayInt::Multiply(self,aaaa);
3761 throw INTERP_KERNEL::Exception(msg);
3765 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3767 const char msg[]="Unexpected situation in __rmul__ !";
3770 std::vector<int> aa;
3771 DataArrayIntTuple *aaa;
3773 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3778 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3779 ret->applyLin(val,0);
3784 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3785 return DataArrayInt::Multiply(self,aaaa);
3789 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3790 return DataArrayInt::Multiply(self,aaaa);
3793 throw INTERP_KERNEL::Exception(msg);
3797 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3799 const char msg[]="Unexpected situation in __imul__ !";
3802 std::vector<int> aa;
3803 DataArrayIntTuple *aaa;
3805 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3810 self->applyLin(val,0);
3811 Py_XINCREF(trueSelf);
3816 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3817 self->multiplyEqual(bb);
3818 Py_XINCREF(trueSelf);
3823 self->multiplyEqual(a);
3824 Py_XINCREF(trueSelf);
3829 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3830 self->multiplyEqual(aaaa);
3831 Py_XINCREF(trueSelf);
3835 throw INTERP_KERNEL::Exception(msg);
3839 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3841 const char msg[]="Unexpected situation in __div__ !";
3844 std::vector<int> aa;
3845 DataArrayIntTuple *aaa;
3847 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3852 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3853 ret->applyDivideBy(val);
3858 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3859 return DataArrayInt::Divide(self,aaaa);
3863 return DataArrayInt::Divide(self,a);
3867 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3868 return DataArrayInt::Divide(self,aaaa);
3871 throw INTERP_KERNEL::Exception(msg);
3875 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3877 const char msg[]="Unexpected situation in __rdiv__ !";
3880 std::vector<int> aa;
3881 DataArrayIntTuple *aaa;
3883 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3888 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3894 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3895 return DataArrayInt::Divide(aaaa,self);
3899 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3900 return DataArrayInt::Divide(aaaa,self);
3903 throw INTERP_KERNEL::Exception(msg);
3907 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3909 const char msg[]="Unexpected situation in __idiv__ !";
3912 std::vector<int> aa;
3913 DataArrayIntTuple *aaa;
3915 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3920 self->applyDivideBy(val);
3921 Py_XINCREF(trueSelf);
3926 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3927 self->divideEqual(bb);
3928 Py_XINCREF(trueSelf);
3933 self->divideEqual(a);
3934 Py_XINCREF(trueSelf);
3939 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3940 self->divideEqual(aaaa);
3941 Py_XINCREF(trueSelf);
3945 throw INTERP_KERNEL::Exception(msg);
3949 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3951 const char msg[]="Unexpected situation in __mod__ !";
3954 std::vector<int> aa;
3955 DataArrayIntTuple *aaa;
3957 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3962 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3963 ret->applyModulus(val);
3968 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3969 return DataArrayInt::Modulus(self,aaaa);
3973 return DataArrayInt::Modulus(self,a);
3977 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3978 return DataArrayInt::Modulus(self,aaaa);
3981 throw INTERP_KERNEL::Exception(msg);
3985 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3987 const char msg[]="Unexpected situation in __rmod__ !";
3990 std::vector<int> aa;
3991 DataArrayIntTuple *aaa;
3993 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3998 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3999 ret->applyRModulus(val);
4004 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4005 return DataArrayInt::Modulus(aaaa,self);
4009 return DataArrayInt::Modulus(a,self);
4013 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4014 return DataArrayInt::Modulus(aaaa,self);
4017 throw INTERP_KERNEL::Exception(msg);
4021 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4023 const char msg[]="Unexpected situation in __imod__ !";
4026 std::vector<int> aa;
4027 DataArrayIntTuple *aaa;
4029 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4034 self->applyModulus(val);
4035 Py_XINCREF(trueSelf);
4040 self->modulusEqual(a);
4041 Py_XINCREF(trueSelf);
4046 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4047 self->modulusEqual(aaaa);
4048 Py_XINCREF(trueSelf);
4052 throw INTERP_KERNEL::Exception(msg);
4056 DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4058 const char msg[]="Unexpected situation in __pow__ !";
4061 std::vector<int> aa;
4062 DataArrayIntTuple *aaa;
4064 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4069 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4075 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4076 return DataArrayInt::Pow(self,aaaa);
4080 return DataArrayInt::Pow(self,a);
4084 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4085 return DataArrayInt::Pow(self,aaaa);
4088 throw INTERP_KERNEL::Exception(msg);
4092 DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4094 const char msg[]="Unexpected situation in __rpow__ !";
4097 std::vector<int> aa;
4098 DataArrayIntTuple *aaa;
4100 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4105 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4106 ret->applyRPow(val);
4111 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4112 return DataArrayInt::Pow(aaaa,self);
4116 return DataArrayInt::Pow(a,self);
4120 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4121 return DataArrayInt::Pow(aaaa,self);
4124 throw INTERP_KERNEL::Exception(msg);
4128 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4130 const char msg[]="Unexpected situation in __ipow__ !";
4133 std::vector<int> aa;
4134 DataArrayIntTuple *aaa;
4136 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4141 self->applyPow(val);
4142 Py_XINCREF(trueSelf);
4148 Py_XINCREF(trueSelf);
4153 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4154 self->powEqual(aaaa);
4155 Py_XINCREF(trueSelf);
4159 throw INTERP_KERNEL::Exception(msg);
4163 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4165 std::ostringstream oss;
4166 self->reprQuickOverview(oss);
4170 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4172 int szArr,sw,iTypppArr;
4173 std::vector<int> stdvecTyyppArr;
4174 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4175 self->pushBackValsSilent(tmp,tmp+szArr);
4178 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4180 std::vector<int> ret1;
4181 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4182 std::size_t sz=ret0.size();
4183 PyObject *pyRet=PyTuple_New(2);
4184 PyObject *pyRet0=PyList_New((int)sz);
4185 PyObject *pyRet1=PyList_New((int)sz);
4186 for(std::size_t i=0;i<sz;i++)
4188 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4189 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4191 PyTuple_SetItem(pyRet,0,pyRet0);
4192 PyTuple_SetItem(pyRet,1,pyRet1);
4196 PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4198 DataArrayInt *ret0=0,*ret1=0;
4199 self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4200 PyObject *pyRet=PyTuple_New(2);
4201 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4202 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4208 class DataArrayIntTuple;
4210 class DataArrayIntIterator
4213 DataArrayIntIterator(DataArrayInt *da);
4214 ~DataArrayIntIterator();
4219 DataArrayIntTuple *ret=self->nextt();
4221 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4224 PyErr_SetString(PyExc_StopIteration,"No more data.");
4231 class DataArrayIntTuple
4234 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4235 DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4238 std::string __str__() const throw(INTERP_KERNEL::Exception)
4240 return self->repr();
4243 int __int__() const throw(INTERP_KERNEL::Exception)
4245 return self->intValue();
4248 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4250 return self->buildDAInt(1,self->getNumberOfCompo());
4253 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4255 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4256 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4257 Py_XINCREF(trueSelf);
4261 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4263 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4264 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4265 Py_XINCREF(trueSelf);
4269 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4271 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4272 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4273 Py_XINCREF(trueSelf);
4277 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4279 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4280 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4281 Py_XINCREF(trueSelf);
4285 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4287 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4288 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4289 Py_XINCREF(trueSelf);
4293 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4295 const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4298 std::vector<int> multiVal;
4299 std::pair<int, std::pair<int,int> > slic;
4300 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4301 const int *pt=self->getConstPointer();
4302 int nbc=self->getNumberOfCompo();
4303 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4310 std::ostringstream oss;
4311 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4312 throw INTERP_KERNEL::Exception(oss.str().c_str());
4315 return PyInt_FromLong(pt[singleVal]);
4319 return PyInt_FromLong(pt[nbc+singleVal]);
4322 std::ostringstream oss;
4323 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4324 throw INTERP_KERNEL::Exception(oss.str().c_str());
4330 PyObject *t=PyTuple_New(multiVal.size());
4331 for(int j=0;j<(int)multiVal.size();j++)
4333 int cid=multiVal[j];
4336 std::ostringstream oss;
4337 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4338 throw INTERP_KERNEL::Exception(oss.str().c_str());
4340 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4346 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4347 PyObject *t=PyTuple_New(sz);
4348 for(int j=0;j<sz;j++)
4349 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4353 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4357 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4359 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4360 const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4363 std::vector<int> multiValV;
4364 std::pair<int, std::pair<int,int> > slicV;
4365 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4366 int nbc=self->getNumberOfCompo();
4367 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4369 std::vector<int> multiVal;
4370 std::pair<int, std::pair<int,int> > slic;
4371 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4372 int *pt=self->getPointer();
4373 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4380 std::ostringstream oss;
4381 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4382 throw INTERP_KERNEL::Exception(oss.str().c_str());
4388 pt[singleVal]=singleValV;
4393 if(multiValV.size()!=1)
4395 std::ostringstream oss;
4396 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4397 throw INTERP_KERNEL::Exception(oss.str().c_str());
4399 pt[singleVal]=multiValV[0];
4404 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4408 throw INTERP_KERNEL::Exception(msg);
4417 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4421 std::ostringstream oss;
4422 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4423 throw INTERP_KERNEL::Exception(oss.str().c_str());
4431 if(multiVal.size()!=multiValV.size())
4433 std::ostringstream oss;
4434 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4435 throw INTERP_KERNEL::Exception(oss.str().c_str());
4437 for(int i=0;i<(int)multiVal.size();i++)
4439 int pos=multiVal[i];
4442 std::ostringstream oss;
4443 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4444 throw INTERP_KERNEL::Exception(oss.str().c_str());
4446 pt[multiVal[i]]=multiValV[i];
4452 const int *ptV=daIntTyyppV->getConstPointer();
4453 if(nbc>daIntTyyppV->getNumberOfCompo())
4455 std::ostringstream oss;
4456 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4457 throw INTERP_KERNEL::Exception(oss.str().c_str());
4459 std::copy(ptV,ptV+nbc,pt);
4463 throw INTERP_KERNEL::Exception(msg);
4468 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4473 for(int j=0;j<sz;j++)
4474 pt[slic.first+j*slic.second.second]=singleValV;
4479 if(sz!=(int)multiValV.size())
4481 std::ostringstream oss;
4482 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4483 throw INTERP_KERNEL::Exception(oss.str().c_str());
4485 for(int j=0;j<sz;j++)
4486 pt[slic.first+j*slic.second.second]=multiValV[j];
4491 const int *ptV=daIntTyyppV->getConstPointer();
4492 if(sz>daIntTyyppV->getNumberOfCompo())
4494 std::ostringstream oss;
4495 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4496 throw INTERP_KERNEL::Exception(oss.str().c_str());
4498 for(int j=0;j<sz;j++)
4499 pt[slic.first+j*slic.second.second]=ptV[j];
4503 throw INTERP_KERNEL::Exception(msg);
4507 throw INTERP_KERNEL::Exception(msg);
4513 class DataArrayChar : public DataArray
4516 virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4517 int getHashCode() const throw(INTERP_KERNEL::Exception);
4518 bool empty() const throw(INTERP_KERNEL::Exception);
4519 void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4520 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4521 void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4522 void pushBackValsSilent(const char *valsBg, const char *valsEnd) throw(INTERP_KERNEL::Exception);
4523 char popBackSilent() throw(INTERP_KERNEL::Exception);
4524 void pack() const throw(INTERP_KERNEL::Exception);
4525 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4526 bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4527 bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4528 void reverse() throw(INTERP_KERNEL::Exception);
4529 void fillWithZero() throw(INTERP_KERNEL::Exception);
4530 void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4531 std::string repr() const throw(INTERP_KERNEL::Exception);
4532 std::string reprZip() const throw(INTERP_KERNEL::Exception);
4533 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4534 DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4535 DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4536 DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4537 bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4538 void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
4539 DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4540 DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4541 void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4542 void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4543 char front() const throw(INTERP_KERNEL::Exception);
4544 char back() const throw(INTERP_KERNEL::Exception);
4545 void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4546 void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4547 char *getPointer() throw(INTERP_KERNEL::Exception);
4548 DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4549 DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4550 int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4551 bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4552 char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4553 char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4554 char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4555 char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4556 DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4557 static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4558 static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4561 int __len__() const throw(INTERP_KERNEL::Exception)
4563 if(self->isAllocated())
4565 return self->getNumberOfTuples();
4569 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4573 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4576 bool ret0=self->isEqualIfNotWhy(other,ret1);
4577 PyObject *ret=PyTuple_New(2);
4578 PyObject *ret0Py=ret0?Py_True:Py_False;
4580 PyTuple_SetItem(ret,0,ret0Py);
4581 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4585 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4588 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4589 if (!SWIG_IsOK(res1))
4592 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4593 if(size!=self->getNumberOfTuples())
4595 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4597 return self->renumber(tmp);
4601 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4603 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4604 da2->checkAllocated();
4605 int size=self->getNumberOfTuples();
4606 if(size!=self->getNumberOfTuples())
4608 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4610 return self->renumber(da2->getConstPointer());
4614 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4617 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4618 if (!SWIG_IsOK(res1))
4621 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4622 if(size!=self->getNumberOfTuples())
4624 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4626 return self->renumberR(tmp);
4630 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4632 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4633 da2->checkAllocated();
4634 int size=self->getNumberOfTuples();
4635 if(size!=self->getNumberOfTuples())
4637 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4639 return self->renumberR(da2->getConstPointer());
4643 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4646 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4647 if (!SWIG_IsOK(res1))
4650 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4651 if(size!=self->getNumberOfTuples())
4653 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4655 return self->renumberAndReduce(tmp,newNbOfTuple);
4659 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4661 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4662 da2->checkAllocated();
4663 int size=self->getNumberOfTuples();
4664 if(size!=self->getNumberOfTuples())
4666 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4668 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4672 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4674 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4675 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4676 return DataArrayChar::Aggregate(tmp);
4679 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4681 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4682 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4683 return DataArrayChar::Meld(tmp);
4688 class DataArrayByteIterator;
4690 class DataArrayByte : public DataArrayChar
4693 static DataArrayByte *New();
4694 DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4695 DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4696 char byteValue() const throw(INTERP_KERNEL::Exception);
4699 DataArrayByte() throw(INTERP_KERNEL::Exception)
4701 return DataArrayByte::New();
4704 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4706 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) !";
4707 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4711 if(PyInt_Check(nbOfTuples))
4713 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4715 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4718 if(PyInt_Check(nbOfComp))
4719 {//DataArrayByte.New([1,3,4,5],2,2)
4720 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4722 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4723 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4724 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4725 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4729 throw INTERP_KERNEL::Exception(msg);
4732 {//DataArrayByte.New([1,3,4],3)
4733 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4735 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4736 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4741 throw INTERP_KERNEL::Exception(msg);
4744 {// DataArrayByte.New([1,3,4])
4745 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4746 int tmpp1=-1,tmpp2=-1;
4747 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4748 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4752 else if(PyInt_Check(elt0))
4754 int nbOfTuples1=PyInt_AS_LONG(elt0);
4756 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4761 if(PyInt_Check(nbOfTuples))
4762 {//DataArrayByte.New(5,2)
4763 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4765 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4766 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4767 ret->alloc(nbOfTuples1,nbOfCompo);
4771 throw INTERP_KERNEL::Exception(msg);
4774 throw INTERP_KERNEL::Exception(msg);
4777 {//DataArrayByte.New(5)
4778 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4779 ret->alloc(nbOfTuples1,1);
4784 throw INTERP_KERNEL::Exception(msg);
4787 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4789 return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4792 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4794 std::ostringstream oss;
4795 self->reprQuickOverview(oss);
4799 int __int__() const throw(INTERP_KERNEL::Exception)
4801 return (int) self->byteValue();
4804 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
4806 return self->iterator();
4809 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4811 return (int)self->getIJ(tupleId,compoId);
4814 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4816 return (int)self->getIJSafe(tupleId,compoId);
4819 std::string __str__() const throw(INTERP_KERNEL::Exception)
4821 return self->repr();
4824 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
4826 const char *vals=self->getConstPointer();
4827 int nbOfComp=self->getNumberOfComponents();
4828 int nbOfTuples=self->getNumberOfTuples();
4829 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4832 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4835 int ival=-1; std::vector<int> ivval;
4836 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4837 std::vector<char> vals(sz);
4838 std::copy(pt,pt+sz,vals.begin());
4839 return self->presenceOfTuple(vals);
4842 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4845 int ival=-1; std::vector<int> ivval;
4846 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4847 std::vector<char> vals2(sz);
4848 std::copy(pt,pt+sz,vals2.begin());
4849 return self->presenceOfValue(vals2);
4852 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4855 int ival=-1; std::vector<int> ivval;
4856 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4857 std::vector<char> vals2(sz);
4858 std::copy(pt,pt+sz,vals2.begin());
4859 return self->locateValue(vals2);
4862 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4865 int ival=-1; std::vector<int> ivval;
4866 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4867 std::vector<char> vals(sz);
4868 std::copy(pt,pt+sz,vals.begin());
4869 return self->locateTuple(vals);
4872 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
4875 int ival=-1; std::vector<int> ivval;
4876 const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
4877 std::vector<char> vals(sz);
4878 std::copy(pt,pt+sz,vals.begin());
4879 return self->search(vals);
4882 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
4884 int sz=self->getNumberOfComponents();
4885 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
4886 self->getTuple(tupleId,tmp);
4887 PyObject *ret=PyTuple_New(sz);
4888 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
4892 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
4895 int r1=(int)self->getMaxValue(tmp);
4896 PyObject *ret=PyTuple_New(2);
4897 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4898 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4902 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
4905 int r1=(int)self->getMinValue(tmp);
4906 PyObject *ret=PyTuple_New(2);
4907 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4908 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4912 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4914 int nbOfCompo=self->getNumberOfComponents();
4919 if(PyInt_Check(obj))
4921 int val=(int)PyInt_AS_LONG(obj);
4922 return self->locateValue(val);
4925 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
4928 return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
4932 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4934 int nbOfCompo=self->getNumberOfComponents();
4941 if(PyInt_Check(obj))
4943 int val=(int)PyInt_AS_LONG(obj);
4944 return self->presenceOfValue(val);
4947 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
4950 return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
4956 class DataArrayByteTuple;
4958 class DataArrayByteIterator
4961 DataArrayByteIterator(DataArrayByte *da);
4962 ~DataArrayByteIterator();
4965 class DataArrayByteTuple
4968 std::string repr() const throw(INTERP_KERNEL::Exception);
4969 DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4972 std::string __str__() const throw(INTERP_KERNEL::Exception)
4974 return self->repr();
4977 char __int__() const throw(INTERP_KERNEL::Exception)
4979 return self->byteValue();
4982 DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
4984 return self->buildDAByte(1,self->getNumberOfCompo());
4989 class DataArrayAsciiCharIterator;
4991 class DataArrayAsciiChar : public DataArrayChar
4994 static DataArrayAsciiChar *New();
4995 DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
4996 DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4997 char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5000 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5002 return DataArrayAsciiChar::New();
5005 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5007 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) !";
5008 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5012 if(PyInt_Check(nbOfTuples))
5014 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5016 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5019 if(PyInt_Check(nbOfComp))
5020 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5021 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5023 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5024 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5025 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5026 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5030 throw INTERP_KERNEL::Exception(msg);
5033 {//DataArrayAsciiChar.New([1,3,4],3)
5034 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5036 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5037 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5041 else if(PyString_Check(nbOfTuples))
5043 if(PyString_Size(nbOfTuples)!=1)
5044 throw INTERP_KERNEL::Exception(msg);
5045 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5046 std::vector<std::string> tmp;
5047 if(fillStringVector(elt0,tmp))
5048 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5050 throw INTERP_KERNEL::Exception(msg);
5053 throw INTERP_KERNEL::Exception(msg);
5057 std::vector<std::string> tmmp;
5058 if(fillStringVector(elt0,tmmp))
5059 //DataArrayAsciiChar.New(["abc","de","fghi"])
5060 return DataArrayAsciiChar::New(tmmp,' ');
5063 // DataArrayAsciiChar.New([1,3,4])
5064 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5065 int tmpp1=-1,tmpp2=-1;
5066 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5067 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5072 else if(PyInt_Check(elt0))
5074 int nbOfTuples1=PyInt_AS_LONG(elt0);
5076 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5081 if(PyInt_Check(nbOfTuples))
5082 {//DataArrayAsciiChar.New(5,2)
5083 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5085 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5086 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5087 ret->alloc(nbOfTuples1,nbOfCompo);
5091 throw INTERP_KERNEL::Exception(msg);
5094 throw INTERP_KERNEL::Exception(msg);
5097 {//DataArrayAsciiChar.New(5)
5098 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5099 ret->alloc(nbOfTuples1,1);
5104 throw INTERP_KERNEL::Exception(msg);
5107 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5109 return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5112 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5114 std::ostringstream oss;
5115 self->reprQuickOverview(oss);
5119 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5121 return self->iterator();
5124 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5126 char tmp[2]; tmp[1]='\0';
5127 tmp[0]=self->getIJ(tupleId,compoId);
5128 return std::string(tmp);
5131 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5133 char tmp[2]; tmp[1]='\0';
5134 tmp[0]=self->getIJSafe(tupleId,compoId);
5135 return std::string(tmp);
5138 std::string __str__() const throw(INTERP_KERNEL::Exception)
5140 return self->repr();
5143 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5145 const char *vals=self->getConstPointer();
5146 int nbOfComp=self->getNumberOfComponents();
5147 int nbOfTuples=self->getNumberOfTuples();
5148 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5151 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5153 if(PyString_Check(tupl))
5155 Py_ssize_t sz=PyString_Size(tupl);
5156 std::vector<char> vals(sz);
5157 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5158 return self->presenceOfTuple(vals);
5161 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5164 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5166 if(PyString_Check(vals))
5168 Py_ssize_t sz=PyString_Size(vals);
5169 std::vector<char> vals2(sz);
5170 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5171 return self->presenceOfValue(vals2);
5174 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5177 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5179 if(PyString_Check(vals))
5181 Py_ssize_t sz=PyString_Size(vals);
5182 std::vector<char> vals2(sz);
5183 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5184 return self->locateValue(vals2);
5187 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5190 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5192 if(PyString_Check(tupl))
5194 Py_ssize_t sz=PyString_Size(tupl);
5195 std::vector<char> vals(sz);
5196 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5197 return self->locateTuple(vals);
5200 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5203 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5205 if(PyString_Check(strOrListOfInt))
5207 Py_ssize_t sz=PyString_Size(strOrListOfInt);
5208 std::vector<char> vals(sz);
5209 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5210 return self->search(vals);
5213 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5216 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5218 int sz=self->getNumberOfComponents();
5219 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5220 self->getTuple(tupleId,tmp);
5221 return PyString_FromString(tmp);
5224 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5227 char tmp2[2]; tmp2[1]='\0';
5228 tmp2[0]=self->getMaxValue(tmp);
5229 PyObject *ret=PyTuple_New(2);
5230 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5231 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5235 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5238 char tmp2[2]; tmp2[1]='\0';
5239 tmp2[0]=self->getMinValue(tmp);
5240 PyObject *ret=PyTuple_New(2);
5241 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5242 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5246 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5248 int nbOfCompo=self->getNumberOfComponents();
5253 if(PyString_Check(obj))
5255 Py_ssize_t sz=PyString_Size(obj);
5256 char *pt=PyString_AsString(obj);
5258 return self->locateValue(pt[0]);
5260 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5263 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5266 return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5270 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5272 int nbOfCompo=self->getNumberOfComponents();
5279 if(PyString_Check(obj))
5281 Py_ssize_t sz=PyString_Size(obj);
5282 char *pt=PyString_AsString(obj);
5284 return self->presenceOfValue(pt[0]);
5286 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5289 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5292 return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5296 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5299 std::vector<int> stdvecTyyppArr;
5300 std::pair<int, std::pair<int,int> > sTyyppArr;
5301 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5302 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5306 return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5308 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5310 return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5312 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5314 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5318 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5320 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.";
5322 std::vector<int> stdvecTyyppArr;
5323 std::pair<int, std::pair<int,int> > sTyyppArr;
5324 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5325 int nbOfCompo=self->getNumberOfComponents();
5326 int nbOfTuples=self->getNumberOfTuples();
5327 convertObjToPossibleCpp2(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5329 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5330 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5339 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5345 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5346 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5349 //value vector<string>
5352 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5353 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5356 //value DataArrayChar
5359 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5363 throw INTERP_KERNEL::Exception(msg);
5367 {//obj list-tuple[int]
5373 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5379 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5380 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5383 //value vector<string>
5386 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5387 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5390 //value DataArrayChar
5393 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5397 throw INTERP_KERNEL::Exception(msg);
5408 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5414 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5415 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5418 //value vector<string>
5421 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5422 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5425 //value DataArrayChar
5428 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5432 throw INTERP_KERNEL::Exception(msg);
5443 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5449 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5450 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5453 //value vector<string>
5456 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5457 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5460 //value DataArrayChar
5463 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5467 throw INTERP_KERNEL::Exception(msg);
5472 throw INTERP_KERNEL::Exception(msg);
5478 class DataArrayAsciiCharTuple;
5480 class DataArrayAsciiCharIterator
5483 DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5484 ~DataArrayAsciiCharIterator();
5489 DataArrayAsciiCharTuple *ret=self->nextt();
5491 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5494 PyErr_SetString(PyExc_StopIteration,"No more data.");
5501 class DataArrayAsciiCharTuple
5504 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5505 DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5508 std::string __str__() const throw(INTERP_KERNEL::Exception)
5510 return self->repr();
5513 DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5515 return self->buildDAAsciiChar(1,self->getNumberOfCompo());