1 // Copyright (C) 2007-2014 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, or (at your option) any later version.
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)
22 %typemap(out) ParaMEDMEM::DataArray*
24 $result=convertDataArray($1,$owner);
27 %typemap(out) DataArray*
29 $result=convertDataArray($1,$owner);
34 %typemap(out) ParaMEDMEM::DataArrayChar*
36 $result=convertDataArrayChar($1,$owner);
39 %typemap(out) DataArrayChar*
41 $result=convertDataArrayChar($1,$owner);
45 %newobject ParaMEDMEM::DataArray::deepCpy;
46 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
47 %newobject ParaMEDMEM::DataArray::selectByTupleId;
48 %newobject ParaMEDMEM::DataArray::selectByTupleIdSafe;
49 %newobject ParaMEDMEM::DataArray::selectByTupleId2;
50 %newobject ParaMEDMEM::DataArray::Aggregate;
51 %newobject ParaMEDMEM::DataArrayInt::New;
52 %newobject ParaMEDMEM::DataArrayInt::__iter__;
53 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
54 %newobject ParaMEDMEM::DataArrayInt::performCpy;
55 %newobject ParaMEDMEM::DataArrayInt::substr;
56 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
57 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
58 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
59 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
60 %newobject ParaMEDMEM::DataArrayInt::renumber;
61 %newobject ParaMEDMEM::DataArrayInt::renumberR;
62 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
63 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
64 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
65 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
66 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
67 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
68 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
69 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
70 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualTuple;
71 %newobject ParaMEDMEM::DataArrayInt::sumPerTuple;
72 %newobject ParaMEDMEM::DataArrayInt::negate;
73 %newobject ParaMEDMEM::DataArrayInt::computeAbs;
74 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
75 %newobject ParaMEDMEM::DataArrayInt::getIdsNotInRange;
76 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
77 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
78 %newobject ParaMEDMEM::DataArrayInt::Meld;
79 %newobject ParaMEDMEM::DataArrayInt::Add;
80 %newobject ParaMEDMEM::DataArrayInt::Substract;
81 %newobject ParaMEDMEM::DataArrayInt::Multiply;
82 %newobject ParaMEDMEM::DataArrayInt::Divide;
83 %newobject ParaMEDMEM::DataArrayInt::Pow;
84 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
85 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
86 %newobject ParaMEDMEM::DataArrayInt::Range;
87 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
88 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
89 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
90 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
91 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
92 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
93 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
94 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
95 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
96 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
97 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
98 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
99 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
100 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
101 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
102 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
103 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
104 %newobject ParaMEDMEM::DataArrayInt::FindPermutationFromFirstToSecond;
105 %newobject ParaMEDMEM::DataArrayInt::CheckAndPreparePermutation;
106 %newobject ParaMEDMEM::DataArrayInt::__neg__;
107 %newobject ParaMEDMEM::DataArrayInt::__add__;
108 %newobject ParaMEDMEM::DataArrayInt::__radd__;
109 %newobject ParaMEDMEM::DataArrayInt::__sub__;
110 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
111 %newobject ParaMEDMEM::DataArrayInt::__mul__;
112 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
113 %newobject ParaMEDMEM::DataArrayInt::__div__;
114 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
115 %newobject ParaMEDMEM::DataArrayInt::__mod__;
116 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
117 %newobject ParaMEDMEM::DataArrayInt::__pow__;
118 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
119 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
120 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
121 %newobject ParaMEDMEM::DataArrayChar::renumber;
122 %newobject ParaMEDMEM::DataArrayChar::renumberR;
123 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
124 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
125 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
126 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
127 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
128 %newobject ParaMEDMEM::DataArrayChar::Meld;
129 %newobject ParaMEDMEM::DataArrayByte::New;
130 %newobject ParaMEDMEM::DataArrayByte::__iter__;
131 %newobject ParaMEDMEM::DataArrayByte::performCpy;
132 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
133 %newobject ParaMEDMEM::DataArrayChar::substr;
134 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
135 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
136 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
137 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
138 %newobject ParaMEDMEM::DataArrayDouble::New;
139 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
140 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
141 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
142 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
143 %newobject ParaMEDMEM::DataArrayDouble::Meld;
144 %newobject ParaMEDMEM::DataArrayDouble::Dot;
145 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
146 %newobject ParaMEDMEM::DataArrayDouble::Add;
147 %newobject ParaMEDMEM::DataArrayDouble::Substract;
148 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
149 %newobject ParaMEDMEM::DataArrayDouble::Divide;
150 %newobject ParaMEDMEM::DataArrayDouble::Pow;
151 %newobject ParaMEDMEM::DataArrayDouble::substr;
152 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
153 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
154 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
155 %newobject ParaMEDMEM::DataArrayDouble::getIdsNotInRange;
156 %newobject ParaMEDMEM::DataArrayDouble::negate;
157 %newobject ParaMEDMEM::DataArrayDouble::computeAbs;
158 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
159 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
160 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
161 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
162 %newobject ParaMEDMEM::DataArrayDouble::determinant;
163 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
164 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
165 %newobject ParaMEDMEM::DataArrayDouble::inverse;
166 %newobject ParaMEDMEM::DataArrayDouble::trace;
167 %newobject ParaMEDMEM::DataArrayDouble::deviator;
168 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
169 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
170 %newobject ParaMEDMEM::DataArrayDouble::sumPerTuple;
171 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
172 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
173 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
174 %newobject ParaMEDMEM::DataArrayDouble::renumber;
175 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
176 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
177 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
178 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
179 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
180 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
181 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
182 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
183 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
184 %newobject ParaMEDMEM::DataArrayDouble::computeNbOfInteractionsWith;
185 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
186 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
187 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
188 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
189 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
190 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
191 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
192 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
193 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
195 %feature("unref") DataArray "$this->decrRef();"
196 %feature("unref") DataArrayDouble "$this->decrRef();"
197 %feature("unref") DataArrayInt "$this->decrRef();"
198 %feature("unref") DataArrayChar "$this->decrRef();"
199 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
200 %feature("unref") DataArrayByte "$this->decrRef();"
204 class DataArray : public RefCountObject, public TimeLabel
207 void setName(const std::string& name);
208 void copyStringInfoFrom(const DataArray& other) throw(INTERP_KERNEL::Exception);
209 void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
210 void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other) throw(INTERP_KERNEL::Exception);
211 bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const throw(INTERP_KERNEL::Exception);
212 bool areInfoEquals(const DataArray& other) const throw(INTERP_KERNEL::Exception);
213 std::string cppRepr(const std::string& varName) const throw(INTERP_KERNEL::Exception);
214 std::string getName() const;
215 void setInfoOnComponents(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
216 void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
217 std::vector<std::string> getVarsOnComponent() const throw(INTERP_KERNEL::Exception);
218 std::vector<std::string> getUnitsOnComponent() const throw(INTERP_KERNEL::Exception);
219 std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);
220 std::string getVarOnComponent(int i) const throw(INTERP_KERNEL::Exception);
221 std::string getUnitOnComponent(int i) const throw(INTERP_KERNEL::Exception);
222 void setInfoOnComponent(int i, const std::string& info) throw(INTERP_KERNEL::Exception);
223 int getNumberOfComponents() const;
224 virtual void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
225 virtual void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
226 virtual bool isAllocated() const throw(INTERP_KERNEL::Exception);
227 virtual void checkAllocated() const throw(INTERP_KERNEL::Exception);
228 virtual void desallocate() throw(INTERP_KERNEL::Exception);
229 virtual int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
230 virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
231 virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
232 virtual DataArray *deepCpy() const throw(INTERP_KERNEL::Exception);
233 virtual DataArray *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
234 virtual void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
235 void checkNbOfTuples(int nbOfTuples, const std::string& msg) const throw(INTERP_KERNEL::Exception);
236 void checkNbOfComps(int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
237 void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const throw(INTERP_KERNEL::Exception);
238 void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
239 void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const throw(INTERP_KERNEL::Exception);
240 static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
241 static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
242 static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
243 static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
244 static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
245 static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit) throw(INTERP_KERNEL::Exception);
246 void updateTime() const;
249 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
251 const std::vector<std::string>& comps=self->getInfoOnComponents();
252 PyObject *ret=PyList_New((int)comps.size());
253 for(int i=0;i<(int)comps.size();i++)
254 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
258 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
260 std::vector<int> tmp;
261 convertPyToNewIntArr3(li,tmp);
262 self->copyPartOfStringInfoFrom(other,tmp);
265 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
267 std::vector<int> tmp;
268 convertPyToNewIntArr3(li,tmp);
269 self->copyPartOfStringInfoFrom2(tmp,other);
272 virtual void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
275 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
276 if (!SWIG_IsOK(res1))
279 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
280 if(size!=self->getNumberOfTuples())
282 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
284 self->renumberInPlace(tmp);
288 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
290 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
291 da2->checkAllocated();
292 int size=self->getNumberOfTuples();
293 if(size!=self->getNumberOfTuples())
295 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
297 self->renumberInPlace(da2->getConstPointer());
301 virtual void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
304 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
305 if (!SWIG_IsOK(res1))
308 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
309 if(size!=self->getNumberOfTuples())
311 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
313 self->renumberInPlaceR(tmp);
317 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
319 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
320 da2->checkAllocated();
321 int size=self->getNumberOfTuples();
322 if(size!=self->getNumberOfTuples())
324 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
326 self->renumberInPlaceR(da2->getConstPointer());
330 //tuplesSelec in PyObject * because DataArrayInt is not already existing !
331 virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec) throw(INTERP_KERNEL::Exception)
333 static const char msg[]="DataArray::setContigPartOfSelectedValues2 : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
334 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 3rd parameter \"aBase\" should be of type DataArray");
335 DataArray *tuplesSelecPtr=CheckAndRetrieveDataArrayInstance(tuplesSelec,msg);
336 DataArrayInt *tuplesSelecPtr2=0;
339 tuplesSelecPtr2=dynamic_cast<DataArrayInt *>(tuplesSelecPtr);
341 throw INTERP_KERNEL::Exception(msg);
343 self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
346 virtual void setContigPartOfSelectedValues2(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
348 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 2nd parameter \"aBase\" should be of type DataArray");
349 self->setContigPartOfSelectedValues2(tupleIdStart,a,bg,end2,step);
352 virtual DataArray *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
354 std::vector<std::pair<int,int> > ranges;
355 convertPyToVectorPairInt(li,ranges);
356 return self->selectByTupleRanges(ranges);
359 virtual DataArray *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
362 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
363 if (!SWIG_IsOK(res1))
366 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
367 return self->selectByTupleId(tmp,tmp+size);
371 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
373 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
374 da2->checkAllocated();
375 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
379 virtual DataArray *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
382 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
383 if (!SWIG_IsOK(res1))
386 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
387 return self->selectByTupleIdSafe(tmp,tmp+size);
391 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
393 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
394 da2->checkAllocated();
395 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
399 virtual PyObject *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
401 std::vector<int> tmp;
402 convertPyToNewIntArr3(li,tmp);
403 DataArray *ret=self->keepSelectedComponents(tmp);
404 return convertDataArray(ret,SWIG_POINTER_OWN | 0 );
407 static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices) throw(INTERP_KERNEL::Exception)
409 if(!PySlice_Check(slic))
410 throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
411 Py_ssize_t strt=2,stp=2,step=2;
412 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
413 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetSlice (wrap) : the input slice is invalid !");
415 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
416 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
419 PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
421 if(!PySlice_Check(slic))
422 throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
423 Py_ssize_t strt=2,stp=2,step=2;
424 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
425 GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getSlice (wrap) : the input slice is invalid !");
427 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
428 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
431 static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
433 if(!PySlice_Check(slic))
434 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
435 Py_ssize_t strt=2,stp=2,step=2;
436 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
437 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
438 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
441 static int GetNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
443 if(!PySlice_Check(slic))
444 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
445 Py_ssize_t strt=2,stp=2,step=2;
446 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
447 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
448 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
451 static DataArray *Aggregate(PyObject *arrs) throw(INTERP_KERNEL::Exception)
453 std::vector<const DataArray *> tmp;
454 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArray *>(arrs,SWIGTYPE_p_ParaMEDMEM__DataArray,"DataArray",tmp);
455 return DataArray::Aggregate(tmp);
458 int getNumberOfItemGivenBES(PyObject *slic) const throw(INTERP_KERNEL::Exception)
460 if(!PySlice_Check(slic))
461 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
462 Py_ssize_t strt=2,stp=2,step=2;
463 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
464 GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
465 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
468 int getNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
470 if(!PySlice_Check(slic))
471 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
472 Py_ssize_t strt=2,stp=2,step=2;
473 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
474 GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
475 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
481 class DataArrayDoubleIterator;
483 class DataArrayDouble : public DataArray
486 static DataArrayDouble *New();
487 double doubleValue() const throw(INTERP_KERNEL::Exception);
488 bool empty() const throw(INTERP_KERNEL::Exception);
489 DataArrayDouble *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
490 void cpyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
491 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
492 void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
493 double popBackSilent() throw(INTERP_KERNEL::Exception);
494 void pack() const throw(INTERP_KERNEL::Exception);
495 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
496 void fillWithZero() throw(INTERP_KERNEL::Exception);
497 void fillWithValue(double val) throw(INTERP_KERNEL::Exception);
498 void iota(double init=0.) throw(INTERP_KERNEL::Exception);
499 bool isUniform(double val, double eps) const throw(INTERP_KERNEL::Exception);
500 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
501 void reverse() throw(INTERP_KERNEL::Exception);
502 void checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
503 bool isMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
504 std::string repr() const throw(INTERP_KERNEL::Exception);
505 std::string reprZip() const throw(INTERP_KERNEL::Exception);
506 bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
507 bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
508 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
509 DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
510 DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
511 DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
512 void transpose() throw(INTERP_KERNEL::Exception);
513 DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
514 void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
515 DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
516 DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception);
517 DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
518 DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const throw(INTERP_KERNEL::Exception);
519 void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
520 void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
521 void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
522 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
523 double front() const throw(INTERP_KERNEL::Exception);
524 double back() const throw(INTERP_KERNEL::Exception);
525 double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
526 void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
527 void setIJSilent(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
528 double *getPointer() throw(INTERP_KERNEL::Exception);
529 void checkNoNullValues() const throw(INTERP_KERNEL::Exception);
530 DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const throw(INTERP_KERNEL::Exception);
531 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
532 double getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
533 double getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
534 double getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
535 double getMinValueInArray() const throw(INTERP_KERNEL::Exception);
536 int count(double value, double eps) const throw(INTERP_KERNEL::Exception);
537 double getAverageValue() const throw(INTERP_KERNEL::Exception);
538 double norm2() const throw(INTERP_KERNEL::Exception);
539 double normMax() const throw(INTERP_KERNEL::Exception);
540 double normMin() const throw(INTERP_KERNEL::Exception);
541 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
542 DataArrayDouble *fromPolarToCart() const throw(INTERP_KERNEL::Exception);
543 DataArrayDouble *fromCylToCart() const throw(INTERP_KERNEL::Exception);
544 DataArrayDouble *fromSpherToCart() const throw(INTERP_KERNEL::Exception);
545 DataArrayDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
546 DataArrayDouble *determinant() const throw(INTERP_KERNEL::Exception);
547 DataArrayDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
548 DataArrayDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
549 DataArrayDouble *inverse() const throw(INTERP_KERNEL::Exception);
550 DataArrayDouble *trace() const throw(INTERP_KERNEL::Exception);
551 DataArrayDouble *deviator() const throw(INTERP_KERNEL::Exception);
552 DataArrayDouble *magnitude() const throw(INTERP_KERNEL::Exception);
553 DataArrayDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
554 DataArrayDouble *sumPerTuple() const throw(INTERP_KERNEL::Exception);
555 DataArrayDouble *buildEuclidianDistanceDenseMatrix() const throw(INTERP_KERNEL::Exception);
556 DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
557 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
558 void abs() throw(INTERP_KERNEL::Exception);
559 DataArrayDouble *computeAbs() const throw(INTERP_KERNEL::Exception);
560 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
561 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
562 void applyInv(double numerator) throw(INTERP_KERNEL::Exception);
563 void applyPow(double val) throw(INTERP_KERNEL::Exception);
564 void applyRPow(double val) throw(INTERP_KERNEL::Exception);
565 DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
566 DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
567 DataArrayDouble *applyFunc(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
568 DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
569 void applyFuncOnThis(const std::string& func, bool isSafe=true) throw(INTERP_KERNEL::Exception);
570 DataArrayDouble *applyFunc2(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
571 DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
572 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
573 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
574 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
575 DataArrayInt *getIdsNotInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
576 static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
577 static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
578 static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
579 static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
580 static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
581 static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
582 static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
583 void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
584 static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
585 void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
586 static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
587 void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
588 static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
589 void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
590 static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
591 void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
594 DataArrayDouble() throw(INTERP_KERNEL::Exception)
596 return DataArrayDouble::New();
599 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
601 const char *msgBase="ParaMEDMEM::DataArrayDouble::New : Available API are : \n-DataArrayDouble.New()\n-DataArrayDouble.New([1.,3.,4.])\n-DataArrayDouble.New([1.,3.,4.],3)\n-DataArrayDouble.New([1.,3.,4.,5.],2,2)\n-DataArrayDouble.New([1.,3.,4.,5.,7,8.],3,2)\n-DataArrayDouble.New([(1.,3.),(4.,5.),(7,8.)])\n-DataArrayDouble.New(5)\n-DataArrayDouble.New(5,2)";
602 std::string msg(msgBase);
604 msg+="\n-DataArrayDouble.New(numpy array with dtype=float64)";
607 if(PyList_Check(elt0) || PyTuple_Check(elt0))
611 if(PyInt_Check(nbOfTuples))
613 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
615 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
618 if(PyInt_Check(elt2))
619 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
620 int nbOfCompo=PyInt_AS_LONG(elt2);
622 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
623 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
624 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
625 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
629 throw INTERP_KERNEL::Exception(msg.c_str());
632 {//DataArrayDouble.New([1.,3.,4.],3)
633 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
635 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
636 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
641 throw INTERP_KERNEL::Exception(msg.c_str());
644 {// DataArrayDouble.New([1.,3.,4.])
645 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
646 int tmpp1=-1,tmpp2=-1;
647 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
648 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
652 else if(PyInt_Check(elt0))
654 int nbOfTuples1=PyInt_AS_LONG(elt0);
656 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
661 if(PyInt_Check(nbOfTuples))
662 {//DataArrayDouble.New(5,2)
663 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
665 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
666 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
667 ret->alloc(nbOfTuples1,nbOfCompo);
671 throw INTERP_KERNEL::Exception(msg.c_str());
674 throw INTERP_KERNEL::Exception(msg.c_str());
677 {//DataArrayDouble.New(5)
678 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
679 ret->alloc(nbOfTuples1,1);
684 else if(PyArray_Check(elt0) && nbOfTuples==NULL && elt2==NULL)
685 {//DataArrayDouble.New(numpyArray)
686 return BuildNewInstance<DataArrayDouble,double>(elt0,NPY_DOUBLE,&PyCallBackDataArrayDouble_RefType,"FLOAT64");
690 throw INTERP_KERNEL::Exception(msg.c_str());
691 throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
694 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
696 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
699 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
702 std::vector<double> bb;
704 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
705 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
706 self->pushBackValsSilent(tmp,tmp+nbTuples);
709 std::string __repr__() const throw(INTERP_KERNEL::Exception)
711 std::ostringstream oss;
712 self->reprQuickOverview(oss);
716 std::string __str__() const throw(INTERP_KERNEL::Exception)
721 double __float__() const throw(INTERP_KERNEL::Exception)
723 return self->doubleValue();
726 int __len__() const throw(INTERP_KERNEL::Exception)
728 if(self->isAllocated())
730 return self->getNumberOfTuples();
734 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
738 DataArrayDoubleIterator *__iter__() throw(INTERP_KERNEL::Exception)
740 return self->iterator();
743 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
745 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 !";
746 if(PyList_Check(li) || PyTuple_Check(li))
750 if(PyInt_Check(nbOfTuples))
752 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
754 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
757 if(PyInt_Check(nbOfComp))
758 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
759 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
761 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
762 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
763 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
766 throw INTERP_KERNEL::Exception(msg);
769 {//DataArrayDouble.setValues([1.,3.,4.],3)
771 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
772 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
776 throw INTERP_KERNEL::Exception(msg);
779 {// DataArrayDouble.setValues([1.,3.,4.])
780 int tmpp1=-1,tmpp2=-1;
781 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
782 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
786 throw INTERP_KERNEL::Exception(msg);
789 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
791 const double *vals=self->getConstPointer();
792 return convertDblArrToPyList(vals,self->getNbOfElems());
796 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
798 return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
802 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
805 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
806 PyObject *ret=PyTuple_New(2);
807 PyObject *ret0Py=ret0?Py_True:Py_False;
809 PyTuple_SetItem(ret,0,ret0Py);
810 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
814 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
816 const double *vals=self->getConstPointer();
817 int nbOfComp=self->getNumberOfComponents();
818 int nbOfTuples=self->getNumberOfTuples();
819 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
822 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
825 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
826 if (!SWIG_IsOK(res1))
829 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
830 if(size!=self->getNumberOfTuples())
832 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
834 return self->renumber(tmp);
838 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
840 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
841 da2->checkAllocated();
842 int size=self->getNumberOfTuples();
843 if(size!=self->getNumberOfTuples())
845 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
847 return self->renumber(da2->getConstPointer());
851 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
854 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
855 if (!SWIG_IsOK(res1))
858 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
859 if(size!=self->getNumberOfTuples())
861 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
863 return self->renumberR(tmp);
867 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
869 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
870 da2->checkAllocated();
871 int size=self->getNumberOfTuples();
872 if(size!=self->getNumberOfTuples())
874 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
876 return self->renumberR(da2->getConstPointer());
880 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
883 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
884 if (!SWIG_IsOK(res1))
887 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
888 if(size!=self->getNumberOfTuples())
890 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
892 return self->renumberAndReduce(tmp,newNbOfTuple);
896 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
898 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
899 da2->checkAllocated();
900 int size=self->getNumberOfTuples();
901 if(size!=self->getNumberOfTuples())
903 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
905 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
909 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
911 int thisTupleId,otherTupleId;
912 double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
913 PyObject *ret=PyTuple_New(3);
914 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
915 PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
916 PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
920 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
923 double r1=self->getMaxValue(tmp);
924 PyObject *ret=PyTuple_New(2);
925 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
926 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
930 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
933 double r1=self->getMaxValue2(tmp);
934 PyObject *ret=PyTuple_New(2);
935 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
936 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
940 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
943 double r1=self->getMinValue(tmp);
944 PyObject *ret=PyTuple_New(2);
945 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
946 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
950 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
953 double r1=self->getMinValue2(tmp);
954 PyObject *ret=PyTuple_New(2);
955 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
956 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
960 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
962 int nbOfCompo=self->getNumberOfComponents();
963 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
964 self->getMinMaxPerComponent(tmp);
965 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
969 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
971 int sz=self->getNumberOfComponents();
972 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
973 self->accumulate(tmp);
974 return convertDblArrToPyList(tmp,sz);
977 DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
980 std::vector<int> val2;
981 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
982 return self->accumulatePerChunck(bg,bg+sz);
985 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
987 DataArrayInt *comm, *commIndex;
988 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
989 PyObject *res = PyList_New(2);
990 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
991 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
995 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
999 DataArrayDoubleTuple *aa;
1000 std::vector<double> bb;
1002 int tupleId=-1,nbOfCompo=self->getNumberOfComponents();
1003 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
1005 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
1006 PyObject *ret=PyTuple_New(2);
1007 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1008 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
1012 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
1014 std::vector<int> tmp;
1015 convertPyToNewIntArr3(li,tmp);
1016 self->setSelectedComponents(a,tmp);
1019 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
1021 int sz=self->getNumberOfComponents();
1022 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
1023 self->getTuple(tupleId,tmp);
1024 return convertDblArrToPyList(tmp,sz);
1027 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
1029 std::vector<const DataArrayDouble *> tmp;
1030 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
1031 return DataArrayDouble::Aggregate(tmp);
1034 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
1036 std::vector<const DataArrayDouble *> tmp;
1037 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
1038 return DataArrayDouble::Meld(tmp);
1041 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1045 DataArrayDoubleTuple *aa;
1046 std::vector<double> bb;
1048 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
1049 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
1050 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
1051 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
1052 DataArrayInt *c=0,*cI=0;
1053 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
1054 PyObject *ret=PyTuple_New(2);
1055 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1056 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1060 PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const throw(INTERP_KERNEL::Exception)
1062 DataArrayInt *ret1=0;
1063 bool ret0=self->areIncludedInMe(other,prec,ret1);
1064 PyObject *ret=PyTuple_New(2);
1065 PyObject *ret0Py=ret0?Py_True:Py_False;
1067 PyTuple_SetItem(ret,0,ret0Py);
1068 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1072 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1074 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
1075 const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
1076 self->checkAllocated();
1077 int nbOfTuples=self->getNumberOfTuples();
1078 int nbOfComponents=self->getNumberOfComponents();
1080 std::vector<int> vt1,vc1;
1081 std::pair<int, std::pair<int,int> > pt1,pc1;
1082 DataArrayInt *dt1=0,*dc1=0;
1084 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1085 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
1089 if(nbOfComponents==1)
1090 return PyFloat_FromDouble(self->getIJSafe(it1,0));
1091 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1093 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1095 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1097 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1099 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
1102 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1103 std::vector<int> v2(1,ic1);
1104 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1108 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1109 std::vector<int> v2(1,ic1);
1110 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1114 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1115 std::vector<int> v2(1,ic1);
1116 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1120 ret=self->selectByTupleIdSafe(&it1,&it1+1);
1121 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1125 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1126 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1130 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1131 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1135 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1136 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1140 ret=self->selectByTupleIdSafe(&it1,&it1+1);
1141 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1142 std::vector<int> v2(nbOfComp);
1143 for(int i=0;i<nbOfComp;i++)
1144 v2[i]=pc1.first+i*pc1.second.second;
1145 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1149 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1150 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1151 std::vector<int> v2(nbOfComp);
1152 for(int i=0;i<nbOfComp;i++)
1153 v2[i]=pc1.first+i*pc1.second.second;
1154 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1158 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1159 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1160 std::vector<int> v2(nbOfComp);
1161 for(int i=0;i<nbOfComp;i++)
1162 v2[i]=pc1.first+i*pc1.second.second;
1163 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1167 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1168 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1169 std::vector<int> v2(nbOfComp);
1170 for(int i=0;i<nbOfComp;i++)
1171 v2[i]=pc1.first+i*pc1.second.second;
1172 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1175 throw INTERP_KERNEL::Exception(msg);
1179 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
1181 self->checkAllocated();
1182 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
1183 int nbOfTuples=self->getNumberOfTuples();
1184 int nbOfComponents=self->getNumberOfComponents();
1187 std::vector<double> v1;
1188 DataArrayDouble *d1=0;
1189 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
1191 std::vector<int> vt1,vc1;
1192 std::pair<int, std::pair<int,int> > pt1,pc1;
1193 DataArrayInt *dt1=0,*dc1=0;
1194 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1195 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
1203 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
1206 tmp=DataArrayDouble::New();
1207 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1208 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
1211 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
1214 throw INTERP_KERNEL::Exception(msg);
1223 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1226 tmp=DataArrayDouble::New();
1227 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1228 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
1231 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1234 throw INTERP_KERNEL::Exception(msg);
1243 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1246 tmp=DataArrayDouble::New();
1247 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1248 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
1251 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1254 throw INTERP_KERNEL::Exception(msg);
1263 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1266 tmp=DataArrayDouble::New();
1267 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1268 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
1271 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1274 throw INTERP_KERNEL::Exception(msg);
1283 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
1286 tmp=DataArrayDouble::New();
1287 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1288 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
1291 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
1294 throw INTERP_KERNEL::Exception(msg);
1303 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1306 tmp=DataArrayDouble::New();
1307 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1308 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
1311 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1314 throw INTERP_KERNEL::Exception(msg);
1323 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1326 tmp=DataArrayDouble::New();
1327 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1328 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
1331 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1334 throw INTERP_KERNEL::Exception(msg);
1343 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1346 tmp=DataArrayDouble::New();
1347 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1348 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
1351 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1354 throw INTERP_KERNEL::Exception(msg);
1363 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1366 tmp=DataArrayDouble::New();
1367 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1368 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
1371 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1374 throw INTERP_KERNEL::Exception(msg);
1383 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1386 tmp=DataArrayDouble::New();
1387 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1388 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
1391 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1394 throw INTERP_KERNEL::Exception(msg);
1403 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1406 tmp=DataArrayDouble::New();
1407 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1408 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
1411 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1414 throw INTERP_KERNEL::Exception(msg);
1423 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1426 tmp=DataArrayDouble::New();
1427 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1428 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
1431 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1434 throw INTERP_KERNEL::Exception(msg);
1443 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1446 tmp=DataArrayDouble::New();
1447 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1448 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
1451 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1454 throw INTERP_KERNEL::Exception(msg);
1463 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1466 tmp=DataArrayDouble::New();
1467 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1468 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
1471 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1474 throw INTERP_KERNEL::Exception(msg);
1483 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1486 tmp=DataArrayDouble::New();
1487 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1488 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
1491 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1494 throw INTERP_KERNEL::Exception(msg);
1503 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1506 tmp=DataArrayDouble::New();
1507 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1508 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
1511 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1514 throw INTERP_KERNEL::Exception(msg);
1519 throw INTERP_KERNEL::Exception(msg);
1524 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
1526 return self->negate();
1529 PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1531 const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
1534 DataArrayDoubleTuple *aa;
1535 std::vector<double> bb;
1538 #ifndef WITHOUT_AUTOFIELD
1540 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1542 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1545 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1546 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1548 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1551 throw INTERP_KERNEL::Exception(msg);
1555 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1560 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1561 ret->applyLin(1.,val);
1562 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1566 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1570 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1571 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1575 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1576 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1579 throw INTERP_KERNEL::Exception(msg);
1583 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1585 const char msg[]="Unexpected situation in __radd__ !";
1588 DataArrayDoubleTuple *aa;
1589 std::vector<double> bb;
1591 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1596 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1597 ret->applyLin(1.,val);
1602 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1603 return DataArrayDouble::Add(self,aaa);
1607 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1608 return DataArrayDouble::Add(self,aaa);
1611 throw INTERP_KERNEL::Exception(msg);
1615 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1617 const char msg[]="Unexpected situation in __iadd__ !";
1620 DataArrayDoubleTuple *aa;
1621 std::vector<double> bb;
1623 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1628 self->applyLin(1.,val);
1629 Py_XINCREF(trueSelf);
1635 Py_XINCREF(trueSelf);
1640 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1641 self->addEqual(aaa);
1642 Py_XINCREF(trueSelf);
1647 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1648 self->addEqual(aaa);
1649 Py_XINCREF(trueSelf);
1653 throw INTERP_KERNEL::Exception(msg);
1657 PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1659 const char msg[]="Unexpected situation in __sub__ !";
1662 DataArrayDoubleTuple *aa;
1663 std::vector<double> bb;
1666 #ifndef WITHOUT_AUTOFIELD
1668 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1670 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1673 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1674 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1676 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1679 throw INTERP_KERNEL::Exception(msg);
1683 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1688 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1689 ret->applyLin(1.,-val);
1690 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1694 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1698 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1699 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1703 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1704 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1707 throw INTERP_KERNEL::Exception(msg);
1711 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1713 const char msg[]="Unexpected situation in __rsub__ !";
1716 DataArrayDoubleTuple *aa;
1717 std::vector<double> bb;
1719 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1724 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1725 ret->applyLin(-1.,val);
1730 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1731 return DataArrayDouble::Substract(aaa,self);
1735 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1736 return DataArrayDouble::Substract(aaa,self);
1739 throw INTERP_KERNEL::Exception(msg);
1743 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1745 const char msg[]="Unexpected situation in __isub__ !";
1748 DataArrayDoubleTuple *aa;
1749 std::vector<double> bb;
1751 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1756 self->applyLin(1,-val);
1757 Py_XINCREF(trueSelf);
1762 self->substractEqual(a);
1763 Py_XINCREF(trueSelf);
1768 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1769 self->substractEqual(aaa);
1770 Py_XINCREF(trueSelf);
1775 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1776 self->substractEqual(aaa);
1777 Py_XINCREF(trueSelf);
1781 throw INTERP_KERNEL::Exception(msg);
1785 PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1787 const char msg[]="Unexpected situation in __mul__ !";
1790 DataArrayDoubleTuple *aa;
1791 std::vector<double> bb;
1794 #ifndef WITHOUT_AUTOFIELD
1796 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1798 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1801 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1802 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1804 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1807 throw INTERP_KERNEL::Exception(msg);
1811 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1816 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1817 ret->applyLin(val,0.);
1818 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1822 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1826 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1827 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1831 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1832 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1835 throw INTERP_KERNEL::Exception(msg);
1839 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1841 const char msg[]="Unexpected situation in __rmul__ !";
1844 DataArrayDoubleTuple *aa;
1845 std::vector<double> bb;
1847 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1852 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1853 ret->applyLin(val,0.);
1858 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1859 return DataArrayDouble::Multiply(self,aaa);
1863 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1864 return DataArrayDouble::Multiply(self,aaa);
1867 throw INTERP_KERNEL::Exception(msg);
1871 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1873 const char msg[]="Unexpected situation in __imul__ !";
1876 DataArrayDoubleTuple *aa;
1877 std::vector<double> bb;
1879 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1884 self->applyLin(val,0.);
1885 Py_XINCREF(trueSelf);
1890 self->multiplyEqual(a);
1891 Py_XINCREF(trueSelf);
1896 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1897 self->multiplyEqual(aaa);
1898 Py_XINCREF(trueSelf);
1903 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1904 self->multiplyEqual(aaa);
1905 Py_XINCREF(trueSelf);
1909 throw INTERP_KERNEL::Exception(msg);
1913 PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1915 const char msg[]="Unexpected situation in __div__ !";
1918 DataArrayDoubleTuple *aa;
1919 std::vector<double> bb;
1922 #ifndef WITHOUT_AUTOFIELD
1924 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1926 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1929 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1930 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1932 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1935 throw INTERP_KERNEL::Exception(msg);
1939 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1945 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1946 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1947 ret->applyLin(1/val,0.);
1948 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1952 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1956 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1957 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1961 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1962 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1965 throw INTERP_KERNEL::Exception(msg);
1969 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1971 const char msg[]="Unexpected situation in __rdiv__ !";
1974 DataArrayDoubleTuple *aa;
1975 std::vector<double> bb;
1977 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1982 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1988 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1989 return DataArrayDouble::Divide(aaa,self);
1993 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1994 return DataArrayDouble::Divide(aaa,self);
1997 throw INTERP_KERNEL::Exception(msg);
2001 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2003 const char msg[]="Unexpected situation in __idiv__ !";
2006 DataArrayDoubleTuple *aa;
2007 std::vector<double> bb;
2009 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2015 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
2016 self->applyLin(1./val,0.);
2017 Py_XINCREF(trueSelf);
2022 self->divideEqual(a);
2023 Py_XINCREF(trueSelf);
2028 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2029 self->divideEqual(aaa);
2030 Py_XINCREF(trueSelf);
2035 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2036 self->divideEqual(aaa);
2037 Py_XINCREF(trueSelf);
2041 throw INTERP_KERNEL::Exception(msg);
2045 DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2047 const char msg[]="Unexpected situation in __pow__ !";
2050 DataArrayDoubleTuple *aa;
2051 std::vector<double> bb;
2053 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2058 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2064 return DataArrayDouble::Pow(self,a);
2068 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2069 return DataArrayDouble::Pow(self,aaa);
2073 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2074 return DataArrayDouble::Pow(self,aaa);
2077 throw INTERP_KERNEL::Exception(msg);
2081 DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2083 const char msg[]="Unexpected situation in __rpow__ !";
2086 DataArrayDoubleTuple *aa;
2087 std::vector<double> bb;
2089 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2094 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2095 ret->applyRPow(val);
2100 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2101 return DataArrayDouble::Pow(aaa,self);
2105 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2106 return DataArrayDouble::Pow(aaa,self);
2109 throw INTERP_KERNEL::Exception(msg);
2113 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2115 const char msg[]="Unexpected situation in __ipow__ !";
2118 DataArrayDoubleTuple *aa;
2119 std::vector<double> bb;
2121 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2126 self->applyPow(val);
2127 Py_XINCREF(trueSelf);
2133 Py_XINCREF(trueSelf);
2138 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2139 self->powEqual(aaa);
2140 Py_XINCREF(trueSelf);
2145 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2146 self->powEqual(aaa);
2147 Py_XINCREF(trueSelf);
2151 throw INTERP_KERNEL::Exception(msg);
2155 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
2157 DataArrayInt *c=0,*cI=0;
2159 self->computeTupleIdsNearTuples(other,eps,c,cI);
2160 PyObject *ret=PyTuple_New(2);
2161 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2166 PyObject *maxPerTupleWithCompoId() const throw(INTERP_KERNEL::Exception)
2168 DataArrayInt *ret1=0;
2169 DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
2170 PyObject *ret=PyTuple_New(2);
2171 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2172 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2178 class DataArrayDoubleTuple;
2180 class DataArrayDoubleIterator
2183 DataArrayDoubleIterator(DataArrayDouble *da);
2184 ~DataArrayDoubleIterator();
2189 DataArrayDoubleTuple *ret=self->nextt();
2191 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2194 PyErr_SetString(PyExc_StopIteration,"No more data.");
2201 class DataArrayDoubleTuple
2204 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
2205 DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
2208 std::string __str__() const throw(INTERP_KERNEL::Exception)
2210 return self->repr();
2213 double __float__() const throw(INTERP_KERNEL::Exception)
2215 return self->doubleValue();
2218 DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
2220 return self->buildDADouble(1,self->getNumberOfCompo());
2223 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2225 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2226 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2227 Py_XINCREF(trueSelf);
2231 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2233 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2234 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2235 Py_XINCREF(trueSelf);
2239 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2241 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2242 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2243 Py_XINCREF(trueSelf);
2247 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2249 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2250 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2251 Py_XINCREF(trueSelf);
2255 PyObject *__len__() throw(INTERP_KERNEL::Exception)
2257 return PyInt_FromLong(self->getNumberOfCompo());
2260 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2262 const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2265 std::vector<int> multiVal;
2266 std::pair<int, std::pair<int,int> > slic;
2267 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2268 const double *pt=self->getConstPointer();
2269 int nbc=self->getNumberOfCompo();
2270 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2277 std::ostringstream oss;
2278 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2279 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
2283 return PyFloat_FromDouble(pt[singleVal]);
2287 return PyFloat_FromDouble(pt[nbc+singleVal]);
2290 std::ostringstream oss;
2291 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2292 throw INTERP_KERNEL::Exception(oss.str().c_str());
2298 PyObject *t=PyTuple_New(multiVal.size());
2299 for(int j=0;j<(int)multiVal.size();j++)
2301 int cid=multiVal[j];
2304 std::ostringstream oss;
2305 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2306 throw INTERP_KERNEL::Exception(oss.str().c_str());
2308 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2314 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2315 PyObject *t=PyTuple_New(sz);
2316 for(int j=0;j<sz;j++)
2317 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2321 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2325 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2327 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2328 const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2331 std::vector<double> multiValV;
2332 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2333 int nbc=self->getNumberOfCompo();
2334 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2336 std::vector<int> multiVal;
2337 std::pair<int, std::pair<int,int> > slic;
2338 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2339 double *pt=self->getPointer();
2340 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2347 std::ostringstream oss;
2348 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2349 throw INTERP_KERNEL::Exception(oss.str().c_str());
2355 pt[singleVal]=singleValV;
2360 if(multiValV.size()!=1)
2362 std::ostringstream oss;
2363 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2364 throw INTERP_KERNEL::Exception(oss.str().c_str());
2366 pt[singleVal]=multiValV[0];
2371 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2375 throw INTERP_KERNEL::Exception(msg);
2384 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2388 std::ostringstream oss;
2389 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2390 throw INTERP_KERNEL::Exception(oss.str().c_str());
2398 if(multiVal.size()!=multiValV.size())
2400 std::ostringstream oss;
2401 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2402 throw INTERP_KERNEL::Exception(oss.str().c_str());
2404 for(int i=0;i<(int)multiVal.size();i++)
2406 int pos=multiVal[i];
2409 std::ostringstream oss;
2410 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2411 throw INTERP_KERNEL::Exception(oss.str().c_str());
2413 pt[multiVal[i]]=multiValV[i];
2419 const double *ptV=daIntTyyppV->getConstPointer();
2420 if(nbc>daIntTyyppV->getNumberOfCompo())
2422 std::ostringstream oss;
2423 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2424 throw INTERP_KERNEL::Exception(oss.str().c_str());
2426 std::copy(ptV,ptV+nbc,pt);
2430 throw INTERP_KERNEL::Exception(msg);
2435 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2440 for(int j=0;j<sz;j++)
2441 pt[slic.first+j*slic.second.second]=singleValV;
2446 if(sz!=(int)multiValV.size())
2448 std::ostringstream oss;
2449 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2450 throw INTERP_KERNEL::Exception(oss.str().c_str());
2452 for(int j=0;j<sz;j++)
2453 pt[slic.first+j*slic.second.second]=multiValV[j];
2458 const double *ptV=daIntTyyppV->getConstPointer();
2459 if(sz>daIntTyyppV->getNumberOfCompo())
2461 std::ostringstream oss;
2462 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2463 throw INTERP_KERNEL::Exception(oss.str().c_str());
2465 for(int j=0;j<sz;j++)
2466 pt[slic.first+j*slic.second.second]=ptV[j];
2470 throw INTERP_KERNEL::Exception(msg);
2474 throw INTERP_KERNEL::Exception(msg);
2480 class DataArrayIntIterator;
2482 class DataArrayInt : public DataArray
2485 static DataArrayInt *New();
2486 int intValue() const throw(INTERP_KERNEL::Exception);
2487 int getHashCode() const throw(INTERP_KERNEL::Exception);
2488 bool empty() const throw(INTERP_KERNEL::Exception);
2489 DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2490 void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2491 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2492 void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2493 int popBackSilent() throw(INTERP_KERNEL::Exception);
2494 void pack() const throw(INTERP_KERNEL::Exception);
2495 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2496 bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2497 bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2498 bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2499 DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2500 DataArrayInt *sumPerTuple() const throw(INTERP_KERNEL::Exception);
2501 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2502 void reverse() throw(INTERP_KERNEL::Exception);
2503 void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2504 bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2505 void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2506 bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2507 void fillWithZero() throw(INTERP_KERNEL::Exception);
2508 void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2509 void iota(int init=0) throw(INTERP_KERNEL::Exception);
2510 std::string repr() const throw(INTERP_KERNEL::Exception);
2511 std::string reprZip() const throw(INTERP_KERNEL::Exception);
2512 DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2513 DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2514 DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2515 DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
2516 DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2517 DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2518 DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2519 DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2520 DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2521 bool isIdentity() const throw(INTERP_KERNEL::Exception);
2522 bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2523 DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2524 void transpose() throw(INTERP_KERNEL::Exception);
2525 DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2526 void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2527 void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2528 void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2529 void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2530 void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2531 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2532 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2533 int front() const throw(INTERP_KERNEL::Exception);
2534 int back() const throw(INTERP_KERNEL::Exception);
2535 void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2536 void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2537 int *getPointer() throw(INTERP_KERNEL::Exception);
2538 const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2539 DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2540 const int *begin() const throw(INTERP_KERNEL::Exception);
2541 const int *end() const throw(INTERP_KERNEL::Exception);
2542 DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2543 DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2544 int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2545 int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2546 int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2547 int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2548 int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2549 bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2550 bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2551 bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2552 int count(int value) const throw(INTERP_KERNEL::Exception);
2553 int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2554 int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2555 int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2556 int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2557 int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2558 void abs() throw(INTERP_KERNEL::Exception);
2559 DataArrayInt *computeAbs() const throw(INTERP_KERNEL::Exception);
2560 void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2561 void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2562 void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2563 DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2564 void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2565 void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2566 void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2567 void applyPow(int val) throw(INTERP_KERNEL::Exception);
2568 void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2569 DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2570 DataArrayInt *getIdsNotInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2571 bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2572 static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2573 static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2574 static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2575 static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2576 static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2577 static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2) throw(INTERP_KERNEL::Exception);
2578 DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2579 DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2580 DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2581 DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2582 DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2583 DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2584 DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2585 void computeOffsets() throw(INTERP_KERNEL::Exception);
2586 void computeOffsets2() throw(INTERP_KERNEL::Exception);
2587 DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2588 DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2589 DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2590 DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2591 DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2592 static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2593 void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2594 static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2595 void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2596 static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2597 void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2598 static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2599 void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2600 static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2601 void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2602 static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2603 void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2605 static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2608 DataArrayInt() throw(INTERP_KERNEL::Exception)
2610 return DataArrayInt::New();
2613 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2615 const char *msgBase="ParaMEDMEM::DataArrayInt::New : Available API are : \n-DataArrayInt.New()\n-DataArrayInt.New([1,3,4])\n-DataArrayInt.New([1,3,4],3)\n-DataArrayInt.New([1,3,4,5],2,2)\n-DataArrayInt.New([1,3,4,5,7,8],3,2)\n-DataArrayInt.New([(1,3),(4,5),(7,8)])\n-DataArrayInt.New(5)\n-DataArrayInt.New(5,2)";
2616 std::string msg(msgBase);
2618 msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2621 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2625 if(PyInt_Check(nbOfTuples))
2627 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2629 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2632 if(PyInt_Check(nbOfComp))
2633 {//DataArrayInt.New([1,3,4,5],2,2)
2634 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2636 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2637 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2638 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2639 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2643 throw INTERP_KERNEL::Exception(msg.c_str());
2646 {//DataArrayInt.New([1,3,4],3)
2647 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2649 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2650 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2655 throw INTERP_KERNEL::Exception(msg.c_str());
2658 {// DataArrayInt.New([1,3,4])
2659 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2660 int tmpp1=-1,tmpp2=-1;
2661 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2662 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2666 else if(PyInt_Check(elt0))
2668 int nbOfTuples1=PyInt_AS_LONG(elt0);
2670 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2675 if(PyInt_Check(nbOfTuples))
2676 {//DataArrayInt.New(5,2)
2677 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2679 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2680 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2681 ret->alloc(nbOfTuples1,nbOfCompo);
2685 throw INTERP_KERNEL::Exception(msg.c_str());
2688 throw INTERP_KERNEL::Exception(msg.c_str());
2691 {//DataArrayInt.New(5)
2692 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2693 ret->alloc(nbOfTuples1,1);
2698 else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2699 {//DataArrayInt.New(numpyArray)
2700 return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2704 throw INTERP_KERNEL::Exception(msg.c_str());
2705 throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
2708 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2710 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2713 std::string __str__() const throw(INTERP_KERNEL::Exception)
2715 return self->repr();
2718 int __len__() const throw(INTERP_KERNEL::Exception)
2720 if(self->isAllocated())
2722 return self->getNumberOfTuples();
2726 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2730 int __int__() const throw(INTERP_KERNEL::Exception)
2732 return self->intValue();
2735 DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2737 return self->iterator();
2740 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2742 int sz=self->getNumberOfComponents();
2743 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2744 self->accumulate(tmp);
2745 return convertIntArrToPyList(tmp,sz);
2748 DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2751 std::vector<int> val2;
2752 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2753 return self->accumulatePerChunck(bg,bg+sz);
2756 DataArrayInt *getIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
2759 std::vector<int> val2;
2760 const int *bg(convertObjToPossibleCpp1_Safe(inputTuple,sw,sz,val,val2));
2761 return self->getIdsEqualTuple(bg,bg+sz);
2764 PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
2766 std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
2767 PyObject *ret=PyList_New(slcs.size());
2768 for(std::size_t i=0;i<slcs.size();i++)
2769 PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
2773 DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const throw(INTERP_KERNEL::Exception)
2775 if(!PySlice_Check(slic))
2776 throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
2777 Py_ssize_t strt=2,stp=2,step=2;
2778 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
2779 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
2780 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
2781 throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice contains some unknowns that can't be determined in static method ! Call DataArray::getSlice (non static) instead !");
2782 return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
2785 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2787 int newNbOfTuples=-1;
2788 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2789 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2790 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2791 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2792 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2793 PyObject *ret=PyTuple_New(2);
2794 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2795 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2799 static DataArrayInt *CheckAndPreparePermutation(PyObject *arr) throw(INTERP_KERNEL::Exception)
2801 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
2802 int szArr,sw,iTypppArr;
2803 std::vector<int> stdvecTyyppArr;
2804 const int *arrPtr(convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
2805 int *pt(ParaMEDMEM::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
2806 ret->useArray(pt,true,ParaMEDMEM::C_DEALLOC,szArr,1);
2810 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2812 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 !";
2813 if(PyList_Check(li) || PyTuple_Check(li))
2817 if(PyInt_Check(nbOfTuples))
2819 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2821 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2824 if(PyInt_Check(nbOfComp))
2825 {//DataArrayInt.setValues([1,3,4,5],2,2)
2826 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2828 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2829 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2830 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2833 throw INTERP_KERNEL::Exception(msg);
2836 {//DataArrayInt.setValues([1,3,4],3)
2838 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2839 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2843 throw INTERP_KERNEL::Exception(msg);
2846 {// DataArrayInt.setValues([1,3,4])
2847 int tmpp1=-1,tmpp2=-1;
2848 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2849 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2853 throw INTERP_KERNEL::Exception(msg);
2856 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2858 const int *vals=self->getConstPointer();
2859 return convertIntArrToPyList(vals,self->getNbOfElems());
2863 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2865 return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2869 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2872 bool ret0=self->isEqualIfNotWhy(other,ret1);
2873 PyObject *ret=PyTuple_New(2);
2874 PyObject *ret0Py=ret0?Py_True:Py_False;
2876 PyTuple_SetItem(ret,0,ret0Py);
2877 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2881 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2883 const int *vals=self->getConstPointer();
2884 int nbOfComp=self->getNumberOfComponents();
2885 int nbOfTuples=self->getNumberOfTuples();
2886 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2889 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2891 std::vector<const DataArrayInt *> groups;
2892 std::vector< std::vector<int> > fidsOfGroups;
2893 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2894 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2895 PyObject *ret = PyList_New(2);
2896 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2897 int sz=fidsOfGroups.size();
2898 PyObject *ret1 = PyList_New(sz);
2899 for(int i=0;i<sz;i++)
2900 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2901 PyList_SetItem(ret,1,ret1);
2905 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2908 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2909 if (!SWIG_IsOK(res1))
2912 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2913 self->transformWithIndArr(tmp,tmp+size);
2917 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2918 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2922 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2926 std::vector<int> multiVal;
2927 std::pair<int, std::pair<int,int> > slic;
2928 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2929 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2933 return self->getIdsEqualList(&singleVal,&singleVal+1);
2935 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2937 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2939 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2943 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2947 std::vector<int> multiVal;
2948 std::pair<int, std::pair<int,int> > slic;
2949 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2950 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2954 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2956 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2958 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2960 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2964 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2966 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2968 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2969 if (!SWIG_IsOK(res1))
2972 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2973 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2977 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2979 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2980 da2->checkAllocated();
2981 int size=self->getNumberOfTuples();
2982 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2984 PyObject *ret = PyList_New(3);
2985 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2986 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2987 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2991 DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2994 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2995 if (!SWIG_IsOK(res1))
2998 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2999 return self->transformWithIndArrR(tmp,tmp+size);
3003 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3004 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3008 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3011 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3012 if (!SWIG_IsOK(res1))
3015 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3016 if(size!=self->getNumberOfTuples())
3018 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3020 return self->renumberAndReduce(tmp,newNbOfTuple);
3024 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3026 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3027 da2->checkAllocated();
3028 int size=self->getNumberOfTuples();
3029 if(size!=self->getNumberOfTuples())
3031 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3033 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3037 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3040 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3041 if (!SWIG_IsOK(res1))
3044 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3045 if(size!=self->getNumberOfTuples())
3047 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3049 return self->renumber(tmp);
3053 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3055 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3056 da2->checkAllocated();
3057 int size=self->getNumberOfTuples();
3058 if(size!=self->getNumberOfTuples())
3060 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3062 return self->renumber(da2->getConstPointer());
3066 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3069 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3070 if (!SWIG_IsOK(res1))
3073 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3074 if(size!=self->getNumberOfTuples())
3076 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3078 return self->renumberR(tmp);
3082 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3084 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3085 da2->checkAllocated();
3086 int size=self->getNumberOfTuples();
3087 if(size!=self->getNumberOfTuples())
3089 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3091 return self->renumberR(da2->getConstPointer());
3095 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3097 std::vector<int> tmp;
3098 convertPyToNewIntArr3(li,tmp);
3099 self->setSelectedComponents(a,tmp);
3102 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3104 int sz=self->getNumberOfComponents();
3105 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
3106 self->getTuple(tupleId,tmp);
3107 return convertIntArrToPyList(tmp,sz);
3110 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
3112 DataArrayInt *arr=0;
3113 DataArrayInt *arrI=0;
3114 self->changeSurjectiveFormat(targetNb,arr,arrI);
3115 PyObject *res = PyList_New(2);
3116 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3117 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3121 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3123 std::vector<const DataArrayInt *> tmp;
3124 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3125 return DataArrayInt::Meld(tmp);
3128 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3130 std::vector<const DataArrayInt *> tmp;
3131 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3132 return DataArrayInt::Aggregate(tmp);
3135 static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
3137 std::vector<const DataArrayInt *> tmp;
3138 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3139 return DataArrayInt::AggregateIndexes(tmp);
3142 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
3144 std::vector<const DataArrayInt *> tmp;
3145 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3146 return DataArrayInt::BuildUnion(tmp);
3149 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
3151 std::vector<const DataArrayInt *> tmp;
3152 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3153 return DataArrayInt::BuildIntersection(tmp);
3156 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3159 int r1=self->getMaxValue(tmp);
3160 PyObject *ret=PyTuple_New(2);
3161 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3162 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3166 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3169 int r1=self->getMinValue(tmp);
3170 PyObject *ret=PyTuple_New(2);
3171 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3172 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3176 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3178 int nbOfCompo=self->getNumberOfComponents();
3183 if(PyInt_Check(obj))
3185 int val=(int)PyInt_AS_LONG(obj);
3186 return self->locateValue(val);
3189 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
3193 std::vector<int> arr;
3194 convertPyToNewIntArr3(obj,arr);
3195 return self->locateTuple(arr);
3200 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3202 int nbOfCompo=self->getNumberOfComponents();
3209 if(PyInt_Check(obj))
3211 int val=(int)PyInt_AS_LONG(obj);
3212 return self->presenceOfValue(val);
3215 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
3219 std::vector<int> arr;
3220 convertPyToNewIntArr3(obj,arr);
3221 return self->presenceOfTuple(arr);
3226 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3228 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
3229 const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
3230 self->checkAllocated();
3231 int nbOfTuples=self->getNumberOfTuples();
3232 int nbOfComponents=self->getNumberOfComponents();
3234 std::vector<int> vt1,vc1;
3235 std::pair<int, std::pair<int,int> > pt1,pc1;
3236 DataArrayInt *dt1=0,*dc1=0;
3238 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3239 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3244 if(nbOfComponents==1)
3245 return PyInt_FromLong(self->getIJSafe(it1,0));
3246 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3249 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3251 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3253 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3255 return PyInt_FromLong(self->getIJSafe(it1,ic1));
3258 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3259 std::vector<int> v2(1,ic1);
3260 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3264 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3265 std::vector<int> v2(1,ic1);
3266 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3270 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3271 std::vector<int> v2(1,ic1);
3272 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3276 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3277 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3281 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3282 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3286 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3287 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3291 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3292 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3296 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3297 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3298 std::vector<int> v2(nbOfComp);
3299 for(int i=0;i<nbOfComp;i++)
3300 v2[i]=pc1.first+i*pc1.second.second;
3301 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3305 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3306 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3307 std::vector<int> v2(nbOfComp);
3308 for(int i=0;i<nbOfComp;i++)
3309 v2[i]=pc1.first+i*pc1.second.second;
3310 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3314 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3315 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3316 std::vector<int> v2(nbOfComp);
3317 for(int i=0;i<nbOfComp;i++)
3318 v2[i]=pc1.first+i*pc1.second.second;
3319 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3323 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3324 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3325 std::vector<int> v2(nbOfComp);
3326 for(int i=0;i<nbOfComp;i++)
3327 v2[i]=pc1.first+i*pc1.second.second;
3328 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3331 throw INTERP_KERNEL::Exception(msg);
3335 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3337 self->checkAllocated();
3338 const char msg[]="Unexpected situation in __setitem__ !";
3339 int nbOfTuples=self->getNumberOfTuples();
3340 int nbOfComponents=self->getNumberOfComponents();
3343 std::vector<int> v1;
3345 DataArrayIntTuple *dd1=0;
3346 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3348 std::vector<int> vt1,vc1;
3349 std::pair<int, std::pair<int,int> > pt1,pc1;
3350 DataArrayInt *dt1=0,*dc1=0;
3351 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3352 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3360 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3363 tmp=DataArrayInt::New();
3364 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3365 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3368 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3371 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3372 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3375 throw INTERP_KERNEL::Exception(msg);
3384 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3387 tmp=DataArrayInt::New();
3388 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3389 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3392 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3395 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3396 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3399 throw INTERP_KERNEL::Exception(msg);
3408 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3411 tmp=DataArrayInt::New();
3412 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3413 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3416 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3419 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3420 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3423 throw INTERP_KERNEL::Exception(msg);
3432 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3435 tmp=DataArrayInt::New();
3436 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3437 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3440 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3443 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3444 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3447 throw INTERP_KERNEL::Exception(msg);
3456 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3459 tmp=DataArrayInt::New();
3460 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3461 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3464 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3467 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3468 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3471 throw INTERP_KERNEL::Exception(msg);
3480 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3483 tmp=DataArrayInt::New();
3484 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3485 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3488 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3491 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3492 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3495 throw INTERP_KERNEL::Exception(msg);
3504 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3507 tmp=DataArrayInt::New();
3508 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3509 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3512 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3515 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3516 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3519 throw INTERP_KERNEL::Exception(msg);
3528 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3531 tmp=DataArrayInt::New();
3532 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3533 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3536 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3539 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3540 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3543 throw INTERP_KERNEL::Exception(msg);
3552 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3555 tmp=DataArrayInt::New();
3556 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3557 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3560 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3563 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3564 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3567 throw INTERP_KERNEL::Exception(msg);
3576 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3579 tmp=DataArrayInt::New();
3580 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3581 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3584 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3587 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3588 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3591 throw INTERP_KERNEL::Exception(msg);
3600 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3603 tmp=DataArrayInt::New();
3604 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3605 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3608 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3611 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3612 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3615 throw INTERP_KERNEL::Exception(msg);
3624 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3627 tmp=DataArrayInt::New();
3628 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3629 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3632 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3635 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3636 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3639 throw INTERP_KERNEL::Exception(msg);
3648 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3651 tmp=DataArrayInt::New();
3652 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3653 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3656 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3659 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3660 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3663 throw INTERP_KERNEL::Exception(msg);
3672 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3675 tmp=DataArrayInt::New();
3676 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3677 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3680 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3683 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3684 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3687 throw INTERP_KERNEL::Exception(msg);
3696 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3699 tmp=DataArrayInt::New();
3700 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3701 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3704 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3707 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3708 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3711 throw INTERP_KERNEL::Exception(msg);
3720 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3723 tmp=DataArrayInt::New();
3724 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3725 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3728 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3731 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3732 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3735 throw INTERP_KERNEL::Exception(msg);
3740 throw INTERP_KERNEL::Exception(msg);
3745 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3747 return self->negate();
3750 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3752 const char msg[]="Unexpected situation in __add__ !";
3755 std::vector<int> aa;
3756 DataArrayIntTuple *aaa;
3758 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3763 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3764 ret->applyLin(1,val);
3769 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3770 return DataArrayInt::Add(self,aaaa);
3774 return DataArrayInt::Add(self,a);
3778 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3779 return DataArrayInt::Add(self,aaaa);
3782 throw INTERP_KERNEL::Exception(msg);
3786 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3788 const char msg[]="Unexpected situation in __radd__ !";
3791 std::vector<int> aa;
3792 DataArrayIntTuple *aaa;
3794 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3799 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3800 ret->applyLin(1,val);
3805 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3806 return DataArrayInt::Add(self,aaaa);
3810 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3811 return DataArrayInt::Add(self,aaaa);
3814 throw INTERP_KERNEL::Exception(msg);
3818 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3820 const char msg[]="Unexpected situation in __iadd__ !";
3823 std::vector<int> aa;
3824 DataArrayIntTuple *aaa;
3826 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3831 self->applyLin(1,val);
3832 Py_XINCREF(trueSelf);
3837 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3839 Py_XINCREF(trueSelf);
3845 Py_XINCREF(trueSelf);
3850 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3851 self->addEqual(aaaa);
3852 Py_XINCREF(trueSelf);
3856 throw INTERP_KERNEL::Exception(msg);
3860 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3862 const char msg[]="Unexpected situation in __sub__ !";
3865 std::vector<int> aa;
3866 DataArrayIntTuple *aaa;
3868 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3873 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3874 ret->applyLin(1,-val);
3879 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3880 return DataArrayInt::Substract(self,aaaa);
3884 return DataArrayInt::Substract(self,a);
3888 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3889 return DataArrayInt::Substract(self,aaaa);
3892 throw INTERP_KERNEL::Exception(msg);
3896 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3898 const char msg[]="Unexpected situation in __rsub__ !";
3901 std::vector<int> aa;
3902 DataArrayIntTuple *aaa;
3904 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3909 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3910 ret->applyLin(-1,val);
3915 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3916 return DataArrayInt::Substract(aaaa,self);
3920 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3921 return DataArrayInt::Substract(aaaa,self);
3924 throw INTERP_KERNEL::Exception(msg);
3928 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3930 const char msg[]="Unexpected situation in __isub__ !";
3933 std::vector<int> aa;
3934 DataArrayIntTuple *aaa;
3936 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3941 self->applyLin(1,-val);
3942 Py_XINCREF(trueSelf);
3947 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3948 self->substractEqual(bb);
3949 Py_XINCREF(trueSelf);
3954 self->substractEqual(a);
3955 Py_XINCREF(trueSelf);
3960 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3961 self->substractEqual(aaaa);
3962 Py_XINCREF(trueSelf);
3966 throw INTERP_KERNEL::Exception(msg);
3970 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3972 const char msg[]="Unexpected situation in __mul__ !";
3975 std::vector<int> aa;
3976 DataArrayIntTuple *aaa;
3978 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3983 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3984 ret->applyLin(val,0);
3989 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3990 return DataArrayInt::Multiply(self,aaaa);
3994 return DataArrayInt::Multiply(self,a);
3998 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3999 return DataArrayInt::Multiply(self,aaaa);
4002 throw INTERP_KERNEL::Exception(msg);
4006 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4008 const char msg[]="Unexpected situation in __rmul__ !";
4011 std::vector<int> aa;
4012 DataArrayIntTuple *aaa;
4014 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4019 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4020 ret->applyLin(val,0);
4025 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4026 return DataArrayInt::Multiply(self,aaaa);
4030 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4031 return DataArrayInt::Multiply(self,aaaa);
4034 throw INTERP_KERNEL::Exception(msg);
4038 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4040 const char msg[]="Unexpected situation in __imul__ !";
4043 std::vector<int> aa;
4044 DataArrayIntTuple *aaa;
4046 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4051 self->applyLin(val,0);
4052 Py_XINCREF(trueSelf);
4057 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4058 self->multiplyEqual(bb);
4059 Py_XINCREF(trueSelf);
4064 self->multiplyEqual(a);
4065 Py_XINCREF(trueSelf);
4070 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4071 self->multiplyEqual(aaaa);
4072 Py_XINCREF(trueSelf);
4076 throw INTERP_KERNEL::Exception(msg);
4080 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4082 const char msg[]="Unexpected situation in __div__ !";
4085 std::vector<int> aa;
4086 DataArrayIntTuple *aaa;
4088 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4093 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4094 ret->applyDivideBy(val);
4099 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4100 return DataArrayInt::Divide(self,aaaa);
4104 return DataArrayInt::Divide(self,a);
4108 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4109 return DataArrayInt::Divide(self,aaaa);
4112 throw INTERP_KERNEL::Exception(msg);
4116 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4118 const char msg[]="Unexpected situation in __rdiv__ !";
4121 std::vector<int> aa;
4122 DataArrayIntTuple *aaa;
4124 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4129 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4135 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4136 return DataArrayInt::Divide(aaaa,self);
4140 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4141 return DataArrayInt::Divide(aaaa,self);
4144 throw INTERP_KERNEL::Exception(msg);
4148 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4150 const char msg[]="Unexpected situation in __idiv__ !";
4153 std::vector<int> aa;
4154 DataArrayIntTuple *aaa;
4156 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4161 self->applyDivideBy(val);
4162 Py_XINCREF(trueSelf);
4167 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4168 self->divideEqual(bb);
4169 Py_XINCREF(trueSelf);
4174 self->divideEqual(a);
4175 Py_XINCREF(trueSelf);
4180 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4181 self->divideEqual(aaaa);
4182 Py_XINCREF(trueSelf);
4186 throw INTERP_KERNEL::Exception(msg);
4190 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4192 const char msg[]="Unexpected situation in __mod__ !";
4195 std::vector<int> aa;
4196 DataArrayIntTuple *aaa;
4198 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4203 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4204 ret->applyModulus(val);
4209 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4210 return DataArrayInt::Modulus(self,aaaa);
4214 return DataArrayInt::Modulus(self,a);
4218 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4219 return DataArrayInt::Modulus(self,aaaa);
4222 throw INTERP_KERNEL::Exception(msg);
4226 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4228 const char msg[]="Unexpected situation in __rmod__ !";
4231 std::vector<int> aa;
4232 DataArrayIntTuple *aaa;
4234 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4239 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4240 ret->applyRModulus(val);
4245 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4246 return DataArrayInt::Modulus(aaaa,self);
4250 return DataArrayInt::Modulus(a,self);
4254 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4255 return DataArrayInt::Modulus(aaaa,self);
4258 throw INTERP_KERNEL::Exception(msg);
4262 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4264 const char msg[]="Unexpected situation in __imod__ !";
4267 std::vector<int> aa;
4268 DataArrayIntTuple *aaa;
4270 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4275 self->applyModulus(val);
4276 Py_XINCREF(trueSelf);
4281 self->modulusEqual(a);
4282 Py_XINCREF(trueSelf);
4287 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4288 self->modulusEqual(aaaa);
4289 Py_XINCREF(trueSelf);
4293 throw INTERP_KERNEL::Exception(msg);
4297 DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4299 const char msg[]="Unexpected situation in __pow__ !";
4302 std::vector<int> aa;
4303 DataArrayIntTuple *aaa;
4305 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4310 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4316 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4317 return DataArrayInt::Pow(self,aaaa);
4321 return DataArrayInt::Pow(self,a);
4325 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4326 return DataArrayInt::Pow(self,aaaa);
4329 throw INTERP_KERNEL::Exception(msg);
4333 DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4335 const char msg[]="Unexpected situation in __rpow__ !";
4338 std::vector<int> aa;
4339 DataArrayIntTuple *aaa;
4341 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4346 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4347 ret->applyRPow(val);
4352 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4353 return DataArrayInt::Pow(aaaa,self);
4357 return DataArrayInt::Pow(a,self);
4361 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4362 return DataArrayInt::Pow(aaaa,self);
4365 throw INTERP_KERNEL::Exception(msg);
4369 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4371 const char msg[]="Unexpected situation in __ipow__ !";
4374 std::vector<int> aa;
4375 DataArrayIntTuple *aaa;
4377 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4382 self->applyPow(val);
4383 Py_XINCREF(trueSelf);
4389 Py_XINCREF(trueSelf);
4394 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4395 self->powEqual(aaaa);
4396 Py_XINCREF(trueSelf);
4400 throw INTERP_KERNEL::Exception(msg);
4404 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4406 std::ostringstream oss;
4407 self->reprQuickOverview(oss);
4411 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4413 int szArr,sw,iTypppArr;
4414 std::vector<int> stdvecTyyppArr;
4415 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4416 self->pushBackValsSilent(tmp,tmp+szArr);
4419 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4421 std::vector<int> ret1;
4422 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4423 std::size_t sz=ret0.size();
4424 PyObject *pyRet=PyTuple_New(2);
4425 PyObject *pyRet0=PyList_New((int)sz);
4426 PyObject *pyRet1=PyList_New((int)sz);
4427 for(std::size_t i=0;i<sz;i++)
4429 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4430 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4432 PyTuple_SetItem(pyRet,0,pyRet0);
4433 PyTuple_SetItem(pyRet,1,pyRet1);
4437 PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4439 DataArrayInt *ret0=0,*ret1=0;
4440 self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4441 PyObject *pyRet=PyTuple_New(2);
4442 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4443 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4449 class DataArrayIntTuple;
4451 class DataArrayIntIterator
4454 DataArrayIntIterator(DataArrayInt *da);
4455 ~DataArrayIntIterator();
4460 DataArrayIntTuple *ret=self->nextt();
4462 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4465 PyErr_SetString(PyExc_StopIteration,"No more data.");
4472 class DataArrayIntTuple
4475 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4476 DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4479 std::string __str__() const throw(INTERP_KERNEL::Exception)
4481 return self->repr();
4484 int __int__() const throw(INTERP_KERNEL::Exception)
4486 return self->intValue();
4489 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4491 return self->buildDAInt(1,self->getNumberOfCompo());
4494 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4496 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4497 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4498 Py_XINCREF(trueSelf);
4502 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4504 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4505 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4506 Py_XINCREF(trueSelf);
4510 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4512 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4513 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4514 Py_XINCREF(trueSelf);
4518 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4520 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4521 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4522 Py_XINCREF(trueSelf);
4526 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4528 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4529 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4530 Py_XINCREF(trueSelf);
4534 PyObject *__len__() throw(INTERP_KERNEL::Exception)
4536 return PyInt_FromLong(self->getNumberOfCompo());
4539 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4541 const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4544 std::vector<int> multiVal;
4545 std::pair<int, std::pair<int,int> > slic;
4546 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4547 const int *pt=self->getConstPointer();
4548 int nbc=self->getNumberOfCompo();
4549 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4556 std::ostringstream oss;
4557 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4558 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4562 return PyInt_FromLong(pt[singleVal]);
4566 return PyInt_FromLong(pt[nbc+singleVal]);
4569 std::ostringstream oss;
4570 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4571 throw INTERP_KERNEL::Exception(oss.str().c_str());
4577 PyObject *t=PyTuple_New(multiVal.size());
4578 for(int j=0;j<(int)multiVal.size();j++)
4580 int cid=multiVal[j];
4583 std::ostringstream oss;
4584 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4585 throw INTERP_KERNEL::Exception(oss.str().c_str());
4587 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4593 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4594 PyObject *t=PyTuple_New(sz);
4595 for(int j=0;j<sz;j++)
4596 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4600 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4604 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4606 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4607 const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4610 std::vector<int> multiValV;
4611 std::pair<int, std::pair<int,int> > slicV;
4612 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4613 int nbc=self->getNumberOfCompo();
4614 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4616 std::vector<int> multiVal;
4617 std::pair<int, std::pair<int,int> > slic;
4618 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4619 int *pt=self->getPointer();
4620 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4627 std::ostringstream oss;
4628 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4629 throw INTERP_KERNEL::Exception(oss.str().c_str());
4635 pt[singleVal]=singleValV;
4640 if(multiValV.size()!=1)
4642 std::ostringstream oss;
4643 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4644 throw INTERP_KERNEL::Exception(oss.str().c_str());
4646 pt[singleVal]=multiValV[0];
4651 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4655 throw INTERP_KERNEL::Exception(msg);
4664 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4668 std::ostringstream oss;
4669 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4670 throw INTERP_KERNEL::Exception(oss.str().c_str());
4678 if(multiVal.size()!=multiValV.size())
4680 std::ostringstream oss;
4681 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4682 throw INTERP_KERNEL::Exception(oss.str().c_str());
4684 for(int i=0;i<(int)multiVal.size();i++)
4686 int pos=multiVal[i];
4689 std::ostringstream oss;
4690 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4691 throw INTERP_KERNEL::Exception(oss.str().c_str());
4693 pt[multiVal[i]]=multiValV[i];
4699 const int *ptV=daIntTyyppV->getConstPointer();
4700 if(nbc>daIntTyyppV->getNumberOfCompo())
4702 std::ostringstream oss;
4703 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4704 throw INTERP_KERNEL::Exception(oss.str().c_str());
4706 std::copy(ptV,ptV+nbc,pt);
4710 throw INTERP_KERNEL::Exception(msg);
4715 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4720 for(int j=0;j<sz;j++)
4721 pt[slic.first+j*slic.second.second]=singleValV;
4726 if(sz!=(int)multiValV.size())
4728 std::ostringstream oss;
4729 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4730 throw INTERP_KERNEL::Exception(oss.str().c_str());
4732 for(int j=0;j<sz;j++)
4733 pt[slic.first+j*slic.second.second]=multiValV[j];
4738 const int *ptV=daIntTyyppV->getConstPointer();
4739 if(sz>daIntTyyppV->getNumberOfCompo())
4741 std::ostringstream oss;
4742 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4743 throw INTERP_KERNEL::Exception(oss.str().c_str());
4745 for(int j=0;j<sz;j++)
4746 pt[slic.first+j*slic.second.second]=ptV[j];
4750 throw INTERP_KERNEL::Exception(msg);
4754 throw INTERP_KERNEL::Exception(msg);
4760 class DataArrayChar : public DataArray
4763 virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4764 int getHashCode() const throw(INTERP_KERNEL::Exception);
4765 bool empty() const throw(INTERP_KERNEL::Exception);
4766 void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4767 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4768 void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4769 char popBackSilent() throw(INTERP_KERNEL::Exception);
4770 void pack() const throw(INTERP_KERNEL::Exception);
4771 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4772 bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4773 bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4774 void reverse() throw(INTERP_KERNEL::Exception);
4775 void fillWithZero() throw(INTERP_KERNEL::Exception);
4776 void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4777 std::string repr() const throw(INTERP_KERNEL::Exception);
4778 std::string reprZip() const throw(INTERP_KERNEL::Exception);
4779 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4780 DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4781 DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4782 DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4783 bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4784 DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4785 DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4786 void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4787 void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4788 char front() const throw(INTERP_KERNEL::Exception);
4789 char back() const throw(INTERP_KERNEL::Exception);
4790 void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4791 void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4792 char *getPointer() throw(INTERP_KERNEL::Exception);
4793 DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4794 DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4795 int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4796 bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4797 char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4798 char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4799 char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4800 char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4801 DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4802 static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4803 static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4806 int __len__() const throw(INTERP_KERNEL::Exception)
4808 if(self->isAllocated())
4810 return self->getNumberOfTuples();
4814 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4818 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4821 bool ret0=self->isEqualIfNotWhy(other,ret1);
4822 PyObject *ret=PyTuple_New(2);
4823 PyObject *ret0Py=ret0?Py_True:Py_False;
4825 PyTuple_SetItem(ret,0,ret0Py);
4826 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4830 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4833 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4834 if (!SWIG_IsOK(res1))
4837 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4838 if(size!=self->getNumberOfTuples())
4840 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4842 return self->renumber(tmp);
4846 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4848 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4849 da2->checkAllocated();
4850 int size=self->getNumberOfTuples();
4851 if(size!=self->getNumberOfTuples())
4853 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4855 return self->renumber(da2->getConstPointer());
4859 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4862 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4863 if (!SWIG_IsOK(res1))
4866 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4867 if(size!=self->getNumberOfTuples())
4869 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4871 return self->renumberR(tmp);
4875 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4877 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4878 da2->checkAllocated();
4879 int size=self->getNumberOfTuples();
4880 if(size!=self->getNumberOfTuples())
4882 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4884 return self->renumberR(da2->getConstPointer());
4888 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4891 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4892 if (!SWIG_IsOK(res1))
4895 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4896 if(size!=self->getNumberOfTuples())
4898 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4900 return self->renumberAndReduce(tmp,newNbOfTuple);
4904 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4906 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4907 da2->checkAllocated();
4908 int size=self->getNumberOfTuples();
4909 if(size!=self->getNumberOfTuples())
4911 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4913 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4917 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4919 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4920 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4921 return DataArrayChar::Aggregate(tmp);
4924 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4926 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4927 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4928 return DataArrayChar::Meld(tmp);
4933 class DataArrayByteIterator;
4935 class DataArrayByte : public DataArrayChar
4938 static DataArrayByte *New();
4939 DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4940 DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4941 char byteValue() const throw(INTERP_KERNEL::Exception);
4944 DataArrayByte() throw(INTERP_KERNEL::Exception)
4946 return DataArrayByte::New();
4949 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4951 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) !";
4952 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4956 if(PyInt_Check(nbOfTuples))
4958 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4960 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4963 if(PyInt_Check(nbOfComp))
4964 {//DataArrayByte.New([1,3,4,5],2,2)
4965 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4967 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4968 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4969 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4970 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4974 throw INTERP_KERNEL::Exception(msg);
4977 {//DataArrayByte.New([1,3,4],3)
4978 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4980 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4981 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4986 throw INTERP_KERNEL::Exception(msg);
4989 {// DataArrayByte.New([1,3,4])
4990 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4991 int tmpp1=-1,tmpp2=-1;
4992 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4993 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4997 else if(PyInt_Check(elt0))
4999 int nbOfTuples1=PyInt_AS_LONG(elt0);
5001 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
5006 if(PyInt_Check(nbOfTuples))
5007 {//DataArrayByte.New(5,2)
5008 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5010 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
5011 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5012 ret->alloc(nbOfTuples1,nbOfCompo);
5016 throw INTERP_KERNEL::Exception(msg);
5019 throw INTERP_KERNEL::Exception(msg);
5022 {//DataArrayByte.New(5)
5023 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5024 ret->alloc(nbOfTuples1,1);
5029 throw INTERP_KERNEL::Exception(msg);
5032 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5034 return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5037 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5039 std::ostringstream oss;
5040 self->reprQuickOverview(oss);
5044 int __int__() const throw(INTERP_KERNEL::Exception)
5046 return (int) self->byteValue();
5049 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
5051 return self->iterator();
5054 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5056 return (int)self->getIJ(tupleId,compoId);
5059 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5061 return (int)self->getIJSafe(tupleId,compoId);
5064 std::string __str__() const throw(INTERP_KERNEL::Exception)
5066 return self->repr();
5069 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5071 const char *vals=self->getConstPointer();
5072 int nbOfComp=self->getNumberOfComponents();
5073 int nbOfTuples=self->getNumberOfTuples();
5074 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5077 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5080 int ival=-1; std::vector<int> ivval;
5081 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5082 std::vector<char> vals(sz);
5083 std::copy(pt,pt+sz,vals.begin());
5084 return self->presenceOfTuple(vals);
5087 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5090 int ival=-1; std::vector<int> ivval;
5091 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5092 std::vector<char> vals2(sz);
5093 std::copy(pt,pt+sz,vals2.begin());
5094 return self->presenceOfValue(vals2);
5097 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5100 int ival=-1; std::vector<int> ivval;
5101 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5102 std::vector<char> vals2(sz);
5103 std::copy(pt,pt+sz,vals2.begin());
5104 return self->locateValue(vals2);
5107 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5110 int ival=-1; std::vector<int> ivval;
5111 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5112 std::vector<char> vals(sz);
5113 std::copy(pt,pt+sz,vals.begin());
5114 return self->locateTuple(vals);
5117 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5120 int ival=-1; std::vector<int> ivval;
5121 const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
5122 std::vector<char> vals(sz);
5123 std::copy(pt,pt+sz,vals.begin());
5124 return self->search(vals);
5127 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5129 int sz=self->getNumberOfComponents();
5130 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
5131 self->getTuple(tupleId,tmp);
5132 PyObject *ret=PyTuple_New(sz);
5133 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
5137 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5140 int r1=(int)self->getMaxValue(tmp);
5141 PyObject *ret=PyTuple_New(2);
5142 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5143 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5147 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5150 int r1=(int)self->getMinValue(tmp);
5151 PyObject *ret=PyTuple_New(2);
5152 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5153 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5157 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5159 int nbOfCompo=self->getNumberOfComponents();
5164 if(PyInt_Check(obj))
5166 int val=(int)PyInt_AS_LONG(obj);
5167 return self->locateValue(val);
5170 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
5173 return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
5177 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5179 int nbOfCompo=self->getNumberOfComponents();
5186 if(PyInt_Check(obj))
5188 int val=(int)PyInt_AS_LONG(obj);
5189 return self->presenceOfValue(val);
5192 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5195 return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
5199 DataArrayByte *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5201 self->checkAllocated();
5202 const char msg[]="Unexpected situation in __setitem__ !";
5203 int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
5206 std::vector<int> v1;
5208 DataArrayIntTuple *dd1=0;
5209 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5211 std::vector<int> vt1,vc1;
5212 std::pair<int, std::pair<int,int> > pt1,pc1;
5213 DataArrayInt *dt1=0,*dc1=0;
5214 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5215 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5223 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5226 throw INTERP_KERNEL::Exception(msg);
5235 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5238 throw INTERP_KERNEL::Exception(msg);
5247 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5250 throw INTERP_KERNEL::Exception(msg);
5259 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5262 throw INTERP_KERNEL::Exception(msg);
5271 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5274 throw INTERP_KERNEL::Exception(msg);
5283 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5286 throw INTERP_KERNEL::Exception(msg);
5295 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5298 throw INTERP_KERNEL::Exception(msg);
5307 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5310 throw INTERP_KERNEL::Exception(msg);
5319 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5322 throw INTERP_KERNEL::Exception(msg);
5331 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5334 throw INTERP_KERNEL::Exception(msg);
5343 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5346 throw INTERP_KERNEL::Exception(msg);
5355 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5358 throw INTERP_KERNEL::Exception(msg);
5367 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5370 throw INTERP_KERNEL::Exception(msg);
5379 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5382 throw INTERP_KERNEL::Exception(msg);
5391 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5394 throw INTERP_KERNEL::Exception(msg);
5403 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5406 throw INTERP_KERNEL::Exception(msg);
5411 throw INTERP_KERNEL::Exception(msg);
5418 class DataArrayByteTuple;
5420 class DataArrayByteIterator
5423 DataArrayByteIterator(DataArrayByte *da);
5424 ~DataArrayByteIterator();
5427 class DataArrayByteTuple
5430 std::string repr() const throw(INTERP_KERNEL::Exception);
5431 DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5434 std::string __str__() const throw(INTERP_KERNEL::Exception)
5436 return self->repr();
5439 char __int__() const throw(INTERP_KERNEL::Exception)
5441 return self->byteValue();
5444 DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5446 return self->buildDAByte(1,self->getNumberOfCompo());
5451 class DataArrayAsciiCharIterator;
5453 class DataArrayAsciiChar : public DataArrayChar
5456 static DataArrayAsciiChar *New();
5457 DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5458 DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5459 char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5462 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5464 return DataArrayAsciiChar::New();
5467 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5469 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) !";
5470 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5474 if(PyInt_Check(nbOfTuples))
5476 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5478 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5481 if(PyInt_Check(nbOfComp))
5482 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5483 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5485 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5486 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5487 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5488 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5492 throw INTERP_KERNEL::Exception(msg);
5495 {//DataArrayAsciiChar.New([1,3,4],3)
5496 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5498 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5499 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5503 else if(PyString_Check(nbOfTuples))
5505 if(PyString_Size(nbOfTuples)!=1)
5506 throw INTERP_KERNEL::Exception(msg);
5507 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5508 std::vector<std::string> tmp;
5509 if(fillStringVector(elt0,tmp))
5510 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5512 throw INTERP_KERNEL::Exception(msg);
5515 throw INTERP_KERNEL::Exception(msg);
5519 std::vector<std::string> tmmp;
5520 if(fillStringVector(elt0,tmmp))
5521 //DataArrayAsciiChar.New(["abc","de","fghi"])
5522 return DataArrayAsciiChar::New(tmmp,' ');
5525 // DataArrayAsciiChar.New([1,3,4])
5526 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5527 int tmpp1=-1,tmpp2=-1;
5528 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5529 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5534 else if(PyInt_Check(elt0))
5536 int nbOfTuples1=PyInt_AS_LONG(elt0);
5538 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5543 if(PyInt_Check(nbOfTuples))
5544 {//DataArrayAsciiChar.New(5,2)
5545 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5547 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5548 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5549 ret->alloc(nbOfTuples1,nbOfCompo);
5553 throw INTERP_KERNEL::Exception(msg);
5556 throw INTERP_KERNEL::Exception(msg);
5559 {//DataArrayAsciiChar.New(5)
5560 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5561 ret->alloc(nbOfTuples1,1);
5566 throw INTERP_KERNEL::Exception(msg);
5569 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5571 return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5574 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5576 std::ostringstream oss;
5577 self->reprQuickOverview(oss);
5581 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5583 return self->iterator();
5586 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5588 char tmp[2]; tmp[1]='\0';
5589 tmp[0]=self->getIJ(tupleId,compoId);
5590 return std::string(tmp);
5593 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5595 char tmp[2]; tmp[1]='\0';
5596 tmp[0]=self->getIJSafe(tupleId,compoId);
5597 return std::string(tmp);
5600 std::string __str__() const throw(INTERP_KERNEL::Exception)
5602 return self->repr();
5605 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5607 const char *vals=self->getConstPointer();
5608 int nbOfComp=self->getNumberOfComponents();
5609 int nbOfTuples=self->getNumberOfTuples();
5610 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5613 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5615 if(PyString_Check(tupl))
5617 Py_ssize_t sz=PyString_Size(tupl);
5618 std::vector<char> vals(sz);
5619 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5620 return self->presenceOfTuple(vals);
5623 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5626 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5628 if(PyString_Check(vals))
5630 Py_ssize_t sz=PyString_Size(vals);
5631 std::vector<char> vals2(sz);
5632 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5633 return self->presenceOfValue(vals2);
5636 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5639 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5641 if(PyString_Check(vals))
5643 Py_ssize_t sz=PyString_Size(vals);
5644 std::vector<char> vals2(sz);
5645 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5646 return self->locateValue(vals2);
5649 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5652 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5654 if(PyString_Check(tupl))
5656 Py_ssize_t sz=PyString_Size(tupl);
5657 std::vector<char> vals(sz);
5658 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5659 return self->locateTuple(vals);
5662 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5665 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5667 if(PyString_Check(strOrListOfInt))
5669 Py_ssize_t sz=PyString_Size(strOrListOfInt);
5670 std::vector<char> vals(sz);
5671 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5672 return self->search(vals);
5675 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5678 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5680 int sz=self->getNumberOfComponents();
5681 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5682 self->getTuple(tupleId,tmp);
5683 return PyString_FromString(tmp);
5686 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5689 char tmp2[2]; tmp2[1]='\0';
5690 tmp2[0]=self->getMaxValue(tmp);
5691 PyObject *ret=PyTuple_New(2);
5692 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5693 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5697 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5700 char tmp2[2]; tmp2[1]='\0';
5701 tmp2[0]=self->getMinValue(tmp);
5702 PyObject *ret=PyTuple_New(2);
5703 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5704 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5708 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5710 int nbOfCompo=self->getNumberOfComponents();
5715 if(PyString_Check(obj))
5717 Py_ssize_t sz=PyString_Size(obj);
5718 char *pt=PyString_AsString(obj);
5720 return self->locateValue(pt[0]);
5722 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5725 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5728 return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5732 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5734 int nbOfCompo=self->getNumberOfComponents();
5741 if(PyString_Check(obj))
5743 Py_ssize_t sz=PyString_Size(obj);
5744 char *pt=PyString_AsString(obj);
5746 return self->presenceOfValue(pt[0]);
5748 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5751 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5754 return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5758 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5761 std::vector<int> stdvecTyyppArr;
5762 std::pair<int, std::pair<int,int> > sTyyppArr;
5763 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5764 convertObjToPossibleCpp2WithNegIntInterp(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5768 return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5770 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5772 return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5774 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5776 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5780 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5782 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.";
5784 std::vector<int> stdvecTyyppArr;
5785 std::pair<int, std::pair<int,int> > sTyyppArr;
5786 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5787 int nbOfCompo=self->getNumberOfComponents();
5788 int nbOfTuples=self->getNumberOfTuples();
5789 convertObjToPossibleCpp2WithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5791 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5792 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5801 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5807 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5808 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5811 //value vector<string>
5814 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5815 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5818 //value DataArrayChar
5821 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5825 throw INTERP_KERNEL::Exception(msg);
5829 {//obj list-tuple[int]
5835 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5841 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5842 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5845 //value vector<string>
5848 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5849 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5852 //value DataArrayChar
5855 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5859 throw INTERP_KERNEL::Exception(msg);
5870 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5876 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5877 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5880 //value vector<string>
5883 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5884 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5887 //value DataArrayChar
5890 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5894 throw INTERP_KERNEL::Exception(msg);
5905 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5911 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5912 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5915 //value vector<string>
5918 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5919 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5922 //value DataArrayChar
5925 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5929 throw INTERP_KERNEL::Exception(msg);
5934 throw INTERP_KERNEL::Exception(msg);
5940 class DataArrayAsciiCharTuple;
5942 class DataArrayAsciiCharIterator
5945 DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5946 ~DataArrayAsciiCharIterator();
5951 DataArrayAsciiCharTuple *ret=self->nextt();
5953 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5956 PyErr_SetString(PyExc_StopIteration,"No more data.");
5963 class DataArrayAsciiCharTuple
5966 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5967 DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5970 std::string __str__() const throw(INTERP_KERNEL::Exception)
5972 return self->repr();
5975 DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5977 return self->buildDAAsciiChar(1,self->getNumberOfCompo());