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 std::vector<std::string> getVarsOnComponent() const throw(INTERP_KERNEL::Exception);
36 std::vector<std::string> getUnitsOnComponent() const throw(INTERP_KERNEL::Exception);
37 std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);
38 std::string getVarOnComponent(int i) const throw(INTERP_KERNEL::Exception);
39 std::string getUnitOnComponent(int i) const throw(INTERP_KERNEL::Exception);
40 void setInfoOnComponent(int i, const char *info) throw(INTERP_KERNEL::Exception);
41 int getNumberOfComponents() const;
42 virtual int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
43 virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
44 virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
45 void checkNbOfTuples(int nbOfTuples, const char *msg) const throw(INTERP_KERNEL::Exception);
46 void checkNbOfComps(int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
47 void checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const throw(INTERP_KERNEL::Exception);
48 void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
49 void checkNbOfElems(std::size_t nbOfElems, const char *msg) const throw(INTERP_KERNEL::Exception);
50 static int GetNumberOfItemGivenBES(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
51 static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
52 static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
53 static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
54 static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
55 void updateTime() const;
58 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
60 const std::vector<std::string>& comps=self->getInfoOnComponents();
61 PyObject *ret=PyList_New((int)comps.size());
62 for(int i=0;i<(int)comps.size();i++)
63 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
67 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
70 convertPyToNewIntArr3(li,tmp);
71 self->copyPartOfStringInfoFrom(other,tmp);
74 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
77 convertPyToNewIntArr3(li,tmp);
78 self->copyPartOfStringInfoFrom2(tmp,other);
84 class DataArrayDoubleIterator;
86 class DataArrayDouble : public DataArray
89 static DataArrayDouble *New();
90 bool isAllocated() const throw(INTERP_KERNEL::Exception);
91 void checkAllocated() const throw(INTERP_KERNEL::Exception);
92 void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
93 double doubleValue() const throw(INTERP_KERNEL::Exception);
94 bool empty() const throw(INTERP_KERNEL::Exception);
95 DataArrayDouble *deepCpy() const throw(INTERP_KERNEL::Exception);
96 DataArrayDouble *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
97 void cpyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
98 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
99 void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
100 void pushBackValsSilent(const double *valsBg, const double *valsEnd) throw(INTERP_KERNEL::Exception);
101 double popBackSilent() throw(INTERP_KERNEL::Exception);
102 void pack() const throw(INTERP_KERNEL::Exception);
103 void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
104 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
105 void fillWithZero() throw(INTERP_KERNEL::Exception);
106 void fillWithValue(double val) throw(INTERP_KERNEL::Exception);
107 void iota(double init=0.) throw(INTERP_KERNEL::Exception);
108 bool isUniform(double val, double eps) const throw(INTERP_KERNEL::Exception);
109 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
110 void reverse() throw(INTERP_KERNEL::Exception);
111 void checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
112 bool isMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
113 std::string repr() const throw(INTERP_KERNEL::Exception);
114 std::string reprZip() const throw(INTERP_KERNEL::Exception);
115 bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
116 bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
117 void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
118 DataArrayInt *convertToIntArr() const;
119 DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
120 DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
121 DataArrayDouble *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
122 DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
123 void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
124 void transpose() throw(INTERP_KERNEL::Exception);
125 DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
126 void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
127 DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
128 DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception);
129 DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
130 void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
131 void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
132 void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
133 void setContigPartOfSelectedValues(int tupleIdStart, const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
134 void setContigPartOfSelectedValues2(int tupleIdStart, const DataArrayDouble *a, int bg, int end2, int step) throw(INTERP_KERNEL::Exception);
135 double getIJ(int tupleId, int compoId) const;
136 double back() const throw(INTERP_KERNEL::Exception);
137 double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
138 void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
139 void setIJSilent(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
140 double *getPointer() throw(INTERP_KERNEL::Exception);
141 void checkNoNullValues() const throw(INTERP_KERNEL::Exception);
142 DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const throw(INTERP_KERNEL::Exception);
143 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
144 double getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
145 double getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
146 double getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
147 double getMinValueInArray() const throw(INTERP_KERNEL::Exception);
148 double getAverageValue() const throw(INTERP_KERNEL::Exception);
149 double norm2() const throw(INTERP_KERNEL::Exception);
150 double normMax() const throw(INTERP_KERNEL::Exception);
151 void accumulate(double *res) const throw(INTERP_KERNEL::Exception);
152 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
153 DataArrayDouble *fromPolarToCart() const throw(INTERP_KERNEL::Exception);
154 DataArrayDouble *fromCylToCart() const throw(INTERP_KERNEL::Exception);
155 DataArrayDouble *fromSpherToCart() const throw(INTERP_KERNEL::Exception);
156 DataArrayDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
157 DataArrayDouble *determinant() const throw(INTERP_KERNEL::Exception);
158 DataArrayDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
159 DataArrayDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
160 DataArrayDouble *inverse() const throw(INTERP_KERNEL::Exception);
161 DataArrayDouble *trace() const throw(INTERP_KERNEL::Exception);
162 DataArrayDouble *deviator() const throw(INTERP_KERNEL::Exception);
163 DataArrayDouble *magnitude() const throw(INTERP_KERNEL::Exception);
164 DataArrayDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
165 DataArrayDouble *buildEuclidianDistanceDenseMatrix() const throw(INTERP_KERNEL::Exception);
166 DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
167 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
168 void abs() throw(INTERP_KERNEL::Exception);
169 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
170 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
171 void applyInv(double numerator) throw(INTERP_KERNEL::Exception);
172 void applyPow(double val) throw(INTERP_KERNEL::Exception);
173 void applyRPow(double val) throw(INTERP_KERNEL::Exception);
174 DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
175 DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
176 DataArrayDouble *applyFunc(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
177 DataArrayDouble *applyFunc(const char *func) const throw(INTERP_KERNEL::Exception);
178 DataArrayDouble *applyFunc2(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
179 DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
180 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
181 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
182 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
183 static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
184 static DataArrayDouble *Aggregate(const std::vector<const DataArrayDouble *>& arr) throw(INTERP_KERNEL::Exception);
185 static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
186 static DataArrayDouble *Meld(const std::vector<const DataArrayDouble *>& arr) throw(INTERP_KERNEL::Exception);
187 static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
188 static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
189 static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
190 static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
191 static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
192 void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
193 static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
194 void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
195 static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
196 void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
197 static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
198 void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
199 static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
200 void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
203 DataArrayDouble() throw(INTERP_KERNEL::Exception)
205 return DataArrayDouble::New();
208 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
210 const char *msg="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(5)\n-DataArrayDouble.New(5,2) !";
211 if(PyList_Check(elt0) || PyTuple_Check(elt0))
215 if(PyInt_Check(nbOfTuples))
217 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
219 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
222 if(PyInt_Check(elt2))
223 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
224 int nbOfCompo=PyInt_AS_LONG(elt2);
226 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
227 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
228 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
229 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
233 throw INTERP_KERNEL::Exception(msg);
236 {//DataArrayDouble.New([1.,3.,4.],3)
237 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
239 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
240 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
245 throw INTERP_KERNEL::Exception(msg);
248 {// DataArrayDouble.New([1.,3.,4.])
249 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
250 int tmpp1=-1,tmpp2=-1;
251 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
252 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
256 else if(PyInt_Check(elt0))
258 int nbOfTuples1=PyInt_AS_LONG(elt0);
260 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
265 if(PyInt_Check(nbOfTuples))
266 {//DataArrayDouble.New(5,2)
267 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
269 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
270 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
271 ret->alloc(nbOfTuples1,nbOfCompo);
275 throw INTERP_KERNEL::Exception(msg);
278 throw INTERP_KERNEL::Exception(msg);
281 {//DataArrayDouble.New(5)
282 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
283 ret->alloc(nbOfTuples1,1);
288 else if(PyArray_Check(elt0))
289 {//DataArrayDouble.New(numpyArray)
290 return BuildNewInstance<DataArrayDouble,double>(elt0,NPY_DOUBLE,&PyCallBackDataArrayDouble_RefType,"FLOAT64");
294 throw INTERP_KERNEL::Exception(msg);
297 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
299 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
302 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
305 std::vector<double> bb;
307 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
308 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
309 self->pushBackValsSilent(tmp,tmp+nbTuples);
312 std::string __repr__() const throw(INTERP_KERNEL::Exception)
314 std::ostringstream oss;
315 self->reprQuickOverview(oss);
319 std::string __str__() const throw(INTERP_KERNEL::Exception)
324 double __float__() const throw(INTERP_KERNEL::Exception)
326 return self->doubleValue();
329 int __len__() const throw(INTERP_KERNEL::Exception)
331 if(self->isAllocated())
333 return self->getNumberOfTuples();
337 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
341 DataArrayDoubleIterator *__iter__()
343 return self->iterator();
346 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
348 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 !";
349 if(PyList_Check(li) || PyTuple_Check(li))
353 if(PyInt_Check(nbOfTuples))
355 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
357 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
360 if(PyInt_Check(nbOfComp))
361 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
362 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
364 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
365 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
366 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
369 throw INTERP_KERNEL::Exception(msg);
372 {//DataArrayDouble.setValues([1.,3.,4.],3)
374 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
375 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
379 throw INTERP_KERNEL::Exception(msg);
382 {// DataArrayDouble.setValues([1.,3.,4.])
383 int tmpp1=-1,tmpp2=-1;
384 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
385 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
389 throw INTERP_KERNEL::Exception(msg);
392 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
394 const double *vals=self->getConstPointer();
395 return convertDblArrToPyList(vals,self->getNbOfElems());
399 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
401 return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
405 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
408 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
409 PyObject *ret=PyTuple_New(2);
410 PyObject *ret0Py=ret0?Py_True:Py_False;
412 PyTuple_SetItem(ret,0,ret0Py);
413 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
417 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
419 const double *vals=self->getConstPointer();
420 int nbOfComp=self->getNumberOfComponents();
421 int nbOfTuples=self->getNumberOfTuples();
422 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
425 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
428 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
429 if (!SWIG_IsOK(res1))
432 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
433 if(size!=self->getNumberOfTuples())
435 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
437 return self->renumber(tmp);
441 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
443 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
444 da2->checkAllocated();
445 int size=self->getNumberOfTuples();
446 if(size!=self->getNumberOfTuples())
448 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
450 return self->renumber(da2->getConstPointer());
454 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
457 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
458 if (!SWIG_IsOK(res1))
461 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
462 if(size!=self->getNumberOfTuples())
464 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
466 return self->renumberR(tmp);
470 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
472 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
473 da2->checkAllocated();
474 int size=self->getNumberOfTuples();
475 if(size!=self->getNumberOfTuples())
477 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
479 return self->renumberR(da2->getConstPointer());
483 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
486 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
487 if (!SWIG_IsOK(res1))
490 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
491 if(size!=self->getNumberOfTuples())
493 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
495 return self->renumberAndReduce(tmp,newNbOfTuple);
499 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
501 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
502 da2->checkAllocated();
503 int size=self->getNumberOfTuples();
504 if(size!=self->getNumberOfTuples())
506 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
508 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
512 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
515 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
516 if (!SWIG_IsOK(res1))
519 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
520 if(size!=self->getNumberOfTuples())
522 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
524 self->renumberInPlace(tmp);
528 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
530 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
531 da2->checkAllocated();
532 int size=self->getNumberOfTuples();
533 if(size!=self->getNumberOfTuples())
535 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
537 self->renumberInPlace(da2->getConstPointer());
541 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
544 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
545 if (!SWIG_IsOK(res1))
548 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
549 if(size!=self->getNumberOfTuples())
551 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
553 self->renumberInPlaceR(tmp);
557 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
559 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
560 da2->checkAllocated();
561 int size=self->getNumberOfTuples();
562 if(size!=self->getNumberOfTuples())
564 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
566 self->renumberInPlaceR(da2->getConstPointer());
570 DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
573 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
574 if (!SWIG_IsOK(res1))
577 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
578 return self->selectByTupleId(tmp,tmp+size);
582 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
584 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
585 da2->checkAllocated();
586 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
590 DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
593 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
594 if (!SWIG_IsOK(res1))
597 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
598 return self->selectByTupleIdSafe(tmp,tmp+size);
602 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
604 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
605 da2->checkAllocated();
606 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
610 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
612 int thisTupleId,otherTupleId;
613 double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
614 PyObject *ret=PyTuple_New(3);
615 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
616 PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
617 PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
621 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
624 double r1=self->getMaxValue(tmp);
625 PyObject *ret=PyTuple_New(2);
626 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
627 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
631 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
634 double r1=self->getMaxValue2(tmp);
635 PyObject *ret=PyTuple_New(2);
636 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
637 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
641 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
644 double r1=self->getMinValue(tmp);
645 PyObject *ret=PyTuple_New(2);
646 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
647 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
651 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
654 double r1=self->getMinValue2(tmp);
655 PyObject *ret=PyTuple_New(2);
656 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
657 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
661 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
663 int nbOfCompo=self->getNumberOfComponents();
664 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
665 self->getMinMaxPerComponent(tmp);
666 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
670 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
672 int sz=self->getNumberOfComponents();
673 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
674 self->accumulate(tmp);
675 return convertDblArrToPyList(tmp,sz);
678 DataArrayDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
680 std::vector<int> tmp;
681 convertPyToNewIntArr3(li,tmp);
682 return self->keepSelectedComponents(tmp);
685 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
687 DataArrayInt *comm, *commIndex;
688 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
689 PyObject *res = PyList_New(2);
690 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
691 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
695 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
699 DataArrayDoubleTuple *aa;
700 std::vector<double> bb;
702 int tupleId=-1,nbOfCompo=self->getNumberOfComponents();
703 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
705 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
706 PyObject *ret=PyTuple_New(2);
707 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
708 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
712 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
714 std::vector<int> tmp;
715 convertPyToNewIntArr3(li,tmp);
716 self->setSelectedComponents(a,tmp);
719 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
721 int sz=self->getNumberOfComponents();
722 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
723 self->getTuple(tupleId,tmp);
724 return convertDblArrToPyList(tmp,sz);
727 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
729 std::vector<const DataArrayDouble *> tmp;
730 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
731 return DataArrayDouble::Aggregate(tmp);
734 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
736 std::vector<const DataArrayDouble *> tmp;
737 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
738 return DataArrayDouble::Meld(tmp);
741 DataArrayDouble *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
743 std::vector<std::pair<int,int> > ranges;
744 convertPyToVectorPairInt(li,ranges);
745 return self->selectByTupleRanges(ranges);
748 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
752 DataArrayDoubleTuple *aa;
753 std::vector<double> bb;
755 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
756 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
757 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
758 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
759 DataArrayInt *c=0,*cI=0;
760 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
761 PyObject *ret=PyTuple_New(2);
762 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
763 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
767 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
769 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
770 const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
771 self->checkAllocated();
772 int nbOfTuples=self->getNumberOfTuples();
773 int nbOfComponents=self->getNumberOfComponents();
775 std::vector<int> vt1,vc1;
776 std::pair<int, std::pair<int,int> > pt1,pc1;
777 DataArrayInt *dt1=0,*dc1=0;
779 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
780 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
784 if(nbOfComponents==1)
785 return PyFloat_FromDouble(self->getIJSafe(it1,0));
786 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
788 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
790 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
792 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
794 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
797 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
798 std::vector<int> v2(1,ic1);
799 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
803 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
804 std::vector<int> v2(1,ic1);
805 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
809 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
810 std::vector<int> v2(1,ic1);
811 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
815 ret=self->selectByTupleIdSafe(&it1,&it1+1);
816 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
820 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
821 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
825 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
826 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
830 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
831 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
835 ret=self->selectByTupleIdSafe(&it1,&it1+1);
836 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
837 std::vector<int> v2(nbOfComp);
838 for(int i=0;i<nbOfComp;i++)
839 v2[i]=pc1.first+i*pc1.second.second;
840 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
844 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
845 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
846 std::vector<int> v2(nbOfComp);
847 for(int i=0;i<nbOfComp;i++)
848 v2[i]=pc1.first+i*pc1.second.second;
849 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
853 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
854 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
855 std::vector<int> v2(nbOfComp);
856 for(int i=0;i<nbOfComp;i++)
857 v2[i]=pc1.first+i*pc1.second.second;
858 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
862 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
863 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
864 std::vector<int> v2(nbOfComp);
865 for(int i=0;i<nbOfComp;i++)
866 v2[i]=pc1.first+i*pc1.second.second;
867 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
870 throw INTERP_KERNEL::Exception(msg);
874 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
876 self->checkAllocated();
877 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
878 int nbOfTuples=self->getNumberOfTuples();
879 int nbOfComponents=self->getNumberOfComponents();
882 std::vector<double> v1;
883 DataArrayDouble *d1=0;
884 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
886 std::vector<int> vt1,vc1;
887 std::pair<int, std::pair<int,int> > pt1,pc1;
888 DataArrayInt *dt1=0,*dc1=0;
889 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
890 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
898 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
901 tmp=DataArrayDouble::New();
902 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
903 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
906 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
909 throw INTERP_KERNEL::Exception(msg);
918 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
921 tmp=DataArrayDouble::New();
922 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
923 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
926 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
929 throw INTERP_KERNEL::Exception(msg);
938 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
941 tmp=DataArrayDouble::New();
942 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
943 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
946 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
949 throw INTERP_KERNEL::Exception(msg);
958 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
961 tmp=DataArrayDouble::New();
962 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
963 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
966 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
969 throw INTERP_KERNEL::Exception(msg);
978 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
981 tmp=DataArrayDouble::New();
982 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
983 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
986 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
989 throw INTERP_KERNEL::Exception(msg);
998 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1001 tmp=DataArrayDouble::New();
1002 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1003 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
1006 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1009 throw INTERP_KERNEL::Exception(msg);
1018 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1021 tmp=DataArrayDouble::New();
1022 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1023 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
1026 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1029 throw INTERP_KERNEL::Exception(msg);
1038 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1041 tmp=DataArrayDouble::New();
1042 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1043 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
1046 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1049 throw INTERP_KERNEL::Exception(msg);
1058 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1061 tmp=DataArrayDouble::New();
1062 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1063 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
1066 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1069 throw INTERP_KERNEL::Exception(msg);
1078 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1081 tmp=DataArrayDouble::New();
1082 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1083 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
1086 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1089 throw INTERP_KERNEL::Exception(msg);
1098 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1101 tmp=DataArrayDouble::New();
1102 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1103 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
1106 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1109 throw INTERP_KERNEL::Exception(msg);
1118 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1121 tmp=DataArrayDouble::New();
1122 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1123 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
1126 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1129 throw INTERP_KERNEL::Exception(msg);
1138 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1141 tmp=DataArrayDouble::New();
1142 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1143 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
1146 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1149 throw INTERP_KERNEL::Exception(msg);
1158 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1161 tmp=DataArrayDouble::New();
1162 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1163 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
1166 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1169 throw INTERP_KERNEL::Exception(msg);
1178 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1181 tmp=DataArrayDouble::New();
1182 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1183 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
1186 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1189 throw INTERP_KERNEL::Exception(msg);
1198 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1201 tmp=DataArrayDouble::New();
1202 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1203 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
1206 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1209 throw INTERP_KERNEL::Exception(msg);
1214 throw INTERP_KERNEL::Exception(msg);
1219 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
1221 return self->negate();
1224 PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1226 const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
1229 DataArrayDoubleTuple *aa;
1230 std::vector<double> bb;
1234 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1236 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1239 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1240 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1242 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1245 throw INTERP_KERNEL::Exception(msg);
1248 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1253 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1254 ret->applyLin(1.,val);
1255 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1259 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1263 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1264 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1268 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1269 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1272 throw INTERP_KERNEL::Exception(msg);
1276 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1278 const char msg[]="Unexpected situation in __radd__ !";
1281 DataArrayDoubleTuple *aa;
1282 std::vector<double> bb;
1284 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1289 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1290 ret->applyLin(1.,val);
1295 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1296 return DataArrayDouble::Add(self,aaa);
1300 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1301 return DataArrayDouble::Add(self,aaa);
1304 throw INTERP_KERNEL::Exception(msg);
1308 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1310 const char msg[]="Unexpected situation in __iadd__ !";
1313 DataArrayDoubleTuple *aa;
1314 std::vector<double> bb;
1316 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1321 self->applyLin(1.,val);
1322 Py_XINCREF(trueSelf);
1328 Py_XINCREF(trueSelf);
1333 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1334 self->addEqual(aaa);
1335 Py_XINCREF(trueSelf);
1340 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1341 self->addEqual(aaa);
1342 Py_XINCREF(trueSelf);
1346 throw INTERP_KERNEL::Exception(msg);
1350 PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1352 const char msg[]="Unexpected situation in __sub__ !";
1355 DataArrayDoubleTuple *aa;
1356 std::vector<double> bb;
1360 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1362 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1365 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1366 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1368 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1371 throw INTERP_KERNEL::Exception(msg);
1374 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1379 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1380 ret->applyLin(1.,-val);
1381 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1385 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1389 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1390 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1394 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1395 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1398 throw INTERP_KERNEL::Exception(msg);
1402 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1404 const char msg[]="Unexpected situation in __rsub__ !";
1407 DataArrayDoubleTuple *aa;
1408 std::vector<double> bb;
1410 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1415 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1416 ret->applyLin(-1.,val);
1421 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1422 return DataArrayDouble::Substract(aaa,self);
1426 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1427 return DataArrayDouble::Substract(aaa,self);
1430 throw INTERP_KERNEL::Exception(msg);
1434 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1436 const char msg[]="Unexpected situation in __isub__ !";
1439 DataArrayDoubleTuple *aa;
1440 std::vector<double> bb;
1442 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1447 self->applyLin(1,-val);
1448 Py_XINCREF(trueSelf);
1453 self->substractEqual(a);
1454 Py_XINCREF(trueSelf);
1459 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1460 self->substractEqual(aaa);
1461 Py_XINCREF(trueSelf);
1466 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1467 self->substractEqual(aaa);
1468 Py_XINCREF(trueSelf);
1472 throw INTERP_KERNEL::Exception(msg);
1476 PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1478 const char msg[]="Unexpected situation in __mul__ !";
1481 DataArrayDoubleTuple *aa;
1482 std::vector<double> bb;
1486 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1488 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1491 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1492 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1494 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1497 throw INTERP_KERNEL::Exception(msg);
1500 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1505 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1506 ret->applyLin(val,0.);
1507 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1511 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1515 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1516 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1520 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1521 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1524 throw INTERP_KERNEL::Exception(msg);
1528 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1530 const char msg[]="Unexpected situation in __rmul__ !";
1533 DataArrayDoubleTuple *aa;
1534 std::vector<double> bb;
1536 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1541 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1542 ret->applyLin(val,0.);
1547 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1548 return DataArrayDouble::Multiply(self,aaa);
1552 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1553 return DataArrayDouble::Multiply(self,aaa);
1556 throw INTERP_KERNEL::Exception(msg);
1560 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1562 const char msg[]="Unexpected situation in __imul__ !";
1565 DataArrayDoubleTuple *aa;
1566 std::vector<double> bb;
1568 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1573 self->applyLin(val,0.);
1574 Py_XINCREF(trueSelf);
1579 self->multiplyEqual(a);
1580 Py_XINCREF(trueSelf);
1585 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1586 self->multiplyEqual(aaa);
1587 Py_XINCREF(trueSelf);
1592 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1593 self->multiplyEqual(aaa);
1594 Py_XINCREF(trueSelf);
1598 throw INTERP_KERNEL::Exception(msg);
1602 PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1604 const char msg[]="Unexpected situation in __div__ !";
1607 DataArrayDoubleTuple *aa;
1608 std::vector<double> bb;
1612 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1614 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1617 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1618 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1620 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1623 throw INTERP_KERNEL::Exception(msg);
1626 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1632 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1633 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1634 ret->applyLin(1/val,0.);
1635 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1639 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1643 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1644 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1648 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1649 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1652 throw INTERP_KERNEL::Exception(msg);
1656 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1658 const char msg[]="Unexpected situation in __rdiv__ !";
1661 DataArrayDoubleTuple *aa;
1662 std::vector<double> bb;
1664 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1669 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1675 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1676 return DataArrayDouble::Divide(aaa,self);
1680 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1681 return DataArrayDouble::Divide(aaa,self);
1684 throw INTERP_KERNEL::Exception(msg);
1688 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1690 const char msg[]="Unexpected situation in __idiv__ !";
1693 DataArrayDoubleTuple *aa;
1694 std::vector<double> bb;
1696 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1702 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1703 self->applyLin(1./val,0.);
1704 Py_XINCREF(trueSelf);
1709 self->divideEqual(a);
1710 Py_XINCREF(trueSelf);
1715 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1716 self->divideEqual(aaa);
1717 Py_XINCREF(trueSelf);
1722 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1723 self->divideEqual(aaa);
1724 Py_XINCREF(trueSelf);
1728 throw INTERP_KERNEL::Exception(msg);
1732 DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1734 const char msg[]="Unexpected situation in __pow__ !";
1737 DataArrayDoubleTuple *aa;
1738 std::vector<double> bb;
1740 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1745 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1751 return DataArrayDouble::Pow(self,a);
1755 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1756 return DataArrayDouble::Pow(self,aaa);
1760 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1761 return DataArrayDouble::Pow(self,aaa);
1764 throw INTERP_KERNEL::Exception(msg);
1768 DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1770 const char msg[]="Unexpected situation in __rpow__ !";
1773 DataArrayDoubleTuple *aa;
1774 std::vector<double> bb;
1776 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1781 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1782 ret->applyRPow(val);
1787 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1788 return DataArrayDouble::Pow(aaa,self);
1792 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1793 return DataArrayDouble::Pow(aaa,self);
1796 throw INTERP_KERNEL::Exception(msg);
1800 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1802 const char msg[]="Unexpected situation in __ipow__ !";
1805 DataArrayDoubleTuple *aa;
1806 std::vector<double> bb;
1808 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1813 self->applyPow(val);
1814 Py_XINCREF(trueSelf);
1820 Py_XINCREF(trueSelf);
1825 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1826 self->powEqual(aaa);
1827 Py_XINCREF(trueSelf);
1832 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1833 self->powEqual(aaa);
1834 Py_XINCREF(trueSelf);
1838 throw INTERP_KERNEL::Exception(msg);
1842 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
1844 DataArrayInt *c=0,*cI=0;
1846 self->computeTupleIdsNearTuples(other,eps,c,cI);
1847 PyObject *ret=PyTuple_New(2);
1848 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1849 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1855 class DataArrayDoubleTuple;
1857 class DataArrayDoubleIterator
1860 DataArrayDoubleIterator(DataArrayDouble *da);
1861 ~DataArrayDoubleIterator();
1866 DataArrayDoubleTuple *ret=self->nextt();
1868 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
1871 PyErr_SetString(PyExc_StopIteration,"No more data.");
1878 class DataArrayDoubleTuple
1881 int getNumberOfCompo() const;
1882 DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
1885 std::string __str__() const throw(INTERP_KERNEL::Exception)
1887 return self->repr();
1890 double __float__() const throw(INTERP_KERNEL::Exception)
1892 return self->doubleValue();
1895 DataArrayDouble *buildDADouble()
1897 return self->buildDADouble(1,self->getNumberOfCompo());
1900 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1902 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
1903 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
1904 Py_XINCREF(trueSelf);
1908 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1910 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
1911 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
1912 Py_XINCREF(trueSelf);
1916 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1918 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
1919 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
1920 Py_XINCREF(trueSelf);
1924 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1926 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
1927 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
1928 Py_XINCREF(trueSelf);
1932 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1934 const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
1937 std::vector<int> multiVal;
1938 std::pair<int, std::pair<int,int> > slic;
1939 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1940 const double *pt=self->getConstPointer();
1941 int nbc=self->getNumberOfCompo();
1942 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1949 std::ostringstream oss;
1950 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
1951 throw INTERP_KERNEL::Exception(oss.str().c_str());
1954 return PyFloat_FromDouble(pt[singleVal]);
1958 return PyFloat_FromDouble(pt[nbc+singleVal]);
1961 std::ostringstream oss;
1962 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
1963 throw INTERP_KERNEL::Exception(oss.str().c_str());
1969 PyObject *t=PyTuple_New(multiVal.size());
1970 for(int j=0;j<(int)multiVal.size();j++)
1972 int cid=multiVal[j];
1975 std::ostringstream oss;
1976 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
1977 throw INTERP_KERNEL::Exception(oss.str().c_str());
1979 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
1985 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
1986 PyObject *t=PyTuple_New(sz);
1987 for(int j=0;j<sz;j++)
1988 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
1992 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
1996 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
1998 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
1999 const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2002 std::vector<double> multiValV;
2003 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2004 int nbc=self->getNumberOfCompo();
2005 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2007 std::vector<int> multiVal;
2008 std::pair<int, std::pair<int,int> > slic;
2009 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2010 double *pt=self->getPointer();
2011 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2018 std::ostringstream oss;
2019 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2020 throw INTERP_KERNEL::Exception(oss.str().c_str());
2026 pt[singleVal]=singleValV;
2031 if(multiValV.size()!=1)
2033 std::ostringstream oss;
2034 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2035 throw INTERP_KERNEL::Exception(oss.str().c_str());
2037 pt[singleVal]=multiValV[0];
2042 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2046 throw INTERP_KERNEL::Exception(msg);
2055 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2059 std::ostringstream oss;
2060 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2061 throw INTERP_KERNEL::Exception(oss.str().c_str());
2069 if(multiVal.size()!=multiValV.size())
2071 std::ostringstream oss;
2072 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2073 throw INTERP_KERNEL::Exception(oss.str().c_str());
2075 for(int i=0;i<(int)multiVal.size();i++)
2077 int pos=multiVal[i];
2080 std::ostringstream oss;
2081 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2082 throw INTERP_KERNEL::Exception(oss.str().c_str());
2084 pt[multiVal[i]]=multiValV[i];
2090 const double *ptV=daIntTyyppV->getConstPointer();
2091 if(nbc>daIntTyyppV->getNumberOfCompo())
2093 std::ostringstream oss;
2094 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2095 throw INTERP_KERNEL::Exception(oss.str().c_str());
2097 std::copy(ptV,ptV+nbc,pt);
2101 throw INTERP_KERNEL::Exception(msg);
2106 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2111 for(int j=0;j<sz;j++)
2112 pt[slic.first+j*slic.second.second]=singleValV;
2117 if(sz!=(int)multiValV.size())
2119 std::ostringstream oss;
2120 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2121 throw INTERP_KERNEL::Exception(oss.str().c_str());
2123 for(int j=0;j<sz;j++)
2124 pt[slic.first+j*slic.second.second]=multiValV[j];
2129 const double *ptV=daIntTyyppV->getConstPointer();
2130 if(sz>daIntTyyppV->getNumberOfCompo())
2132 std::ostringstream oss;
2133 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2134 throw INTERP_KERNEL::Exception(oss.str().c_str());
2136 for(int j=0;j<sz;j++)
2137 pt[slic.first+j*slic.second.second]=ptV[j];
2141 throw INTERP_KERNEL::Exception(msg);
2145 throw INTERP_KERNEL::Exception(msg);
2151 class DataArrayIntIterator;
2153 class DataArrayInt : public DataArray
2156 static DataArrayInt *New();
2157 bool isAllocated() const throw(INTERP_KERNEL::Exception);
2158 void checkAllocated() const throw(INTERP_KERNEL::Exception);
2159 void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
2160 int intValue() const throw(INTERP_KERNEL::Exception);
2161 int getHashCode() const throw(INTERP_KERNEL::Exception);
2162 bool empty() const throw(INTERP_KERNEL::Exception);
2163 DataArrayInt *deepCpy() const throw(INTERP_KERNEL::Exception);
2164 DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2165 void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2166 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2167 void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2168 int popBackSilent() throw(INTERP_KERNEL::Exception);
2169 void pack() const throw(INTERP_KERNEL::Exception);
2170 void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
2171 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2172 bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2173 bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2174 bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2175 DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2176 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2177 void reverse() throw(INTERP_KERNEL::Exception);
2178 void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2179 bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2180 void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2181 bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2182 void fillWithZero() throw(INTERP_KERNEL::Exception);
2183 void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2184 void iota(int init=0) throw(INTERP_KERNEL::Exception);
2185 std::string repr() const throw(INTERP_KERNEL::Exception);
2186 std::string reprZip() const throw(INTERP_KERNEL::Exception);
2187 DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const;
2188 DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const;
2189 DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2190 void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
2191 DataArrayDouble *convertToDblArr() const;
2192 DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2193 DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2194 DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2195 DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2196 DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2197 bool isIdentity() const throw(INTERP_KERNEL::Exception);
2198 bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2199 DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2200 void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
2201 void transpose() throw(INTERP_KERNEL::Exception);
2202 DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2203 void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2204 void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2205 void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2206 void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2207 void setContigPartOfSelectedValues(int tupleIdStart, const DataArrayInt*a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2208 void setContigPartOfSelectedValues2(int tupleIdStart, const DataArrayInt *a, int bg, int end2, int step) throw(INTERP_KERNEL::Exception);
2209 void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2210 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2211 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2212 int back() const throw(INTERP_KERNEL::Exception);
2213 void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2214 void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2215 int *getPointer() throw(INTERP_KERNEL::Exception);
2216 const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2217 DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2218 const int *begin() const throw(INTERP_KERNEL::Exception);
2219 const int *end() const throw(INTERP_KERNEL::Exception);
2220 DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2221 DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2222 int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2223 int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2224 int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2225 int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2226 int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2227 bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2228 bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2229 bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2230 void accumulate(int *res) const throw(INTERP_KERNEL::Exception);
2231 int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2232 int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2233 int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2234 int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2235 int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2236 void abs() throw(INTERP_KERNEL::Exception);
2237 void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2238 void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2239 void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2240 DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2241 void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2242 void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2243 void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2244 void applyPow(int val) throw(INTERP_KERNEL::Exception);
2245 void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2246 DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2247 static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2);
2248 static DataArrayInt *Aggregate(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2249 static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2250 static DataArrayInt *Meld(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2251 static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2252 static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2253 static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2254 DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2255 DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2256 DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2257 DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2258 DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2259 DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2260 DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2261 void computeOffsets() throw(INTERP_KERNEL::Exception);
2262 void computeOffsets2() throw(INTERP_KERNEL::Exception);
2263 DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2264 DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2265 DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2266 DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2267 DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2268 static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2269 void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2270 static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2271 void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2272 static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2273 void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2274 static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2275 void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2276 static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2277 void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2278 static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2279 void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2281 static int *CheckAndPreparePermutation(const int *start, const int *end);
2282 static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2285 DataArrayInt() throw(INTERP_KERNEL::Exception)
2287 return DataArrayInt::New();
2290 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2292 const char *msg="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(5)\n-DataArrayInt.New(5,2) !";
2293 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2297 if(PyInt_Check(nbOfTuples))
2299 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2301 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2304 if(PyInt_Check(nbOfComp))
2305 {//DataArrayInt.New([1,3,4,5],2,2)
2306 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2308 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2309 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2310 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2311 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2315 throw INTERP_KERNEL::Exception(msg);
2318 {//DataArrayInt.New([1,3,4],3)
2319 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2321 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2322 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2327 throw INTERP_KERNEL::Exception(msg);
2330 {// DataArrayInt.New([1,3,4])
2331 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2332 int tmpp1=-1,tmpp2=-1;
2333 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2334 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2338 else if(PyInt_Check(elt0))
2340 int nbOfTuples1=PyInt_AS_LONG(elt0);
2342 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2347 if(PyInt_Check(nbOfTuples))
2348 {//DataArrayInt.New(5,2)
2349 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2351 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2352 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2353 ret->alloc(nbOfTuples1,nbOfCompo);
2357 throw INTERP_KERNEL::Exception(msg);
2360 throw INTERP_KERNEL::Exception(msg);
2363 {//DataArrayInt.New(5)
2364 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2365 ret->alloc(nbOfTuples1,1);
2370 else if(PyArray_Check(elt0))
2371 {//DataArrayInt.New(numpyArray)
2372 return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT,&PyCallBackDataArrayInt_RefType,"INT32");
2376 throw INTERP_KERNEL::Exception(msg);
2379 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2381 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2384 std::string __str__() const throw(INTERP_KERNEL::Exception)
2386 return self->repr();
2389 int __len__() const throw(INTERP_KERNEL::Exception)
2391 if(self->isAllocated())
2393 return self->getNumberOfTuples();
2397 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2401 int __int__() const throw(INTERP_KERNEL::Exception)
2403 return self->intValue();
2406 DataArrayIntIterator *__iter__()
2408 return self->iterator();
2411 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2413 int sz=self->getNumberOfComponents();
2414 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2415 self->accumulate(tmp);
2416 return convertIntArrToPyList(tmp,sz);
2419 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2421 int newNbOfTuples=-1;
2422 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2423 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2424 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2425 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2426 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2427 PyObject *ret=PyTuple_New(2);
2428 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2429 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2433 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2435 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 !";
2436 if(PyList_Check(li) || PyTuple_Check(li))
2440 if(PyInt_Check(nbOfTuples))
2442 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2444 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2447 if(PyInt_Check(nbOfComp))
2448 {//DataArrayInt.setValues([1,3,4,5],2,2)
2449 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2451 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2452 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2453 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2456 throw INTERP_KERNEL::Exception(msg);
2459 {//DataArrayInt.setValues([1,3,4],3)
2461 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2462 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2466 throw INTERP_KERNEL::Exception(msg);
2469 {// DataArrayInt.setValues([1,3,4])
2470 int tmpp1=-1,tmpp2=-1;
2471 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2472 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2476 throw INTERP_KERNEL::Exception(msg);
2479 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2481 const int *vals=self->getConstPointer();
2482 return convertIntArrToPyList(vals,self->getNbOfElems());
2486 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2488 return ToNumPyArray<DataArrayInt,int>(self,NPY_INT,"DataArrayInt");
2492 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2495 bool ret0=self->isEqualIfNotWhy(other,ret1);
2496 PyObject *ret=PyTuple_New(2);
2497 PyObject *ret0Py=ret0?Py_True:Py_False;
2499 PyTuple_SetItem(ret,0,ret0Py);
2500 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2504 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2506 const int *vals=self->getConstPointer();
2507 int nbOfComp=self->getNumberOfComponents();
2508 int nbOfTuples=self->getNumberOfTuples();
2509 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2512 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2514 std::vector<const DataArrayInt *> groups;
2515 std::vector< std::vector<int> > fidsOfGroups;
2516 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2517 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2518 PyObject *ret = PyList_New(2);
2519 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2520 int sz=fidsOfGroups.size();
2521 PyObject *ret1 = PyList_New(sz);
2522 for(int i=0;i<sz;i++)
2523 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2524 PyList_SetItem(ret,1,ret1);
2528 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2531 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2532 if (!SWIG_IsOK(res1))
2535 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2536 self->transformWithIndArr(tmp,tmp+size);
2540 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2541 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2545 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2549 std::vector<int> multiVal;
2550 std::pair<int, std::pair<int,int> > slic;
2551 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2552 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2556 return self->getIdsEqualList(&singleVal,&singleVal+1);
2558 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2560 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2562 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2566 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2570 std::vector<int> multiVal;
2571 std::pair<int, std::pair<int,int> > slic;
2572 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2573 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2577 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2579 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2581 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2583 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2587 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2589 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2591 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2592 if (!SWIG_IsOK(res1))
2595 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2596 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2600 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2602 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2603 da2->checkAllocated();
2604 int size=self->getNumberOfTuples();
2605 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2607 PyObject *ret = PyList_New(3);
2608 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2609 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2610 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2614 DataArrayInt *transformWithIndArrR(PyObject *li) const
2617 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2618 if (!SWIG_IsOK(res1))
2621 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2622 return self->transformWithIndArrR(tmp,tmp+size);
2626 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2627 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2631 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
2634 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2635 if (!SWIG_IsOK(res1))
2638 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2639 if(size!=self->getNumberOfTuples())
2641 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2643 self->renumberInPlace(tmp);
2647 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2649 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2650 da2->checkAllocated();
2651 int size=self->getNumberOfTuples();
2652 if(size!=self->getNumberOfTuples())
2654 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2656 self->renumberInPlace(da2->getConstPointer());
2660 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
2663 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2664 if (!SWIG_IsOK(res1))
2667 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2668 if(size!=self->getNumberOfTuples())
2670 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2672 self->renumberInPlaceR(tmp);
2676 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2678 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2679 da2->checkAllocated();
2680 int size=self->getNumberOfTuples();
2681 if(size!=self->getNumberOfTuples())
2683 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2685 self->renumberInPlaceR(da2->getConstPointer());
2689 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2692 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2693 if (!SWIG_IsOK(res1))
2696 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2697 if(size!=self->getNumberOfTuples())
2699 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2701 return self->renumberAndReduce(tmp,newNbOfTuple);
2705 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2707 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2708 da2->checkAllocated();
2709 int size=self->getNumberOfTuples();
2710 if(size!=self->getNumberOfTuples())
2712 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2714 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
2718 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
2721 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2722 if (!SWIG_IsOK(res1))
2725 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2726 if(size!=self->getNumberOfTuples())
2728 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2730 return self->renumber(tmp);
2734 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2736 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2737 da2->checkAllocated();
2738 int size=self->getNumberOfTuples();
2739 if(size!=self->getNumberOfTuples())
2741 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2743 return self->renumber(da2->getConstPointer());
2747 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
2750 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2751 if (!SWIG_IsOK(res1))
2754 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2755 if(size!=self->getNumberOfTuples())
2757 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2759 return self->renumberR(tmp);
2763 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2765 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2766 da2->checkAllocated();
2767 int size=self->getNumberOfTuples();
2768 if(size!=self->getNumberOfTuples())
2770 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2772 return self->renumberR(da2->getConstPointer());
2776 DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
2779 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2780 if (!SWIG_IsOK(res1))
2783 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2784 return self->selectByTupleId(tmp,tmp+size);
2788 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2790 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2791 da2->checkAllocated();
2792 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2796 DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
2799 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2800 if (!SWIG_IsOK(res1))
2803 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2804 return self->selectByTupleIdSafe(tmp,tmp+size);
2808 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2810 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2811 da2->checkAllocated();
2812 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2816 DataArrayInt *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
2818 std::vector<int> tmp;
2819 convertPyToNewIntArr3(li,tmp);
2820 return self->keepSelectedComponents(tmp);
2823 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
2825 std::vector<int> tmp;
2826 convertPyToNewIntArr3(li,tmp);
2827 self->setSelectedComponents(a,tmp);
2830 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
2832 int sz=self->getNumberOfComponents();
2833 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2834 self->getTuple(tupleId,tmp);
2835 return convertIntArrToPyList(tmp,sz);
2838 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
2840 DataArrayInt *arr=0;
2841 DataArrayInt *arrI=0;
2842 self->changeSurjectiveFormat(targetNb,arr,arrI);
2843 PyObject *res = PyList_New(2);
2844 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2845 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2849 DataArrayInt *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
2851 std::vector<std::pair<int,int> > ranges;
2852 convertPyToVectorPairInt(li,ranges);
2853 return self->selectByTupleRanges(ranges);
2856 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
2858 std::vector<const DataArrayInt *> tmp;
2859 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2860 return DataArrayInt::Meld(tmp);
2863 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
2865 std::vector<const DataArrayInt *> tmp;
2866 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2867 return DataArrayInt::Aggregate(tmp);
2870 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
2872 std::vector<const DataArrayInt *> tmp;
2873 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2874 return DataArrayInt::BuildUnion(tmp);
2877 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
2879 std::vector<const DataArrayInt *> tmp;
2880 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2881 return DataArrayInt::BuildIntersection(tmp);
2884 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
2887 int r1=self->getMaxValue(tmp);
2888 PyObject *ret=PyTuple_New(2);
2889 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2890 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2894 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
2897 int r1=self->getMinValue(tmp);
2898 PyObject *ret=PyTuple_New(2);
2899 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2900 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2904 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2906 int nbOfCompo=self->getNumberOfComponents();
2911 if(PyInt_Check(obj))
2913 int val=(int)PyInt_AS_LONG(obj);
2914 return self->locateValue(val);
2917 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
2921 std::vector<int> arr;
2922 convertPyToNewIntArr3(obj,arr);
2923 return self->locateTuple(arr);
2928 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2930 int nbOfCompo=self->getNumberOfComponents();
2937 if(PyInt_Check(obj))
2939 int val=(int)PyInt_AS_LONG(obj);
2940 return self->presenceOfValue(val);
2943 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
2947 std::vector<int> arr;
2948 convertPyToNewIntArr3(obj,arr);
2949 return self->presenceOfTuple(arr);
2954 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2956 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
2957 const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2958 self->checkAllocated();
2959 int nbOfTuples=self->getNumberOfTuples();
2960 int nbOfComponents=self->getNumberOfComponents();
2962 std::vector<int> vt1,vc1;
2963 std::pair<int, std::pair<int,int> > pt1,pc1;
2964 DataArrayInt *dt1=0,*dc1=0;
2966 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
2967 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
2972 if(nbOfComponents==1)
2973 return PyInt_FromLong(self->getIJSafe(it1,0));
2974 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2977 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2979 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2981 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2983 return PyInt_FromLong(self->getIJSafe(it1,ic1));
2986 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
2987 std::vector<int> v2(1,ic1);
2988 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2992 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
2993 std::vector<int> v2(1,ic1);
2994 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2998 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
2999 std::vector<int> v2(1,ic1);
3000 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3004 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3005 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3009 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3010 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3014 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3015 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3019 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3020 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3024 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3025 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3026 std::vector<int> v2(nbOfComp);
3027 for(int i=0;i<nbOfComp;i++)
3028 v2[i]=pc1.first+i*pc1.second.second;
3029 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3033 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3034 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3035 std::vector<int> v2(nbOfComp);
3036 for(int i=0;i<nbOfComp;i++)
3037 v2[i]=pc1.first+i*pc1.second.second;
3038 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3042 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3043 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3044 std::vector<int> v2(nbOfComp);
3045 for(int i=0;i<nbOfComp;i++)
3046 v2[i]=pc1.first+i*pc1.second.second;
3047 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3051 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3052 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3053 std::vector<int> v2(nbOfComp);
3054 for(int i=0;i<nbOfComp;i++)
3055 v2[i]=pc1.first+i*pc1.second.second;
3056 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3059 throw INTERP_KERNEL::Exception(msg);
3063 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3065 self->checkAllocated();
3066 const char msg[]="Unexpected situation in __setitem__ !";
3067 int nbOfTuples=self->getNumberOfTuples();
3068 int nbOfComponents=self->getNumberOfComponents();
3071 std::vector<int> v1;
3073 DataArrayIntTuple *dd1=0;
3074 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3076 std::vector<int> vt1,vc1;
3077 std::pair<int, std::pair<int,int> > pt1,pc1;
3078 DataArrayInt *dt1=0,*dc1=0;
3079 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3080 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3088 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3091 tmp=DataArrayInt::New();
3092 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3093 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3096 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3099 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3100 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3103 throw INTERP_KERNEL::Exception(msg);
3112 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3115 tmp=DataArrayInt::New();
3116 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3117 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3120 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3123 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3124 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3127 throw INTERP_KERNEL::Exception(msg);
3136 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3139 tmp=DataArrayInt::New();
3140 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3141 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3144 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3147 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3148 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3151 throw INTERP_KERNEL::Exception(msg);
3160 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3163 tmp=DataArrayInt::New();
3164 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3165 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3168 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3171 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3172 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3175 throw INTERP_KERNEL::Exception(msg);
3184 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3187 tmp=DataArrayInt::New();
3188 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3189 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3192 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3195 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3196 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3199 throw INTERP_KERNEL::Exception(msg);
3208 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3211 tmp=DataArrayInt::New();
3212 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3213 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3216 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3219 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3220 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3223 throw INTERP_KERNEL::Exception(msg);
3232 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3235 tmp=DataArrayInt::New();
3236 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3237 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3240 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3243 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3244 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3247 throw INTERP_KERNEL::Exception(msg);
3256 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3259 tmp=DataArrayInt::New();
3260 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3261 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3264 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3267 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3268 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3271 throw INTERP_KERNEL::Exception(msg);
3280 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3283 tmp=DataArrayInt::New();
3284 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3285 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3288 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3291 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3292 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3295 throw INTERP_KERNEL::Exception(msg);
3304 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3307 tmp=DataArrayInt::New();
3308 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3309 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3312 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3315 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3316 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3319 throw INTERP_KERNEL::Exception(msg);
3328 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3331 tmp=DataArrayInt::New();
3332 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3333 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3336 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3339 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3340 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3343 throw INTERP_KERNEL::Exception(msg);
3352 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3355 tmp=DataArrayInt::New();
3356 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3357 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3360 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3363 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3364 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3367 throw INTERP_KERNEL::Exception(msg);
3376 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3379 tmp=DataArrayInt::New();
3380 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3381 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3384 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3387 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3388 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3391 throw INTERP_KERNEL::Exception(msg);
3400 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3403 tmp=DataArrayInt::New();
3404 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3405 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3408 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3411 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3412 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3415 throw INTERP_KERNEL::Exception(msg);
3424 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3427 tmp=DataArrayInt::New();
3428 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3429 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3432 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3435 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3436 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3439 throw INTERP_KERNEL::Exception(msg);
3448 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3451 tmp=DataArrayInt::New();
3452 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3453 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3456 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3459 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3460 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3463 throw INTERP_KERNEL::Exception(msg);
3468 throw INTERP_KERNEL::Exception(msg);
3473 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3475 return self->negate();
3478 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3480 const char msg[]="Unexpected situation in __add__ !";
3483 std::vector<int> aa;
3484 DataArrayIntTuple *aaa;
3486 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3491 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3492 ret->applyLin(1,val);
3497 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3498 return DataArrayInt::Add(self,aaaa);
3502 return DataArrayInt::Add(self,a);
3506 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3507 return DataArrayInt::Add(self,aaaa);
3510 throw INTERP_KERNEL::Exception(msg);
3514 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3516 const char msg[]="Unexpected situation in __radd__ !";
3519 std::vector<int> aa;
3520 DataArrayIntTuple *aaa;
3522 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3527 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3528 ret->applyLin(1,val);
3533 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3534 return DataArrayInt::Add(self,aaaa);
3538 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3539 return DataArrayInt::Add(self,aaaa);
3542 throw INTERP_KERNEL::Exception(msg);
3546 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3548 const char msg[]="Unexpected situation in __iadd__ !";
3551 std::vector<int> aa;
3552 DataArrayIntTuple *aaa;
3554 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3559 self->applyLin(1,val);
3560 Py_XINCREF(trueSelf);
3565 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3567 Py_XINCREF(trueSelf);
3573 Py_XINCREF(trueSelf);
3578 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3579 self->addEqual(aaaa);
3580 Py_XINCREF(trueSelf);
3584 throw INTERP_KERNEL::Exception(msg);
3588 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3590 const char msg[]="Unexpected situation in __sub__ !";
3593 std::vector<int> aa;
3594 DataArrayIntTuple *aaa;
3596 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3601 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3602 ret->applyLin(1,-val);
3607 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3608 return DataArrayInt::Substract(self,aaaa);
3612 return DataArrayInt::Substract(self,a);
3616 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3617 return DataArrayInt::Substract(self,aaaa);
3620 throw INTERP_KERNEL::Exception(msg);
3624 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3626 const char msg[]="Unexpected situation in __rsub__ !";
3629 std::vector<int> aa;
3630 DataArrayIntTuple *aaa;
3632 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3637 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3638 ret->applyLin(-1,val);
3643 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3644 return DataArrayInt::Substract(aaaa,self);
3648 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3649 return DataArrayInt::Substract(aaaa,self);
3652 throw INTERP_KERNEL::Exception(msg);
3656 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3658 const char msg[]="Unexpected situation in __isub__ !";
3661 std::vector<int> aa;
3662 DataArrayIntTuple *aaa;
3664 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3669 self->applyLin(1,-val);
3670 Py_XINCREF(trueSelf);
3675 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3676 self->substractEqual(bb);
3677 Py_XINCREF(trueSelf);
3682 self->substractEqual(a);
3683 Py_XINCREF(trueSelf);
3688 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3689 self->substractEqual(aaaa);
3690 Py_XINCREF(trueSelf);
3694 throw INTERP_KERNEL::Exception(msg);
3698 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3700 const char msg[]="Unexpected situation in __mul__ !";
3703 std::vector<int> aa;
3704 DataArrayIntTuple *aaa;
3706 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3711 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3712 ret->applyLin(val,0);
3717 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3718 return DataArrayInt::Multiply(self,aaaa);
3722 return DataArrayInt::Multiply(self,a);
3726 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3727 return DataArrayInt::Multiply(self,aaaa);
3730 throw INTERP_KERNEL::Exception(msg);
3734 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3736 const char msg[]="Unexpected situation in __rmul__ !";
3739 std::vector<int> aa;
3740 DataArrayIntTuple *aaa;
3742 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3747 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3748 ret->applyLin(val,0);
3753 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3754 return DataArrayInt::Multiply(self,aaaa);
3758 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3759 return DataArrayInt::Multiply(self,aaaa);
3762 throw INTERP_KERNEL::Exception(msg);
3766 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3768 const char msg[]="Unexpected situation in __imul__ !";
3771 std::vector<int> aa;
3772 DataArrayIntTuple *aaa;
3774 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3779 self->applyLin(val,0);
3780 Py_XINCREF(trueSelf);
3785 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3786 self->multiplyEqual(bb);
3787 Py_XINCREF(trueSelf);
3792 self->multiplyEqual(a);
3793 Py_XINCREF(trueSelf);
3798 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3799 self->multiplyEqual(aaaa);
3800 Py_XINCREF(trueSelf);
3804 throw INTERP_KERNEL::Exception(msg);
3808 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3810 const char msg[]="Unexpected situation in __div__ !";
3813 std::vector<int> aa;
3814 DataArrayIntTuple *aaa;
3816 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3821 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3822 ret->applyDivideBy(val);
3827 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3828 return DataArrayInt::Divide(self,aaaa);
3832 return DataArrayInt::Divide(self,a);
3836 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3837 return DataArrayInt::Divide(self,aaaa);
3840 throw INTERP_KERNEL::Exception(msg);
3844 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3846 const char msg[]="Unexpected situation in __rdiv__ !";
3849 std::vector<int> aa;
3850 DataArrayIntTuple *aaa;
3852 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3857 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3863 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3864 return DataArrayInt::Divide(aaaa,self);
3868 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3869 return DataArrayInt::Divide(aaaa,self);
3872 throw INTERP_KERNEL::Exception(msg);
3876 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3878 const char msg[]="Unexpected situation in __idiv__ !";
3881 std::vector<int> aa;
3882 DataArrayIntTuple *aaa;
3884 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3889 self->applyDivideBy(val);
3890 Py_XINCREF(trueSelf);
3895 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3896 self->divideEqual(bb);
3897 Py_XINCREF(trueSelf);
3902 self->divideEqual(a);
3903 Py_XINCREF(trueSelf);
3908 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3909 self->divideEqual(aaaa);
3910 Py_XINCREF(trueSelf);
3914 throw INTERP_KERNEL::Exception(msg);
3918 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3920 const char msg[]="Unexpected situation in __mod__ !";
3923 std::vector<int> aa;
3924 DataArrayIntTuple *aaa;
3926 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3931 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3932 ret->applyModulus(val);
3937 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3938 return DataArrayInt::Modulus(self,aaaa);
3942 return DataArrayInt::Modulus(self,a);
3946 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3947 return DataArrayInt::Modulus(self,aaaa);
3950 throw INTERP_KERNEL::Exception(msg);
3954 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3956 const char msg[]="Unexpected situation in __rmod__ !";
3959 std::vector<int> aa;
3960 DataArrayIntTuple *aaa;
3962 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3967 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3968 ret->applyRModulus(val);
3973 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3974 return DataArrayInt::Modulus(aaaa,self);
3978 return DataArrayInt::Modulus(a,self);
3982 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3983 return DataArrayInt::Modulus(aaaa,self);
3986 throw INTERP_KERNEL::Exception(msg);
3990 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3992 const char msg[]="Unexpected situation in __imod__ !";
3995 std::vector<int> aa;
3996 DataArrayIntTuple *aaa;
3998 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4003 self->applyModulus(val);
4004 Py_XINCREF(trueSelf);
4009 self->modulusEqual(a);
4010 Py_XINCREF(trueSelf);
4015 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4016 self->modulusEqual(aaaa);
4017 Py_XINCREF(trueSelf);
4021 throw INTERP_KERNEL::Exception(msg);
4025 DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4027 const char msg[]="Unexpected situation in __pow__ !";
4030 std::vector<int> aa;
4031 DataArrayIntTuple *aaa;
4033 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4038 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4044 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4045 return DataArrayInt::Pow(self,aaaa);
4049 return DataArrayInt::Pow(self,a);
4053 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4054 return DataArrayInt::Pow(self,aaaa);
4057 throw INTERP_KERNEL::Exception(msg);
4061 DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4063 const char msg[]="Unexpected situation in __rpow__ !";
4066 std::vector<int> aa;
4067 DataArrayIntTuple *aaa;
4069 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4074 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4075 ret->applyRPow(val);
4080 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4081 return DataArrayInt::Pow(aaaa,self);
4085 return DataArrayInt::Pow(a,self);
4089 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4090 return DataArrayInt::Pow(aaaa,self);
4093 throw INTERP_KERNEL::Exception(msg);
4097 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4099 const char msg[]="Unexpected situation in __ipow__ !";
4102 std::vector<int> aa;
4103 DataArrayIntTuple *aaa;
4105 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4110 self->applyPow(val);
4111 Py_XINCREF(trueSelf);
4117 Py_XINCREF(trueSelf);
4122 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4123 self->powEqual(aaaa);
4124 Py_XINCREF(trueSelf);
4128 throw INTERP_KERNEL::Exception(msg);
4132 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4134 std::ostringstream oss;
4135 self->reprQuickOverview(oss);
4139 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4141 int szArr,sw,iTypppArr;
4142 std::vector<int> stdvecTyyppArr;
4143 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4144 self->pushBackValsSilent(tmp,tmp+szArr);
4147 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4149 std::vector<int> ret1;
4150 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4151 std::size_t sz=ret0.size();
4152 PyObject *pyRet=PyTuple_New(2);
4153 PyObject *pyRet0=PyList_New((int)sz);
4154 PyObject *pyRet1=PyList_New((int)sz);
4155 for(std::size_t i=0;i<sz;i++)
4157 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4158 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4160 PyTuple_SetItem(pyRet,0,pyRet0);
4161 PyTuple_SetItem(pyRet,1,pyRet1);
4165 PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4167 DataArrayInt *ret0=0,*ret1=0;
4168 self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4169 PyObject *pyRet=PyTuple_New(2);
4170 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4171 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4177 class DataArrayIntTuple;
4179 class DataArrayIntIterator
4182 DataArrayIntIterator(DataArrayInt *da);
4183 ~DataArrayIntIterator();
4188 DataArrayIntTuple *ret=self->nextt();
4190 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4193 PyErr_SetString(PyExc_StopIteration,"No more data.");
4200 class DataArrayIntTuple
4203 int getNumberOfCompo() const;
4204 DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4207 std::string __str__() const throw(INTERP_KERNEL::Exception)
4209 return self->repr();
4212 int __int__() const throw(INTERP_KERNEL::Exception)
4214 return self->intValue();
4217 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4219 return self->buildDAInt(1,self->getNumberOfCompo());
4222 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4224 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4225 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4226 Py_XINCREF(trueSelf);
4230 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4232 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4233 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4234 Py_XINCREF(trueSelf);
4238 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4240 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4241 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4242 Py_XINCREF(trueSelf);
4246 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4248 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4249 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4250 Py_XINCREF(trueSelf);
4254 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4256 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4257 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4258 Py_XINCREF(trueSelf);
4262 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4264 const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4267 std::vector<int> multiVal;
4268 std::pair<int, std::pair<int,int> > slic;
4269 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4270 const int *pt=self->getConstPointer();
4271 int nbc=self->getNumberOfCompo();
4272 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4279 std::ostringstream oss;
4280 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4281 throw INTERP_KERNEL::Exception(oss.str().c_str());
4284 return PyInt_FromLong(pt[singleVal]);
4288 return PyInt_FromLong(pt[nbc+singleVal]);
4291 std::ostringstream oss;
4292 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4293 throw INTERP_KERNEL::Exception(oss.str().c_str());
4299 PyObject *t=PyTuple_New(multiVal.size());
4300 for(int j=0;j<(int)multiVal.size();j++)
4302 int cid=multiVal[j];
4305 std::ostringstream oss;
4306 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4307 throw INTERP_KERNEL::Exception(oss.str().c_str());
4309 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4315 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4316 PyObject *t=PyTuple_New(sz);
4317 for(int j=0;j<sz;j++)
4318 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4322 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4326 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4328 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4329 const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4332 std::vector<int> multiValV;
4333 std::pair<int, std::pair<int,int> > slicV;
4334 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4335 int nbc=self->getNumberOfCompo();
4336 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4338 std::vector<int> multiVal;
4339 std::pair<int, std::pair<int,int> > slic;
4340 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4341 int *pt=self->getPointer();
4342 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4349 std::ostringstream oss;
4350 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4351 throw INTERP_KERNEL::Exception(oss.str().c_str());
4357 pt[singleVal]=singleValV;
4362 if(multiValV.size()!=1)
4364 std::ostringstream oss;
4365 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4366 throw INTERP_KERNEL::Exception(oss.str().c_str());
4368 pt[singleVal]=multiValV[0];
4373 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4377 throw INTERP_KERNEL::Exception(msg);
4386 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4390 std::ostringstream oss;
4391 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4392 throw INTERP_KERNEL::Exception(oss.str().c_str());
4400 if(multiVal.size()!=multiValV.size())
4402 std::ostringstream oss;
4403 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4404 throw INTERP_KERNEL::Exception(oss.str().c_str());
4406 for(int i=0;i<(int)multiVal.size();i++)
4408 int pos=multiVal[i];
4411 std::ostringstream oss;
4412 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4413 throw INTERP_KERNEL::Exception(oss.str().c_str());
4415 pt[multiVal[i]]=multiValV[i];
4421 const int *ptV=daIntTyyppV->getConstPointer();
4422 if(nbc>daIntTyyppV->getNumberOfCompo())
4424 std::ostringstream oss;
4425 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4426 throw INTERP_KERNEL::Exception(oss.str().c_str());
4428 std::copy(ptV,ptV+nbc,pt);
4432 throw INTERP_KERNEL::Exception(msg);
4437 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4442 for(int j=0;j<sz;j++)
4443 pt[slic.first+j*slic.second.second]=singleValV;
4448 if(sz!=(int)multiValV.size())
4450 std::ostringstream oss;
4451 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4452 throw INTERP_KERNEL::Exception(oss.str().c_str());
4454 for(int j=0;j<sz;j++)
4455 pt[slic.first+j*slic.second.second]=multiValV[j];
4460 const int *ptV=daIntTyyppV->getConstPointer();
4461 if(sz>daIntTyyppV->getNumberOfCompo())
4463 std::ostringstream oss;
4464 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4465 throw INTERP_KERNEL::Exception(oss.str().c_str());
4467 for(int j=0;j<sz;j++)
4468 pt[slic.first+j*slic.second.second]=ptV[j];
4472 throw INTERP_KERNEL::Exception(msg);
4476 throw INTERP_KERNEL::Exception(msg);
4482 class DataArrayChar : public DataArray
4485 virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception) = 0;
4486 bool isAllocated() const throw(INTERP_KERNEL::Exception);
4487 void checkAllocated() const throw(INTERP_KERNEL::Exception);
4488 void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
4489 int getHashCode() const throw(INTERP_KERNEL::Exception);
4490 bool empty() const throw(INTERP_KERNEL::Exception);
4491 void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4492 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4493 void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4494 void pushBackValsSilent(const char *valsBg, const char *valsEnd) throw(INTERP_KERNEL::Exception);
4495 char popBackSilent() throw(INTERP_KERNEL::Exception);
4496 void pack() const throw(INTERP_KERNEL::Exception);
4497 void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
4498 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4499 bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4500 bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4501 void reverse() throw(INTERP_KERNEL::Exception);
4502 void fillWithZero() throw(INTERP_KERNEL::Exception);
4503 void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4504 std::string repr() const throw(INTERP_KERNEL::Exception);
4505 std::string reprZip() const throw(INTERP_KERNEL::Exception);
4506 void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
4507 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4508 void renumberInPlace(const int *old2New) throw(INTERP_KERNEL::Exception);
4509 void renumberInPlaceR(const int *new2Old) throw(INTERP_KERNEL::Exception);
4510 DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4511 DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4512 DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4513 DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const throw(INTERP_KERNEL::Exception);
4514 DataArrayChar *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
4515 bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4516 void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
4517 DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4518 DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4519 void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4520 void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4521 char back() const throw(INTERP_KERNEL::Exception);
4522 void setIJ(int tupleId, int compoId, char newVal);
4523 void setIJSilent(int tupleId, int compoId, char newVal);
4525 DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4526 DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4527 int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4528 bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4529 char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4530 char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4531 char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4532 char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4533 DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4534 static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2);
4535 static DataArrayChar *Aggregate(const std::vector<const DataArrayChar *>& arr) throw(INTERP_KERNEL::Exception);
4536 static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4537 static DataArrayChar *Meld(const std::vector<const DataArrayChar *>& arr) throw(INTERP_KERNEL::Exception);
4540 int __len__() const throw(INTERP_KERNEL::Exception)
4542 if(self->isAllocated())
4544 return self->getNumberOfTuples();
4548 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4552 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4555 bool ret0=self->isEqualIfNotWhy(other,ret1);
4556 PyObject *ret=PyTuple_New(2);
4557 PyObject *ret0Py=ret0?Py_True:Py_False;
4559 PyTuple_SetItem(ret,0,ret0Py);
4560 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4564 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
4567 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4568 if (!SWIG_IsOK(res1))
4571 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4572 if(size!=self->getNumberOfTuples())
4574 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4576 self->renumberInPlace(tmp);
4580 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4582 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4583 da2->checkAllocated();
4584 int size=self->getNumberOfTuples();
4585 if(size!=self->getNumberOfTuples())
4587 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4589 self->renumberInPlace(da2->getConstPointer());
4593 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
4596 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4597 if (!SWIG_IsOK(res1))
4600 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4601 if(size!=self->getNumberOfTuples())
4603 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4605 self->renumberInPlaceR(tmp);
4609 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4611 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4612 da2->checkAllocated();
4613 int size=self->getNumberOfTuples();
4614 if(size!=self->getNumberOfTuples())
4616 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4618 self->renumberInPlaceR(da2->getConstPointer());
4622 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4625 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4626 if (!SWIG_IsOK(res1))
4629 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4630 if(size!=self->getNumberOfTuples())
4632 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4634 return self->renumber(tmp);
4638 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4640 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4641 da2->checkAllocated();
4642 int size=self->getNumberOfTuples();
4643 if(size!=self->getNumberOfTuples())
4645 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4647 return self->renumber(da2->getConstPointer());
4651 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4654 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4655 if (!SWIG_IsOK(res1))
4658 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4659 if(size!=self->getNumberOfTuples())
4661 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4663 return self->renumberR(tmp);
4667 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4669 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4670 da2->checkAllocated();
4671 int size=self->getNumberOfTuples();
4672 if(size!=self->getNumberOfTuples())
4674 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4676 return self->renumberR(da2->getConstPointer());
4680 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4683 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4684 if (!SWIG_IsOK(res1))
4687 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4688 if(size!=self->getNumberOfTuples())
4690 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4692 return self->renumberAndReduce(tmp,newNbOfTuple);
4696 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4698 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4699 da2->checkAllocated();
4700 int size=self->getNumberOfTuples();
4701 if(size!=self->getNumberOfTuples())
4703 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4705 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4709 DataArrayChar *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
4712 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4713 if (!SWIG_IsOK(res1))
4716 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4717 return self->selectByTupleIdSafe(tmp,tmp+size);
4721 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4723 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4724 da2->checkAllocated();
4725 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4729 DataArrayChar *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4731 std::vector<int> tmp;
4732 convertPyToNewIntArr3(li,tmp);
4733 return self->keepSelectedComponents(tmp);
4736 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4738 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4739 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4740 return DataArrayChar::Aggregate(tmp);
4743 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4745 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4746 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4747 return DataArrayChar::Meld(tmp);
4752 class DataArrayByteIterator;
4754 class DataArrayByte : public DataArrayChar
4757 static DataArrayByte *New();
4758 DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4759 DataArrayByteIterator *iterator();
4760 DataArrayByte *deepCpy() const;
4761 DataArrayByte *performCpy(bool deepCpy) const;
4762 char byteValue() const throw(INTERP_KERNEL::Exception);
4765 DataArrayByte() throw(INTERP_KERNEL::Exception)
4767 return DataArrayByte::New();
4770 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4772 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) !";
4773 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4777 if(PyInt_Check(nbOfTuples))
4779 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4781 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4784 if(PyInt_Check(nbOfComp))
4785 {//DataArrayByte.New([1,3,4,5],2,2)
4786 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4788 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4789 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4790 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4791 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4795 throw INTERP_KERNEL::Exception(msg);
4798 {//DataArrayByte.New([1,3,4],3)
4799 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4801 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4802 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4807 throw INTERP_KERNEL::Exception(msg);
4810 {// DataArrayByte.New([1,3,4])
4811 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4812 int tmpp1=-1,tmpp2=-1;
4813 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4814 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4818 else if(PyInt_Check(elt0))
4820 int nbOfTuples1=PyInt_AS_LONG(elt0);
4822 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4827 if(PyInt_Check(nbOfTuples))
4828 {//DataArrayByte.New(5,2)
4829 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4831 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4832 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4833 ret->alloc(nbOfTuples1,nbOfCompo);
4837 throw INTERP_KERNEL::Exception(msg);
4840 throw INTERP_KERNEL::Exception(msg);
4843 {//DataArrayByte.New(5)
4844 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4845 ret->alloc(nbOfTuples1,1);
4850 throw INTERP_KERNEL::Exception(msg);
4853 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4855 return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4858 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4860 std::ostringstream oss;
4861 self->reprQuickOverview(oss);
4865 int __int__() const throw(INTERP_KERNEL::Exception)
4867 return (int) self->byteValue();
4870 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
4872 return self->iterator();
4875 int getIJ(int tupleId, int compoId) const
4877 return (int)self->getIJ(tupleId,compoId);
4880 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4882 return (int)self->getIJSafe(tupleId,compoId);
4885 std::string __str__() const throw(INTERP_KERNEL::Exception)
4887 return self->repr();
4890 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
4892 const char *vals=self->getConstPointer();
4893 int nbOfComp=self->getNumberOfComponents();
4894 int nbOfTuples=self->getNumberOfTuples();
4895 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4898 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4901 int ival=-1; std::vector<int> ivval;
4902 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4903 std::vector<char> vals(sz);
4904 std::copy(pt,pt+sz,vals.begin());
4905 return self->presenceOfTuple(vals);
4908 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4911 int ival=-1; std::vector<int> ivval;
4912 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4913 std::vector<char> vals2(sz);
4914 std::copy(pt,pt+sz,vals2.begin());
4915 return self->presenceOfValue(vals2);
4918 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4921 int ival=-1; std::vector<int> ivval;
4922 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4923 std::vector<char> vals2(sz);
4924 std::copy(pt,pt+sz,vals2.begin());
4925 return self->locateValue(vals2);
4928 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4931 int ival=-1; std::vector<int> ivval;
4932 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4933 std::vector<char> vals(sz);
4934 std::copy(pt,pt+sz,vals.begin());
4935 return self->locateTuple(vals);
4938 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
4941 int ival=-1; std::vector<int> ivval;
4942 const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
4943 std::vector<char> vals(sz);
4944 std::copy(pt,pt+sz,vals.begin());
4945 return self->search(vals);
4948 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
4950 int sz=self->getNumberOfComponents();
4951 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
4952 self->getTuple(tupleId,tmp);
4953 PyObject *ret=PyTuple_New(sz);
4954 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
4958 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
4961 int r1=(int)self->getMaxValue(tmp);
4962 PyObject *ret=PyTuple_New(2);
4963 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4964 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4968 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
4971 int r1=(int)self->getMinValue(tmp);
4972 PyObject *ret=PyTuple_New(2);
4973 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4974 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4978 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4980 int nbOfCompo=self->getNumberOfComponents();
4985 if(PyInt_Check(obj))
4987 int val=(int)PyInt_AS_LONG(obj);
4988 return self->locateValue(val);
4991 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
4994 return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
4998 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5000 int nbOfCompo=self->getNumberOfComponents();
5007 if(PyInt_Check(obj))
5009 int val=(int)PyInt_AS_LONG(obj);
5010 return self->presenceOfValue(val);
5013 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5016 return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
5022 class DataArrayByteTuple;
5024 class DataArrayByteIterator
5027 DataArrayByteIterator(DataArrayByte *da);
5028 ~DataArrayByteIterator();
5031 class DataArrayByteTuple
5034 std::string repr() const throw(INTERP_KERNEL::Exception);
5035 DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5038 std::string __str__() const
5040 return self->repr();
5043 char __int__() const throw(INTERP_KERNEL::Exception)
5045 return self->byteValue();
5048 DataArrayByte *buildDAByte()
5050 return self->buildDAByte(1,self->getNumberOfCompo());
5055 class DataArrayAsciiCharIterator;
5057 class DataArrayAsciiChar : public DataArrayChar
5060 static DataArrayAsciiChar *New();
5061 DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
5062 DataArrayAsciiCharIterator *iterator();
5063 DataArrayAsciiChar *deepCpy() const;
5064 DataArrayAsciiChar *performCpy(bool deepCpy) const;
5065 char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5068 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5070 return DataArrayAsciiChar::New();
5073 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5075 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) !";
5076 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5080 if(PyInt_Check(nbOfTuples))
5082 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5084 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5087 if(PyInt_Check(nbOfComp))
5088 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5089 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5091 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5092 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5093 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5094 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5098 throw INTERP_KERNEL::Exception(msg);
5101 {//DataArrayAsciiChar.New([1,3,4],3)
5102 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5104 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5105 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5109 else if(PyString_Check(nbOfTuples))
5111 if(PyString_Size(nbOfTuples)!=1)
5112 throw INTERP_KERNEL::Exception(msg);
5113 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5114 std::vector<std::string> tmp;
5115 if(fillStringVector(elt0,tmp))
5116 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5118 throw INTERP_KERNEL::Exception(msg);
5121 throw INTERP_KERNEL::Exception(msg);
5125 std::vector<std::string> tmmp;
5126 if(fillStringVector(elt0,tmmp))
5127 //DataArrayAsciiChar.New(["abc","de","fghi"])
5128 return DataArrayAsciiChar::New(tmmp,' ');
5131 // DataArrayAsciiChar.New([1,3,4])
5132 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5133 int tmpp1=-1,tmpp2=-1;
5134 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5135 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5140 else if(PyInt_Check(elt0))
5142 int nbOfTuples1=PyInt_AS_LONG(elt0);
5144 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5149 if(PyInt_Check(nbOfTuples))
5150 {//DataArrayAsciiChar.New(5,2)
5151 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5153 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5154 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5155 ret->alloc(nbOfTuples1,nbOfCompo);
5159 throw INTERP_KERNEL::Exception(msg);
5162 throw INTERP_KERNEL::Exception(msg);
5165 {//DataArrayAsciiChar.New(5)
5166 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5167 ret->alloc(nbOfTuples1,1);
5172 throw INTERP_KERNEL::Exception(msg);
5175 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5177 return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5180 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5182 std::ostringstream oss;
5183 self->reprQuickOverview(oss);
5187 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5189 return self->iterator();
5192 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5194 char tmp[2]; tmp[1]='\0';
5195 tmp[0]=self->getIJ(tupleId,compoId);
5196 return std::string(tmp);
5199 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5201 char tmp[2]; tmp[1]='\0';
5202 tmp[0]=self->getIJSafe(tupleId,compoId);
5203 return std::string(tmp);
5206 std::string __str__() const throw(INTERP_KERNEL::Exception)
5208 return self->repr();
5211 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5213 const char *vals=self->getConstPointer();
5214 int nbOfComp=self->getNumberOfComponents();
5215 int nbOfTuples=self->getNumberOfTuples();
5216 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5219 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5221 if(PyString_Check(tupl))
5223 Py_ssize_t sz=PyString_Size(tupl);
5224 std::vector<char> vals(sz);
5225 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5226 return self->presenceOfTuple(vals);
5229 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5232 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5234 if(PyString_Check(vals))
5236 Py_ssize_t sz=PyString_Size(vals);
5237 std::vector<char> vals2(sz);
5238 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5239 return self->presenceOfValue(vals2);
5242 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5245 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5247 if(PyString_Check(vals))
5249 Py_ssize_t sz=PyString_Size(vals);
5250 std::vector<char> vals2(sz);
5251 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5252 return self->locateValue(vals2);
5255 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5258 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5260 if(PyString_Check(tupl))
5262 Py_ssize_t sz=PyString_Size(tupl);
5263 std::vector<char> vals(sz);
5264 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5265 return self->locateTuple(vals);
5268 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5271 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5273 if(PyString_Check(strOrListOfInt))
5275 Py_ssize_t sz=PyString_Size(strOrListOfInt);
5276 std::vector<char> vals(sz);
5277 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5278 return self->search(vals);
5281 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5284 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5286 int sz=self->getNumberOfComponents();
5287 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5288 self->getTuple(tupleId,tmp);
5289 return PyString_FromString(tmp);
5292 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5295 char tmp2[2]; tmp2[1]='\0';
5296 tmp2[0]=self->getMaxValue(tmp);
5297 PyObject *ret=PyTuple_New(2);
5298 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5299 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5303 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5306 char tmp2[2]; tmp2[1]='\0';
5307 tmp2[0]=self->getMinValue(tmp);
5308 PyObject *ret=PyTuple_New(2);
5309 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5310 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5314 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5316 int nbOfCompo=self->getNumberOfComponents();
5321 if(PyString_Check(obj))
5323 Py_ssize_t sz=PyString_Size(obj);
5324 char *pt=PyString_AsString(obj);
5326 return self->locateValue(pt[0]);
5328 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5331 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5334 return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5338 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5340 int nbOfCompo=self->getNumberOfComponents();
5347 if(PyString_Check(obj))
5349 Py_ssize_t sz=PyString_Size(obj);
5350 char *pt=PyString_AsString(obj);
5352 return self->presenceOfValue(pt[0]);
5354 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5357 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5360 return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5364 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5367 std::vector<int> stdvecTyyppArr;
5368 std::pair<int, std::pair<int,int> > sTyyppArr;
5369 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5370 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5374 return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5376 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5378 return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5380 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5382 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5386 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5388 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.";
5390 std::vector<int> stdvecTyyppArr;
5391 std::pair<int, std::pair<int,int> > sTyyppArr;
5392 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5393 int nbOfCompo=self->getNumberOfComponents();
5394 int nbOfTuples=self->getNumberOfTuples();
5395 convertObjToPossibleCpp2(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5397 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5398 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5407 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5413 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5414 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5417 //value vector<string>
5420 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5421 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5424 //value DataArrayChar
5427 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5431 throw INTERP_KERNEL::Exception(msg);
5435 {//obj list-tuple[int]
5441 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5447 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5448 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5451 //value vector<string>
5454 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5455 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5458 //value DataArrayChar
5461 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5465 throw INTERP_KERNEL::Exception(msg);
5476 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5482 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5483 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5486 //value vector<string>
5489 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5490 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5493 //value DataArrayChar
5496 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5500 throw INTERP_KERNEL::Exception(msg);
5511 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5517 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5518 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5521 //value vector<string>
5524 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5525 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5528 //value DataArrayChar
5531 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5535 throw INTERP_KERNEL::Exception(msg);
5540 throw INTERP_KERNEL::Exception(msg);
5546 class DataArrayAsciiCharTuple;
5548 class DataArrayAsciiCharIterator
5551 DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5552 ~DataArrayAsciiCharIterator();
5557 DataArrayAsciiCharTuple *ret=self->nextt();
5559 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5562 PyErr_SetString(PyExc_StopIteration,"No more data.");
5569 class DataArrayAsciiCharTuple
5572 int getNumberOfCompo() const;
5573 DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5576 std::string __str__() const
5578 return self->repr();
5581 DataArrayAsciiChar *buildDAAsciiChar()
5583 return self->buildDAAsciiChar(1,self->getNumberOfCompo());