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 void sortEachPairToMakeALinkedList() throw(INTERP_KERNEL::Exception);
2591 DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2592 DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2593 static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2594 void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2595 static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2596 void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2597 static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2598 void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2599 static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2600 void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2601 static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2602 void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2603 static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2604 void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2606 static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2609 DataArrayInt() throw(INTERP_KERNEL::Exception)
2611 return DataArrayInt::New();
2614 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2616 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)";
2617 std::string msg(msgBase);
2619 msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2622 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2626 if(PyInt_Check(nbOfTuples))
2628 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2630 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2633 if(PyInt_Check(nbOfComp))
2634 {//DataArrayInt.New([1,3,4,5],2,2)
2635 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2637 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2638 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2639 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2640 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2644 throw INTERP_KERNEL::Exception(msg.c_str());
2647 {//DataArrayInt.New([1,3,4],3)
2648 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2650 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2651 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2656 throw INTERP_KERNEL::Exception(msg.c_str());
2659 {// DataArrayInt.New([1,3,4])
2660 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2661 int tmpp1=-1,tmpp2=-1;
2662 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2663 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2667 else if(PyInt_Check(elt0))
2669 int nbOfTuples1=PyInt_AS_LONG(elt0);
2671 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2676 if(PyInt_Check(nbOfTuples))
2677 {//DataArrayInt.New(5,2)
2678 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2680 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2681 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2682 ret->alloc(nbOfTuples1,nbOfCompo);
2686 throw INTERP_KERNEL::Exception(msg.c_str());
2689 throw INTERP_KERNEL::Exception(msg.c_str());
2692 {//DataArrayInt.New(5)
2693 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2694 ret->alloc(nbOfTuples1,1);
2699 else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2700 {//DataArrayInt.New(numpyArray)
2701 return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2705 throw INTERP_KERNEL::Exception(msg.c_str());
2706 throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
2709 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2711 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2714 std::string __str__() const throw(INTERP_KERNEL::Exception)
2716 return self->repr();
2719 int __len__() const throw(INTERP_KERNEL::Exception)
2721 if(self->isAllocated())
2723 return self->getNumberOfTuples();
2727 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2731 int __int__() const throw(INTERP_KERNEL::Exception)
2733 return self->intValue();
2736 DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2738 return self->iterator();
2741 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2743 int sz=self->getNumberOfComponents();
2744 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2745 self->accumulate(tmp);
2746 return convertIntArrToPyList(tmp,sz);
2749 DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2752 std::vector<int> val2;
2753 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2754 return self->accumulatePerChunck(bg,bg+sz);
2757 DataArrayInt *getIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
2760 std::vector<int> val2;
2761 const int *bg(convertObjToPossibleCpp1_Safe(inputTuple,sw,sz,val,val2));
2762 return self->getIdsEqualTuple(bg,bg+sz);
2765 PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
2767 std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
2768 PyObject *ret=PyList_New(slcs.size());
2769 for(std::size_t i=0;i<slcs.size();i++)
2770 PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
2774 DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const throw(INTERP_KERNEL::Exception)
2776 if(!PySlice_Check(slic))
2777 throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
2778 Py_ssize_t strt=2,stp=2,step=2;
2779 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
2780 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
2781 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
2782 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 !");
2783 return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
2786 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2788 int newNbOfTuples=-1;
2789 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2790 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2791 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2792 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2793 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2794 PyObject *ret=PyTuple_New(2);
2795 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2796 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2800 static DataArrayInt *CheckAndPreparePermutation(PyObject *arr) throw(INTERP_KERNEL::Exception)
2802 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
2803 int szArr,sw,iTypppArr;
2804 std::vector<int> stdvecTyyppArr;
2805 const int *arrPtr(convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
2806 int *pt(ParaMEDMEM::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
2807 ret->useArray(pt,true,ParaMEDMEM::C_DEALLOC,szArr,1);
2811 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2813 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 !";
2814 if(PyList_Check(li) || PyTuple_Check(li))
2818 if(PyInt_Check(nbOfTuples))
2820 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2822 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2825 if(PyInt_Check(nbOfComp))
2826 {//DataArrayInt.setValues([1,3,4,5],2,2)
2827 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2829 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2830 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2831 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2834 throw INTERP_KERNEL::Exception(msg);
2837 {//DataArrayInt.setValues([1,3,4],3)
2839 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2840 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2844 throw INTERP_KERNEL::Exception(msg);
2847 {// DataArrayInt.setValues([1,3,4])
2848 int tmpp1=-1,tmpp2=-1;
2849 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2850 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2854 throw INTERP_KERNEL::Exception(msg);
2857 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2859 const int *vals=self->getConstPointer();
2860 return convertIntArrToPyList(vals,self->getNbOfElems());
2864 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2866 return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2870 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2873 bool ret0=self->isEqualIfNotWhy(other,ret1);
2874 PyObject *ret=PyTuple_New(2);
2875 PyObject *ret0Py=ret0?Py_True:Py_False;
2877 PyTuple_SetItem(ret,0,ret0Py);
2878 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2882 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2884 const int *vals=self->getConstPointer();
2885 int nbOfComp=self->getNumberOfComponents();
2886 int nbOfTuples=self->getNumberOfTuples();
2887 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2890 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2892 std::vector<const DataArrayInt *> groups;
2893 std::vector< std::vector<int> > fidsOfGroups;
2894 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2895 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2896 PyObject *ret = PyList_New(2);
2897 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2898 int sz=fidsOfGroups.size();
2899 PyObject *ret1 = PyList_New(sz);
2900 for(int i=0;i<sz;i++)
2901 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2902 PyList_SetItem(ret,1,ret1);
2906 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2909 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2910 if (!SWIG_IsOK(res1))
2913 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2914 self->transformWithIndArr(tmp,tmp+size);
2918 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2919 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2923 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2927 std::vector<int> multiVal;
2928 std::pair<int, std::pair<int,int> > slic;
2929 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2930 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2934 return self->getIdsEqualList(&singleVal,&singleVal+1);
2936 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2938 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2940 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2944 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2948 std::vector<int> multiVal;
2949 std::pair<int, std::pair<int,int> > slic;
2950 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2951 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2955 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2957 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2959 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2961 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2965 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2967 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2969 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2970 if (!SWIG_IsOK(res1))
2973 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2974 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2978 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2980 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2981 da2->checkAllocated();
2982 int size=self->getNumberOfTuples();
2983 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2985 PyObject *ret = PyList_New(3);
2986 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2987 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2988 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2992 DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2995 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2996 if (!SWIG_IsOK(res1))
2999 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3000 return self->transformWithIndArrR(tmp,tmp+size);
3004 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3005 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3009 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3012 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3013 if (!SWIG_IsOK(res1))
3016 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3017 if(size!=self->getNumberOfTuples())
3019 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3021 return self->renumberAndReduce(tmp,newNbOfTuple);
3025 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3027 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3028 da2->checkAllocated();
3029 int size=self->getNumberOfTuples();
3030 if(size!=self->getNumberOfTuples())
3032 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3034 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3038 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3041 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3042 if (!SWIG_IsOK(res1))
3045 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3046 if(size!=self->getNumberOfTuples())
3048 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3050 return self->renumber(tmp);
3054 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3056 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3057 da2->checkAllocated();
3058 int size=self->getNumberOfTuples();
3059 if(size!=self->getNumberOfTuples())
3061 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3063 return self->renumber(da2->getConstPointer());
3067 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3070 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3071 if (!SWIG_IsOK(res1))
3074 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3075 if(size!=self->getNumberOfTuples())
3077 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3079 return self->renumberR(tmp);
3083 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3085 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3086 da2->checkAllocated();
3087 int size=self->getNumberOfTuples();
3088 if(size!=self->getNumberOfTuples())
3090 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3092 return self->renumberR(da2->getConstPointer());
3096 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3098 std::vector<int> tmp;
3099 convertPyToNewIntArr3(li,tmp);
3100 self->setSelectedComponents(a,tmp);
3103 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3105 int sz=self->getNumberOfComponents();
3106 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
3107 self->getTuple(tupleId,tmp);
3108 return convertIntArrToPyList(tmp,sz);
3111 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
3113 DataArrayInt *arr=0;
3114 DataArrayInt *arrI=0;
3115 self->changeSurjectiveFormat(targetNb,arr,arrI);
3116 PyObject *res = PyList_New(2);
3117 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3118 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3122 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3124 std::vector<const DataArrayInt *> tmp;
3125 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3126 return DataArrayInt::Meld(tmp);
3129 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3131 std::vector<const DataArrayInt *> tmp;
3132 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3133 return DataArrayInt::Aggregate(tmp);
3136 static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
3138 std::vector<const DataArrayInt *> tmp;
3139 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3140 return DataArrayInt::AggregateIndexes(tmp);
3143 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
3145 std::vector<const DataArrayInt *> tmp;
3146 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3147 return DataArrayInt::BuildUnion(tmp);
3150 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
3152 std::vector<const DataArrayInt *> tmp;
3153 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3154 return DataArrayInt::BuildIntersection(tmp);
3157 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3160 int r1=self->getMaxValue(tmp);
3161 PyObject *ret=PyTuple_New(2);
3162 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3163 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3167 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3170 int r1=self->getMinValue(tmp);
3171 PyObject *ret=PyTuple_New(2);
3172 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3173 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3177 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3179 int nbOfCompo=self->getNumberOfComponents();
3184 if(PyInt_Check(obj))
3186 int val=(int)PyInt_AS_LONG(obj);
3187 return self->locateValue(val);
3190 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
3194 std::vector<int> arr;
3195 convertPyToNewIntArr3(obj,arr);
3196 return self->locateTuple(arr);
3201 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3203 int nbOfCompo=self->getNumberOfComponents();
3210 if(PyInt_Check(obj))
3212 int val=(int)PyInt_AS_LONG(obj);
3213 return self->presenceOfValue(val);
3216 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
3220 std::vector<int> arr;
3221 convertPyToNewIntArr3(obj,arr);
3222 return self->presenceOfTuple(arr);
3227 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3229 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
3230 const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
3231 self->checkAllocated();
3232 int nbOfTuples=self->getNumberOfTuples();
3233 int nbOfComponents=self->getNumberOfComponents();
3235 std::vector<int> vt1,vc1;
3236 std::pair<int, std::pair<int,int> > pt1,pc1;
3237 DataArrayInt *dt1=0,*dc1=0;
3239 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3240 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3245 if(nbOfComponents==1)
3246 return PyInt_FromLong(self->getIJSafe(it1,0));
3247 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3250 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3252 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3254 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3256 return PyInt_FromLong(self->getIJSafe(it1,ic1));
3259 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3260 std::vector<int> v2(1,ic1);
3261 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3265 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3266 std::vector<int> v2(1,ic1);
3267 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3271 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3272 std::vector<int> v2(1,ic1);
3273 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3277 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3278 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3282 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3283 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3287 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3288 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3292 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3293 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3297 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3298 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3299 std::vector<int> v2(nbOfComp);
3300 for(int i=0;i<nbOfComp;i++)
3301 v2[i]=pc1.first+i*pc1.second.second;
3302 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3306 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3307 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3308 std::vector<int> v2(nbOfComp);
3309 for(int i=0;i<nbOfComp;i++)
3310 v2[i]=pc1.first+i*pc1.second.second;
3311 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3315 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3316 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3317 std::vector<int> v2(nbOfComp);
3318 for(int i=0;i<nbOfComp;i++)
3319 v2[i]=pc1.first+i*pc1.second.second;
3320 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3324 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3325 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3326 std::vector<int> v2(nbOfComp);
3327 for(int i=0;i<nbOfComp;i++)
3328 v2[i]=pc1.first+i*pc1.second.second;
3329 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3332 throw INTERP_KERNEL::Exception(msg);
3336 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3338 self->checkAllocated();
3339 const char msg[]="Unexpected situation in __setitem__ !";
3340 int nbOfTuples=self->getNumberOfTuples();
3341 int nbOfComponents=self->getNumberOfComponents();
3344 std::vector<int> v1;
3346 DataArrayIntTuple *dd1=0;
3347 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3349 std::vector<int> vt1,vc1;
3350 std::pair<int, std::pair<int,int> > pt1,pc1;
3351 DataArrayInt *dt1=0,*dc1=0;
3352 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3353 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3361 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3364 tmp=DataArrayInt::New();
3365 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3366 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3369 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3372 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3373 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3376 throw INTERP_KERNEL::Exception(msg);
3385 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3388 tmp=DataArrayInt::New();
3389 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3390 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3393 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3396 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3397 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3400 throw INTERP_KERNEL::Exception(msg);
3409 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3412 tmp=DataArrayInt::New();
3413 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3414 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3417 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3420 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3421 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3424 throw INTERP_KERNEL::Exception(msg);
3433 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3436 tmp=DataArrayInt::New();
3437 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3438 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3441 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3444 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3445 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3448 throw INTERP_KERNEL::Exception(msg);
3457 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3460 tmp=DataArrayInt::New();
3461 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3462 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3465 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3468 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3469 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3472 throw INTERP_KERNEL::Exception(msg);
3481 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3484 tmp=DataArrayInt::New();
3485 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3486 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3489 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3492 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3493 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3496 throw INTERP_KERNEL::Exception(msg);
3505 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3508 tmp=DataArrayInt::New();
3509 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3510 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3513 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3516 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3517 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3520 throw INTERP_KERNEL::Exception(msg);
3529 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3532 tmp=DataArrayInt::New();
3533 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3534 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3537 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3540 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3541 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3544 throw INTERP_KERNEL::Exception(msg);
3553 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3556 tmp=DataArrayInt::New();
3557 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3558 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3561 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3564 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3565 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3568 throw INTERP_KERNEL::Exception(msg);
3577 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3580 tmp=DataArrayInt::New();
3581 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3582 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3585 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3588 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3589 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3592 throw INTERP_KERNEL::Exception(msg);
3601 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3604 tmp=DataArrayInt::New();
3605 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3606 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3609 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3612 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3613 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3616 throw INTERP_KERNEL::Exception(msg);
3625 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3628 tmp=DataArrayInt::New();
3629 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3630 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3633 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3636 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3637 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3640 throw INTERP_KERNEL::Exception(msg);
3649 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3652 tmp=DataArrayInt::New();
3653 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3654 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3657 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3660 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3661 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3664 throw INTERP_KERNEL::Exception(msg);
3673 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3676 tmp=DataArrayInt::New();
3677 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3678 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3681 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3684 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3685 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3688 throw INTERP_KERNEL::Exception(msg);
3697 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3700 tmp=DataArrayInt::New();
3701 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3702 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3705 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3708 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3709 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3712 throw INTERP_KERNEL::Exception(msg);
3721 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3724 tmp=DataArrayInt::New();
3725 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3726 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3729 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3732 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3733 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3736 throw INTERP_KERNEL::Exception(msg);
3741 throw INTERP_KERNEL::Exception(msg);
3746 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3748 return self->negate();
3751 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3753 const char msg[]="Unexpected situation in __add__ !";
3756 std::vector<int> aa;
3757 DataArrayIntTuple *aaa;
3759 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3764 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3765 ret->applyLin(1,val);
3770 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3771 return DataArrayInt::Add(self,aaaa);
3775 return DataArrayInt::Add(self,a);
3779 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3780 return DataArrayInt::Add(self,aaaa);
3783 throw INTERP_KERNEL::Exception(msg);
3787 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3789 const char msg[]="Unexpected situation in __radd__ !";
3792 std::vector<int> aa;
3793 DataArrayIntTuple *aaa;
3795 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3800 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3801 ret->applyLin(1,val);
3806 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3807 return DataArrayInt::Add(self,aaaa);
3811 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3812 return DataArrayInt::Add(self,aaaa);
3815 throw INTERP_KERNEL::Exception(msg);
3819 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3821 const char msg[]="Unexpected situation in __iadd__ !";
3824 std::vector<int> aa;
3825 DataArrayIntTuple *aaa;
3827 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3832 self->applyLin(1,val);
3833 Py_XINCREF(trueSelf);
3838 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3840 Py_XINCREF(trueSelf);
3846 Py_XINCREF(trueSelf);
3851 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3852 self->addEqual(aaaa);
3853 Py_XINCREF(trueSelf);
3857 throw INTERP_KERNEL::Exception(msg);
3861 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3863 const char msg[]="Unexpected situation in __sub__ !";
3866 std::vector<int> aa;
3867 DataArrayIntTuple *aaa;
3869 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3874 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3875 ret->applyLin(1,-val);
3880 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3881 return DataArrayInt::Substract(self,aaaa);
3885 return DataArrayInt::Substract(self,a);
3889 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3890 return DataArrayInt::Substract(self,aaaa);
3893 throw INTERP_KERNEL::Exception(msg);
3897 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3899 const char msg[]="Unexpected situation in __rsub__ !";
3902 std::vector<int> aa;
3903 DataArrayIntTuple *aaa;
3905 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3910 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3911 ret->applyLin(-1,val);
3916 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3917 return DataArrayInt::Substract(aaaa,self);
3921 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3922 return DataArrayInt::Substract(aaaa,self);
3925 throw INTERP_KERNEL::Exception(msg);
3929 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3931 const char msg[]="Unexpected situation in __isub__ !";
3934 std::vector<int> aa;
3935 DataArrayIntTuple *aaa;
3937 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3942 self->applyLin(1,-val);
3943 Py_XINCREF(trueSelf);
3948 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3949 self->substractEqual(bb);
3950 Py_XINCREF(trueSelf);
3955 self->substractEqual(a);
3956 Py_XINCREF(trueSelf);
3961 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3962 self->substractEqual(aaaa);
3963 Py_XINCREF(trueSelf);
3967 throw INTERP_KERNEL::Exception(msg);
3971 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3973 const char msg[]="Unexpected situation in __mul__ !";
3976 std::vector<int> aa;
3977 DataArrayIntTuple *aaa;
3979 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3984 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3985 ret->applyLin(val,0);
3990 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3991 return DataArrayInt::Multiply(self,aaaa);
3995 return DataArrayInt::Multiply(self,a);
3999 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4000 return DataArrayInt::Multiply(self,aaaa);
4003 throw INTERP_KERNEL::Exception(msg);
4007 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4009 const char msg[]="Unexpected situation in __rmul__ !";
4012 std::vector<int> aa;
4013 DataArrayIntTuple *aaa;
4015 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4020 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4021 ret->applyLin(val,0);
4026 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4027 return DataArrayInt::Multiply(self,aaaa);
4031 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4032 return DataArrayInt::Multiply(self,aaaa);
4035 throw INTERP_KERNEL::Exception(msg);
4039 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4041 const char msg[]="Unexpected situation in __imul__ !";
4044 std::vector<int> aa;
4045 DataArrayIntTuple *aaa;
4047 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4052 self->applyLin(val,0);
4053 Py_XINCREF(trueSelf);
4058 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4059 self->multiplyEqual(bb);
4060 Py_XINCREF(trueSelf);
4065 self->multiplyEqual(a);
4066 Py_XINCREF(trueSelf);
4071 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4072 self->multiplyEqual(aaaa);
4073 Py_XINCREF(trueSelf);
4077 throw INTERP_KERNEL::Exception(msg);
4081 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4083 const char msg[]="Unexpected situation in __div__ !";
4086 std::vector<int> aa;
4087 DataArrayIntTuple *aaa;
4089 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4094 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4095 ret->applyDivideBy(val);
4100 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4101 return DataArrayInt::Divide(self,aaaa);
4105 return DataArrayInt::Divide(self,a);
4109 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4110 return DataArrayInt::Divide(self,aaaa);
4113 throw INTERP_KERNEL::Exception(msg);
4117 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4119 const char msg[]="Unexpected situation in __rdiv__ !";
4122 std::vector<int> aa;
4123 DataArrayIntTuple *aaa;
4125 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4130 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4136 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4137 return DataArrayInt::Divide(aaaa,self);
4141 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4142 return DataArrayInt::Divide(aaaa,self);
4145 throw INTERP_KERNEL::Exception(msg);
4149 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4151 const char msg[]="Unexpected situation in __idiv__ !";
4154 std::vector<int> aa;
4155 DataArrayIntTuple *aaa;
4157 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4162 self->applyDivideBy(val);
4163 Py_XINCREF(trueSelf);
4168 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4169 self->divideEqual(bb);
4170 Py_XINCREF(trueSelf);
4175 self->divideEqual(a);
4176 Py_XINCREF(trueSelf);
4181 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4182 self->divideEqual(aaaa);
4183 Py_XINCREF(trueSelf);
4187 throw INTERP_KERNEL::Exception(msg);
4191 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4193 const char msg[]="Unexpected situation in __mod__ !";
4196 std::vector<int> aa;
4197 DataArrayIntTuple *aaa;
4199 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4204 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4205 ret->applyModulus(val);
4210 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4211 return DataArrayInt::Modulus(self,aaaa);
4215 return DataArrayInt::Modulus(self,a);
4219 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4220 return DataArrayInt::Modulus(self,aaaa);
4223 throw INTERP_KERNEL::Exception(msg);
4227 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4229 const char msg[]="Unexpected situation in __rmod__ !";
4232 std::vector<int> aa;
4233 DataArrayIntTuple *aaa;
4235 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4240 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4241 ret->applyRModulus(val);
4246 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4247 return DataArrayInt::Modulus(aaaa,self);
4251 return DataArrayInt::Modulus(a,self);
4255 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4256 return DataArrayInt::Modulus(aaaa,self);
4259 throw INTERP_KERNEL::Exception(msg);
4263 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4265 const char msg[]="Unexpected situation in __imod__ !";
4268 std::vector<int> aa;
4269 DataArrayIntTuple *aaa;
4271 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4276 self->applyModulus(val);
4277 Py_XINCREF(trueSelf);
4282 self->modulusEqual(a);
4283 Py_XINCREF(trueSelf);
4288 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4289 self->modulusEqual(aaaa);
4290 Py_XINCREF(trueSelf);
4294 throw INTERP_KERNEL::Exception(msg);
4298 DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4300 const char msg[]="Unexpected situation in __pow__ !";
4303 std::vector<int> aa;
4304 DataArrayIntTuple *aaa;
4306 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4311 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4317 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4318 return DataArrayInt::Pow(self,aaaa);
4322 return DataArrayInt::Pow(self,a);
4326 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4327 return DataArrayInt::Pow(self,aaaa);
4330 throw INTERP_KERNEL::Exception(msg);
4334 DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4336 const char msg[]="Unexpected situation in __rpow__ !";
4339 std::vector<int> aa;
4340 DataArrayIntTuple *aaa;
4342 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4347 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4348 ret->applyRPow(val);
4353 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4354 return DataArrayInt::Pow(aaaa,self);
4358 return DataArrayInt::Pow(a,self);
4362 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4363 return DataArrayInt::Pow(aaaa,self);
4366 throw INTERP_KERNEL::Exception(msg);
4370 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4372 const char msg[]="Unexpected situation in __ipow__ !";
4375 std::vector<int> aa;
4376 DataArrayIntTuple *aaa;
4378 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4383 self->applyPow(val);
4384 Py_XINCREF(trueSelf);
4390 Py_XINCREF(trueSelf);
4395 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4396 self->powEqual(aaaa);
4397 Py_XINCREF(trueSelf);
4401 throw INTERP_KERNEL::Exception(msg);
4405 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4407 std::ostringstream oss;
4408 self->reprQuickOverview(oss);
4412 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4414 int szArr,sw,iTypppArr;
4415 std::vector<int> stdvecTyyppArr;
4416 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4417 self->pushBackValsSilent(tmp,tmp+szArr);
4420 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4422 std::vector<int> ret1;
4423 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4424 std::size_t sz=ret0.size();
4425 PyObject *pyRet=PyTuple_New(2);
4426 PyObject *pyRet0=PyList_New((int)sz);
4427 PyObject *pyRet1=PyList_New((int)sz);
4428 for(std::size_t i=0;i<sz;i++)
4430 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4431 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4433 PyTuple_SetItem(pyRet,0,pyRet0);
4434 PyTuple_SetItem(pyRet,1,pyRet1);
4438 PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4440 DataArrayInt *ret0=0,*ret1=0;
4441 self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4442 PyObject *pyRet=PyTuple_New(2);
4443 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4444 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4448 PyObject *isRange() const throw(INTERP_KERNEL::Exception)
4451 bool ret(self->isRange(a,b,c));
4452 PyObject *pyRet=PyTuple_New(2);
4453 PyObject *ret0Py=ret?Py_True:Py_False,*ret1Py(0);
4455 PyTuple_SetItem(pyRet,0,ret0Py);
4457 ret1Py=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
4463 PyTuple_SetItem(pyRet,1,ret1Py);
4469 class DataArrayIntTuple;
4471 class DataArrayIntIterator
4474 DataArrayIntIterator(DataArrayInt *da);
4475 ~DataArrayIntIterator();
4480 DataArrayIntTuple *ret=self->nextt();
4482 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4485 PyErr_SetString(PyExc_StopIteration,"No more data.");
4492 class DataArrayIntTuple
4495 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4496 DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4499 std::string __str__() const throw(INTERP_KERNEL::Exception)
4501 return self->repr();
4504 int __int__() const throw(INTERP_KERNEL::Exception)
4506 return self->intValue();
4509 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4511 return self->buildDAInt(1,self->getNumberOfCompo());
4514 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4516 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4517 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4518 Py_XINCREF(trueSelf);
4522 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4524 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4525 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4526 Py_XINCREF(trueSelf);
4530 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4532 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4533 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4534 Py_XINCREF(trueSelf);
4538 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4540 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4541 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4542 Py_XINCREF(trueSelf);
4546 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4548 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4549 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4550 Py_XINCREF(trueSelf);
4554 PyObject *__len__() throw(INTERP_KERNEL::Exception)
4556 return PyInt_FromLong(self->getNumberOfCompo());
4559 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4561 const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4564 std::vector<int> multiVal;
4565 std::pair<int, std::pair<int,int> > slic;
4566 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4567 const int *pt=self->getConstPointer();
4568 int nbc=self->getNumberOfCompo();
4569 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4576 std::ostringstream oss;
4577 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4578 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4582 return PyInt_FromLong(pt[singleVal]);
4586 return PyInt_FromLong(pt[nbc+singleVal]);
4589 std::ostringstream oss;
4590 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4591 throw INTERP_KERNEL::Exception(oss.str().c_str());
4597 PyObject *t=PyTuple_New(multiVal.size());
4598 for(int j=0;j<(int)multiVal.size();j++)
4600 int cid=multiVal[j];
4603 std::ostringstream oss;
4604 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4605 throw INTERP_KERNEL::Exception(oss.str().c_str());
4607 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4613 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4614 PyObject *t=PyTuple_New(sz);
4615 for(int j=0;j<sz;j++)
4616 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4620 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4624 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4626 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4627 const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4630 std::vector<int> multiValV;
4631 std::pair<int, std::pair<int,int> > slicV;
4632 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4633 int nbc=self->getNumberOfCompo();
4634 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4636 std::vector<int> multiVal;
4637 std::pair<int, std::pair<int,int> > slic;
4638 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4639 int *pt=self->getPointer();
4640 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4647 std::ostringstream oss;
4648 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4649 throw INTERP_KERNEL::Exception(oss.str().c_str());
4655 pt[singleVal]=singleValV;
4660 if(multiValV.size()!=1)
4662 std::ostringstream oss;
4663 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4664 throw INTERP_KERNEL::Exception(oss.str().c_str());
4666 pt[singleVal]=multiValV[0];
4671 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4675 throw INTERP_KERNEL::Exception(msg);
4684 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4688 std::ostringstream oss;
4689 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4690 throw INTERP_KERNEL::Exception(oss.str().c_str());
4698 if(multiVal.size()!=multiValV.size())
4700 std::ostringstream oss;
4701 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4702 throw INTERP_KERNEL::Exception(oss.str().c_str());
4704 for(int i=0;i<(int)multiVal.size();i++)
4706 int pos=multiVal[i];
4709 std::ostringstream oss;
4710 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4711 throw INTERP_KERNEL::Exception(oss.str().c_str());
4713 pt[multiVal[i]]=multiValV[i];
4719 const int *ptV=daIntTyyppV->getConstPointer();
4720 if(nbc>daIntTyyppV->getNumberOfCompo())
4722 std::ostringstream oss;
4723 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4724 throw INTERP_KERNEL::Exception(oss.str().c_str());
4726 std::copy(ptV,ptV+nbc,pt);
4730 throw INTERP_KERNEL::Exception(msg);
4735 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4740 for(int j=0;j<sz;j++)
4741 pt[slic.first+j*slic.second.second]=singleValV;
4746 if(sz!=(int)multiValV.size())
4748 std::ostringstream oss;
4749 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4750 throw INTERP_KERNEL::Exception(oss.str().c_str());
4752 for(int j=0;j<sz;j++)
4753 pt[slic.first+j*slic.second.second]=multiValV[j];
4758 const int *ptV=daIntTyyppV->getConstPointer();
4759 if(sz>daIntTyyppV->getNumberOfCompo())
4761 std::ostringstream oss;
4762 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4763 throw INTERP_KERNEL::Exception(oss.str().c_str());
4765 for(int j=0;j<sz;j++)
4766 pt[slic.first+j*slic.second.second]=ptV[j];
4770 throw INTERP_KERNEL::Exception(msg);
4774 throw INTERP_KERNEL::Exception(msg);
4780 class DataArrayChar : public DataArray
4783 virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4784 int getHashCode() const throw(INTERP_KERNEL::Exception);
4785 bool empty() const throw(INTERP_KERNEL::Exception);
4786 void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4787 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4788 void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4789 char popBackSilent() throw(INTERP_KERNEL::Exception);
4790 void pack() const throw(INTERP_KERNEL::Exception);
4791 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4792 bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4793 bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4794 void reverse() throw(INTERP_KERNEL::Exception);
4795 void fillWithZero() throw(INTERP_KERNEL::Exception);
4796 void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4797 std::string repr() const throw(INTERP_KERNEL::Exception);
4798 std::string reprZip() const throw(INTERP_KERNEL::Exception);
4799 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4800 DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4801 DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4802 DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4803 bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4804 DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4805 DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4806 void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4807 void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4808 char front() const throw(INTERP_KERNEL::Exception);
4809 char back() const throw(INTERP_KERNEL::Exception);
4810 void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4811 void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4812 char *getPointer() throw(INTERP_KERNEL::Exception);
4813 DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4814 DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4815 int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4816 bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4817 char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4818 char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4819 char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4820 char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4821 DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4822 static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4823 static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4826 int __len__() const throw(INTERP_KERNEL::Exception)
4828 if(self->isAllocated())
4830 return self->getNumberOfTuples();
4834 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4838 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4841 bool ret0=self->isEqualIfNotWhy(other,ret1);
4842 PyObject *ret=PyTuple_New(2);
4843 PyObject *ret0Py=ret0?Py_True:Py_False;
4845 PyTuple_SetItem(ret,0,ret0Py);
4846 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4850 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4853 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4854 if (!SWIG_IsOK(res1))
4857 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4858 if(size!=self->getNumberOfTuples())
4860 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4862 return self->renumber(tmp);
4866 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4868 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4869 da2->checkAllocated();
4870 int size=self->getNumberOfTuples();
4871 if(size!=self->getNumberOfTuples())
4873 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4875 return self->renumber(da2->getConstPointer());
4879 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4882 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4883 if (!SWIG_IsOK(res1))
4886 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4887 if(size!=self->getNumberOfTuples())
4889 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4891 return self->renumberR(tmp);
4895 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4897 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4898 da2->checkAllocated();
4899 int size=self->getNumberOfTuples();
4900 if(size!=self->getNumberOfTuples())
4902 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4904 return self->renumberR(da2->getConstPointer());
4908 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4911 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4912 if (!SWIG_IsOK(res1))
4915 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4916 if(size!=self->getNumberOfTuples())
4918 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4920 return self->renumberAndReduce(tmp,newNbOfTuple);
4924 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4926 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4927 da2->checkAllocated();
4928 int size=self->getNumberOfTuples();
4929 if(size!=self->getNumberOfTuples())
4931 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4933 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4937 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4939 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4940 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4941 return DataArrayChar::Aggregate(tmp);
4944 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4946 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4947 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4948 return DataArrayChar::Meld(tmp);
4953 class DataArrayByteIterator;
4955 class DataArrayByte : public DataArrayChar
4958 static DataArrayByte *New();
4959 DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4960 DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4961 char byteValue() const throw(INTERP_KERNEL::Exception);
4964 DataArrayByte() throw(INTERP_KERNEL::Exception)
4966 return DataArrayByte::New();
4969 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4971 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) !";
4972 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4976 if(PyInt_Check(nbOfTuples))
4978 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4980 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4983 if(PyInt_Check(nbOfComp))
4984 {//DataArrayByte.New([1,3,4,5],2,2)
4985 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4987 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4988 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4989 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4990 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4994 throw INTERP_KERNEL::Exception(msg);
4997 {//DataArrayByte.New([1,3,4],3)
4998 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5000 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5001 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5006 throw INTERP_KERNEL::Exception(msg);
5009 {// DataArrayByte.New([1,3,4])
5010 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5011 int tmpp1=-1,tmpp2=-1;
5012 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5013 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5017 else if(PyInt_Check(elt0))
5019 int nbOfTuples1=PyInt_AS_LONG(elt0);
5021 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
5026 if(PyInt_Check(nbOfTuples))
5027 {//DataArrayByte.New(5,2)
5028 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5030 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
5031 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5032 ret->alloc(nbOfTuples1,nbOfCompo);
5036 throw INTERP_KERNEL::Exception(msg);
5039 throw INTERP_KERNEL::Exception(msg);
5042 {//DataArrayByte.New(5)
5043 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5044 ret->alloc(nbOfTuples1,1);
5049 throw INTERP_KERNEL::Exception(msg);
5052 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5054 return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5057 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5059 std::ostringstream oss;
5060 self->reprQuickOverview(oss);
5064 int __int__() const throw(INTERP_KERNEL::Exception)
5066 return (int) self->byteValue();
5069 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
5071 return self->iterator();
5074 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5076 return (int)self->getIJ(tupleId,compoId);
5079 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5081 return (int)self->getIJSafe(tupleId,compoId);
5084 std::string __str__() const throw(INTERP_KERNEL::Exception)
5086 return self->repr();
5089 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5091 const char *vals=self->getConstPointer();
5092 int nbOfComp=self->getNumberOfComponents();
5093 int nbOfTuples=self->getNumberOfTuples();
5094 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5097 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5100 int ival=-1; std::vector<int> ivval;
5101 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5102 std::vector<char> vals(sz);
5103 std::copy(pt,pt+sz,vals.begin());
5104 return self->presenceOfTuple(vals);
5107 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5110 int ival=-1; std::vector<int> ivval;
5111 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5112 std::vector<char> vals2(sz);
5113 std::copy(pt,pt+sz,vals2.begin());
5114 return self->presenceOfValue(vals2);
5117 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5120 int ival=-1; std::vector<int> ivval;
5121 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5122 std::vector<char> vals2(sz);
5123 std::copy(pt,pt+sz,vals2.begin());
5124 return self->locateValue(vals2);
5127 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5130 int ival=-1; std::vector<int> ivval;
5131 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5132 std::vector<char> vals(sz);
5133 std::copy(pt,pt+sz,vals.begin());
5134 return self->locateTuple(vals);
5137 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5140 int ival=-1; std::vector<int> ivval;
5141 const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
5142 std::vector<char> vals(sz);
5143 std::copy(pt,pt+sz,vals.begin());
5144 return self->search(vals);
5147 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5149 int sz=self->getNumberOfComponents();
5150 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
5151 self->getTuple(tupleId,tmp);
5152 PyObject *ret=PyTuple_New(sz);
5153 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
5157 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5160 int r1=(int)self->getMaxValue(tmp);
5161 PyObject *ret=PyTuple_New(2);
5162 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5163 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5167 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5170 int r1=(int)self->getMinValue(tmp);
5171 PyObject *ret=PyTuple_New(2);
5172 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5173 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5177 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5179 int nbOfCompo=self->getNumberOfComponents();
5184 if(PyInt_Check(obj))
5186 int val=(int)PyInt_AS_LONG(obj);
5187 return self->locateValue(val);
5190 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
5193 return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
5197 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5199 int nbOfCompo=self->getNumberOfComponents();
5206 if(PyInt_Check(obj))
5208 int val=(int)PyInt_AS_LONG(obj);
5209 return self->presenceOfValue(val);
5212 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5215 return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
5219 DataArrayByte *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5221 self->checkAllocated();
5222 const char msg[]="Unexpected situation in __setitem__ !";
5223 int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
5226 std::vector<int> v1;
5228 DataArrayIntTuple *dd1=0;
5229 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5231 std::vector<int> vt1,vc1;
5232 std::pair<int, std::pair<int,int> > pt1,pc1;
5233 DataArrayInt *dt1=0,*dc1=0;
5234 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5235 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5243 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5246 throw INTERP_KERNEL::Exception(msg);
5255 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5258 throw INTERP_KERNEL::Exception(msg);
5267 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5270 throw INTERP_KERNEL::Exception(msg);
5279 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5282 throw INTERP_KERNEL::Exception(msg);
5291 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5294 throw INTERP_KERNEL::Exception(msg);
5303 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5306 throw INTERP_KERNEL::Exception(msg);
5315 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5318 throw INTERP_KERNEL::Exception(msg);
5327 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5330 throw INTERP_KERNEL::Exception(msg);
5339 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5342 throw INTERP_KERNEL::Exception(msg);
5351 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5354 throw INTERP_KERNEL::Exception(msg);
5363 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5366 throw INTERP_KERNEL::Exception(msg);
5375 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5378 throw INTERP_KERNEL::Exception(msg);
5387 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5390 throw INTERP_KERNEL::Exception(msg);
5399 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5402 throw INTERP_KERNEL::Exception(msg);
5411 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5414 throw INTERP_KERNEL::Exception(msg);
5423 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5426 throw INTERP_KERNEL::Exception(msg);
5431 throw INTERP_KERNEL::Exception(msg);
5438 class DataArrayByteTuple;
5440 class DataArrayByteIterator
5443 DataArrayByteIterator(DataArrayByte *da);
5444 ~DataArrayByteIterator();
5447 class DataArrayByteTuple
5450 std::string repr() const throw(INTERP_KERNEL::Exception);
5451 DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5454 std::string __str__() const throw(INTERP_KERNEL::Exception)
5456 return self->repr();
5459 char __int__() const throw(INTERP_KERNEL::Exception)
5461 return self->byteValue();
5464 DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5466 return self->buildDAByte(1,self->getNumberOfCompo());
5471 class DataArrayAsciiCharIterator;
5473 class DataArrayAsciiChar : public DataArrayChar
5476 static DataArrayAsciiChar *New();
5477 DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5478 DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5479 char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5482 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5484 return DataArrayAsciiChar::New();
5487 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5489 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) !";
5490 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5494 if(PyInt_Check(nbOfTuples))
5496 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5498 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5501 if(PyInt_Check(nbOfComp))
5502 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5503 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5505 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5506 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5507 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5508 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5512 throw INTERP_KERNEL::Exception(msg);
5515 {//DataArrayAsciiChar.New([1,3,4],3)
5516 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5518 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5519 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5523 else if(PyString_Check(nbOfTuples))
5525 if(PyString_Size(nbOfTuples)!=1)
5526 throw INTERP_KERNEL::Exception(msg);
5527 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5528 std::vector<std::string> tmp;
5529 if(fillStringVector(elt0,tmp))
5530 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5532 throw INTERP_KERNEL::Exception(msg);
5535 throw INTERP_KERNEL::Exception(msg);
5539 std::vector<std::string> tmmp;
5540 if(fillStringVector(elt0,tmmp))
5541 //DataArrayAsciiChar.New(["abc","de","fghi"])
5542 return DataArrayAsciiChar::New(tmmp,' ');
5545 // DataArrayAsciiChar.New([1,3,4])
5546 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5547 int tmpp1=-1,tmpp2=-1;
5548 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5549 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5554 else if(PyInt_Check(elt0))
5556 int nbOfTuples1=PyInt_AS_LONG(elt0);
5558 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5563 if(PyInt_Check(nbOfTuples))
5564 {//DataArrayAsciiChar.New(5,2)
5565 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5567 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5568 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5569 ret->alloc(nbOfTuples1,nbOfCompo);
5573 throw INTERP_KERNEL::Exception(msg);
5576 throw INTERP_KERNEL::Exception(msg);
5579 {//DataArrayAsciiChar.New(5)
5580 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5581 ret->alloc(nbOfTuples1,1);
5586 throw INTERP_KERNEL::Exception(msg);
5589 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5591 return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5594 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5596 std::ostringstream oss;
5597 self->reprQuickOverview(oss);
5601 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5603 return self->iterator();
5606 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5608 char tmp[2]; tmp[1]='\0';
5609 tmp[0]=self->getIJ(tupleId,compoId);
5610 return std::string(tmp);
5613 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5615 char tmp[2]; tmp[1]='\0';
5616 tmp[0]=self->getIJSafe(tupleId,compoId);
5617 return std::string(tmp);
5620 std::string __str__() const throw(INTERP_KERNEL::Exception)
5622 return self->repr();
5625 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5627 const char *vals=self->getConstPointer();
5628 int nbOfComp=self->getNumberOfComponents();
5629 int nbOfTuples=self->getNumberOfTuples();
5630 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5633 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5635 if(PyString_Check(tupl))
5637 Py_ssize_t sz=PyString_Size(tupl);
5638 std::vector<char> vals(sz);
5639 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5640 return self->presenceOfTuple(vals);
5643 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5646 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5648 if(PyString_Check(vals))
5650 Py_ssize_t sz=PyString_Size(vals);
5651 std::vector<char> vals2(sz);
5652 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5653 return self->presenceOfValue(vals2);
5656 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5659 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5661 if(PyString_Check(vals))
5663 Py_ssize_t sz=PyString_Size(vals);
5664 std::vector<char> vals2(sz);
5665 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5666 return self->locateValue(vals2);
5669 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5672 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5674 if(PyString_Check(tupl))
5676 Py_ssize_t sz=PyString_Size(tupl);
5677 std::vector<char> vals(sz);
5678 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5679 return self->locateTuple(vals);
5682 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5685 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5687 if(PyString_Check(strOrListOfInt))
5689 Py_ssize_t sz=PyString_Size(strOrListOfInt);
5690 std::vector<char> vals(sz);
5691 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5692 return self->search(vals);
5695 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5698 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5700 int sz=self->getNumberOfComponents();
5701 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5702 self->getTuple(tupleId,tmp);
5703 return PyString_FromString(tmp);
5706 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5709 char tmp2[2]; tmp2[1]='\0';
5710 tmp2[0]=self->getMaxValue(tmp);
5711 PyObject *ret=PyTuple_New(2);
5712 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5713 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5717 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5720 char tmp2[2]; tmp2[1]='\0';
5721 tmp2[0]=self->getMinValue(tmp);
5722 PyObject *ret=PyTuple_New(2);
5723 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5724 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5728 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5730 int nbOfCompo=self->getNumberOfComponents();
5735 if(PyString_Check(obj))
5737 Py_ssize_t sz=PyString_Size(obj);
5738 char *pt=PyString_AsString(obj);
5740 return self->locateValue(pt[0]);
5742 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5745 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5748 return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5752 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5754 int nbOfCompo=self->getNumberOfComponents();
5761 if(PyString_Check(obj))
5763 Py_ssize_t sz=PyString_Size(obj);
5764 char *pt=PyString_AsString(obj);
5766 return self->presenceOfValue(pt[0]);
5768 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5771 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5774 return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5778 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5781 std::vector<int> stdvecTyyppArr;
5782 std::pair<int, std::pair<int,int> > sTyyppArr;
5783 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5784 convertObjToPossibleCpp2WithNegIntInterp(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5788 return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5790 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5792 return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5794 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5796 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5800 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5802 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.";
5804 std::vector<int> stdvecTyyppArr;
5805 std::pair<int, std::pair<int,int> > sTyyppArr;
5806 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5807 int nbOfCompo=self->getNumberOfComponents();
5808 int nbOfTuples=self->getNumberOfTuples();
5809 convertObjToPossibleCpp2WithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5811 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5812 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5821 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5827 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5828 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5831 //value vector<string>
5834 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5835 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5838 //value DataArrayChar
5841 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5845 throw INTERP_KERNEL::Exception(msg);
5849 {//obj list-tuple[int]
5855 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5861 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5862 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5865 //value vector<string>
5868 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5869 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5872 //value DataArrayChar
5875 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5879 throw INTERP_KERNEL::Exception(msg);
5890 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5896 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5897 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5900 //value vector<string>
5903 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5904 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5907 //value DataArrayChar
5910 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5914 throw INTERP_KERNEL::Exception(msg);
5925 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5931 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5932 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5935 //value vector<string>
5938 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5939 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5942 //value DataArrayChar
5945 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5949 throw INTERP_KERNEL::Exception(msg);
5954 throw INTERP_KERNEL::Exception(msg);
5960 class DataArrayAsciiCharTuple;
5962 class DataArrayAsciiCharIterator
5965 DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5966 ~DataArrayAsciiCharIterator();
5971 DataArrayAsciiCharTuple *ret=self->nextt();
5973 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5976 PyErr_SetString(PyExc_StopIteration,"No more data.");
5983 class DataArrayAsciiCharTuple
5986 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5987 DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5990 std::string __str__() const throw(INTERP_KERNEL::Exception)
5992 return self->repr();
5995 DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5997 return self->buildDAAsciiChar(1,self->getNumberOfCompo());