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 throw INTERP_KERNEL::Exception(msg);
291 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
293 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
296 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
299 std::vector<double> bb;
301 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
302 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
303 self->pushBackValsSilent(tmp,tmp+nbTuples);
306 std::string __repr__() const throw(INTERP_KERNEL::Exception)
308 std::ostringstream oss;
309 self->reprQuickOverview(oss);
313 std::string __str__() const throw(INTERP_KERNEL::Exception)
318 double __float__() const throw(INTERP_KERNEL::Exception)
320 return self->doubleValue();
323 int __len__() const throw(INTERP_KERNEL::Exception)
325 if(self->isAllocated())
327 return self->getNumberOfTuples();
331 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
335 DataArrayDoubleIterator *__iter__()
337 return self->iterator();
340 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
342 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 !";
343 if(PyList_Check(li) || PyTuple_Check(li))
347 if(PyInt_Check(nbOfTuples))
349 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
351 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
354 if(PyInt_Check(nbOfComp))
355 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
356 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
358 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
359 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
360 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
363 throw INTERP_KERNEL::Exception(msg);
366 {//DataArrayDouble.setValues([1.,3.,4.],3)
368 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
369 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
373 throw INTERP_KERNEL::Exception(msg);
376 {// DataArrayDouble.setValues([1.,3.,4.])
377 int tmpp1=-1,tmpp2=-1;
378 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
379 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
383 throw INTERP_KERNEL::Exception(msg);
386 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
388 const double *vals=self->getConstPointer();
389 return convertDblArrToPyList(vals,self->getNbOfElems());
392 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
395 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
396 PyObject *ret=PyTuple_New(2);
397 PyObject *ret0Py=ret0?Py_True:Py_False;
399 PyTuple_SetItem(ret,0,ret0Py);
400 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
404 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
406 const double *vals=self->getConstPointer();
407 int nbOfComp=self->getNumberOfComponents();
408 int nbOfTuples=self->getNumberOfTuples();
409 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
412 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
415 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
416 if (!SWIG_IsOK(res1))
419 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
420 if(size!=self->getNumberOfTuples())
422 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
424 return self->renumber(tmp);
428 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
430 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
431 da2->checkAllocated();
432 int size=self->getNumberOfTuples();
433 if(size!=self->getNumberOfTuples())
435 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
437 return self->renumber(da2->getConstPointer());
441 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
444 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
445 if (!SWIG_IsOK(res1))
448 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
449 if(size!=self->getNumberOfTuples())
451 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
453 return self->renumberR(tmp);
457 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
459 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
460 da2->checkAllocated();
461 int size=self->getNumberOfTuples();
462 if(size!=self->getNumberOfTuples())
464 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
466 return self->renumberR(da2->getConstPointer());
470 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
473 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
474 if (!SWIG_IsOK(res1))
477 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
478 if(size!=self->getNumberOfTuples())
480 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
482 return self->renumberAndReduce(tmp,newNbOfTuple);
486 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
488 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
489 da2->checkAllocated();
490 int size=self->getNumberOfTuples();
491 if(size!=self->getNumberOfTuples())
493 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
495 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
499 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
502 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
503 if (!SWIG_IsOK(res1))
506 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
507 if(size!=self->getNumberOfTuples())
509 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
511 self->renumberInPlace(tmp);
515 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
517 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
518 da2->checkAllocated();
519 int size=self->getNumberOfTuples();
520 if(size!=self->getNumberOfTuples())
522 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
524 self->renumberInPlace(da2->getConstPointer());
528 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
531 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
532 if (!SWIG_IsOK(res1))
535 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
536 if(size!=self->getNumberOfTuples())
538 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
540 self->renumberInPlaceR(tmp);
544 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
546 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
547 da2->checkAllocated();
548 int size=self->getNumberOfTuples();
549 if(size!=self->getNumberOfTuples())
551 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
553 self->renumberInPlaceR(da2->getConstPointer());
557 DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
560 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
561 if (!SWIG_IsOK(res1))
564 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
565 return self->selectByTupleId(tmp,tmp+size);
569 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
571 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
572 da2->checkAllocated();
573 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
577 DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
580 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
581 if (!SWIG_IsOK(res1))
584 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
585 return self->selectByTupleIdSafe(tmp,tmp+size);
589 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
591 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
592 da2->checkAllocated();
593 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
597 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
599 int thisTupleId,otherTupleId;
600 double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
601 PyObject *ret=PyTuple_New(3);
602 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
603 PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
604 PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
608 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
611 double r1=self->getMaxValue(tmp);
612 PyObject *ret=PyTuple_New(2);
613 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
614 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
618 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
621 double r1=self->getMaxValue2(tmp);
622 PyObject *ret=PyTuple_New(2);
623 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
624 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
628 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
631 double r1=self->getMinValue(tmp);
632 PyObject *ret=PyTuple_New(2);
633 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
634 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
638 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
641 double r1=self->getMinValue2(tmp);
642 PyObject *ret=PyTuple_New(2);
643 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
644 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
648 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
650 int nbOfCompo=self->getNumberOfComponents();
651 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
652 self->getMinMaxPerComponent(tmp);
653 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
657 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
659 int sz=self->getNumberOfComponents();
660 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
661 self->accumulate(tmp);
662 return convertDblArrToPyList(tmp,sz);
665 DataArrayDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
667 std::vector<int> tmp;
668 convertPyToNewIntArr3(li,tmp);
669 return self->keepSelectedComponents(tmp);
672 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
674 DataArrayInt *comm, *commIndex;
675 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
676 PyObject *res = PyList_New(2);
677 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
678 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
682 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
686 DataArrayDoubleTuple *aa;
687 std::vector<double> bb;
689 int tupleId=-1,nbOfCompo=self->getNumberOfComponents();
690 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
692 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
693 PyObject *ret=PyTuple_New(2);
694 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
695 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
699 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
701 std::vector<int> tmp;
702 convertPyToNewIntArr3(li,tmp);
703 self->setSelectedComponents(a,tmp);
706 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
708 int sz=self->getNumberOfComponents();
709 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
710 self->getTuple(tupleId,tmp);
711 return convertDblArrToPyList(tmp,sz);
714 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
716 std::vector<const DataArrayDouble *> tmp;
717 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
718 return DataArrayDouble::Aggregate(tmp);
721 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
723 std::vector<const DataArrayDouble *> tmp;
724 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
725 return DataArrayDouble::Meld(tmp);
728 DataArrayDouble *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
730 std::vector<std::pair<int,int> > ranges;
731 convertPyToVectorPairInt(li,ranges);
732 return self->selectByTupleRanges(ranges);
735 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
739 DataArrayDoubleTuple *aa;
740 std::vector<double> bb;
742 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
743 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
744 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
745 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
746 DataArrayInt *c=0,*cI=0;
747 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
748 PyObject *ret=PyTuple_New(2);
749 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
750 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
754 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
756 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
757 const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
758 self->checkAllocated();
759 int nbOfTuples=self->getNumberOfTuples();
760 int nbOfComponents=self->getNumberOfComponents();
762 std::vector<int> vt1,vc1;
763 std::pair<int, std::pair<int,int> > pt1,pc1;
764 DataArrayInt *dt1=0,*dc1=0;
766 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
767 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
771 if(nbOfComponents==1)
772 return PyFloat_FromDouble(self->getIJSafe(it1,0));
773 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
775 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
777 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
779 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
781 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
784 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
785 std::vector<int> v2(1,ic1);
786 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
790 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
791 std::vector<int> v2(1,ic1);
792 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
796 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
797 std::vector<int> v2(1,ic1);
798 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
802 ret=self->selectByTupleIdSafe(&it1,&it1+1);
803 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
807 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
808 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
812 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
813 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
817 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
818 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
822 ret=self->selectByTupleIdSafe(&it1,&it1+1);
823 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
824 std::vector<int> v2(nbOfComp);
825 for(int i=0;i<nbOfComp;i++)
826 v2[i]=pc1.first+i*pc1.second.second;
827 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
831 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
832 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
833 std::vector<int> v2(nbOfComp);
834 for(int i=0;i<nbOfComp;i++)
835 v2[i]=pc1.first+i*pc1.second.second;
836 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
840 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
841 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
842 std::vector<int> v2(nbOfComp);
843 for(int i=0;i<nbOfComp;i++)
844 v2[i]=pc1.first+i*pc1.second.second;
845 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
849 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
850 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
851 std::vector<int> v2(nbOfComp);
852 for(int i=0;i<nbOfComp;i++)
853 v2[i]=pc1.first+i*pc1.second.second;
854 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
857 throw INTERP_KERNEL::Exception(msg);
861 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
863 self->checkAllocated();
864 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
865 int nbOfTuples=self->getNumberOfTuples();
866 int nbOfComponents=self->getNumberOfComponents();
869 std::vector<double> v1;
870 DataArrayDouble *d1=0;
871 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
873 std::vector<int> vt1,vc1;
874 std::pair<int, std::pair<int,int> > pt1,pc1;
875 DataArrayInt *dt1=0,*dc1=0;
876 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
877 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
885 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
888 tmp=DataArrayDouble::New();
889 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
890 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
893 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
896 throw INTERP_KERNEL::Exception(msg);
905 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
908 tmp=DataArrayDouble::New();
909 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
910 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
913 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
916 throw INTERP_KERNEL::Exception(msg);
925 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
928 tmp=DataArrayDouble::New();
929 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
930 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
933 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
936 throw INTERP_KERNEL::Exception(msg);
945 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
948 tmp=DataArrayDouble::New();
949 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
950 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
953 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
956 throw INTERP_KERNEL::Exception(msg);
965 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
968 tmp=DataArrayDouble::New();
969 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
970 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
973 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
976 throw INTERP_KERNEL::Exception(msg);
985 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
988 tmp=DataArrayDouble::New();
989 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
990 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
993 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
996 throw INTERP_KERNEL::Exception(msg);
1005 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1008 tmp=DataArrayDouble::New();
1009 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1010 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
1013 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1016 throw INTERP_KERNEL::Exception(msg);
1025 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1028 tmp=DataArrayDouble::New();
1029 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1030 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
1033 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1036 throw INTERP_KERNEL::Exception(msg);
1045 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1048 tmp=DataArrayDouble::New();
1049 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1050 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
1053 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1056 throw INTERP_KERNEL::Exception(msg);
1065 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1068 tmp=DataArrayDouble::New();
1069 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1070 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
1073 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1076 throw INTERP_KERNEL::Exception(msg);
1085 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1088 tmp=DataArrayDouble::New();
1089 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1090 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
1093 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1096 throw INTERP_KERNEL::Exception(msg);
1105 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1108 tmp=DataArrayDouble::New();
1109 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1110 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
1113 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1116 throw INTERP_KERNEL::Exception(msg);
1125 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1128 tmp=DataArrayDouble::New();
1129 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1130 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
1133 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1136 throw INTERP_KERNEL::Exception(msg);
1145 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1148 tmp=DataArrayDouble::New();
1149 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1150 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
1153 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1156 throw INTERP_KERNEL::Exception(msg);
1165 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1168 tmp=DataArrayDouble::New();
1169 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1170 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
1173 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1176 throw INTERP_KERNEL::Exception(msg);
1185 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1188 tmp=DataArrayDouble::New();
1189 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1190 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
1193 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1196 throw INTERP_KERNEL::Exception(msg);
1201 throw INTERP_KERNEL::Exception(msg);
1206 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
1208 return self->negate();
1211 PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1213 const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
1216 DataArrayDoubleTuple *aa;
1217 std::vector<double> bb;
1221 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1223 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1226 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1227 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1229 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1232 throw INTERP_KERNEL::Exception(msg);
1235 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1240 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1241 ret->applyLin(1.,val);
1242 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1246 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1250 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1251 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1255 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1256 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1259 throw INTERP_KERNEL::Exception(msg);
1263 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1265 const char msg[]="Unexpected situation in __radd__ !";
1268 DataArrayDoubleTuple *aa;
1269 std::vector<double> bb;
1271 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1276 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1277 ret->applyLin(1.,val);
1282 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1283 return DataArrayDouble::Add(self,aaa);
1287 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1288 return DataArrayDouble::Add(self,aaa);
1291 throw INTERP_KERNEL::Exception(msg);
1295 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1297 const char msg[]="Unexpected situation in __iadd__ !";
1300 DataArrayDoubleTuple *aa;
1301 std::vector<double> bb;
1303 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1308 self->applyLin(1.,val);
1309 Py_XINCREF(trueSelf);
1315 Py_XINCREF(trueSelf);
1320 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1321 self->addEqual(aaa);
1322 Py_XINCREF(trueSelf);
1327 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1328 self->addEqual(aaa);
1329 Py_XINCREF(trueSelf);
1333 throw INTERP_KERNEL::Exception(msg);
1337 PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1339 const char msg[]="Unexpected situation in __sub__ !";
1342 DataArrayDoubleTuple *aa;
1343 std::vector<double> bb;
1347 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1349 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1352 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1353 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1355 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1358 throw INTERP_KERNEL::Exception(msg);
1361 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1366 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1367 ret->applyLin(1.,-val);
1368 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1372 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1376 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1377 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1381 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1382 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1385 throw INTERP_KERNEL::Exception(msg);
1389 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1391 const char msg[]="Unexpected situation in __rsub__ !";
1394 DataArrayDoubleTuple *aa;
1395 std::vector<double> bb;
1397 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1402 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1403 ret->applyLin(-1.,val);
1408 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1409 return DataArrayDouble::Substract(aaa,self);
1413 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1414 return DataArrayDouble::Substract(aaa,self);
1417 throw INTERP_KERNEL::Exception(msg);
1421 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1423 const char msg[]="Unexpected situation in __isub__ !";
1426 DataArrayDoubleTuple *aa;
1427 std::vector<double> bb;
1429 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1434 self->applyLin(1,-val);
1435 Py_XINCREF(trueSelf);
1440 self->substractEqual(a);
1441 Py_XINCREF(trueSelf);
1446 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1447 self->substractEqual(aaa);
1448 Py_XINCREF(trueSelf);
1453 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1454 self->substractEqual(aaa);
1455 Py_XINCREF(trueSelf);
1459 throw INTERP_KERNEL::Exception(msg);
1463 PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1465 const char msg[]="Unexpected situation in __mul__ !";
1468 DataArrayDoubleTuple *aa;
1469 std::vector<double> bb;
1473 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1475 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1478 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1479 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1481 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1484 throw INTERP_KERNEL::Exception(msg);
1487 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1492 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1493 ret->applyLin(val,0.);
1494 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1498 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1502 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1503 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1507 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1508 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1511 throw INTERP_KERNEL::Exception(msg);
1515 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1517 const char msg[]="Unexpected situation in __rmul__ !";
1520 DataArrayDoubleTuple *aa;
1521 std::vector<double> bb;
1523 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1528 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1529 ret->applyLin(val,0.);
1534 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1535 return DataArrayDouble::Multiply(self,aaa);
1539 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1540 return DataArrayDouble::Multiply(self,aaa);
1543 throw INTERP_KERNEL::Exception(msg);
1547 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1549 const char msg[]="Unexpected situation in __imul__ !";
1552 DataArrayDoubleTuple *aa;
1553 std::vector<double> bb;
1555 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1560 self->applyLin(val,0.);
1561 Py_XINCREF(trueSelf);
1566 self->multiplyEqual(a);
1567 Py_XINCREF(trueSelf);
1572 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1573 self->multiplyEqual(aaa);
1574 Py_XINCREF(trueSelf);
1579 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1580 self->multiplyEqual(aaa);
1581 Py_XINCREF(trueSelf);
1585 throw INTERP_KERNEL::Exception(msg);
1589 PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1591 const char msg[]="Unexpected situation in __div__ !";
1594 DataArrayDoubleTuple *aa;
1595 std::vector<double> bb;
1599 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1601 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1604 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1605 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1607 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1610 throw INTERP_KERNEL::Exception(msg);
1613 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1619 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1620 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1621 ret->applyLin(1/val,0.);
1622 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1626 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1630 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1631 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1635 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1636 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1639 throw INTERP_KERNEL::Exception(msg);
1643 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1645 const char msg[]="Unexpected situation in __rdiv__ !";
1648 DataArrayDoubleTuple *aa;
1649 std::vector<double> bb;
1651 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1656 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1662 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1663 return DataArrayDouble::Divide(aaa,self);
1667 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1668 return DataArrayDouble::Divide(aaa,self);
1671 throw INTERP_KERNEL::Exception(msg);
1675 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1677 const char msg[]="Unexpected situation in __idiv__ !";
1680 DataArrayDoubleTuple *aa;
1681 std::vector<double> bb;
1683 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1689 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1690 self->applyLin(1./val,0.);
1691 Py_XINCREF(trueSelf);
1696 self->divideEqual(a);
1697 Py_XINCREF(trueSelf);
1702 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1703 self->divideEqual(aaa);
1704 Py_XINCREF(trueSelf);
1709 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1710 self->divideEqual(aaa);
1711 Py_XINCREF(trueSelf);
1715 throw INTERP_KERNEL::Exception(msg);
1719 DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1721 const char msg[]="Unexpected situation in __pow__ !";
1724 DataArrayDoubleTuple *aa;
1725 std::vector<double> bb;
1727 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1732 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1738 return DataArrayDouble::Pow(self,a);
1742 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1743 return DataArrayDouble::Pow(self,aaa);
1747 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1748 return DataArrayDouble::Pow(self,aaa);
1751 throw INTERP_KERNEL::Exception(msg);
1755 DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1757 const char msg[]="Unexpected situation in __rpow__ !";
1760 DataArrayDoubleTuple *aa;
1761 std::vector<double> bb;
1763 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1768 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1769 ret->applyRPow(val);
1774 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1775 return DataArrayDouble::Pow(aaa,self);
1779 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1780 return DataArrayDouble::Pow(aaa,self);
1783 throw INTERP_KERNEL::Exception(msg);
1787 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1789 const char msg[]="Unexpected situation in __ipow__ !";
1792 DataArrayDoubleTuple *aa;
1793 std::vector<double> bb;
1795 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1800 self->applyPow(val);
1801 Py_XINCREF(trueSelf);
1807 Py_XINCREF(trueSelf);
1812 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1813 self->powEqual(aaa);
1814 Py_XINCREF(trueSelf);
1819 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1820 self->powEqual(aaa);
1821 Py_XINCREF(trueSelf);
1825 throw INTERP_KERNEL::Exception(msg);
1829 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
1831 DataArrayInt *c=0,*cI=0;
1833 self->computeTupleIdsNearTuples(other,eps,c,cI);
1834 PyObject *ret=PyTuple_New(2);
1835 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1836 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1842 class DataArrayDoubleTuple;
1844 class DataArrayDoubleIterator
1847 DataArrayDoubleIterator(DataArrayDouble *da);
1848 ~DataArrayDoubleIterator();
1853 DataArrayDoubleTuple *ret=self->nextt();
1855 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
1858 PyErr_SetString(PyExc_StopIteration,"No more data.");
1865 class DataArrayDoubleTuple
1868 int getNumberOfCompo() const;
1869 DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
1872 std::string __str__() const throw(INTERP_KERNEL::Exception)
1874 return self->repr();
1877 double __float__() const throw(INTERP_KERNEL::Exception)
1879 return self->doubleValue();
1882 DataArrayDouble *buildDADouble()
1884 return self->buildDADouble(1,self->getNumberOfCompo());
1887 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1889 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
1890 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
1891 Py_XINCREF(trueSelf);
1895 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1897 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
1898 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
1899 Py_XINCREF(trueSelf);
1903 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1905 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
1906 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
1907 Py_XINCREF(trueSelf);
1911 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1913 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
1914 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
1915 Py_XINCREF(trueSelf);
1919 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1921 const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
1924 std::vector<int> multiVal;
1925 std::pair<int, std::pair<int,int> > slic;
1926 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1927 const double *pt=self->getConstPointer();
1928 int nbc=self->getNumberOfCompo();
1929 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1936 std::ostringstream oss;
1937 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
1938 throw INTERP_KERNEL::Exception(oss.str().c_str());
1941 return PyFloat_FromDouble(pt[singleVal]);
1945 return PyFloat_FromDouble(pt[nbc+singleVal]);
1948 std::ostringstream oss;
1949 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
1950 throw INTERP_KERNEL::Exception(oss.str().c_str());
1956 PyObject *t=PyTuple_New(multiVal.size());
1957 for(int j=0;j<(int)multiVal.size();j++)
1959 int cid=multiVal[j];
1962 std::ostringstream oss;
1963 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
1964 throw INTERP_KERNEL::Exception(oss.str().c_str());
1966 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
1972 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
1973 PyObject *t=PyTuple_New(sz);
1974 for(int j=0;j<sz;j++)
1975 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
1979 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
1983 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
1985 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
1986 const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
1989 std::vector<double> multiValV;
1990 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
1991 int nbc=self->getNumberOfCompo();
1992 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
1994 std::vector<int> multiVal;
1995 std::pair<int, std::pair<int,int> > slic;
1996 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1997 double *pt=self->getPointer();
1998 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2005 std::ostringstream oss;
2006 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2007 throw INTERP_KERNEL::Exception(oss.str().c_str());
2013 pt[singleVal]=singleValV;
2018 if(multiValV.size()!=1)
2020 std::ostringstream oss;
2021 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2022 throw INTERP_KERNEL::Exception(oss.str().c_str());
2024 pt[singleVal]=multiValV[0];
2029 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2033 throw INTERP_KERNEL::Exception(msg);
2042 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2046 std::ostringstream oss;
2047 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2048 throw INTERP_KERNEL::Exception(oss.str().c_str());
2056 if(multiVal.size()!=multiValV.size())
2058 std::ostringstream oss;
2059 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2060 throw INTERP_KERNEL::Exception(oss.str().c_str());
2062 for(int i=0;i<(int)multiVal.size();i++)
2064 int pos=multiVal[i];
2067 std::ostringstream oss;
2068 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2069 throw INTERP_KERNEL::Exception(oss.str().c_str());
2071 pt[multiVal[i]]=multiValV[i];
2077 const double *ptV=daIntTyyppV->getConstPointer();
2078 if(nbc>daIntTyyppV->getNumberOfCompo())
2080 std::ostringstream oss;
2081 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2082 throw INTERP_KERNEL::Exception(oss.str().c_str());
2084 std::copy(ptV,ptV+nbc,pt);
2088 throw INTERP_KERNEL::Exception(msg);
2093 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2098 for(int j=0;j<sz;j++)
2099 pt[slic.first+j*slic.second.second]=singleValV;
2104 if(sz!=(int)multiValV.size())
2106 std::ostringstream oss;
2107 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2108 throw INTERP_KERNEL::Exception(oss.str().c_str());
2110 for(int j=0;j<sz;j++)
2111 pt[slic.first+j*slic.second.second]=multiValV[j];
2116 const double *ptV=daIntTyyppV->getConstPointer();
2117 if(sz>daIntTyyppV->getNumberOfCompo())
2119 std::ostringstream oss;
2120 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
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]=ptV[j];
2128 throw INTERP_KERNEL::Exception(msg);
2132 throw INTERP_KERNEL::Exception(msg);
2138 class DataArrayIntIterator;
2140 class DataArrayInt : public DataArray
2143 static DataArrayInt *New();
2144 bool isAllocated() const throw(INTERP_KERNEL::Exception);
2145 void checkAllocated() const throw(INTERP_KERNEL::Exception);
2146 void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
2147 int intValue() const throw(INTERP_KERNEL::Exception);
2148 int getHashCode() const throw(INTERP_KERNEL::Exception);
2149 bool empty() const throw(INTERP_KERNEL::Exception);
2150 DataArrayInt *deepCpy() const throw(INTERP_KERNEL::Exception);
2151 DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2152 void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2153 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2154 void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2155 int popBackSilent() throw(INTERP_KERNEL::Exception);
2156 void pack() const throw(INTERP_KERNEL::Exception);
2157 void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
2158 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2159 bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2160 bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2161 bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2162 DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2163 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2164 void reverse() throw(INTERP_KERNEL::Exception);
2165 void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2166 bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2167 void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2168 bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2169 void fillWithZero() throw(INTERP_KERNEL::Exception);
2170 void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2171 void iota(int init=0) throw(INTERP_KERNEL::Exception);
2172 std::string repr() const throw(INTERP_KERNEL::Exception);
2173 std::string reprZip() const throw(INTERP_KERNEL::Exception);
2174 DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const;
2175 DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const;
2176 DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2177 void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
2178 DataArrayDouble *convertToDblArr() const;
2179 DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2180 DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2181 DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2182 DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2183 DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2184 bool isIdentity() const throw(INTERP_KERNEL::Exception);
2185 bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2186 DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2187 void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
2188 void transpose() throw(INTERP_KERNEL::Exception);
2189 DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2190 void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2191 void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2192 void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2193 void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2194 void setContigPartOfSelectedValues(int tupleIdStart, const DataArrayInt*a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2195 void setContigPartOfSelectedValues2(int tupleIdStart, const DataArrayInt *a, int bg, int end2, int step) throw(INTERP_KERNEL::Exception);
2196 void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2197 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2198 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2199 int back() const throw(INTERP_KERNEL::Exception);
2200 void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2201 void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2202 int *getPointer() throw(INTERP_KERNEL::Exception);
2203 const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2204 DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2205 const int *begin() const throw(INTERP_KERNEL::Exception);
2206 const int *end() const throw(INTERP_KERNEL::Exception);
2207 DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2208 DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2209 int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2210 int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2211 int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2212 int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2213 int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2214 bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2215 bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2216 bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2217 void accumulate(int *res) const throw(INTERP_KERNEL::Exception);
2218 int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2219 int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2220 int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2221 int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2222 int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2223 void abs() throw(INTERP_KERNEL::Exception);
2224 void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2225 void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2226 void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2227 DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2228 void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2229 void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2230 void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2231 void applyPow(int val) throw(INTERP_KERNEL::Exception);
2232 void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2233 DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2234 static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2);
2235 static DataArrayInt *Aggregate(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2236 static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2237 static DataArrayInt *Meld(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2238 static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2239 static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2240 static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2241 DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2242 DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2243 DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2244 DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2245 DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2246 DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2247 DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2248 void computeOffsets() throw(INTERP_KERNEL::Exception);
2249 void computeOffsets2() throw(INTERP_KERNEL::Exception);
2250 DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2251 DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2252 DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2253 DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2254 DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2255 static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2256 void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2257 static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2258 void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2259 static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2260 void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2261 static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2262 void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2263 static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2264 void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2265 static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2266 void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2268 static int *CheckAndPreparePermutation(const int *start, const int *end);
2269 static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2272 DataArrayInt() throw(INTERP_KERNEL::Exception)
2274 return DataArrayInt::New();
2277 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2279 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) !";
2280 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2284 if(PyInt_Check(nbOfTuples))
2286 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2288 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2291 if(PyInt_Check(nbOfComp))
2292 {//DataArrayInt.New([1,3,4,5],2,2)
2293 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2295 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2296 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2297 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2298 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2302 throw INTERP_KERNEL::Exception(msg);
2305 {//DataArrayInt.New([1,3,4],3)
2306 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2308 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2309 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2314 throw INTERP_KERNEL::Exception(msg);
2317 {// DataArrayInt.New([1,3,4])
2318 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2319 int tmpp1=-1,tmpp2=-1;
2320 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2321 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2325 else if(PyInt_Check(elt0))
2327 int nbOfTuples1=PyInt_AS_LONG(elt0);
2329 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2334 if(PyInt_Check(nbOfTuples))
2335 {//DataArrayInt.New(5,2)
2336 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2338 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2339 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2340 ret->alloc(nbOfTuples1,nbOfCompo);
2344 throw INTERP_KERNEL::Exception(msg);
2347 throw INTERP_KERNEL::Exception(msg);
2350 {//DataArrayInt.New(5)
2351 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2352 ret->alloc(nbOfTuples1,1);
2357 throw INTERP_KERNEL::Exception(msg);
2360 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2362 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2365 std::string __str__() const throw(INTERP_KERNEL::Exception)
2367 return self->repr();
2370 int __len__() const throw(INTERP_KERNEL::Exception)
2372 if(self->isAllocated())
2374 return self->getNumberOfTuples();
2378 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2382 int __int__() const throw(INTERP_KERNEL::Exception)
2384 return self->intValue();
2387 DataArrayIntIterator *__iter__()
2389 return self->iterator();
2392 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2394 int sz=self->getNumberOfComponents();
2395 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2396 self->accumulate(tmp);
2397 return convertIntArrToPyList(tmp,sz);
2400 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2402 int newNbOfTuples=-1;
2403 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2404 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2405 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2406 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2407 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2408 PyObject *ret=PyTuple_New(2);
2409 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2410 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2414 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2416 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 !";
2417 if(PyList_Check(li) || PyTuple_Check(li))
2421 if(PyInt_Check(nbOfTuples))
2423 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2425 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2428 if(PyInt_Check(nbOfComp))
2429 {//DataArrayInt.setValues([1,3,4,5],2,2)
2430 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2432 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2433 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2434 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2437 throw INTERP_KERNEL::Exception(msg);
2440 {//DataArrayInt.setValues([1,3,4],3)
2442 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2443 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2447 throw INTERP_KERNEL::Exception(msg);
2450 {// DataArrayInt.setValues([1,3,4])
2451 int tmpp1=-1,tmpp2=-1;
2452 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2453 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2457 throw INTERP_KERNEL::Exception(msg);
2460 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2462 const int *vals=self->getConstPointer();
2463 return convertIntArrToPyList(vals,self->getNbOfElems());
2466 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2469 bool ret0=self->isEqualIfNotWhy(other,ret1);
2470 PyObject *ret=PyTuple_New(2);
2471 PyObject *ret0Py=ret0?Py_True:Py_False;
2473 PyTuple_SetItem(ret,0,ret0Py);
2474 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2478 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2480 const int *vals=self->getConstPointer();
2481 int nbOfComp=self->getNumberOfComponents();
2482 int nbOfTuples=self->getNumberOfTuples();
2483 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2486 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2488 std::vector<const DataArrayInt *> groups;
2489 std::vector< std::vector<int> > fidsOfGroups;
2490 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2491 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2492 PyObject *ret = PyList_New(2);
2493 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2494 int sz=fidsOfGroups.size();
2495 PyObject *ret1 = PyList_New(sz);
2496 for(int i=0;i<sz;i++)
2497 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2498 PyList_SetItem(ret,1,ret1);
2502 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2505 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2506 if (!SWIG_IsOK(res1))
2509 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2510 self->transformWithIndArr(tmp,tmp+size);
2514 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2515 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2519 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2523 std::vector<int> multiVal;
2524 std::pair<int, std::pair<int,int> > slic;
2525 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2526 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2530 return self->getIdsEqualList(&singleVal,&singleVal+1);
2532 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2534 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2536 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2540 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2544 std::vector<int> multiVal;
2545 std::pair<int, std::pair<int,int> > slic;
2546 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2547 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2551 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2553 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2555 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2557 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2561 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2563 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2565 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2566 if (!SWIG_IsOK(res1))
2569 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2570 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2574 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2576 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2577 da2->checkAllocated();
2578 int size=self->getNumberOfTuples();
2579 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2581 PyObject *ret = PyList_New(3);
2582 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2583 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2584 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2588 DataArrayInt *transformWithIndArrR(PyObject *li) const
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 return self->transformWithIndArrR(tmp,tmp+size);
2600 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2601 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2605 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
2608 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2609 if (!SWIG_IsOK(res1))
2612 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2613 if(size!=self->getNumberOfTuples())
2615 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2617 self->renumberInPlace(tmp);
2621 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2623 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2624 da2->checkAllocated();
2625 int size=self->getNumberOfTuples();
2626 if(size!=self->getNumberOfTuples())
2628 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2630 self->renumberInPlace(da2->getConstPointer());
2634 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
2637 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2638 if (!SWIG_IsOK(res1))
2641 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2642 if(size!=self->getNumberOfTuples())
2644 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2646 self->renumberInPlaceR(tmp);
2650 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2652 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2653 da2->checkAllocated();
2654 int size=self->getNumberOfTuples();
2655 if(size!=self->getNumberOfTuples())
2657 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2659 self->renumberInPlaceR(da2->getConstPointer());
2663 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2666 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2667 if (!SWIG_IsOK(res1))
2670 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2671 if(size!=self->getNumberOfTuples())
2673 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2675 return self->renumberAndReduce(tmp,newNbOfTuple);
2679 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2681 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2682 da2->checkAllocated();
2683 int size=self->getNumberOfTuples();
2684 if(size!=self->getNumberOfTuples())
2686 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2688 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
2692 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
2695 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2696 if (!SWIG_IsOK(res1))
2699 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2700 if(size!=self->getNumberOfTuples())
2702 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2704 return self->renumber(tmp);
2708 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2710 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2711 da2->checkAllocated();
2712 int size=self->getNumberOfTuples();
2713 if(size!=self->getNumberOfTuples())
2715 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2717 return self->renumber(da2->getConstPointer());
2721 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
2724 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2725 if (!SWIG_IsOK(res1))
2728 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2729 if(size!=self->getNumberOfTuples())
2731 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2733 return self->renumberR(tmp);
2737 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2739 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2740 da2->checkAllocated();
2741 int size=self->getNumberOfTuples();
2742 if(size!=self->getNumberOfTuples())
2744 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2746 return self->renumberR(da2->getConstPointer());
2750 DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
2753 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2754 if (!SWIG_IsOK(res1))
2757 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2758 return self->selectByTupleId(tmp,tmp+size);
2762 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2764 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2765 da2->checkAllocated();
2766 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2770 DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
2773 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2774 if (!SWIG_IsOK(res1))
2777 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2778 return self->selectByTupleIdSafe(tmp,tmp+size);
2782 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2784 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2785 da2->checkAllocated();
2786 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2790 DataArrayInt *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
2792 std::vector<int> tmp;
2793 convertPyToNewIntArr3(li,tmp);
2794 return self->keepSelectedComponents(tmp);
2797 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
2799 std::vector<int> tmp;
2800 convertPyToNewIntArr3(li,tmp);
2801 self->setSelectedComponents(a,tmp);
2804 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
2806 int sz=self->getNumberOfComponents();
2807 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2808 self->getTuple(tupleId,tmp);
2809 return convertIntArrToPyList(tmp,sz);
2812 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
2814 DataArrayInt *arr=0;
2815 DataArrayInt *arrI=0;
2816 self->changeSurjectiveFormat(targetNb,arr,arrI);
2817 PyObject *res = PyList_New(2);
2818 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2819 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2823 DataArrayInt *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
2825 std::vector<std::pair<int,int> > ranges;
2826 convertPyToVectorPairInt(li,ranges);
2827 return self->selectByTupleRanges(ranges);
2830 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
2832 std::vector<const DataArrayInt *> tmp;
2833 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2834 return DataArrayInt::Meld(tmp);
2837 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
2839 std::vector<const DataArrayInt *> tmp;
2840 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2841 return DataArrayInt::Aggregate(tmp);
2844 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
2846 std::vector<const DataArrayInt *> tmp;
2847 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2848 return DataArrayInt::BuildUnion(tmp);
2851 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
2853 std::vector<const DataArrayInt *> tmp;
2854 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2855 return DataArrayInt::BuildIntersection(tmp);
2858 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
2861 int r1=self->getMaxValue(tmp);
2862 PyObject *ret=PyTuple_New(2);
2863 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2864 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2868 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
2871 int r1=self->getMinValue(tmp);
2872 PyObject *ret=PyTuple_New(2);
2873 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2874 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2878 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2880 int nbOfCompo=self->getNumberOfComponents();
2885 if(PyInt_Check(obj))
2887 int val=(int)PyInt_AS_LONG(obj);
2888 return self->locateValue(val);
2891 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
2895 std::vector<int> arr;
2896 convertPyToNewIntArr3(obj,arr);
2897 return self->locateTuple(arr);
2902 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
2904 int nbOfCompo=self->getNumberOfComponents();
2911 if(PyInt_Check(obj))
2913 int val=(int)PyInt_AS_LONG(obj);
2914 return self->presenceOfValue(val);
2917 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : '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->presenceOfTuple(arr);
2928 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2930 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
2931 const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2932 self->checkAllocated();
2933 int nbOfTuples=self->getNumberOfTuples();
2934 int nbOfComponents=self->getNumberOfComponents();
2936 std::vector<int> vt1,vc1;
2937 std::pair<int, std::pair<int,int> > pt1,pc1;
2938 DataArrayInt *dt1=0,*dc1=0;
2940 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
2941 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
2946 if(nbOfComponents==1)
2947 return PyInt_FromLong(self->getIJSafe(it1,0));
2948 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2951 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2953 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2955 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2957 return PyInt_FromLong(self->getIJSafe(it1,ic1));
2960 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
2961 std::vector<int> v2(1,ic1);
2962 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2966 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
2967 std::vector<int> v2(1,ic1);
2968 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2972 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
2973 std::vector<int> v2(1,ic1);
2974 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2978 ret=self->selectByTupleIdSafe(&it1,&it1+1);
2979 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2983 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
2984 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2988 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
2989 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2993 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
2994 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2998 ret=self->selectByTupleIdSafe(&it1,&it1+1);
2999 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3000 std::vector<int> v2(nbOfComp);
3001 for(int i=0;i<nbOfComp;i++)
3002 v2[i]=pc1.first+i*pc1.second.second;
3003 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3007 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3008 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3009 std::vector<int> v2(nbOfComp);
3010 for(int i=0;i<nbOfComp;i++)
3011 v2[i]=pc1.first+i*pc1.second.second;
3012 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3016 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3017 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3018 std::vector<int> v2(nbOfComp);
3019 for(int i=0;i<nbOfComp;i++)
3020 v2[i]=pc1.first+i*pc1.second.second;
3021 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3025 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3026 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3027 std::vector<int> v2(nbOfComp);
3028 for(int i=0;i<nbOfComp;i++)
3029 v2[i]=pc1.first+i*pc1.second.second;
3030 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3033 throw INTERP_KERNEL::Exception(msg);
3037 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3039 self->checkAllocated();
3040 const char msg[]="Unexpected situation in __setitem__ !";
3041 int nbOfTuples=self->getNumberOfTuples();
3042 int nbOfComponents=self->getNumberOfComponents();
3045 std::vector<int> v1;
3047 DataArrayIntTuple *dd1=0;
3048 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3050 std::vector<int> vt1,vc1;
3051 std::pair<int, std::pair<int,int> > pt1,pc1;
3052 DataArrayInt *dt1=0,*dc1=0;
3053 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3054 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3062 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3065 tmp=DataArrayInt::New();
3066 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3067 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3070 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3073 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3074 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3077 throw INTERP_KERNEL::Exception(msg);
3086 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3089 tmp=DataArrayInt::New();
3090 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3091 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3094 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3097 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3098 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3101 throw INTERP_KERNEL::Exception(msg);
3110 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3113 tmp=DataArrayInt::New();
3114 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3115 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3118 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3121 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3122 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3125 throw INTERP_KERNEL::Exception(msg);
3134 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3137 tmp=DataArrayInt::New();
3138 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3139 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3142 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3145 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3146 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3149 throw INTERP_KERNEL::Exception(msg);
3158 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3161 tmp=DataArrayInt::New();
3162 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3163 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3166 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3169 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3170 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3173 throw INTERP_KERNEL::Exception(msg);
3182 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3185 tmp=DataArrayInt::New();
3186 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3187 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3190 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3193 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3194 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3197 throw INTERP_KERNEL::Exception(msg);
3206 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3209 tmp=DataArrayInt::New();
3210 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3211 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3214 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3217 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3218 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3221 throw INTERP_KERNEL::Exception(msg);
3230 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3233 tmp=DataArrayInt::New();
3234 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3235 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3238 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3241 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3242 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3245 throw INTERP_KERNEL::Exception(msg);
3254 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3257 tmp=DataArrayInt::New();
3258 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3259 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3262 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3265 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3266 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3269 throw INTERP_KERNEL::Exception(msg);
3278 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3281 tmp=DataArrayInt::New();
3282 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3283 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3286 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3289 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3290 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3293 throw INTERP_KERNEL::Exception(msg);
3302 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3305 tmp=DataArrayInt::New();
3306 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3307 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3310 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3313 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3314 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3317 throw INTERP_KERNEL::Exception(msg);
3326 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3329 tmp=DataArrayInt::New();
3330 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3331 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3334 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3337 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3338 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3341 throw INTERP_KERNEL::Exception(msg);
3350 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3353 tmp=DataArrayInt::New();
3354 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3355 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3358 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3361 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3362 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3365 throw INTERP_KERNEL::Exception(msg);
3374 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3377 tmp=DataArrayInt::New();
3378 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3379 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3382 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3385 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3386 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3389 throw INTERP_KERNEL::Exception(msg);
3398 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3401 tmp=DataArrayInt::New();
3402 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3403 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3406 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3409 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3410 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3413 throw INTERP_KERNEL::Exception(msg);
3422 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3425 tmp=DataArrayInt::New();
3426 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3427 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3430 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3433 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3434 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3437 throw INTERP_KERNEL::Exception(msg);
3442 throw INTERP_KERNEL::Exception(msg);
3447 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3449 return self->negate();
3452 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3454 const char msg[]="Unexpected situation in __add__ !";
3457 std::vector<int> aa;
3458 DataArrayIntTuple *aaa;
3460 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3465 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3466 ret->applyLin(1,val);
3471 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3472 return DataArrayInt::Add(self,aaaa);
3476 return DataArrayInt::Add(self,a);
3480 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3481 return DataArrayInt::Add(self,aaaa);
3484 throw INTERP_KERNEL::Exception(msg);
3488 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3490 const char msg[]="Unexpected situation in __radd__ !";
3493 std::vector<int> aa;
3494 DataArrayIntTuple *aaa;
3496 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3501 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3502 ret->applyLin(1,val);
3507 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3508 return DataArrayInt::Add(self,aaaa);
3512 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3513 return DataArrayInt::Add(self,aaaa);
3516 throw INTERP_KERNEL::Exception(msg);
3520 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3522 const char msg[]="Unexpected situation in __iadd__ !";
3525 std::vector<int> aa;
3526 DataArrayIntTuple *aaa;
3528 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3533 self->applyLin(1,val);
3534 Py_XINCREF(trueSelf);
3539 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3541 Py_XINCREF(trueSelf);
3547 Py_XINCREF(trueSelf);
3552 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3553 self->addEqual(aaaa);
3554 Py_XINCREF(trueSelf);
3558 throw INTERP_KERNEL::Exception(msg);
3562 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3564 const char msg[]="Unexpected situation in __sub__ !";
3567 std::vector<int> aa;
3568 DataArrayIntTuple *aaa;
3570 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3575 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3576 ret->applyLin(1,-val);
3581 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3582 return DataArrayInt::Substract(self,aaaa);
3586 return DataArrayInt::Substract(self,a);
3590 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3591 return DataArrayInt::Substract(self,aaaa);
3594 throw INTERP_KERNEL::Exception(msg);
3598 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3600 const char msg[]="Unexpected situation in __rsub__ !";
3603 std::vector<int> aa;
3604 DataArrayIntTuple *aaa;
3606 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3611 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3612 ret->applyLin(-1,val);
3617 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3618 return DataArrayInt::Substract(aaaa,self);
3622 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3623 return DataArrayInt::Substract(aaaa,self);
3626 throw INTERP_KERNEL::Exception(msg);
3630 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3632 const char msg[]="Unexpected situation in __isub__ !";
3635 std::vector<int> aa;
3636 DataArrayIntTuple *aaa;
3638 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3643 self->applyLin(1,-val);
3644 Py_XINCREF(trueSelf);
3649 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3650 self->substractEqual(bb);
3651 Py_XINCREF(trueSelf);
3656 self->substractEqual(a);
3657 Py_XINCREF(trueSelf);
3662 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3663 self->substractEqual(aaaa);
3664 Py_XINCREF(trueSelf);
3668 throw INTERP_KERNEL::Exception(msg);
3672 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3674 const char msg[]="Unexpected situation in __mul__ !";
3677 std::vector<int> aa;
3678 DataArrayIntTuple *aaa;
3680 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3685 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3686 ret->applyLin(val,0);
3691 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3692 return DataArrayInt::Multiply(self,aaaa);
3696 return DataArrayInt::Multiply(self,a);
3700 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3701 return DataArrayInt::Multiply(self,aaaa);
3704 throw INTERP_KERNEL::Exception(msg);
3708 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3710 const char msg[]="Unexpected situation in __rmul__ !";
3713 std::vector<int> aa;
3714 DataArrayIntTuple *aaa;
3716 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3721 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3722 ret->applyLin(val,0);
3727 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3728 return DataArrayInt::Multiply(self,aaaa);
3732 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3733 return DataArrayInt::Multiply(self,aaaa);
3736 throw INTERP_KERNEL::Exception(msg);
3740 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3742 const char msg[]="Unexpected situation in __imul__ !";
3745 std::vector<int> aa;
3746 DataArrayIntTuple *aaa;
3748 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3753 self->applyLin(val,0);
3754 Py_XINCREF(trueSelf);
3759 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3760 self->multiplyEqual(bb);
3761 Py_XINCREF(trueSelf);
3766 self->multiplyEqual(a);
3767 Py_XINCREF(trueSelf);
3772 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3773 self->multiplyEqual(aaaa);
3774 Py_XINCREF(trueSelf);
3778 throw INTERP_KERNEL::Exception(msg);
3782 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3784 const char msg[]="Unexpected situation in __div__ !";
3787 std::vector<int> aa;
3788 DataArrayIntTuple *aaa;
3790 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3795 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3796 ret->applyDivideBy(val);
3801 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3802 return DataArrayInt::Divide(self,aaaa);
3806 return DataArrayInt::Divide(self,a);
3810 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3811 return DataArrayInt::Divide(self,aaaa);
3814 throw INTERP_KERNEL::Exception(msg);
3818 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3820 const char msg[]="Unexpected situation in __rdiv__ !";
3823 std::vector<int> aa;
3824 DataArrayIntTuple *aaa;
3826 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3831 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3837 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3838 return DataArrayInt::Divide(aaaa,self);
3842 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3843 return DataArrayInt::Divide(aaaa,self);
3846 throw INTERP_KERNEL::Exception(msg);
3850 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3852 const char msg[]="Unexpected situation in __idiv__ !";
3855 std::vector<int> aa;
3856 DataArrayIntTuple *aaa;
3858 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3863 self->applyDivideBy(val);
3864 Py_XINCREF(trueSelf);
3869 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3870 self->divideEqual(bb);
3871 Py_XINCREF(trueSelf);
3876 self->divideEqual(a);
3877 Py_XINCREF(trueSelf);
3882 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3883 self->divideEqual(aaaa);
3884 Py_XINCREF(trueSelf);
3888 throw INTERP_KERNEL::Exception(msg);
3892 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3894 const char msg[]="Unexpected situation in __mod__ !";
3897 std::vector<int> aa;
3898 DataArrayIntTuple *aaa;
3900 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3905 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3906 ret->applyModulus(val);
3911 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3912 return DataArrayInt::Modulus(self,aaaa);
3916 return DataArrayInt::Modulus(self,a);
3920 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3921 return DataArrayInt::Modulus(self,aaaa);
3924 throw INTERP_KERNEL::Exception(msg);
3928 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3930 const char msg[]="Unexpected situation in __rmod__ !";
3933 std::vector<int> aa;
3934 DataArrayIntTuple *aaa;
3936 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3941 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3942 ret->applyRModulus(val);
3947 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3948 return DataArrayInt::Modulus(aaaa,self);
3952 return DataArrayInt::Modulus(a,self);
3956 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3957 return DataArrayInt::Modulus(aaaa,self);
3960 throw INTERP_KERNEL::Exception(msg);
3964 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3966 const char msg[]="Unexpected situation in __imod__ !";
3969 std::vector<int> aa;
3970 DataArrayIntTuple *aaa;
3972 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3977 self->applyModulus(val);
3978 Py_XINCREF(trueSelf);
3983 self->modulusEqual(a);
3984 Py_XINCREF(trueSelf);
3989 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3990 self->modulusEqual(aaaa);
3991 Py_XINCREF(trueSelf);
3995 throw INTERP_KERNEL::Exception(msg);
3999 DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4001 const char msg[]="Unexpected situation in __pow__ !";
4004 std::vector<int> aa;
4005 DataArrayIntTuple *aaa;
4007 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4012 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4018 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4019 return DataArrayInt::Pow(self,aaaa);
4023 return DataArrayInt::Pow(self,a);
4027 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4028 return DataArrayInt::Pow(self,aaaa);
4031 throw INTERP_KERNEL::Exception(msg);
4035 DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4037 const char msg[]="Unexpected situation in __rpow__ !";
4040 std::vector<int> aa;
4041 DataArrayIntTuple *aaa;
4043 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4048 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4049 ret->applyRPow(val);
4054 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4055 return DataArrayInt::Pow(aaaa,self);
4059 return DataArrayInt::Pow(a,self);
4063 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4064 return DataArrayInt::Pow(aaaa,self);
4067 throw INTERP_KERNEL::Exception(msg);
4071 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4073 const char msg[]="Unexpected situation in __ipow__ !";
4076 std::vector<int> aa;
4077 DataArrayIntTuple *aaa;
4079 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4084 self->applyPow(val);
4085 Py_XINCREF(trueSelf);
4091 Py_XINCREF(trueSelf);
4096 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4097 self->powEqual(aaaa);
4098 Py_XINCREF(trueSelf);
4102 throw INTERP_KERNEL::Exception(msg);
4106 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4108 std::ostringstream oss;
4109 self->reprQuickOverview(oss);
4113 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4115 int szArr,sw,iTypppArr;
4116 std::vector<int> stdvecTyyppArr;
4117 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4118 self->pushBackValsSilent(tmp,tmp+szArr);
4121 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4123 std::vector<int> ret1;
4124 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4125 std::size_t sz=ret0.size();
4126 PyObject *pyRet=PyTuple_New(2);
4127 PyObject *pyRet0=PyList_New((int)sz);
4128 PyObject *pyRet1=PyList_New((int)sz);
4129 for(std::size_t i=0;i<sz;i++)
4131 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4132 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4134 PyTuple_SetItem(pyRet,0,pyRet0);
4135 PyTuple_SetItem(pyRet,1,pyRet1);
4139 PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4141 DataArrayInt *ret0=0,*ret1=0;
4142 self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4143 PyObject *pyRet=PyTuple_New(2);
4144 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4145 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4151 class DataArrayIntTuple;
4153 class DataArrayIntIterator
4156 DataArrayIntIterator(DataArrayInt *da);
4157 ~DataArrayIntIterator();
4162 DataArrayIntTuple *ret=self->nextt();
4164 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4167 PyErr_SetString(PyExc_StopIteration,"No more data.");
4174 class DataArrayIntTuple
4177 int getNumberOfCompo() const;
4178 DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4181 std::string __str__() const throw(INTERP_KERNEL::Exception)
4183 return self->repr();
4186 int __int__() const throw(INTERP_KERNEL::Exception)
4188 return self->intValue();
4191 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4193 return self->buildDAInt(1,self->getNumberOfCompo());
4196 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4198 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4199 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4200 Py_XINCREF(trueSelf);
4204 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4206 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4207 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4208 Py_XINCREF(trueSelf);
4212 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4214 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4215 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4216 Py_XINCREF(trueSelf);
4220 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4222 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4223 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4224 Py_XINCREF(trueSelf);
4228 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4230 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4231 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4232 Py_XINCREF(trueSelf);
4236 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4238 const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4241 std::vector<int> multiVal;
4242 std::pair<int, std::pair<int,int> > slic;
4243 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4244 const int *pt=self->getConstPointer();
4245 int nbc=self->getNumberOfCompo();
4246 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4253 std::ostringstream oss;
4254 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4255 throw INTERP_KERNEL::Exception(oss.str().c_str());
4258 return PyInt_FromLong(pt[singleVal]);
4262 return PyInt_FromLong(pt[nbc+singleVal]);
4265 std::ostringstream oss;
4266 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4267 throw INTERP_KERNEL::Exception(oss.str().c_str());
4273 PyObject *t=PyTuple_New(multiVal.size());
4274 for(int j=0;j<(int)multiVal.size();j++)
4276 int cid=multiVal[j];
4279 std::ostringstream oss;
4280 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4281 throw INTERP_KERNEL::Exception(oss.str().c_str());
4283 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4289 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4290 PyObject *t=PyTuple_New(sz);
4291 for(int j=0;j<sz;j++)
4292 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4296 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4300 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4302 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4303 const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4306 std::vector<int> multiValV;
4307 std::pair<int, std::pair<int,int> > slicV;
4308 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4309 int nbc=self->getNumberOfCompo();
4310 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4312 std::vector<int> multiVal;
4313 std::pair<int, std::pair<int,int> > slic;
4314 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4315 int *pt=self->getPointer();
4316 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4323 std::ostringstream oss;
4324 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4325 throw INTERP_KERNEL::Exception(oss.str().c_str());
4331 pt[singleVal]=singleValV;
4336 if(multiValV.size()!=1)
4338 std::ostringstream oss;
4339 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4340 throw INTERP_KERNEL::Exception(oss.str().c_str());
4342 pt[singleVal]=multiValV[0];
4347 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4351 throw INTERP_KERNEL::Exception(msg);
4360 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4364 std::ostringstream oss;
4365 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4366 throw INTERP_KERNEL::Exception(oss.str().c_str());
4374 if(multiVal.size()!=multiValV.size())
4376 std::ostringstream oss;
4377 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4378 throw INTERP_KERNEL::Exception(oss.str().c_str());
4380 for(int i=0;i<(int)multiVal.size();i++)
4382 int pos=multiVal[i];
4385 std::ostringstream oss;
4386 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4387 throw INTERP_KERNEL::Exception(oss.str().c_str());
4389 pt[multiVal[i]]=multiValV[i];
4395 const int *ptV=daIntTyyppV->getConstPointer();
4396 if(nbc>daIntTyyppV->getNumberOfCompo())
4398 std::ostringstream oss;
4399 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4400 throw INTERP_KERNEL::Exception(oss.str().c_str());
4402 std::copy(ptV,ptV+nbc,pt);
4406 throw INTERP_KERNEL::Exception(msg);
4411 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4416 for(int j=0;j<sz;j++)
4417 pt[slic.first+j*slic.second.second]=singleValV;
4422 if(sz!=(int)multiValV.size())
4424 std::ostringstream oss;
4425 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4426 throw INTERP_KERNEL::Exception(oss.str().c_str());
4428 for(int j=0;j<sz;j++)
4429 pt[slic.first+j*slic.second.second]=multiValV[j];
4434 const int *ptV=daIntTyyppV->getConstPointer();
4435 if(sz>daIntTyyppV->getNumberOfCompo())
4437 std::ostringstream oss;
4438 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4439 throw INTERP_KERNEL::Exception(oss.str().c_str());
4441 for(int j=0;j<sz;j++)
4442 pt[slic.first+j*slic.second.second]=ptV[j];
4446 throw INTERP_KERNEL::Exception(msg);
4450 throw INTERP_KERNEL::Exception(msg);
4456 class DataArrayChar : public DataArray
4459 virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception) = 0;
4460 bool isAllocated() const throw(INTERP_KERNEL::Exception);
4461 void checkAllocated() const throw(INTERP_KERNEL::Exception);
4462 void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
4463 int getHashCode() const throw(INTERP_KERNEL::Exception);
4464 bool empty() const throw(INTERP_KERNEL::Exception);
4465 void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4466 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4467 void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4468 void pushBackValsSilent(const char *valsBg, const char *valsEnd) throw(INTERP_KERNEL::Exception);
4469 char popBackSilent() throw(INTERP_KERNEL::Exception);
4470 void pack() const throw(INTERP_KERNEL::Exception);
4471 void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
4472 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4473 bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4474 bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4475 void reverse() throw(INTERP_KERNEL::Exception);
4476 void fillWithZero() throw(INTERP_KERNEL::Exception);
4477 void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4478 std::string repr() const throw(INTERP_KERNEL::Exception);
4479 std::string reprZip() const throw(INTERP_KERNEL::Exception);
4480 void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
4481 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4482 void renumberInPlace(const int *old2New) throw(INTERP_KERNEL::Exception);
4483 void renumberInPlaceR(const int *new2Old) throw(INTERP_KERNEL::Exception);
4484 DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4485 DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4486 DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4487 DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const throw(INTERP_KERNEL::Exception);
4488 DataArrayChar *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
4489 bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4490 void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
4491 DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4492 DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4493 void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4494 void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4495 char back() const throw(INTERP_KERNEL::Exception);
4496 void setIJ(int tupleId, int compoId, char newVal);
4497 void setIJSilent(int tupleId, int compoId, char newVal);
4499 DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4500 DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4501 int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4502 bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4503 char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4504 char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4505 char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4506 char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4507 DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4508 static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2);
4509 static DataArrayChar *Aggregate(const std::vector<const DataArrayChar *>& arr) throw(INTERP_KERNEL::Exception);
4510 static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4511 static DataArrayChar *Meld(const std::vector<const DataArrayChar *>& arr) throw(INTERP_KERNEL::Exception);
4514 int __len__() const throw(INTERP_KERNEL::Exception)
4516 if(self->isAllocated())
4518 return self->getNumberOfTuples();
4522 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4526 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4529 bool ret0=self->isEqualIfNotWhy(other,ret1);
4530 PyObject *ret=PyTuple_New(2);
4531 PyObject *ret0Py=ret0?Py_True:Py_False;
4533 PyTuple_SetItem(ret,0,ret0Py);
4534 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4538 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
4541 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4542 if (!SWIG_IsOK(res1))
4545 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4546 if(size!=self->getNumberOfTuples())
4548 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4550 self->renumberInPlace(tmp);
4554 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4556 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4557 da2->checkAllocated();
4558 int size=self->getNumberOfTuples();
4559 if(size!=self->getNumberOfTuples())
4561 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4563 self->renumberInPlace(da2->getConstPointer());
4567 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
4570 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4571 if (!SWIG_IsOK(res1))
4574 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4575 if(size!=self->getNumberOfTuples())
4577 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4579 self->renumberInPlaceR(tmp);
4583 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4585 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4586 da2->checkAllocated();
4587 int size=self->getNumberOfTuples();
4588 if(size!=self->getNumberOfTuples())
4590 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4592 self->renumberInPlaceR(da2->getConstPointer());
4596 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4599 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4600 if (!SWIG_IsOK(res1))
4603 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4604 if(size!=self->getNumberOfTuples())
4606 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4608 return self->renumber(tmp);
4612 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4614 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4615 da2->checkAllocated();
4616 int size=self->getNumberOfTuples();
4617 if(size!=self->getNumberOfTuples())
4619 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4621 return self->renumber(da2->getConstPointer());
4625 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4628 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4629 if (!SWIG_IsOK(res1))
4632 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4633 if(size!=self->getNumberOfTuples())
4635 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4637 return self->renumberR(tmp);
4641 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4643 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4644 da2->checkAllocated();
4645 int size=self->getNumberOfTuples();
4646 if(size!=self->getNumberOfTuples())
4648 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4650 return self->renumberR(da2->getConstPointer());
4654 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4657 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4658 if (!SWIG_IsOK(res1))
4661 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4662 if(size!=self->getNumberOfTuples())
4664 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4666 return self->renumberAndReduce(tmp,newNbOfTuple);
4670 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4672 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4673 da2->checkAllocated();
4674 int size=self->getNumberOfTuples();
4675 if(size!=self->getNumberOfTuples())
4677 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4679 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4683 DataArrayChar *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
4686 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4687 if (!SWIG_IsOK(res1))
4690 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4691 return self->selectByTupleIdSafe(tmp,tmp+size);
4695 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4697 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4698 da2->checkAllocated();
4699 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4703 DataArrayChar *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4705 std::vector<int> tmp;
4706 convertPyToNewIntArr3(li,tmp);
4707 return self->keepSelectedComponents(tmp);
4710 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4712 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4713 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4714 return DataArrayChar::Aggregate(tmp);
4717 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4719 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4720 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4721 return DataArrayChar::Meld(tmp);
4726 class DataArrayByteIterator;
4728 class DataArrayByte : public DataArrayChar
4731 static DataArrayByte *New();
4732 DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4733 DataArrayByteIterator *iterator();
4734 DataArrayByte *deepCpy() const;
4735 DataArrayByte *performCpy(bool deepCpy) const;
4736 char byteValue() const throw(INTERP_KERNEL::Exception);
4739 DataArrayByte() throw(INTERP_KERNEL::Exception)
4741 return DataArrayByte::New();
4744 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4746 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) !";
4747 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4751 if(PyInt_Check(nbOfTuples))
4753 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4755 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4758 if(PyInt_Check(nbOfComp))
4759 {//DataArrayByte.New([1,3,4,5],2,2)
4760 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4762 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4763 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4764 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4765 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4769 throw INTERP_KERNEL::Exception(msg);
4772 {//DataArrayByte.New([1,3,4],3)
4773 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4775 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4776 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4781 throw INTERP_KERNEL::Exception(msg);
4784 {// DataArrayByte.New([1,3,4])
4785 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4786 int tmpp1=-1,tmpp2=-1;
4787 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4788 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4792 else if(PyInt_Check(elt0))
4794 int nbOfTuples1=PyInt_AS_LONG(elt0);
4796 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4801 if(PyInt_Check(nbOfTuples))
4802 {//DataArrayByte.New(5,2)
4803 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4805 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4806 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4807 ret->alloc(nbOfTuples1,nbOfCompo);
4811 throw INTERP_KERNEL::Exception(msg);
4814 throw INTERP_KERNEL::Exception(msg);
4817 {//DataArrayByte.New(5)
4818 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4819 ret->alloc(nbOfTuples1,1);
4824 throw INTERP_KERNEL::Exception(msg);
4827 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4829 return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4832 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4834 std::ostringstream oss;
4835 self->reprQuickOverview(oss);
4839 int __int__() const throw(INTERP_KERNEL::Exception)
4841 return (int) self->byteValue();
4844 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
4846 return self->iterator();
4849 int getIJ(int tupleId, int compoId) const
4851 return (int)self->getIJ(tupleId,compoId);
4854 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4856 return (int)self->getIJSafe(tupleId,compoId);
4859 std::string __str__() const throw(INTERP_KERNEL::Exception)
4861 return self->repr();
4864 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
4866 const char *vals=self->getConstPointer();
4867 int nbOfComp=self->getNumberOfComponents();
4868 int nbOfTuples=self->getNumberOfTuples();
4869 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4872 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4875 int ival=-1; std::vector<int> ivval;
4876 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4877 std::vector<char> vals(sz);
4878 std::copy(pt,pt+sz,vals.begin());
4879 return self->presenceOfTuple(vals);
4882 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4885 int ival=-1; std::vector<int> ivval;
4886 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4887 std::vector<char> vals2(sz);
4888 std::copy(pt,pt+sz,vals2.begin());
4889 return self->presenceOfValue(vals2);
4892 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4895 int ival=-1; std::vector<int> ivval;
4896 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
4897 std::vector<char> vals2(sz);
4898 std::copy(pt,pt+sz,vals2.begin());
4899 return self->locateValue(vals2);
4902 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4905 int ival=-1; std::vector<int> ivval;
4906 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
4907 std::vector<char> vals(sz);
4908 std::copy(pt,pt+sz,vals.begin());
4909 return self->locateTuple(vals);
4912 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
4915 int ival=-1; std::vector<int> ivval;
4916 const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
4917 std::vector<char> vals(sz);
4918 std::copy(pt,pt+sz,vals.begin());
4919 return self->search(vals);
4922 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
4924 int sz=self->getNumberOfComponents();
4925 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
4926 self->getTuple(tupleId,tmp);
4927 PyObject *ret=PyTuple_New(sz);
4928 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
4932 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
4935 int r1=(int)self->getMaxValue(tmp);
4936 PyObject *ret=PyTuple_New(2);
4937 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4938 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4942 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
4945 int r1=(int)self->getMinValue(tmp);
4946 PyObject *ret=PyTuple_New(2);
4947 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4948 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4952 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4954 int nbOfCompo=self->getNumberOfComponents();
4959 if(PyInt_Check(obj))
4961 int val=(int)PyInt_AS_LONG(obj);
4962 return self->locateValue(val);
4965 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
4968 return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
4972 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4974 int nbOfCompo=self->getNumberOfComponents();
4981 if(PyInt_Check(obj))
4983 int val=(int)PyInt_AS_LONG(obj);
4984 return self->presenceOfValue(val);
4987 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
4990 return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
4996 class DataArrayByteTuple;
4998 class DataArrayByteIterator
5001 DataArrayByteIterator(DataArrayByte *da);
5002 ~DataArrayByteIterator();
5005 class DataArrayByteTuple
5008 std::string repr() const throw(INTERP_KERNEL::Exception);
5009 DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5012 std::string __str__() const
5014 return self->repr();
5017 char __int__() const throw(INTERP_KERNEL::Exception)
5019 return self->byteValue();
5022 DataArrayByte *buildDAByte()
5024 return self->buildDAByte(1,self->getNumberOfCompo());
5029 class DataArrayAsciiCharIterator;
5031 class DataArrayAsciiChar : public DataArrayChar
5034 static DataArrayAsciiChar *New();
5035 DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
5036 DataArrayAsciiCharIterator *iterator();
5037 DataArrayAsciiChar *deepCpy() const;
5038 DataArrayAsciiChar *performCpy(bool deepCpy) const;
5039 char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5042 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5044 return DataArrayAsciiChar::New();
5047 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5049 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) !";
5050 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5054 if(PyInt_Check(nbOfTuples))
5056 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5058 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5061 if(PyInt_Check(nbOfComp))
5062 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5063 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5065 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5066 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5067 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5068 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5072 throw INTERP_KERNEL::Exception(msg);
5075 {//DataArrayAsciiChar.New([1,3,4],3)
5076 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5078 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5079 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5083 else if(PyString_Check(nbOfTuples))
5085 if(PyString_Size(nbOfTuples)!=1)
5086 throw INTERP_KERNEL::Exception(msg);
5087 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5088 std::vector<std::string> tmp;
5089 if(fillStringVector(elt0,tmp))
5090 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5092 throw INTERP_KERNEL::Exception(msg);
5095 throw INTERP_KERNEL::Exception(msg);
5099 std::vector<std::string> tmmp;
5100 if(fillStringVector(elt0,tmmp))
5101 //DataArrayAsciiChar.New(["abc","de","fghi"])
5102 return DataArrayAsciiChar::New(tmmp,' ');
5105 // DataArrayAsciiChar.New([1,3,4])
5106 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5107 int tmpp1=-1,tmpp2=-1;
5108 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5109 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5114 else if(PyInt_Check(elt0))
5116 int nbOfTuples1=PyInt_AS_LONG(elt0);
5118 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5123 if(PyInt_Check(nbOfTuples))
5124 {//DataArrayAsciiChar.New(5,2)
5125 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5127 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5128 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5129 ret->alloc(nbOfTuples1,nbOfCompo);
5133 throw INTERP_KERNEL::Exception(msg);
5136 throw INTERP_KERNEL::Exception(msg);
5139 {//DataArrayAsciiChar.New(5)
5140 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5141 ret->alloc(nbOfTuples1,1);
5146 throw INTERP_KERNEL::Exception(msg);
5149 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5151 return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5154 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5156 std::ostringstream oss;
5157 self->reprQuickOverview(oss);
5161 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5163 return self->iterator();
5166 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5168 char tmp[2]; tmp[1]='\0';
5169 tmp[0]=self->getIJ(tupleId,compoId);
5170 return std::string(tmp);
5173 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5175 char tmp[2]; tmp[1]='\0';
5176 tmp[0]=self->getIJSafe(tupleId,compoId);
5177 return std::string(tmp);
5180 std::string __str__() const throw(INTERP_KERNEL::Exception)
5182 return self->repr();
5185 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5187 const char *vals=self->getConstPointer();
5188 int nbOfComp=self->getNumberOfComponents();
5189 int nbOfTuples=self->getNumberOfTuples();
5190 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5193 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5195 if(PyString_Check(tupl))
5197 Py_ssize_t sz=PyString_Size(tupl);
5198 std::vector<char> vals(sz);
5199 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5200 return self->presenceOfTuple(vals);
5203 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5206 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5208 if(PyString_Check(vals))
5210 Py_ssize_t sz=PyString_Size(vals);
5211 std::vector<char> vals2(sz);
5212 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5213 return self->presenceOfValue(vals2);
5216 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5219 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5221 if(PyString_Check(vals))
5223 Py_ssize_t sz=PyString_Size(vals);
5224 std::vector<char> vals2(sz);
5225 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5226 return self->locateValue(vals2);
5229 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5232 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5234 if(PyString_Check(tupl))
5236 Py_ssize_t sz=PyString_Size(tupl);
5237 std::vector<char> vals(sz);
5238 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5239 return self->locateTuple(vals);
5242 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5245 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5247 if(PyString_Check(strOrListOfInt))
5249 Py_ssize_t sz=PyString_Size(strOrListOfInt);
5250 std::vector<char> vals(sz);
5251 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5252 return self->search(vals);
5255 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5258 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5260 int sz=self->getNumberOfComponents();
5261 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5262 self->getTuple(tupleId,tmp);
5263 return PyString_FromString(tmp);
5266 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5269 char tmp2[2]; tmp2[1]='\0';
5270 tmp2[0]=self->getMaxValue(tmp);
5271 PyObject *ret=PyTuple_New(2);
5272 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5273 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5277 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5280 char tmp2[2]; tmp2[1]='\0';
5281 tmp2[0]=self->getMinValue(tmp);
5282 PyObject *ret=PyTuple_New(2);
5283 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5284 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5288 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5290 int nbOfCompo=self->getNumberOfComponents();
5295 if(PyString_Check(obj))
5297 Py_ssize_t sz=PyString_Size(obj);
5298 char *pt=PyString_AsString(obj);
5300 return self->locateValue(pt[0]);
5302 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5305 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5308 return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5312 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5314 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->presenceOfValue(pt[0]);
5328 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5331 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5334 return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5338 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5341 std::vector<int> stdvecTyyppArr;
5342 std::pair<int, std::pair<int,int> > sTyyppArr;
5343 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5344 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5348 return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5350 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5352 return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5354 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5356 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5360 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5362 static const char msg[]="DataArrayAsciiChar::__setitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input, and 4 types accepted in value : string, list or tuple of strings having same size, not null DataArrayChar instance.";
5364 std::vector<int> stdvecTyyppArr;
5365 std::pair<int, std::pair<int,int> > sTyyppArr;
5366 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5367 int nbOfCompo=self->getNumberOfComponents();
5368 int nbOfTuples=self->getNumberOfTuples();
5369 convertObjToPossibleCpp2(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5371 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5372 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5381 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5387 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5388 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5391 //value vector<string>
5394 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5395 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5398 //value DataArrayChar
5401 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5405 throw INTERP_KERNEL::Exception(msg);
5409 {//obj list-tuple[int]
5415 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5421 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5422 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5425 //value vector<string>
5428 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5429 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5432 //value DataArrayChar
5435 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5439 throw INTERP_KERNEL::Exception(msg);
5450 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5456 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5457 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5460 //value vector<string>
5463 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5464 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5467 //value DataArrayChar
5470 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5474 throw INTERP_KERNEL::Exception(msg);
5485 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5491 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5492 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5495 //value vector<string>
5498 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5499 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5502 //value DataArrayChar
5505 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5509 throw INTERP_KERNEL::Exception(msg);
5514 throw INTERP_KERNEL::Exception(msg);
5520 class DataArrayAsciiCharTuple;
5522 class DataArrayAsciiCharIterator
5525 DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5526 ~DataArrayAsciiCharIterator();
5531 DataArrayAsciiCharTuple *ret=self->nextt();
5533 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5536 PyErr_SetString(PyExc_StopIteration,"No more data.");
5543 class DataArrayAsciiCharTuple
5546 int getNumberOfCompo() const;
5547 DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5550 std::string __str__() const
5552 return self->repr();
5555 DataArrayAsciiChar *buildDAAsciiChar()
5557 return self->buildDAAsciiChar(1,self->getNumberOfCompo());