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 virtual void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
54 void checkNbOfTuples(int nbOfTuples, const char *msg) const throw(INTERP_KERNEL::Exception);
55 void checkNbOfComps(int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
56 void checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const throw(INTERP_KERNEL::Exception);
57 void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
58 void checkNbOfElems(std::size_t nbOfElems, const char *msg) const throw(INTERP_KERNEL::Exception);
59 static int GetNumberOfItemGivenBES(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
60 static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
61 static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
62 static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
63 static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
64 void updateTime() const;
67 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
69 const std::vector<std::string>& comps=self->getInfoOnComponents();
70 PyObject *ret=PyList_New((int)comps.size());
71 for(int i=0;i<(int)comps.size();i++)
72 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
76 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
79 convertPyToNewIntArr3(li,tmp);
80 self->copyPartOfStringInfoFrom(other,tmp);
83 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
86 convertPyToNewIntArr3(li,tmp);
87 self->copyPartOfStringInfoFrom2(tmp,other);
90 virtual void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
93 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
97 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
98 if(size!=self->getNumberOfTuples())
100 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
102 self->renumberInPlace(tmp);
106 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
108 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
109 da2->checkAllocated();
110 int size=self->getNumberOfTuples();
111 if(size!=self->getNumberOfTuples())
113 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
115 self->renumberInPlace(da2->getConstPointer());
119 virtual void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
122 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
123 if (!SWIG_IsOK(res1))
126 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
127 if(size!=self->getNumberOfTuples())
129 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
131 self->renumberInPlaceR(tmp);
135 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
137 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
138 da2->checkAllocated();
139 int size=self->getNumberOfTuples();
140 if(size!=self->getNumberOfTuples())
142 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
144 self->renumberInPlaceR(da2->getConstPointer());
148 //tuplesSelec in PyObject * because DataArrayInt is not already existing !
149 virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec) throw(INTERP_KERNEL::Exception)
151 static const char msg[]="DataArray::setContigPartOfSelectedValues2 : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
152 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 3rd parameter \"aBase\" should be of type DataArray");
153 DataArray *tuplesSelecPtr=CheckAndRetrieveDataArrayInstance(tuplesSelec,msg);
154 DataArrayInt *tuplesSelecPtr2=0;
157 tuplesSelecPtr2=dynamic_cast<DataArrayInt *>(tuplesSelecPtr);
159 throw INTERP_KERNEL::Exception(msg);
161 self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
164 virtual void setContigPartOfSelectedValues2(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
166 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 2nd parameter \"aBase\" should be of type DataArray");
167 self->setContigPartOfSelectedValues2(tupleIdStart,a,bg,end2,step);
170 virtual DataArray *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
172 std::vector<std::pair<int,int> > ranges;
173 convertPyToVectorPairInt(li,ranges);
174 return self->selectByTupleRanges(ranges);
177 virtual DataArray *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
180 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
181 if (!SWIG_IsOK(res1))
184 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
185 return self->selectByTupleId(tmp,tmp+size);
189 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
191 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
192 da2->checkAllocated();
193 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
197 virtual DataArray *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
200 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
201 if (!SWIG_IsOK(res1))
204 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
205 return self->selectByTupleIdSafe(tmp,tmp+size);
209 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
211 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
212 da2->checkAllocated();
213 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
217 virtual PyObject *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
219 std::vector<int> tmp;
220 convertPyToNewIntArr3(li,tmp);
221 DataArray *ret=self->keepSelectedComponents(tmp);
222 return convertDataArray(ret,SWIG_POINTER_OWN | 0 );
225 static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices) throw(INTERP_KERNEL::Exception)
227 if(!PySlice_Check(slic))
228 throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
229 Py_ssize_t strt=2,stp=2,step=2;
230 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
231 if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
232 throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : the input slice is invalid !");
233 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
234 throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : the input slice contains some unknowns that can't be determined in static method ! Call DataArray::getSlice (non static) instead !");
236 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
237 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
240 PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
242 if(!PySlice_Check(slic))
243 throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
244 Py_ssize_t strt=2,stp=2,step=2;
245 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
246 if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
247 throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : the input slice is invalid !");
249 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
250 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
253 static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
255 if(!PySlice_Check(slic))
256 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
257 Py_ssize_t strt=2,stp=2,step=2;
258 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
259 if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
260 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
261 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
262 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : the input slice contains some unknowns that can't be determined in static method !");
263 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
266 static int GetNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
268 if(!PySlice_Check(slic))
269 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
270 Py_ssize_t strt=2,stp=2,step=2;
271 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
272 if(PySlice_GetIndices(sly,std::numeric_limits<int>::max(),&strt,&stp,&step)!=0)
273 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
274 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
275 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice contains some unknowns that can't be determined in static method !");
276 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
279 static DataArray *Aggregate(PyObject *arrs) throw(INTERP_KERNEL::Exception)
281 std::vector<const DataArray *> tmp;
282 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArray *>(arrs,SWIGTYPE_p_ParaMEDMEM__DataArray,"DataArray",tmp);
283 return DataArray::Aggregate(tmp);
286 int getNumberOfItemGivenBES(PyObject *slic) const throw(INTERP_KERNEL::Exception)
288 if(!PySlice_Check(slic))
289 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
290 Py_ssize_t strt=2,stp=2,step=2;
291 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
292 if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
293 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
294 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
297 int getNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
299 if(!PySlice_Check(slic))
300 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
301 Py_ssize_t strt=2,stp=2,step=2;
302 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
303 if(PySlice_GetIndices(sly,self->getNumberOfTuples(),&strt,&stp,&step)!=0)
304 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
305 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
311 class DataArrayDoubleIterator;
313 class DataArrayDouble : public DataArray
316 static DataArrayDouble *New();
317 double doubleValue() const throw(INTERP_KERNEL::Exception);
318 bool empty() const throw(INTERP_KERNEL::Exception);
319 DataArrayDouble *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
320 void cpyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
321 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
322 void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
323 void pushBackValsSilent(const double *valsBg, const double *valsEnd) throw(INTERP_KERNEL::Exception);
324 double popBackSilent() throw(INTERP_KERNEL::Exception);
325 void pack() const throw(INTERP_KERNEL::Exception);
326 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
327 void fillWithZero() throw(INTERP_KERNEL::Exception);
328 void fillWithValue(double val) throw(INTERP_KERNEL::Exception);
329 void iota(double init=0.) throw(INTERP_KERNEL::Exception);
330 bool isUniform(double val, double eps) const throw(INTERP_KERNEL::Exception);
331 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
332 void reverse() throw(INTERP_KERNEL::Exception);
333 void checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
334 bool isMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
335 std::string repr() const throw(INTERP_KERNEL::Exception);
336 std::string reprZip() const throw(INTERP_KERNEL::Exception);
337 bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
338 bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
339 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
340 DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
341 DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
342 DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
343 void transpose() throw(INTERP_KERNEL::Exception);
344 DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
345 void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
346 DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
347 DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception);
348 DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
349 void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
350 void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
351 void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
352 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
353 double front() const throw(INTERP_KERNEL::Exception);
354 double back() const throw(INTERP_KERNEL::Exception);
355 double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
356 void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
357 void setIJSilent(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
358 double *getPointer() throw(INTERP_KERNEL::Exception);
359 void checkNoNullValues() const throw(INTERP_KERNEL::Exception);
360 DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const throw(INTERP_KERNEL::Exception);
361 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
362 double getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
363 double getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
364 double getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
365 double getMinValueInArray() const throw(INTERP_KERNEL::Exception);
366 int count(double value, double eps) const throw(INTERP_KERNEL::Exception);
367 double getAverageValue() const throw(INTERP_KERNEL::Exception);
368 double norm2() const throw(INTERP_KERNEL::Exception);
369 double normMax() const throw(INTERP_KERNEL::Exception);
370 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
371 DataArrayDouble *fromPolarToCart() const throw(INTERP_KERNEL::Exception);
372 DataArrayDouble *fromCylToCart() const throw(INTERP_KERNEL::Exception);
373 DataArrayDouble *fromSpherToCart() const throw(INTERP_KERNEL::Exception);
374 DataArrayDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
375 DataArrayDouble *determinant() const throw(INTERP_KERNEL::Exception);
376 DataArrayDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
377 DataArrayDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
378 DataArrayDouble *inverse() const throw(INTERP_KERNEL::Exception);
379 DataArrayDouble *trace() const throw(INTERP_KERNEL::Exception);
380 DataArrayDouble *deviator() const throw(INTERP_KERNEL::Exception);
381 DataArrayDouble *magnitude() const throw(INTERP_KERNEL::Exception);
382 DataArrayDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
383 DataArrayDouble *buildEuclidianDistanceDenseMatrix() const throw(INTERP_KERNEL::Exception);
384 DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
385 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
386 void abs() throw(INTERP_KERNEL::Exception);
387 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
388 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
389 void applyInv(double numerator) throw(INTERP_KERNEL::Exception);
390 void applyPow(double val) throw(INTERP_KERNEL::Exception);
391 void applyRPow(double val) throw(INTERP_KERNEL::Exception);
392 DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
393 DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
394 DataArrayDouble *applyFunc(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
395 DataArrayDouble *applyFunc(const char *func) const throw(INTERP_KERNEL::Exception);
396 DataArrayDouble *applyFunc2(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
397 DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
398 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
399 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
400 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
401 static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
402 static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
403 static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
404 static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
405 static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
406 static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
407 static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
408 void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
409 static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
410 void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
411 static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
412 void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
413 static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
414 void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
415 static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
416 void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
419 DataArrayDouble() throw(INTERP_KERNEL::Exception)
421 return DataArrayDouble::New();
424 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
426 const char *msgBase="ParaMEDMEM::DataArrayDouble::New : Available API are : \n-DataArrayDouble.New()\n-DataArrayDouble.New([1.,3.,4.])\n-DataArrayDouble.New([1.,3.,4.],3)\n-DataArrayDouble.New([1.,3.,4.,5.],2,2)\n-DataArrayDouble.New([1.,3.,4.,5.,7,8.],3,2)\n-DataArrayDouble.New([(1.,3.),(4.,5.),(7,8.)])\n-DataArrayDouble.New(5)\n-DataArrayDouble.New(5,2)";
427 std::string msg(msgBase);
429 msg+="\n-DataArrayDouble.New(numpy array with dtype=float64)";
432 if(PyList_Check(elt0) || PyTuple_Check(elt0))
436 if(PyInt_Check(nbOfTuples))
438 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
440 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
443 if(PyInt_Check(elt2))
444 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
445 int nbOfCompo=PyInt_AS_LONG(elt2);
447 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
448 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
449 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
450 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
454 throw INTERP_KERNEL::Exception(msg.c_str());
457 {//DataArrayDouble.New([1.,3.,4.],3)
458 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
460 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
461 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
466 throw INTERP_KERNEL::Exception(msg.c_str());
469 {// DataArrayDouble.New([1.,3.,4.])
470 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
471 int tmpp1=-1,tmpp2=-1;
472 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
473 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
477 else if(PyInt_Check(elt0))
479 int nbOfTuples1=PyInt_AS_LONG(elt0);
481 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
486 if(PyInt_Check(nbOfTuples))
487 {//DataArrayDouble.New(5,2)
488 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
490 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
491 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
492 ret->alloc(nbOfTuples1,nbOfCompo);
496 throw INTERP_KERNEL::Exception(msg.c_str());
499 throw INTERP_KERNEL::Exception(msg.c_str());
502 {//DataArrayDouble.New(5)
503 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
504 ret->alloc(nbOfTuples1,1);
509 else if(PyArray_Check(elt0) && nbOfTuples==NULL && elt2==NULL)
510 {//DataArrayDouble.New(numpyArray)
511 return BuildNewInstance<DataArrayDouble,double>(elt0,NPY_DOUBLE,&PyCallBackDataArrayDouble_RefType,"FLOAT64");
515 throw INTERP_KERNEL::Exception(msg.c_str());
518 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
520 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
523 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
526 std::vector<double> bb;
528 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
529 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
530 self->pushBackValsSilent(tmp,tmp+nbTuples);
533 std::string __repr__() const throw(INTERP_KERNEL::Exception)
535 std::ostringstream oss;
536 self->reprQuickOverview(oss);
540 std::string __str__() const throw(INTERP_KERNEL::Exception)
545 double __float__() const throw(INTERP_KERNEL::Exception)
547 return self->doubleValue();
550 int __len__() const throw(INTERP_KERNEL::Exception)
552 if(self->isAllocated())
554 return self->getNumberOfTuples();
558 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
562 DataArrayDoubleIterator *__iter__() throw(INTERP_KERNEL::Exception)
564 return self->iterator();
567 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
569 const char *msg="ParaMEDMEM::DataArrayDouble::setValues : Available API are : \n-DataArrayDouble.setValues([1.,3.,4.])\n-DataArrayDouble.setValues([1.,3.,4.],3)\n-DataArrayDouble.setValues([1.,3.,4.,5.],2,2)\n-DataArrayDouble.setValues([(1.,1.7),(3.,3.7),(4.,4.7)])\n !";
570 if(PyList_Check(li) || PyTuple_Check(li))
574 if(PyInt_Check(nbOfTuples))
576 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
578 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
581 if(PyInt_Check(nbOfComp))
582 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
583 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
585 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
586 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
587 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
590 throw INTERP_KERNEL::Exception(msg);
593 {//DataArrayDouble.setValues([1.,3.,4.],3)
595 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
596 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
600 throw INTERP_KERNEL::Exception(msg);
603 {// DataArrayDouble.setValues([1.,3.,4.])
604 int tmpp1=-1,tmpp2=-1;
605 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
606 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
610 throw INTERP_KERNEL::Exception(msg);
613 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
615 const double *vals=self->getConstPointer();
616 return convertDblArrToPyList(vals,self->getNbOfElems());
620 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
622 return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
626 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
629 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
630 PyObject *ret=PyTuple_New(2);
631 PyObject *ret0Py=ret0?Py_True:Py_False;
633 PyTuple_SetItem(ret,0,ret0Py);
634 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
638 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
640 const double *vals=self->getConstPointer();
641 int nbOfComp=self->getNumberOfComponents();
642 int nbOfTuples=self->getNumberOfTuples();
643 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
646 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
649 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
650 if (!SWIG_IsOK(res1))
653 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
654 if(size!=self->getNumberOfTuples())
656 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
658 return self->renumber(tmp);
662 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
664 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
665 da2->checkAllocated();
666 int size=self->getNumberOfTuples();
667 if(size!=self->getNumberOfTuples())
669 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
671 return self->renumber(da2->getConstPointer());
675 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
678 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
679 if (!SWIG_IsOK(res1))
682 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
683 if(size!=self->getNumberOfTuples())
685 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
687 return self->renumberR(tmp);
691 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
693 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
694 da2->checkAllocated();
695 int size=self->getNumberOfTuples();
696 if(size!=self->getNumberOfTuples())
698 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
700 return self->renumberR(da2->getConstPointer());
704 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
707 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
708 if (!SWIG_IsOK(res1))
711 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
712 if(size!=self->getNumberOfTuples())
714 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
716 return self->renumberAndReduce(tmp,newNbOfTuple);
720 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
722 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
723 da2->checkAllocated();
724 int size=self->getNumberOfTuples();
725 if(size!=self->getNumberOfTuples())
727 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
729 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
733 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
735 int thisTupleId,otherTupleId;
736 double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
737 PyObject *ret=PyTuple_New(3);
738 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
739 PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
740 PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
744 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
747 double r1=self->getMaxValue(tmp);
748 PyObject *ret=PyTuple_New(2);
749 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
750 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
754 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
757 double r1=self->getMaxValue2(tmp);
758 PyObject *ret=PyTuple_New(2);
759 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
760 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
764 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
767 double r1=self->getMinValue(tmp);
768 PyObject *ret=PyTuple_New(2);
769 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
770 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
774 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
777 double r1=self->getMinValue2(tmp);
778 PyObject *ret=PyTuple_New(2);
779 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
780 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
784 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
786 int nbOfCompo=self->getNumberOfComponents();
787 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
788 self->getMinMaxPerComponent(tmp);
789 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
793 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
795 int sz=self->getNumberOfComponents();
796 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
797 self->accumulate(tmp);
798 return convertDblArrToPyList(tmp,sz);
801 DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
804 std::vector<int> val2;
805 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
806 return self->accumulatePerChunck(bg,bg+sz);
809 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
811 DataArrayInt *comm, *commIndex;
812 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
813 PyObject *res = PyList_New(2);
814 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
815 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
819 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
823 DataArrayDoubleTuple *aa;
824 std::vector<double> bb;
826 int tupleId=-1,nbOfCompo=self->getNumberOfComponents();
827 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
829 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
830 PyObject *ret=PyTuple_New(2);
831 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
832 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
836 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
838 std::vector<int> tmp;
839 convertPyToNewIntArr3(li,tmp);
840 self->setSelectedComponents(a,tmp);
843 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
845 int sz=self->getNumberOfComponents();
846 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
847 self->getTuple(tupleId,tmp);
848 return convertDblArrToPyList(tmp,sz);
851 static DataArrayDouble *Aggregate(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::Aggregate(tmp);
858 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
860 std::vector<const DataArrayDouble *> tmp;
861 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
862 return DataArrayDouble::Meld(tmp);
865 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
869 DataArrayDoubleTuple *aa;
870 std::vector<double> bb;
872 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
873 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
874 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
875 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
876 DataArrayInt *c=0,*cI=0;
877 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
878 PyObject *ret=PyTuple_New(2);
879 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
880 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
884 PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const throw(INTERP_KERNEL::Exception)
886 DataArrayInt *ret1=0;
887 bool ret0=self->areIncludedInMe(other,prec,ret1);
888 PyObject *ret=PyTuple_New(2);
889 PyObject *ret0Py=ret0?Py_True:Py_False;
891 PyTuple_SetItem(ret,0,ret0Py);
892 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
896 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
898 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
899 const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
900 self->checkAllocated();
901 int nbOfTuples=self->getNumberOfTuples();
902 int nbOfComponents=self->getNumberOfComponents();
904 std::vector<int> vt1,vc1;
905 std::pair<int, std::pair<int,int> > pt1,pc1;
906 DataArrayInt *dt1=0,*dc1=0;
908 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
909 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
913 if(nbOfComponents==1)
914 return PyFloat_FromDouble(self->getIJSafe(it1,0));
915 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
917 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
919 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
921 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
923 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
926 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
927 std::vector<int> v2(1,ic1);
928 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
932 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
933 std::vector<int> v2(1,ic1);
934 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
938 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
939 std::vector<int> v2(1,ic1);
940 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
944 ret=self->selectByTupleIdSafe(&it1,&it1+1);
945 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
949 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
950 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
954 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
955 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
959 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
960 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
964 ret=self->selectByTupleIdSafe(&it1,&it1+1);
965 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
966 std::vector<int> v2(nbOfComp);
967 for(int i=0;i<nbOfComp;i++)
968 v2[i]=pc1.first+i*pc1.second.second;
969 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
973 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
974 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
975 std::vector<int> v2(nbOfComp);
976 for(int i=0;i<nbOfComp;i++)
977 v2[i]=pc1.first+i*pc1.second.second;
978 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
982 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
983 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
984 std::vector<int> v2(nbOfComp);
985 for(int i=0;i<nbOfComp;i++)
986 v2[i]=pc1.first+i*pc1.second.second;
987 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
991 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
992 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
993 std::vector<int> v2(nbOfComp);
994 for(int i=0;i<nbOfComp;i++)
995 v2[i]=pc1.first+i*pc1.second.second;
996 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
999 throw INTERP_KERNEL::Exception(msg);
1003 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
1005 self->checkAllocated();
1006 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
1007 int nbOfTuples=self->getNumberOfTuples();
1008 int nbOfComponents=self->getNumberOfComponents();
1011 std::vector<double> v1;
1012 DataArrayDouble *d1=0;
1013 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
1015 std::vector<int> vt1,vc1;
1016 std::pair<int, std::pair<int,int> > pt1,pc1;
1017 DataArrayInt *dt1=0,*dc1=0;
1018 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1019 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
1027 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
1030 tmp=DataArrayDouble::New();
1031 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1032 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
1035 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
1038 throw INTERP_KERNEL::Exception(msg);
1047 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1050 tmp=DataArrayDouble::New();
1051 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1052 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
1055 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1058 throw INTERP_KERNEL::Exception(msg);
1067 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1070 tmp=DataArrayDouble::New();
1071 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1072 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
1075 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1078 throw INTERP_KERNEL::Exception(msg);
1087 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1090 tmp=DataArrayDouble::New();
1091 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1092 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
1095 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1098 throw INTERP_KERNEL::Exception(msg);
1107 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
1110 tmp=DataArrayDouble::New();
1111 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1112 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
1115 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
1118 throw INTERP_KERNEL::Exception(msg);
1127 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1130 tmp=DataArrayDouble::New();
1131 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1132 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
1135 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1138 throw INTERP_KERNEL::Exception(msg);
1147 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1150 tmp=DataArrayDouble::New();
1151 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1152 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
1155 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1158 throw INTERP_KERNEL::Exception(msg);
1167 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1170 tmp=DataArrayDouble::New();
1171 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1172 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
1175 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1178 throw INTERP_KERNEL::Exception(msg);
1187 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1190 tmp=DataArrayDouble::New();
1191 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1192 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
1195 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1198 throw INTERP_KERNEL::Exception(msg);
1207 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1210 tmp=DataArrayDouble::New();
1211 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1212 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
1215 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1218 throw INTERP_KERNEL::Exception(msg);
1227 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1230 tmp=DataArrayDouble::New();
1231 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1232 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
1235 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1238 throw INTERP_KERNEL::Exception(msg);
1247 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1250 tmp=DataArrayDouble::New();
1251 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1252 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
1255 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1258 throw INTERP_KERNEL::Exception(msg);
1267 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1270 tmp=DataArrayDouble::New();
1271 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1272 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
1275 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1278 throw INTERP_KERNEL::Exception(msg);
1287 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1290 tmp=DataArrayDouble::New();
1291 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1292 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
1295 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1298 throw INTERP_KERNEL::Exception(msg);
1307 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1310 tmp=DataArrayDouble::New();
1311 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1312 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
1315 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1318 throw INTERP_KERNEL::Exception(msg);
1327 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1330 tmp=DataArrayDouble::New();
1331 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1332 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
1335 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1338 throw INTERP_KERNEL::Exception(msg);
1343 throw INTERP_KERNEL::Exception(msg);
1348 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
1350 return self->negate();
1353 PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1355 const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
1358 DataArrayDoubleTuple *aa;
1359 std::vector<double> bb;
1363 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1365 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1368 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1369 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1371 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1374 throw INTERP_KERNEL::Exception(msg);
1377 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1382 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1383 ret->applyLin(1.,val);
1384 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1388 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1392 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1393 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1397 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1398 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1401 throw INTERP_KERNEL::Exception(msg);
1405 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1407 const char msg[]="Unexpected situation in __radd__ !";
1410 DataArrayDoubleTuple *aa;
1411 std::vector<double> bb;
1413 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1418 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1419 ret->applyLin(1.,val);
1424 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1425 return DataArrayDouble::Add(self,aaa);
1429 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1430 return DataArrayDouble::Add(self,aaa);
1433 throw INTERP_KERNEL::Exception(msg);
1437 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1439 const char msg[]="Unexpected situation in __iadd__ !";
1442 DataArrayDoubleTuple *aa;
1443 std::vector<double> bb;
1445 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1450 self->applyLin(1.,val);
1451 Py_XINCREF(trueSelf);
1457 Py_XINCREF(trueSelf);
1462 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1463 self->addEqual(aaa);
1464 Py_XINCREF(trueSelf);
1469 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1470 self->addEqual(aaa);
1471 Py_XINCREF(trueSelf);
1475 throw INTERP_KERNEL::Exception(msg);
1479 PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1481 const char msg[]="Unexpected situation in __sub__ !";
1484 DataArrayDoubleTuple *aa;
1485 std::vector<double> bb;
1489 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1491 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1494 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1495 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1497 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1500 throw INTERP_KERNEL::Exception(msg);
1503 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1508 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1509 ret->applyLin(1.,-val);
1510 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1514 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1518 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1519 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1523 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1524 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1527 throw INTERP_KERNEL::Exception(msg);
1531 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1533 const char msg[]="Unexpected situation in __rsub__ !";
1536 DataArrayDoubleTuple *aa;
1537 std::vector<double> bb;
1539 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1544 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1545 ret->applyLin(-1.,val);
1550 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1551 return DataArrayDouble::Substract(aaa,self);
1555 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1556 return DataArrayDouble::Substract(aaa,self);
1559 throw INTERP_KERNEL::Exception(msg);
1563 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1565 const char msg[]="Unexpected situation in __isub__ !";
1568 DataArrayDoubleTuple *aa;
1569 std::vector<double> bb;
1571 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1576 self->applyLin(1,-val);
1577 Py_XINCREF(trueSelf);
1582 self->substractEqual(a);
1583 Py_XINCREF(trueSelf);
1588 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1589 self->substractEqual(aaa);
1590 Py_XINCREF(trueSelf);
1595 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1596 self->substractEqual(aaa);
1597 Py_XINCREF(trueSelf);
1601 throw INTERP_KERNEL::Exception(msg);
1605 PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1607 const char msg[]="Unexpected situation in __mul__ !";
1610 DataArrayDoubleTuple *aa;
1611 std::vector<double> bb;
1615 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1617 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1620 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1621 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1623 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1626 throw INTERP_KERNEL::Exception(msg);
1629 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1634 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1635 ret->applyLin(val,0.);
1636 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1640 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1644 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1645 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1649 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1650 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1653 throw INTERP_KERNEL::Exception(msg);
1657 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1659 const char msg[]="Unexpected situation in __rmul__ !";
1662 DataArrayDoubleTuple *aa;
1663 std::vector<double> bb;
1665 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1670 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1671 ret->applyLin(val,0.);
1676 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1677 return DataArrayDouble::Multiply(self,aaa);
1681 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1682 return DataArrayDouble::Multiply(self,aaa);
1685 throw INTERP_KERNEL::Exception(msg);
1689 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1691 const char msg[]="Unexpected situation in __imul__ !";
1694 DataArrayDoubleTuple *aa;
1695 std::vector<double> bb;
1697 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1702 self->applyLin(val,0.);
1703 Py_XINCREF(trueSelf);
1708 self->multiplyEqual(a);
1709 Py_XINCREF(trueSelf);
1714 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1715 self->multiplyEqual(aaa);
1716 Py_XINCREF(trueSelf);
1721 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1722 self->multiplyEqual(aaa);
1723 Py_XINCREF(trueSelf);
1727 throw INTERP_KERNEL::Exception(msg);
1731 PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1733 const char msg[]="Unexpected situation in __div__ !";
1736 DataArrayDoubleTuple *aa;
1737 std::vector<double> bb;
1741 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1743 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1746 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1747 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1749 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1752 throw INTERP_KERNEL::Exception(msg);
1755 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1761 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1762 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1763 ret->applyLin(1/val,0.);
1764 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1768 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1772 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1773 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1777 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1778 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1781 throw INTERP_KERNEL::Exception(msg);
1785 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1787 const char msg[]="Unexpected situation in __rdiv__ !";
1790 DataArrayDoubleTuple *aa;
1791 std::vector<double> bb;
1793 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1798 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1804 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1805 return DataArrayDouble::Divide(aaa,self);
1809 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1810 return DataArrayDouble::Divide(aaa,self);
1813 throw INTERP_KERNEL::Exception(msg);
1817 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1819 const char msg[]="Unexpected situation in __idiv__ !";
1822 DataArrayDoubleTuple *aa;
1823 std::vector<double> bb;
1825 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1831 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1832 self->applyLin(1./val,0.);
1833 Py_XINCREF(trueSelf);
1838 self->divideEqual(a);
1839 Py_XINCREF(trueSelf);
1844 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1845 self->divideEqual(aaa);
1846 Py_XINCREF(trueSelf);
1851 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1852 self->divideEqual(aaa);
1853 Py_XINCREF(trueSelf);
1857 throw INTERP_KERNEL::Exception(msg);
1861 DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1863 const char msg[]="Unexpected situation in __pow__ !";
1866 DataArrayDoubleTuple *aa;
1867 std::vector<double> bb;
1869 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1874 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1880 return DataArrayDouble::Pow(self,a);
1884 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1885 return DataArrayDouble::Pow(self,aaa);
1889 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1890 return DataArrayDouble::Pow(self,aaa);
1893 throw INTERP_KERNEL::Exception(msg);
1897 DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1899 const char msg[]="Unexpected situation in __rpow__ !";
1902 DataArrayDoubleTuple *aa;
1903 std::vector<double> bb;
1905 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1910 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1911 ret->applyRPow(val);
1916 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1917 return DataArrayDouble::Pow(aaa,self);
1921 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1922 return DataArrayDouble::Pow(aaa,self);
1925 throw INTERP_KERNEL::Exception(msg);
1929 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1931 const char msg[]="Unexpected situation in __ipow__ !";
1934 DataArrayDoubleTuple *aa;
1935 std::vector<double> bb;
1937 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1942 self->applyPow(val);
1943 Py_XINCREF(trueSelf);
1949 Py_XINCREF(trueSelf);
1954 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1955 self->powEqual(aaa);
1956 Py_XINCREF(trueSelf);
1961 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1962 self->powEqual(aaa);
1963 Py_XINCREF(trueSelf);
1967 throw INTERP_KERNEL::Exception(msg);
1971 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
1973 DataArrayInt *c=0,*cI=0;
1975 self->computeTupleIdsNearTuples(other,eps,c,cI);
1976 PyObject *ret=PyTuple_New(2);
1977 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1978 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1982 PyObject *maxPerTupleWithCompoId() const throw(INTERP_KERNEL::Exception)
1984 DataArrayInt *ret1=0;
1985 DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
1986 PyObject *ret=PyTuple_New(2);
1987 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1988 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1994 class DataArrayDoubleTuple;
1996 class DataArrayDoubleIterator
1999 DataArrayDoubleIterator(DataArrayDouble *da);
2000 ~DataArrayDoubleIterator();
2005 DataArrayDoubleTuple *ret=self->nextt();
2007 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2010 PyErr_SetString(PyExc_StopIteration,"No more data.");
2017 class DataArrayDoubleTuple
2020 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
2021 DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
2024 std::string __str__() const throw(INTERP_KERNEL::Exception)
2026 return self->repr();
2029 double __float__() const throw(INTERP_KERNEL::Exception)
2031 return self->doubleValue();
2034 DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
2036 return self->buildDADouble(1,self->getNumberOfCompo());
2039 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2041 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2042 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2043 Py_XINCREF(trueSelf);
2047 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2049 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2050 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2051 Py_XINCREF(trueSelf);
2055 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2057 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2058 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2059 Py_XINCREF(trueSelf);
2063 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2065 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2066 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2067 Py_XINCREF(trueSelf);
2071 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2073 const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2076 std::vector<int> multiVal;
2077 std::pair<int, std::pair<int,int> > slic;
2078 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2079 const double *pt=self->getConstPointer();
2080 int nbc=self->getNumberOfCompo();
2081 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2088 std::ostringstream oss;
2089 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2090 throw INTERP_KERNEL::Exception(oss.str().c_str());
2093 return PyFloat_FromDouble(pt[singleVal]);
2097 return PyFloat_FromDouble(pt[nbc+singleVal]);
2100 std::ostringstream oss;
2101 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2102 throw INTERP_KERNEL::Exception(oss.str().c_str());
2108 PyObject *t=PyTuple_New(multiVal.size());
2109 for(int j=0;j<(int)multiVal.size();j++)
2111 int cid=multiVal[j];
2114 std::ostringstream oss;
2115 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2116 throw INTERP_KERNEL::Exception(oss.str().c_str());
2118 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2124 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2125 PyObject *t=PyTuple_New(sz);
2126 for(int j=0;j<sz;j++)
2127 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2131 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2135 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2137 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2138 const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2141 std::vector<double> multiValV;
2142 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2143 int nbc=self->getNumberOfCompo();
2144 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2146 std::vector<int> multiVal;
2147 std::pair<int, std::pair<int,int> > slic;
2148 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2149 double *pt=self->getPointer();
2150 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2157 std::ostringstream oss;
2158 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2159 throw INTERP_KERNEL::Exception(oss.str().c_str());
2165 pt[singleVal]=singleValV;
2170 if(multiValV.size()!=1)
2172 std::ostringstream oss;
2173 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2174 throw INTERP_KERNEL::Exception(oss.str().c_str());
2176 pt[singleVal]=multiValV[0];
2181 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2185 throw INTERP_KERNEL::Exception(msg);
2194 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2198 std::ostringstream oss;
2199 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2200 throw INTERP_KERNEL::Exception(oss.str().c_str());
2208 if(multiVal.size()!=multiValV.size())
2210 std::ostringstream oss;
2211 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2212 throw INTERP_KERNEL::Exception(oss.str().c_str());
2214 for(int i=0;i<(int)multiVal.size();i++)
2216 int pos=multiVal[i];
2219 std::ostringstream oss;
2220 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2221 throw INTERP_KERNEL::Exception(oss.str().c_str());
2223 pt[multiVal[i]]=multiValV[i];
2229 const double *ptV=daIntTyyppV->getConstPointer();
2230 if(nbc>daIntTyyppV->getNumberOfCompo())
2232 std::ostringstream oss;
2233 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2234 throw INTERP_KERNEL::Exception(oss.str().c_str());
2236 std::copy(ptV,ptV+nbc,pt);
2240 throw INTERP_KERNEL::Exception(msg);
2245 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2250 for(int j=0;j<sz;j++)
2251 pt[slic.first+j*slic.second.second]=singleValV;
2256 if(sz!=(int)multiValV.size())
2258 std::ostringstream oss;
2259 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2260 throw INTERP_KERNEL::Exception(oss.str().c_str());
2262 for(int j=0;j<sz;j++)
2263 pt[slic.first+j*slic.second.second]=multiValV[j];
2268 const double *ptV=daIntTyyppV->getConstPointer();
2269 if(sz>daIntTyyppV->getNumberOfCompo())
2271 std::ostringstream oss;
2272 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2273 throw INTERP_KERNEL::Exception(oss.str().c_str());
2275 for(int j=0;j<sz;j++)
2276 pt[slic.first+j*slic.second.second]=ptV[j];
2280 throw INTERP_KERNEL::Exception(msg);
2284 throw INTERP_KERNEL::Exception(msg);
2290 class DataArrayIntIterator;
2292 class DataArrayInt : public DataArray
2295 static DataArrayInt *New();
2296 int intValue() const throw(INTERP_KERNEL::Exception);
2297 int getHashCode() const throw(INTERP_KERNEL::Exception);
2298 bool empty() const throw(INTERP_KERNEL::Exception);
2299 DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2300 void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2301 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2302 void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2303 int popBackSilent() throw(INTERP_KERNEL::Exception);
2304 void pack() const throw(INTERP_KERNEL::Exception);
2305 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2306 bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2307 bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2308 bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2309 DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2310 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2311 void reverse() throw(INTERP_KERNEL::Exception);
2312 void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2313 bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2314 void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2315 bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2316 void fillWithZero() throw(INTERP_KERNEL::Exception);
2317 void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2318 void iota(int init=0) throw(INTERP_KERNEL::Exception);
2319 std::string repr() const throw(INTERP_KERNEL::Exception);
2320 std::string reprZip() const throw(INTERP_KERNEL::Exception);
2321 DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2322 DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2323 DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2324 DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
2325 DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2326 DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2327 DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2328 DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2329 DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2330 bool isIdentity() const throw(INTERP_KERNEL::Exception);
2331 bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2332 DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2333 void transpose() throw(INTERP_KERNEL::Exception);
2334 DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2335 void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2336 void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2337 void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2338 void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2339 void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2340 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2341 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2342 int front() const throw(INTERP_KERNEL::Exception);
2343 int back() const throw(INTERP_KERNEL::Exception);
2344 void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2345 void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2346 int *getPointer() throw(INTERP_KERNEL::Exception);
2347 const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2348 DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2349 const int *begin() const throw(INTERP_KERNEL::Exception);
2350 const int *end() const throw(INTERP_KERNEL::Exception);
2351 DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2352 DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2353 int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2354 int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2355 int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2356 int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2357 int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2358 bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2359 bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2360 bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2361 int count(int value) const throw(INTERP_KERNEL::Exception);
2362 int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2363 int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2364 int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2365 int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2366 int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2367 void abs() throw(INTERP_KERNEL::Exception);
2368 void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2369 void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2370 void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2371 DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2372 void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2373 void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2374 void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2375 void applyPow(int val) throw(INTERP_KERNEL::Exception);
2376 void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2377 DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2378 bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2379 static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2380 static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2381 static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2382 static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2383 static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2384 static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2) throw(INTERP_KERNEL::Exception);
2385 DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2386 DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2387 DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2388 DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2389 DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2390 DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2391 DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2392 void computeOffsets() throw(INTERP_KERNEL::Exception);
2393 void computeOffsets2() throw(INTERP_KERNEL::Exception);
2394 DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2395 DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2396 DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2397 DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2398 DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2399 static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2400 void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2401 static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2402 void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2403 static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2404 void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2405 static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2406 void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2407 static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2408 void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2409 static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2410 void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2412 static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2415 DataArrayInt() throw(INTERP_KERNEL::Exception)
2417 return DataArrayInt::New();
2420 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2422 const char *msgBase="ParaMEDMEM::DataArrayInt::New : Available API are : \n-DataArrayInt.New()\n-DataArrayInt.New([1,3,4])\n-DataArrayInt.New([1,3,4],3)\n-DataArrayInt.New([1,3,4,5],2,2)\n-DataArrayInt.New([1,3,4,5,7,8],3,2)\n-DataArrayInt.New([(1,3),(4,5),(7,8)])\n-DataArrayInt.New(5)\n-DataArrayInt.New(5,2)";
2423 std::string msg(msgBase);
2425 msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2428 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2432 if(PyInt_Check(nbOfTuples))
2434 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2436 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2439 if(PyInt_Check(nbOfComp))
2440 {//DataArrayInt.New([1,3,4,5],2,2)
2441 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2443 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2444 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2445 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2446 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2450 throw INTERP_KERNEL::Exception(msg.c_str());
2453 {//DataArrayInt.New([1,3,4],3)
2454 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2456 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2457 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2462 throw INTERP_KERNEL::Exception(msg.c_str());
2465 {// DataArrayInt.New([1,3,4])
2466 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2467 int tmpp1=-1,tmpp2=-1;
2468 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2469 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2473 else if(PyInt_Check(elt0))
2475 int nbOfTuples1=PyInt_AS_LONG(elt0);
2477 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2482 if(PyInt_Check(nbOfTuples))
2483 {//DataArrayInt.New(5,2)
2484 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2486 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2487 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2488 ret->alloc(nbOfTuples1,nbOfCompo);
2492 throw INTERP_KERNEL::Exception(msg.c_str());
2495 throw INTERP_KERNEL::Exception(msg.c_str());
2498 {//DataArrayInt.New(5)
2499 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2500 ret->alloc(nbOfTuples1,1);
2505 else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2506 {//DataArrayInt.New(numpyArray)
2507 return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2511 throw INTERP_KERNEL::Exception(msg.c_str());
2514 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2516 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2519 std::string __str__() const throw(INTERP_KERNEL::Exception)
2521 return self->repr();
2524 int __len__() const throw(INTERP_KERNEL::Exception)
2526 if(self->isAllocated())
2528 return self->getNumberOfTuples();
2532 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2536 int __int__() const throw(INTERP_KERNEL::Exception)
2538 return self->intValue();
2541 DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2543 return self->iterator();
2546 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2548 int sz=self->getNumberOfComponents();
2549 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2550 self->accumulate(tmp);
2551 return convertIntArrToPyList(tmp,sz);
2554 DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2557 std::vector<int> val2;
2558 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2559 return self->accumulatePerChunck(bg,bg+sz);
2562 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2564 int newNbOfTuples=-1;
2565 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2566 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2567 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2568 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2569 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2570 PyObject *ret=PyTuple_New(2);
2571 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2572 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2576 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2578 const char *msg="ParaMEDMEM::DataArrayInt::setValues : Available API are : \n-DataArrayInt.setValues([1,3,4])\n-DataArrayInt.setValues([1,3,4],3)\n-DataArrayInt.setValues([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n !";
2579 if(PyList_Check(li) || PyTuple_Check(li))
2583 if(PyInt_Check(nbOfTuples))
2585 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2587 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2590 if(PyInt_Check(nbOfComp))
2591 {//DataArrayInt.setValues([1,3,4,5],2,2)
2592 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2594 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2595 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2596 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2599 throw INTERP_KERNEL::Exception(msg);
2602 {//DataArrayInt.setValues([1,3,4],3)
2604 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2605 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2609 throw INTERP_KERNEL::Exception(msg);
2612 {// DataArrayInt.setValues([1,3,4])
2613 int tmpp1=-1,tmpp2=-1;
2614 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2615 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2619 throw INTERP_KERNEL::Exception(msg);
2622 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2624 const int *vals=self->getConstPointer();
2625 return convertIntArrToPyList(vals,self->getNbOfElems());
2629 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2631 return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2635 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2638 bool ret0=self->isEqualIfNotWhy(other,ret1);
2639 PyObject *ret=PyTuple_New(2);
2640 PyObject *ret0Py=ret0?Py_True:Py_False;
2642 PyTuple_SetItem(ret,0,ret0Py);
2643 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2647 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2649 const int *vals=self->getConstPointer();
2650 int nbOfComp=self->getNumberOfComponents();
2651 int nbOfTuples=self->getNumberOfTuples();
2652 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2655 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2657 std::vector<const DataArrayInt *> groups;
2658 std::vector< std::vector<int> > fidsOfGroups;
2659 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2660 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2661 PyObject *ret = PyList_New(2);
2662 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2663 int sz=fidsOfGroups.size();
2664 PyObject *ret1 = PyList_New(sz);
2665 for(int i=0;i<sz;i++)
2666 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2667 PyList_SetItem(ret,1,ret1);
2671 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2674 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2675 if (!SWIG_IsOK(res1))
2678 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2679 self->transformWithIndArr(tmp,tmp+size);
2683 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2684 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2688 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2692 std::vector<int> multiVal;
2693 std::pair<int, std::pair<int,int> > slic;
2694 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2695 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2699 return self->getIdsEqualList(&singleVal,&singleVal+1);
2701 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2703 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2705 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2709 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2713 std::vector<int> multiVal;
2714 std::pair<int, std::pair<int,int> > slic;
2715 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2716 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2720 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2722 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2724 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2726 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2730 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2732 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2734 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2735 if (!SWIG_IsOK(res1))
2738 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2739 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2743 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2745 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2746 da2->checkAllocated();
2747 int size=self->getNumberOfTuples();
2748 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2750 PyObject *ret = PyList_New(3);
2751 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2752 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2753 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2757 DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2760 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2761 if (!SWIG_IsOK(res1))
2764 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2765 return self->transformWithIndArrR(tmp,tmp+size);
2769 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2770 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2774 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2777 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2778 if (!SWIG_IsOK(res1))
2781 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2782 if(size!=self->getNumberOfTuples())
2784 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2786 return self->renumberAndReduce(tmp,newNbOfTuple);
2790 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2792 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2793 da2->checkAllocated();
2794 int size=self->getNumberOfTuples();
2795 if(size!=self->getNumberOfTuples())
2797 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2799 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
2803 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
2806 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2807 if (!SWIG_IsOK(res1))
2810 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2811 if(size!=self->getNumberOfTuples())
2813 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2815 return self->renumber(tmp);
2819 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2821 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2822 da2->checkAllocated();
2823 int size=self->getNumberOfTuples();
2824 if(size!=self->getNumberOfTuples())
2826 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2828 return self->renumber(da2->getConstPointer());
2832 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
2835 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2836 if (!SWIG_IsOK(res1))
2839 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2840 if(size!=self->getNumberOfTuples())
2842 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2844 return self->renumberR(tmp);
2848 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2850 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2851 da2->checkAllocated();
2852 int size=self->getNumberOfTuples();
2853 if(size!=self->getNumberOfTuples())
2855 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2857 return self->renumberR(da2->getConstPointer());
2861 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
2863 std::vector<int> tmp;
2864 convertPyToNewIntArr3(li,tmp);
2865 self->setSelectedComponents(a,tmp);
2868 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
2870 int sz=self->getNumberOfComponents();
2871 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2872 self->getTuple(tupleId,tmp);
2873 return convertIntArrToPyList(tmp,sz);
2876 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
2878 DataArrayInt *arr=0;
2879 DataArrayInt *arrI=0;
2880 self->changeSurjectiveFormat(targetNb,arr,arrI);
2881 PyObject *res = PyList_New(2);
2882 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2883 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2887 static DataArrayInt *Meld(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::Meld(tmp);
2894 static DataArrayInt *Aggregate(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::Aggregate(tmp);
2901 static DataArrayInt *AggregateIndexes(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::AggregateIndexes(tmp);
2908 static DataArrayInt *BuildUnion(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::BuildUnion(tmp);
2915 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
2917 std::vector<const DataArrayInt *> tmp;
2918 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2919 return DataArrayInt::BuildIntersection(tmp);
2922 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
2925 int r1=self->getMaxValue(tmp);
2926 PyObject *ret=PyTuple_New(2);
2927 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2928 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2932 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
2935 int r1=self->getMinValue(tmp);
2936 PyObject *ret=PyTuple_New(2);
2937 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2938 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2942 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2944 int nbOfCompo=self->getNumberOfComponents();
2949 if(PyInt_Check(obj))
2951 int val=(int)PyInt_AS_LONG(obj);
2952 return self->locateValue(val);
2955 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
2959 std::vector<int> arr;
2960 convertPyToNewIntArr3(obj,arr);
2961 return self->locateTuple(arr);
2966 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2968 int nbOfCompo=self->getNumberOfComponents();
2975 if(PyInt_Check(obj))
2977 int val=(int)PyInt_AS_LONG(obj);
2978 return self->presenceOfValue(val);
2981 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
2985 std::vector<int> arr;
2986 convertPyToNewIntArr3(obj,arr);
2987 return self->presenceOfTuple(arr);
2992 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2994 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
2995 const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2996 self->checkAllocated();
2997 int nbOfTuples=self->getNumberOfTuples();
2998 int nbOfComponents=self->getNumberOfComponents();
3000 std::vector<int> vt1,vc1;
3001 std::pair<int, std::pair<int,int> > pt1,pc1;
3002 DataArrayInt *dt1=0,*dc1=0;
3004 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3005 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3010 if(nbOfComponents==1)
3011 return PyInt_FromLong(self->getIJSafe(it1,0));
3012 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3015 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3017 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3019 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3021 return PyInt_FromLong(self->getIJSafe(it1,ic1));
3024 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3025 std::vector<int> v2(1,ic1);
3026 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3030 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3031 std::vector<int> v2(1,ic1);
3032 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3036 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3037 std::vector<int> v2(1,ic1);
3038 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3042 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3043 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3047 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3048 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3052 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3053 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3057 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3058 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3062 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3063 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3064 std::vector<int> v2(nbOfComp);
3065 for(int i=0;i<nbOfComp;i++)
3066 v2[i]=pc1.first+i*pc1.second.second;
3067 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3071 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3072 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3073 std::vector<int> v2(nbOfComp);
3074 for(int i=0;i<nbOfComp;i++)
3075 v2[i]=pc1.first+i*pc1.second.second;
3076 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3080 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3081 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3082 std::vector<int> v2(nbOfComp);
3083 for(int i=0;i<nbOfComp;i++)
3084 v2[i]=pc1.first+i*pc1.second.second;
3085 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3089 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3090 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3091 std::vector<int> v2(nbOfComp);
3092 for(int i=0;i<nbOfComp;i++)
3093 v2[i]=pc1.first+i*pc1.second.second;
3094 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3097 throw INTERP_KERNEL::Exception(msg);
3101 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3103 self->checkAllocated();
3104 const char msg[]="Unexpected situation in __setitem__ !";
3105 int nbOfTuples=self->getNumberOfTuples();
3106 int nbOfComponents=self->getNumberOfComponents();
3109 std::vector<int> v1;
3111 DataArrayIntTuple *dd1=0;
3112 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3114 std::vector<int> vt1,vc1;
3115 std::pair<int, std::pair<int,int> > pt1,pc1;
3116 DataArrayInt *dt1=0,*dc1=0;
3117 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3118 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3126 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3129 tmp=DataArrayInt::New();
3130 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3131 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3134 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3137 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3138 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3141 throw INTERP_KERNEL::Exception(msg);
3150 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3153 tmp=DataArrayInt::New();
3154 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3155 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3158 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3161 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3162 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3165 throw INTERP_KERNEL::Exception(msg);
3174 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3177 tmp=DataArrayInt::New();
3178 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3179 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3182 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3185 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3186 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3189 throw INTERP_KERNEL::Exception(msg);
3198 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3201 tmp=DataArrayInt::New();
3202 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3203 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3206 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3209 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3210 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3213 throw INTERP_KERNEL::Exception(msg);
3222 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3225 tmp=DataArrayInt::New();
3226 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3227 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3230 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3233 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3234 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3237 throw INTERP_KERNEL::Exception(msg);
3246 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3249 tmp=DataArrayInt::New();
3250 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3251 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3254 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3257 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3258 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3261 throw INTERP_KERNEL::Exception(msg);
3270 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3273 tmp=DataArrayInt::New();
3274 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3275 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3278 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3281 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3282 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3285 throw INTERP_KERNEL::Exception(msg);
3294 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3297 tmp=DataArrayInt::New();
3298 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3299 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3302 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3305 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3306 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3309 throw INTERP_KERNEL::Exception(msg);
3318 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3321 tmp=DataArrayInt::New();
3322 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3323 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3326 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3329 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3330 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3333 throw INTERP_KERNEL::Exception(msg);
3342 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3345 tmp=DataArrayInt::New();
3346 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3347 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3350 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3353 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3354 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3357 throw INTERP_KERNEL::Exception(msg);
3366 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3369 tmp=DataArrayInt::New();
3370 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3371 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3374 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3377 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3378 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3381 throw INTERP_KERNEL::Exception(msg);
3390 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3393 tmp=DataArrayInt::New();
3394 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3395 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3398 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3401 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3402 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3405 throw INTERP_KERNEL::Exception(msg);
3414 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3417 tmp=DataArrayInt::New();
3418 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3419 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3422 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3425 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3426 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3429 throw INTERP_KERNEL::Exception(msg);
3438 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3441 tmp=DataArrayInt::New();
3442 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3443 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3446 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3449 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3450 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3453 throw INTERP_KERNEL::Exception(msg);
3462 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3465 tmp=DataArrayInt::New();
3466 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3467 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3470 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3473 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3474 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3477 throw INTERP_KERNEL::Exception(msg);
3486 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3489 tmp=DataArrayInt::New();
3490 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3491 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3494 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3497 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3498 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3501 throw INTERP_KERNEL::Exception(msg);
3506 throw INTERP_KERNEL::Exception(msg);
3511 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3513 return self->negate();
3516 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3518 const char msg[]="Unexpected situation in __add__ !";
3521 std::vector<int> aa;
3522 DataArrayIntTuple *aaa;
3524 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3529 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3530 ret->applyLin(1,val);
3535 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3536 return DataArrayInt::Add(self,aaaa);
3540 return DataArrayInt::Add(self,a);
3544 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3545 return DataArrayInt::Add(self,aaaa);
3548 throw INTERP_KERNEL::Exception(msg);
3552 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3554 const char msg[]="Unexpected situation in __radd__ !";
3557 std::vector<int> aa;
3558 DataArrayIntTuple *aaa;
3560 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3565 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3566 ret->applyLin(1,val);
3571 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3572 return DataArrayInt::Add(self,aaaa);
3576 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3577 return DataArrayInt::Add(self,aaaa);
3580 throw INTERP_KERNEL::Exception(msg);
3584 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3586 const char msg[]="Unexpected situation in __iadd__ !";
3589 std::vector<int> aa;
3590 DataArrayIntTuple *aaa;
3592 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3597 self->applyLin(1,val);
3598 Py_XINCREF(trueSelf);
3603 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3605 Py_XINCREF(trueSelf);
3611 Py_XINCREF(trueSelf);
3616 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3617 self->addEqual(aaaa);
3618 Py_XINCREF(trueSelf);
3622 throw INTERP_KERNEL::Exception(msg);
3626 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3628 const char msg[]="Unexpected situation in __sub__ !";
3631 std::vector<int> aa;
3632 DataArrayIntTuple *aaa;
3634 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3639 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3640 ret->applyLin(1,-val);
3645 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3646 return DataArrayInt::Substract(self,aaaa);
3650 return DataArrayInt::Substract(self,a);
3654 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3655 return DataArrayInt::Substract(self,aaaa);
3658 throw INTERP_KERNEL::Exception(msg);
3662 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3664 const char msg[]="Unexpected situation in __rsub__ !";
3667 std::vector<int> aa;
3668 DataArrayIntTuple *aaa;
3670 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3675 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3676 ret->applyLin(-1,val);
3681 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3682 return DataArrayInt::Substract(aaaa,self);
3686 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3687 return DataArrayInt::Substract(aaaa,self);
3690 throw INTERP_KERNEL::Exception(msg);
3694 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3696 const char msg[]="Unexpected situation in __isub__ !";
3699 std::vector<int> aa;
3700 DataArrayIntTuple *aaa;
3702 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3707 self->applyLin(1,-val);
3708 Py_XINCREF(trueSelf);
3713 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3714 self->substractEqual(bb);
3715 Py_XINCREF(trueSelf);
3720 self->substractEqual(a);
3721 Py_XINCREF(trueSelf);
3726 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3727 self->substractEqual(aaaa);
3728 Py_XINCREF(trueSelf);
3732 throw INTERP_KERNEL::Exception(msg);
3736 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3738 const char msg[]="Unexpected situation in __mul__ !";
3741 std::vector<int> aa;
3742 DataArrayIntTuple *aaa;
3744 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3749 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3750 ret->applyLin(val,0);
3755 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3756 return DataArrayInt::Multiply(self,aaaa);
3760 return DataArrayInt::Multiply(self,a);
3764 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3765 return DataArrayInt::Multiply(self,aaaa);
3768 throw INTERP_KERNEL::Exception(msg);
3772 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3774 const char msg[]="Unexpected situation in __rmul__ !";
3777 std::vector<int> aa;
3778 DataArrayIntTuple *aaa;
3780 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3785 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3786 ret->applyLin(val,0);
3791 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3792 return DataArrayInt::Multiply(self,aaaa);
3796 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3797 return DataArrayInt::Multiply(self,aaaa);
3800 throw INTERP_KERNEL::Exception(msg);
3804 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3806 const char msg[]="Unexpected situation in __imul__ !";
3809 std::vector<int> aa;
3810 DataArrayIntTuple *aaa;
3812 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3817 self->applyLin(val,0);
3818 Py_XINCREF(trueSelf);
3823 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3824 self->multiplyEqual(bb);
3825 Py_XINCREF(trueSelf);
3830 self->multiplyEqual(a);
3831 Py_XINCREF(trueSelf);
3836 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3837 self->multiplyEqual(aaaa);
3838 Py_XINCREF(trueSelf);
3842 throw INTERP_KERNEL::Exception(msg);
3846 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3848 const char msg[]="Unexpected situation in __div__ !";
3851 std::vector<int> aa;
3852 DataArrayIntTuple *aaa;
3854 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3859 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3860 ret->applyDivideBy(val);
3865 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3866 return DataArrayInt::Divide(self,aaaa);
3870 return DataArrayInt::Divide(self,a);
3874 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3875 return DataArrayInt::Divide(self,aaaa);
3878 throw INTERP_KERNEL::Exception(msg);
3882 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3884 const char msg[]="Unexpected situation in __rdiv__ !";
3887 std::vector<int> aa;
3888 DataArrayIntTuple *aaa;
3890 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3895 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3901 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3902 return DataArrayInt::Divide(aaaa,self);
3906 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3907 return DataArrayInt::Divide(aaaa,self);
3910 throw INTERP_KERNEL::Exception(msg);
3914 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3916 const char msg[]="Unexpected situation in __idiv__ !";
3919 std::vector<int> aa;
3920 DataArrayIntTuple *aaa;
3922 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3927 self->applyDivideBy(val);
3928 Py_XINCREF(trueSelf);
3933 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3934 self->divideEqual(bb);
3935 Py_XINCREF(trueSelf);
3940 self->divideEqual(a);
3941 Py_XINCREF(trueSelf);
3946 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3947 self->divideEqual(aaaa);
3948 Py_XINCREF(trueSelf);
3952 throw INTERP_KERNEL::Exception(msg);
3956 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3958 const char msg[]="Unexpected situation in __mod__ !";
3961 std::vector<int> aa;
3962 DataArrayIntTuple *aaa;
3964 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3969 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3970 ret->applyModulus(val);
3975 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3976 return DataArrayInt::Modulus(self,aaaa);
3980 return DataArrayInt::Modulus(self,a);
3984 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3985 return DataArrayInt::Modulus(self,aaaa);
3988 throw INTERP_KERNEL::Exception(msg);
3992 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3994 const char msg[]="Unexpected situation in __rmod__ !";
3997 std::vector<int> aa;
3998 DataArrayIntTuple *aaa;
4000 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4005 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4006 ret->applyRModulus(val);
4011 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4012 return DataArrayInt::Modulus(aaaa,self);
4016 return DataArrayInt::Modulus(a,self);
4020 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4021 return DataArrayInt::Modulus(aaaa,self);
4024 throw INTERP_KERNEL::Exception(msg);
4028 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4030 const char msg[]="Unexpected situation in __imod__ !";
4033 std::vector<int> aa;
4034 DataArrayIntTuple *aaa;
4036 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4041 self->applyModulus(val);
4042 Py_XINCREF(trueSelf);
4047 self->modulusEqual(a);
4048 Py_XINCREF(trueSelf);
4053 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4054 self->modulusEqual(aaaa);
4055 Py_XINCREF(trueSelf);
4059 throw INTERP_KERNEL::Exception(msg);
4063 DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4065 const char msg[]="Unexpected situation in __pow__ !";
4068 std::vector<int> aa;
4069 DataArrayIntTuple *aaa;
4071 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4076 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4082 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4083 return DataArrayInt::Pow(self,aaaa);
4087 return DataArrayInt::Pow(self,a);
4091 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4092 return DataArrayInt::Pow(self,aaaa);
4095 throw INTERP_KERNEL::Exception(msg);
4099 DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4101 const char msg[]="Unexpected situation in __rpow__ !";
4104 std::vector<int> aa;
4105 DataArrayIntTuple *aaa;
4107 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4112 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4113 ret->applyRPow(val);
4118 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4119 return DataArrayInt::Pow(aaaa,self);
4123 return DataArrayInt::Pow(a,self);
4127 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4128 return DataArrayInt::Pow(aaaa,self);
4131 throw INTERP_KERNEL::Exception(msg);
4135 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4137 const char msg[]="Unexpected situation in __ipow__ !";
4140 std::vector<int> aa;
4141 DataArrayIntTuple *aaa;
4143 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4148 self->applyPow(val);
4149 Py_XINCREF(trueSelf);
4155 Py_XINCREF(trueSelf);
4160 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4161 self->powEqual(aaaa);
4162 Py_XINCREF(trueSelf);
4166 throw INTERP_KERNEL::Exception(msg);
4170 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4172 std::ostringstream oss;
4173 self->reprQuickOverview(oss);
4177 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4179 int szArr,sw,iTypppArr;
4180 std::vector<int> stdvecTyyppArr;
4181 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4182 self->pushBackValsSilent(tmp,tmp+szArr);
4185 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4187 std::vector<int> ret1;
4188 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4189 std::size_t sz=ret0.size();
4190 PyObject *pyRet=PyTuple_New(2);
4191 PyObject *pyRet0=PyList_New((int)sz);
4192 PyObject *pyRet1=PyList_New((int)sz);
4193 for(std::size_t i=0;i<sz;i++)
4195 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4196 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4198 PyTuple_SetItem(pyRet,0,pyRet0);
4199 PyTuple_SetItem(pyRet,1,pyRet1);
4203 PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4205 DataArrayInt *ret0=0,*ret1=0;
4206 self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4207 PyObject *pyRet=PyTuple_New(2);
4208 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4209 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4215 class DataArrayIntTuple;
4217 class DataArrayIntIterator
4220 DataArrayIntIterator(DataArrayInt *da);
4221 ~DataArrayIntIterator();
4226 DataArrayIntTuple *ret=self->nextt();
4228 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4231 PyErr_SetString(PyExc_StopIteration,"No more data.");
4238 class DataArrayIntTuple
4241 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4242 DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4245 std::string __str__() const throw(INTERP_KERNEL::Exception)
4247 return self->repr();
4250 int __int__() const throw(INTERP_KERNEL::Exception)
4252 return self->intValue();
4255 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4257 return self->buildDAInt(1,self->getNumberOfCompo());
4260 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4262 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4263 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4264 Py_XINCREF(trueSelf);
4268 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4270 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4271 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4272 Py_XINCREF(trueSelf);
4276 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4278 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4279 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4280 Py_XINCREF(trueSelf);
4284 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4286 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4287 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4288 Py_XINCREF(trueSelf);
4292 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4294 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4295 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4296 Py_XINCREF(trueSelf);
4300 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4302 const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4305 std::vector<int> multiVal;
4306 std::pair<int, std::pair<int,int> > slic;
4307 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4308 const int *pt=self->getConstPointer();
4309 int nbc=self->getNumberOfCompo();
4310 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4317 std::ostringstream oss;
4318 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4319 throw INTERP_KERNEL::Exception(oss.str().c_str());
4322 return PyInt_FromLong(pt[singleVal]);
4326 return PyInt_FromLong(pt[nbc+singleVal]);
4329 std::ostringstream oss;
4330 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4331 throw INTERP_KERNEL::Exception(oss.str().c_str());
4337 PyObject *t=PyTuple_New(multiVal.size());
4338 for(int j=0;j<(int)multiVal.size();j++)
4340 int cid=multiVal[j];
4343 std::ostringstream oss;
4344 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4345 throw INTERP_KERNEL::Exception(oss.str().c_str());
4347 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4353 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4354 PyObject *t=PyTuple_New(sz);
4355 for(int j=0;j<sz;j++)
4356 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4360 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4364 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4366 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4367 const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4370 std::vector<int> multiValV;
4371 std::pair<int, std::pair<int,int> > slicV;
4372 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4373 int nbc=self->getNumberOfCompo();
4374 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4376 std::vector<int> multiVal;
4377 std::pair<int, std::pair<int,int> > slic;
4378 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4379 int *pt=self->getPointer();
4380 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4387 std::ostringstream oss;
4388 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4389 throw INTERP_KERNEL::Exception(oss.str().c_str());
4395 pt[singleVal]=singleValV;
4400 if(multiValV.size()!=1)
4402 std::ostringstream oss;
4403 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4404 throw INTERP_KERNEL::Exception(oss.str().c_str());
4406 pt[singleVal]=multiValV[0];
4411 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4415 throw INTERP_KERNEL::Exception(msg);
4424 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4428 std::ostringstream oss;
4429 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4430 throw INTERP_KERNEL::Exception(oss.str().c_str());
4438 if(multiVal.size()!=multiValV.size())
4440 std::ostringstream oss;
4441 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4442 throw INTERP_KERNEL::Exception(oss.str().c_str());
4444 for(int i=0;i<(int)multiVal.size();i++)
4446 int pos=multiVal[i];
4449 std::ostringstream oss;
4450 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4451 throw INTERP_KERNEL::Exception(oss.str().c_str());
4453 pt[multiVal[i]]=multiValV[i];
4459 const int *ptV=daIntTyyppV->getConstPointer();
4460 if(nbc>daIntTyyppV->getNumberOfCompo())
4462 std::ostringstream oss;
4463 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4464 throw INTERP_KERNEL::Exception(oss.str().c_str());
4466 std::copy(ptV,ptV+nbc,pt);
4470 throw INTERP_KERNEL::Exception(msg);
4475 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4480 for(int j=0;j<sz;j++)
4481 pt[slic.first+j*slic.second.second]=singleValV;
4486 if(sz!=(int)multiValV.size())
4488 std::ostringstream oss;
4489 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4490 throw INTERP_KERNEL::Exception(oss.str().c_str());
4492 for(int j=0;j<sz;j++)
4493 pt[slic.first+j*slic.second.second]=multiValV[j];
4498 const int *ptV=daIntTyyppV->getConstPointer();
4499 if(sz>daIntTyyppV->getNumberOfCompo())
4501 std::ostringstream oss;
4502 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4503 throw INTERP_KERNEL::Exception(oss.str().c_str());
4505 for(int j=0;j<sz;j++)
4506 pt[slic.first+j*slic.second.second]=ptV[j];
4510 throw INTERP_KERNEL::Exception(msg);
4514 throw INTERP_KERNEL::Exception(msg);
4520 class DataArrayChar : public DataArray
4523 virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4524 int getHashCode() const throw(INTERP_KERNEL::Exception);
4525 bool empty() const throw(INTERP_KERNEL::Exception);
4526 void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4527 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4528 void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4529 void pushBackValsSilent(const char *valsBg, const char *valsEnd) throw(INTERP_KERNEL::Exception);
4530 char popBackSilent() throw(INTERP_KERNEL::Exception);
4531 void pack() const throw(INTERP_KERNEL::Exception);
4532 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4533 bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4534 bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4535 void reverse() throw(INTERP_KERNEL::Exception);
4536 void fillWithZero() throw(INTERP_KERNEL::Exception);
4537 void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4538 std::string repr() const throw(INTERP_KERNEL::Exception);
4539 std::string reprZip() const throw(INTERP_KERNEL::Exception);
4540 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4541 DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4542 DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4543 DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4544 bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4545 DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4546 DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4547 void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4548 void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4549 char front() const throw(INTERP_KERNEL::Exception);
4550 char back() const throw(INTERP_KERNEL::Exception);
4551 void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4552 void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4553 char *getPointer() throw(INTERP_KERNEL::Exception);
4554 DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4555 DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4556 int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4557 bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4558 char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4559 char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4560 char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4561 char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4562 DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4563 static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4564 static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4567 int __len__() const throw(INTERP_KERNEL::Exception)
4569 if(self->isAllocated())
4571 return self->getNumberOfTuples();
4575 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4579 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4582 bool ret0=self->isEqualIfNotWhy(other,ret1);
4583 PyObject *ret=PyTuple_New(2);
4584 PyObject *ret0Py=ret0?Py_True:Py_False;
4586 PyTuple_SetItem(ret,0,ret0Py);
4587 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4591 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4594 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4595 if (!SWIG_IsOK(res1))
4598 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4599 if(size!=self->getNumberOfTuples())
4601 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4603 return self->renumber(tmp);
4607 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4609 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4610 da2->checkAllocated();
4611 int size=self->getNumberOfTuples();
4612 if(size!=self->getNumberOfTuples())
4614 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4616 return self->renumber(da2->getConstPointer());
4620 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4623 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4624 if (!SWIG_IsOK(res1))
4627 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4628 if(size!=self->getNumberOfTuples())
4630 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4632 return self->renumberR(tmp);
4636 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4638 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4639 da2->checkAllocated();
4640 int size=self->getNumberOfTuples();
4641 if(size!=self->getNumberOfTuples())
4643 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4645 return self->renumberR(da2->getConstPointer());
4649 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4652 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4653 if (!SWIG_IsOK(res1))
4656 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4657 if(size!=self->getNumberOfTuples())
4659 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4661 return self->renumberAndReduce(tmp,newNbOfTuple);
4665 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4667 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4668 da2->checkAllocated();
4669 int size=self->getNumberOfTuples();
4670 if(size!=self->getNumberOfTuples())
4672 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4674 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4678 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4680 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4681 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4682 return DataArrayChar::Aggregate(tmp);
4685 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4687 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4688 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4689 return DataArrayChar::Meld(tmp);
4694 class DataArrayByteIterator;
4696 class DataArrayByte : public DataArrayChar
4699 static DataArrayByte *New();
4700 DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4701 DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4702 char byteValue() const throw(INTERP_KERNEL::Exception);
4705 DataArrayByte() throw(INTERP_KERNEL::Exception)
4707 return DataArrayByte::New();
4710 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4712 const char *msg="ParaMEDMEM::DataArrayByte::New : Available API are : \n-DataArrayByte.New()\n--DataArrayByte.New([1,3,4])\n-DataArrayByte.New([1,3,4],3)\n-DataArrayByte.New([1,3,4,5],2,2)\n-DataArrayByte.New(5)\n-DataArrayByte.New(5,2) !";
4713 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4717 if(PyInt_Check(nbOfTuples))
4719 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4721 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4724 if(PyInt_Check(nbOfComp))
4725 {//DataArrayByte.New([1,3,4,5],2,2)
4726 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4728 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4729 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4730 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4731 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4735 throw INTERP_KERNEL::Exception(msg);
4738 {//DataArrayByte.New([1,3,4],3)
4739 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4741 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4742 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4747 throw INTERP_KERNEL::Exception(msg);
4750 {// DataArrayByte.New([1,3,4])
4751 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4752 int tmpp1=-1,tmpp2=-1;
4753 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4754 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4758 else if(PyInt_Check(elt0))
4760 int nbOfTuples1=PyInt_AS_LONG(elt0);
4762 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4767 if(PyInt_Check(nbOfTuples))
4768 {//DataArrayByte.New(5,2)
4769 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4771 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4772 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4773 ret->alloc(nbOfTuples1,nbOfCompo);
4777 throw INTERP_KERNEL::Exception(msg);
4780 throw INTERP_KERNEL::Exception(msg);
4783 {//DataArrayByte.New(5)
4784 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4785 ret->alloc(nbOfTuples1,1);
4790 throw INTERP_KERNEL::Exception(msg);
4793 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4795 return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4798 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4800 std::ostringstream oss;
4801 self->reprQuickOverview(oss);
4805 int __int__() const throw(INTERP_KERNEL::Exception)
4807 return (int) self->byteValue();
4810 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
4812 return self->iterator();
4815 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4817 return (int)self->getIJ(tupleId,compoId);
4820 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4822 return (int)self->getIJSafe(tupleId,compoId);
4825 std::string __str__() const throw(INTERP_KERNEL::Exception)
4827 return self->repr();
4830 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
4832 const char *vals=self->getConstPointer();
4833 int nbOfComp=self->getNumberOfComponents();
4834 int nbOfTuples=self->getNumberOfTuples();
4835 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4838 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4841 int ival=-1; std::vector<int> ivval;
4842 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4843 std::vector<char> vals(sz);
4844 std::copy(pt,pt+sz,vals.begin());
4845 return self->presenceOfTuple(vals);
4848 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4851 int ival=-1; std::vector<int> ivval;
4852 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4853 std::vector<char> vals2(sz);
4854 std::copy(pt,pt+sz,vals2.begin());
4855 return self->presenceOfValue(vals2);
4858 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4861 int ival=-1; std::vector<int> ivval;
4862 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4863 std::vector<char> vals2(sz);
4864 std::copy(pt,pt+sz,vals2.begin());
4865 return self->locateValue(vals2);
4868 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4871 int ival=-1; std::vector<int> ivval;
4872 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4873 std::vector<char> vals(sz);
4874 std::copy(pt,pt+sz,vals.begin());
4875 return self->locateTuple(vals);
4878 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
4881 int ival=-1; std::vector<int> ivval;
4882 const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
4883 std::vector<char> vals(sz);
4884 std::copy(pt,pt+sz,vals.begin());
4885 return self->search(vals);
4888 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
4890 int sz=self->getNumberOfComponents();
4891 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
4892 self->getTuple(tupleId,tmp);
4893 PyObject *ret=PyTuple_New(sz);
4894 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
4898 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
4901 int r1=(int)self->getMaxValue(tmp);
4902 PyObject *ret=PyTuple_New(2);
4903 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4904 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4908 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
4911 int r1=(int)self->getMinValue(tmp);
4912 PyObject *ret=PyTuple_New(2);
4913 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4914 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4918 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4920 int nbOfCompo=self->getNumberOfComponents();
4925 if(PyInt_Check(obj))
4927 int val=(int)PyInt_AS_LONG(obj);
4928 return self->locateValue(val);
4931 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
4934 return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
4938 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4940 int nbOfCompo=self->getNumberOfComponents();
4947 if(PyInt_Check(obj))
4949 int val=(int)PyInt_AS_LONG(obj);
4950 return self->presenceOfValue(val);
4953 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
4956 return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
4962 class DataArrayByteTuple;
4964 class DataArrayByteIterator
4967 DataArrayByteIterator(DataArrayByte *da);
4968 ~DataArrayByteIterator();
4971 class DataArrayByteTuple
4974 std::string repr() const throw(INTERP_KERNEL::Exception);
4975 DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4978 std::string __str__() const throw(INTERP_KERNEL::Exception)
4980 return self->repr();
4983 char __int__() const throw(INTERP_KERNEL::Exception)
4985 return self->byteValue();
4988 DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
4990 return self->buildDAByte(1,self->getNumberOfCompo());
4995 class DataArrayAsciiCharIterator;
4997 class DataArrayAsciiChar : public DataArrayChar
5000 static DataArrayAsciiChar *New();
5001 DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5002 DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5003 char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5006 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5008 return DataArrayAsciiChar::New();
5011 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5013 const char *msg="ParaMEDMEM::DataArrayAsciiChar::New : Available API are : \n-DataArrayAsciiChar.New()\n-DataArrayAsciiChar.New([1,3,4])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"],\"t\")\n-DataArrayAsciiChar.New([1,3,4],3)\n-DataArrayAsciiChar.New([1,3,4,5],2,2)\n-DataArrayAsciiChar.New(5)\n-DataArrayAsciiChar.New(5,2) !";
5014 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5018 if(PyInt_Check(nbOfTuples))
5020 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5022 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5025 if(PyInt_Check(nbOfComp))
5026 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5027 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5029 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5030 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5031 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5032 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5036 throw INTERP_KERNEL::Exception(msg);
5039 {//DataArrayAsciiChar.New([1,3,4],3)
5040 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5042 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5043 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5047 else if(PyString_Check(nbOfTuples))
5049 if(PyString_Size(nbOfTuples)!=1)
5050 throw INTERP_KERNEL::Exception(msg);
5051 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5052 std::vector<std::string> tmp;
5053 if(fillStringVector(elt0,tmp))
5054 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5056 throw INTERP_KERNEL::Exception(msg);
5059 throw INTERP_KERNEL::Exception(msg);
5063 std::vector<std::string> tmmp;
5064 if(fillStringVector(elt0,tmmp))
5065 //DataArrayAsciiChar.New(["abc","de","fghi"])
5066 return DataArrayAsciiChar::New(tmmp,' ');
5069 // DataArrayAsciiChar.New([1,3,4])
5070 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5071 int tmpp1=-1,tmpp2=-1;
5072 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5073 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5078 else if(PyInt_Check(elt0))
5080 int nbOfTuples1=PyInt_AS_LONG(elt0);
5082 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5087 if(PyInt_Check(nbOfTuples))
5088 {//DataArrayAsciiChar.New(5,2)
5089 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5091 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5092 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5093 ret->alloc(nbOfTuples1,nbOfCompo);
5097 throw INTERP_KERNEL::Exception(msg);
5100 throw INTERP_KERNEL::Exception(msg);
5103 {//DataArrayAsciiChar.New(5)
5104 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5105 ret->alloc(nbOfTuples1,1);
5110 throw INTERP_KERNEL::Exception(msg);
5113 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5115 return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5118 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5120 std::ostringstream oss;
5121 self->reprQuickOverview(oss);
5125 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5127 return self->iterator();
5130 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5132 char tmp[2]; tmp[1]='\0';
5133 tmp[0]=self->getIJ(tupleId,compoId);
5134 return std::string(tmp);
5137 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5139 char tmp[2]; tmp[1]='\0';
5140 tmp[0]=self->getIJSafe(tupleId,compoId);
5141 return std::string(tmp);
5144 std::string __str__() const throw(INTERP_KERNEL::Exception)
5146 return self->repr();
5149 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5151 const char *vals=self->getConstPointer();
5152 int nbOfComp=self->getNumberOfComponents();
5153 int nbOfTuples=self->getNumberOfTuples();
5154 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5157 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5159 if(PyString_Check(tupl))
5161 Py_ssize_t sz=PyString_Size(tupl);
5162 std::vector<char> vals(sz);
5163 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5164 return self->presenceOfTuple(vals);
5167 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5170 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5172 if(PyString_Check(vals))
5174 Py_ssize_t sz=PyString_Size(vals);
5175 std::vector<char> vals2(sz);
5176 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5177 return self->presenceOfValue(vals2);
5180 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5183 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5185 if(PyString_Check(vals))
5187 Py_ssize_t sz=PyString_Size(vals);
5188 std::vector<char> vals2(sz);
5189 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5190 return self->locateValue(vals2);
5193 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5196 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5198 if(PyString_Check(tupl))
5200 Py_ssize_t sz=PyString_Size(tupl);
5201 std::vector<char> vals(sz);
5202 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5203 return self->locateTuple(vals);
5206 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5209 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5211 if(PyString_Check(strOrListOfInt))
5213 Py_ssize_t sz=PyString_Size(strOrListOfInt);
5214 std::vector<char> vals(sz);
5215 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5216 return self->search(vals);
5219 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5222 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5224 int sz=self->getNumberOfComponents();
5225 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5226 self->getTuple(tupleId,tmp);
5227 return PyString_FromString(tmp);
5230 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5233 char tmp2[2]; tmp2[1]='\0';
5234 tmp2[0]=self->getMaxValue(tmp);
5235 PyObject *ret=PyTuple_New(2);
5236 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5237 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5241 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5244 char tmp2[2]; tmp2[1]='\0';
5245 tmp2[0]=self->getMinValue(tmp);
5246 PyObject *ret=PyTuple_New(2);
5247 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5248 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5252 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5254 int nbOfCompo=self->getNumberOfComponents();
5259 if(PyString_Check(obj))
5261 Py_ssize_t sz=PyString_Size(obj);
5262 char *pt=PyString_AsString(obj);
5264 return self->locateValue(pt[0]);
5266 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5269 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5272 return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5276 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5278 int nbOfCompo=self->getNumberOfComponents();
5285 if(PyString_Check(obj))
5287 Py_ssize_t sz=PyString_Size(obj);
5288 char *pt=PyString_AsString(obj);
5290 return self->presenceOfValue(pt[0]);
5292 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5295 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5298 return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5302 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5305 std::vector<int> stdvecTyyppArr;
5306 std::pair<int, std::pair<int,int> > sTyyppArr;
5307 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5308 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5312 return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5314 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5316 return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5318 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5320 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5324 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5326 static const char msg[]="DataArrayAsciiChar::__setitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input, and 4 types accepted in value : string, list or tuple of strings having same size, not null DataArrayChar instance.";
5328 std::vector<int> stdvecTyyppArr;
5329 std::pair<int, std::pair<int,int> > sTyyppArr;
5330 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5331 int nbOfCompo=self->getNumberOfComponents();
5332 int nbOfTuples=self->getNumberOfTuples();
5333 convertObjToPossibleCpp2(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5335 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5336 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5345 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5351 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5352 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5355 //value vector<string>
5358 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5359 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5362 //value DataArrayChar
5365 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5369 throw INTERP_KERNEL::Exception(msg);
5373 {//obj list-tuple[int]
5379 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5385 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5386 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5389 //value vector<string>
5392 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5393 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5396 //value DataArrayChar
5399 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5403 throw INTERP_KERNEL::Exception(msg);
5414 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5420 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5421 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5424 //value vector<string>
5427 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5428 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5431 //value DataArrayChar
5434 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5438 throw INTERP_KERNEL::Exception(msg);
5449 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5455 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5456 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5459 //value vector<string>
5462 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5463 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5466 //value DataArrayChar
5469 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5473 throw INTERP_KERNEL::Exception(msg);
5478 throw INTERP_KERNEL::Exception(msg);
5484 class DataArrayAsciiCharTuple;
5486 class DataArrayAsciiCharIterator
5489 DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5490 ~DataArrayAsciiCharIterator();
5495 DataArrayAsciiCharTuple *ret=self->nextt();
5497 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5500 PyErr_SetString(PyExc_StopIteration,"No more data.");
5507 class DataArrayAsciiCharTuple
5510 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5511 DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5514 std::string __str__() const throw(INTERP_KERNEL::Exception)
5516 return self->repr();
5519 DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5521 return self->buildDAAsciiChar(1,self->getNumberOfCompo());