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) const throw(INTERP_KERNEL::Exception);
568 DataArrayDouble *applyFunc(const std::string& func) const throw(INTERP_KERNEL::Exception);
569 DataArrayDouble *applyFunc2(int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
570 DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
571 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
572 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
573 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
574 DataArrayInt *getIdsNotInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
575 static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
576 static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
577 static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
578 static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
579 static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
580 static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
581 static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
582 void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
583 static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
584 void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
585 static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
586 void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
587 static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
588 void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
589 static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
590 void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
593 DataArrayDouble() throw(INTERP_KERNEL::Exception)
595 return DataArrayDouble::New();
598 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
600 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)";
601 std::string msg(msgBase);
603 msg+="\n-DataArrayDouble.New(numpy array with dtype=float64)";
606 if(PyList_Check(elt0) || PyTuple_Check(elt0))
610 if(PyInt_Check(nbOfTuples))
612 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
614 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
617 if(PyInt_Check(elt2))
618 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
619 int nbOfCompo=PyInt_AS_LONG(elt2);
621 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
622 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
623 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
624 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
628 throw INTERP_KERNEL::Exception(msg.c_str());
631 {//DataArrayDouble.New([1.,3.,4.],3)
632 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
634 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
635 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
640 throw INTERP_KERNEL::Exception(msg.c_str());
643 {// DataArrayDouble.New([1.,3.,4.])
644 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
645 int tmpp1=-1,tmpp2=-1;
646 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
647 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
651 else if(PyInt_Check(elt0))
653 int nbOfTuples1=PyInt_AS_LONG(elt0);
655 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
660 if(PyInt_Check(nbOfTuples))
661 {//DataArrayDouble.New(5,2)
662 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
664 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
665 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
666 ret->alloc(nbOfTuples1,nbOfCompo);
670 throw INTERP_KERNEL::Exception(msg.c_str());
673 throw INTERP_KERNEL::Exception(msg.c_str());
676 {//DataArrayDouble.New(5)
677 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
678 ret->alloc(nbOfTuples1,1);
683 else if(PyArray_Check(elt0) && nbOfTuples==NULL && elt2==NULL)
684 {//DataArrayDouble.New(numpyArray)
685 return BuildNewInstance<DataArrayDouble,double>(elt0,NPY_DOUBLE,&PyCallBackDataArrayDouble_RefType,"FLOAT64");
689 throw INTERP_KERNEL::Exception(msg.c_str());
690 throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
693 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
695 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
698 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
701 std::vector<double> bb;
703 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
704 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
705 self->pushBackValsSilent(tmp,tmp+nbTuples);
708 std::string __repr__() const throw(INTERP_KERNEL::Exception)
710 std::ostringstream oss;
711 self->reprQuickOverview(oss);
715 std::string __str__() const throw(INTERP_KERNEL::Exception)
720 double __float__() const throw(INTERP_KERNEL::Exception)
722 return self->doubleValue();
725 int __len__() const throw(INTERP_KERNEL::Exception)
727 if(self->isAllocated())
729 return self->getNumberOfTuples();
733 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
737 DataArrayDoubleIterator *__iter__() throw(INTERP_KERNEL::Exception)
739 return self->iterator();
742 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
744 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 !";
745 if(PyList_Check(li) || PyTuple_Check(li))
749 if(PyInt_Check(nbOfTuples))
751 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
753 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
756 if(PyInt_Check(nbOfComp))
757 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
758 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
760 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
761 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
762 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
765 throw INTERP_KERNEL::Exception(msg);
768 {//DataArrayDouble.setValues([1.,3.,4.],3)
770 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
771 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
775 throw INTERP_KERNEL::Exception(msg);
778 {// DataArrayDouble.setValues([1.,3.,4.])
779 int tmpp1=-1,tmpp2=-1;
780 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
781 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
785 throw INTERP_KERNEL::Exception(msg);
788 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
790 const double *vals=self->getConstPointer();
791 return convertDblArrToPyList(vals,self->getNbOfElems());
795 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
797 return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
801 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
804 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
805 PyObject *ret=PyTuple_New(2);
806 PyObject *ret0Py=ret0?Py_True:Py_False;
808 PyTuple_SetItem(ret,0,ret0Py);
809 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
813 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
815 const double *vals=self->getConstPointer();
816 int nbOfComp=self->getNumberOfComponents();
817 int nbOfTuples=self->getNumberOfTuples();
818 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
821 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
824 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
825 if (!SWIG_IsOK(res1))
828 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
829 if(size!=self->getNumberOfTuples())
831 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
833 return self->renumber(tmp);
837 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
839 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
840 da2->checkAllocated();
841 int size=self->getNumberOfTuples();
842 if(size!=self->getNumberOfTuples())
844 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
846 return self->renumber(da2->getConstPointer());
850 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
853 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
854 if (!SWIG_IsOK(res1))
857 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
858 if(size!=self->getNumberOfTuples())
860 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
862 return self->renumberR(tmp);
866 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
868 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
869 da2->checkAllocated();
870 int size=self->getNumberOfTuples();
871 if(size!=self->getNumberOfTuples())
873 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
875 return self->renumberR(da2->getConstPointer());
879 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
882 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
883 if (!SWIG_IsOK(res1))
886 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
887 if(size!=self->getNumberOfTuples())
889 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
891 return self->renumberAndReduce(tmp,newNbOfTuple);
895 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
897 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
898 da2->checkAllocated();
899 int size=self->getNumberOfTuples();
900 if(size!=self->getNumberOfTuples())
902 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
904 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
908 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
910 int thisTupleId,otherTupleId;
911 double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
912 PyObject *ret=PyTuple_New(3);
913 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
914 PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
915 PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
919 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
922 double r1=self->getMaxValue(tmp);
923 PyObject *ret=PyTuple_New(2);
924 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
925 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
929 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
932 double r1=self->getMaxValue2(tmp);
933 PyObject *ret=PyTuple_New(2);
934 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
935 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
939 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
942 double r1=self->getMinValue(tmp);
943 PyObject *ret=PyTuple_New(2);
944 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
945 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
949 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
952 double r1=self->getMinValue2(tmp);
953 PyObject *ret=PyTuple_New(2);
954 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
955 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
959 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
961 int nbOfCompo=self->getNumberOfComponents();
962 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
963 self->getMinMaxPerComponent(tmp);
964 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
968 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
970 int sz=self->getNumberOfComponents();
971 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
972 self->accumulate(tmp);
973 return convertDblArrToPyList(tmp,sz);
976 DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
979 std::vector<int> val2;
980 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
981 return self->accumulatePerChunck(bg,bg+sz);
984 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
986 DataArrayInt *comm, *commIndex;
987 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
988 PyObject *res = PyList_New(2);
989 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
990 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
994 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
998 DataArrayDoubleTuple *aa;
999 std::vector<double> bb;
1001 int tupleId=-1,nbOfCompo=self->getNumberOfComponents();
1002 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
1004 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
1005 PyObject *ret=PyTuple_New(2);
1006 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1007 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
1011 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
1013 std::vector<int> tmp;
1014 convertPyToNewIntArr3(li,tmp);
1015 self->setSelectedComponents(a,tmp);
1018 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
1020 int sz=self->getNumberOfComponents();
1021 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
1022 self->getTuple(tupleId,tmp);
1023 return convertDblArrToPyList(tmp,sz);
1026 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
1028 std::vector<const DataArrayDouble *> tmp;
1029 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
1030 return DataArrayDouble::Aggregate(tmp);
1033 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
1035 std::vector<const DataArrayDouble *> tmp;
1036 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
1037 return DataArrayDouble::Meld(tmp);
1040 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1044 DataArrayDoubleTuple *aa;
1045 std::vector<double> bb;
1047 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
1048 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
1049 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
1050 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
1051 DataArrayInt *c=0,*cI=0;
1052 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
1053 PyObject *ret=PyTuple_New(2);
1054 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1055 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1059 PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const throw(INTERP_KERNEL::Exception)
1061 DataArrayInt *ret1=0;
1062 bool ret0=self->areIncludedInMe(other,prec,ret1);
1063 PyObject *ret=PyTuple_New(2);
1064 PyObject *ret0Py=ret0?Py_True:Py_False;
1066 PyTuple_SetItem(ret,0,ret0Py);
1067 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1071 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1073 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
1074 const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
1075 self->checkAllocated();
1076 int nbOfTuples=self->getNumberOfTuples();
1077 int nbOfComponents=self->getNumberOfComponents();
1079 std::vector<int> vt1,vc1;
1080 std::pair<int, std::pair<int,int> > pt1,pc1;
1081 DataArrayInt *dt1=0,*dc1=0;
1083 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1084 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
1088 if(nbOfComponents==1)
1089 return PyFloat_FromDouble(self->getIJSafe(it1,0));
1090 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1092 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1094 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1096 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1098 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
1101 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1102 std::vector<int> v2(1,ic1);
1103 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1107 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1108 std::vector<int> v2(1,ic1);
1109 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1113 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1114 std::vector<int> v2(1,ic1);
1115 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1119 ret=self->selectByTupleIdSafe(&it1,&it1+1);
1120 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1124 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1125 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1129 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1130 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1134 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1135 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1139 ret=self->selectByTupleIdSafe(&it1,&it1+1);
1140 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1141 std::vector<int> v2(nbOfComp);
1142 for(int i=0;i<nbOfComp;i++)
1143 v2[i]=pc1.first+i*pc1.second.second;
1144 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1148 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1149 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1150 std::vector<int> v2(nbOfComp);
1151 for(int i=0;i<nbOfComp;i++)
1152 v2[i]=pc1.first+i*pc1.second.second;
1153 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1157 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1158 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1159 std::vector<int> v2(nbOfComp);
1160 for(int i=0;i<nbOfComp;i++)
1161 v2[i]=pc1.first+i*pc1.second.second;
1162 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1166 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1167 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1168 std::vector<int> v2(nbOfComp);
1169 for(int i=0;i<nbOfComp;i++)
1170 v2[i]=pc1.first+i*pc1.second.second;
1171 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1174 throw INTERP_KERNEL::Exception(msg);
1178 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
1180 self->checkAllocated();
1181 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
1182 int nbOfTuples=self->getNumberOfTuples();
1183 int nbOfComponents=self->getNumberOfComponents();
1186 std::vector<double> v1;
1187 DataArrayDouble *d1=0;
1188 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
1190 std::vector<int> vt1,vc1;
1191 std::pair<int, std::pair<int,int> > pt1,pc1;
1192 DataArrayInt *dt1=0,*dc1=0;
1193 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1194 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
1202 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
1205 tmp=DataArrayDouble::New();
1206 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1207 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
1210 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
1213 throw INTERP_KERNEL::Exception(msg);
1222 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1225 tmp=DataArrayDouble::New();
1226 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1227 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
1230 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1233 throw INTERP_KERNEL::Exception(msg);
1242 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1245 tmp=DataArrayDouble::New();
1246 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1247 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
1250 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1253 throw INTERP_KERNEL::Exception(msg);
1262 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1265 tmp=DataArrayDouble::New();
1266 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1267 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
1270 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1273 throw INTERP_KERNEL::Exception(msg);
1282 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
1285 tmp=DataArrayDouble::New();
1286 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1287 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
1290 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
1293 throw INTERP_KERNEL::Exception(msg);
1302 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1305 tmp=DataArrayDouble::New();
1306 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1307 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
1310 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1313 throw INTERP_KERNEL::Exception(msg);
1322 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1325 tmp=DataArrayDouble::New();
1326 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1327 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
1330 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1333 throw INTERP_KERNEL::Exception(msg);
1342 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1345 tmp=DataArrayDouble::New();
1346 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1347 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
1350 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1353 throw INTERP_KERNEL::Exception(msg);
1362 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1365 tmp=DataArrayDouble::New();
1366 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1367 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
1370 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1373 throw INTERP_KERNEL::Exception(msg);
1382 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1385 tmp=DataArrayDouble::New();
1386 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1387 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
1390 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1393 throw INTERP_KERNEL::Exception(msg);
1402 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1405 tmp=DataArrayDouble::New();
1406 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1407 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
1410 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1413 throw INTERP_KERNEL::Exception(msg);
1422 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1425 tmp=DataArrayDouble::New();
1426 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1427 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
1430 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1433 throw INTERP_KERNEL::Exception(msg);
1442 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1445 tmp=DataArrayDouble::New();
1446 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1447 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
1450 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1453 throw INTERP_KERNEL::Exception(msg);
1462 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1465 tmp=DataArrayDouble::New();
1466 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1467 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
1470 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1473 throw INTERP_KERNEL::Exception(msg);
1482 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1485 tmp=DataArrayDouble::New();
1486 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1487 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
1490 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1493 throw INTERP_KERNEL::Exception(msg);
1502 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1505 tmp=DataArrayDouble::New();
1506 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1507 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
1510 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1513 throw INTERP_KERNEL::Exception(msg);
1518 throw INTERP_KERNEL::Exception(msg);
1523 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
1525 return self->negate();
1528 PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1530 const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
1533 DataArrayDoubleTuple *aa;
1534 std::vector<double> bb;
1537 #ifndef WITHOUT_AUTOFIELD
1539 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1541 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1544 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1545 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1547 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1550 throw INTERP_KERNEL::Exception(msg);
1554 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1559 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1560 ret->applyLin(1.,val);
1561 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1565 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1569 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1570 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1574 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1575 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1578 throw INTERP_KERNEL::Exception(msg);
1582 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1584 const char msg[]="Unexpected situation in __radd__ !";
1587 DataArrayDoubleTuple *aa;
1588 std::vector<double> bb;
1590 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1595 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1596 ret->applyLin(1.,val);
1601 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1602 return DataArrayDouble::Add(self,aaa);
1606 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1607 return DataArrayDouble::Add(self,aaa);
1610 throw INTERP_KERNEL::Exception(msg);
1614 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1616 const char msg[]="Unexpected situation in __iadd__ !";
1619 DataArrayDoubleTuple *aa;
1620 std::vector<double> bb;
1622 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1627 self->applyLin(1.,val);
1628 Py_XINCREF(trueSelf);
1634 Py_XINCREF(trueSelf);
1639 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1640 self->addEqual(aaa);
1641 Py_XINCREF(trueSelf);
1646 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1647 self->addEqual(aaa);
1648 Py_XINCREF(trueSelf);
1652 throw INTERP_KERNEL::Exception(msg);
1656 PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1658 const char msg[]="Unexpected situation in __sub__ !";
1661 DataArrayDoubleTuple *aa;
1662 std::vector<double> bb;
1665 #ifndef WITHOUT_AUTOFIELD
1667 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1669 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1672 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1673 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1675 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1678 throw INTERP_KERNEL::Exception(msg);
1682 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1687 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1688 ret->applyLin(1.,-val);
1689 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1693 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1697 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1698 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1702 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1703 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1706 throw INTERP_KERNEL::Exception(msg);
1710 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1712 const char msg[]="Unexpected situation in __rsub__ !";
1715 DataArrayDoubleTuple *aa;
1716 std::vector<double> bb;
1718 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1723 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1724 ret->applyLin(-1.,val);
1729 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1730 return DataArrayDouble::Substract(aaa,self);
1734 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1735 return DataArrayDouble::Substract(aaa,self);
1738 throw INTERP_KERNEL::Exception(msg);
1742 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1744 const char msg[]="Unexpected situation in __isub__ !";
1747 DataArrayDoubleTuple *aa;
1748 std::vector<double> bb;
1750 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1755 self->applyLin(1,-val);
1756 Py_XINCREF(trueSelf);
1761 self->substractEqual(a);
1762 Py_XINCREF(trueSelf);
1767 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1768 self->substractEqual(aaa);
1769 Py_XINCREF(trueSelf);
1774 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1775 self->substractEqual(aaa);
1776 Py_XINCREF(trueSelf);
1780 throw INTERP_KERNEL::Exception(msg);
1784 PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1786 const char msg[]="Unexpected situation in __mul__ !";
1789 DataArrayDoubleTuple *aa;
1790 std::vector<double> bb;
1793 #ifndef WITHOUT_AUTOFIELD
1795 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1797 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1800 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1801 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1803 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1806 throw INTERP_KERNEL::Exception(msg);
1810 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1815 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1816 ret->applyLin(val,0.);
1817 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1821 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1825 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1826 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1830 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1831 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1834 throw INTERP_KERNEL::Exception(msg);
1838 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1840 const char msg[]="Unexpected situation in __rmul__ !";
1843 DataArrayDoubleTuple *aa;
1844 std::vector<double> bb;
1846 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1851 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1852 ret->applyLin(val,0.);
1857 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1858 return DataArrayDouble::Multiply(self,aaa);
1862 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1863 return DataArrayDouble::Multiply(self,aaa);
1866 throw INTERP_KERNEL::Exception(msg);
1870 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1872 const char msg[]="Unexpected situation in __imul__ !";
1875 DataArrayDoubleTuple *aa;
1876 std::vector<double> bb;
1878 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1883 self->applyLin(val,0.);
1884 Py_XINCREF(trueSelf);
1889 self->multiplyEqual(a);
1890 Py_XINCREF(trueSelf);
1895 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1896 self->multiplyEqual(aaa);
1897 Py_XINCREF(trueSelf);
1902 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1903 self->multiplyEqual(aaa);
1904 Py_XINCREF(trueSelf);
1908 throw INTERP_KERNEL::Exception(msg);
1912 PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1914 const char msg[]="Unexpected situation in __div__ !";
1917 DataArrayDoubleTuple *aa;
1918 std::vector<double> bb;
1921 #ifndef WITHOUT_AUTOFIELD
1923 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1925 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1928 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1929 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1931 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1934 throw INTERP_KERNEL::Exception(msg);
1938 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1944 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1945 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1946 ret->applyLin(1/val,0.);
1947 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1951 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1955 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1956 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1960 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1961 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1964 throw INTERP_KERNEL::Exception(msg);
1968 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1970 const char msg[]="Unexpected situation in __rdiv__ !";
1973 DataArrayDoubleTuple *aa;
1974 std::vector<double> bb;
1976 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1981 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1987 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1988 return DataArrayDouble::Divide(aaa,self);
1992 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1993 return DataArrayDouble::Divide(aaa,self);
1996 throw INTERP_KERNEL::Exception(msg);
2000 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2002 const char msg[]="Unexpected situation in __idiv__ !";
2005 DataArrayDoubleTuple *aa;
2006 std::vector<double> bb;
2008 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2014 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
2015 self->applyLin(1./val,0.);
2016 Py_XINCREF(trueSelf);
2021 self->divideEqual(a);
2022 Py_XINCREF(trueSelf);
2027 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2028 self->divideEqual(aaa);
2029 Py_XINCREF(trueSelf);
2034 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2035 self->divideEqual(aaa);
2036 Py_XINCREF(trueSelf);
2040 throw INTERP_KERNEL::Exception(msg);
2044 DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2046 const char msg[]="Unexpected situation in __pow__ !";
2049 DataArrayDoubleTuple *aa;
2050 std::vector<double> bb;
2052 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2057 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2063 return DataArrayDouble::Pow(self,a);
2067 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2068 return DataArrayDouble::Pow(self,aaa);
2072 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2073 return DataArrayDouble::Pow(self,aaa);
2076 throw INTERP_KERNEL::Exception(msg);
2080 DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2082 const char msg[]="Unexpected situation in __rpow__ !";
2085 DataArrayDoubleTuple *aa;
2086 std::vector<double> bb;
2088 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2093 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2094 ret->applyRPow(val);
2099 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2100 return DataArrayDouble::Pow(aaa,self);
2104 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2105 return DataArrayDouble::Pow(aaa,self);
2108 throw INTERP_KERNEL::Exception(msg);
2112 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2114 const char msg[]="Unexpected situation in __ipow__ !";
2117 DataArrayDoubleTuple *aa;
2118 std::vector<double> bb;
2120 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2125 self->applyPow(val);
2126 Py_XINCREF(trueSelf);
2132 Py_XINCREF(trueSelf);
2137 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2138 self->powEqual(aaa);
2139 Py_XINCREF(trueSelf);
2144 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2145 self->powEqual(aaa);
2146 Py_XINCREF(trueSelf);
2150 throw INTERP_KERNEL::Exception(msg);
2154 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
2156 DataArrayInt *c=0,*cI=0;
2158 self->computeTupleIdsNearTuples(other,eps,c,cI);
2159 PyObject *ret=PyTuple_New(2);
2160 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2161 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2165 PyObject *maxPerTupleWithCompoId() const throw(INTERP_KERNEL::Exception)
2167 DataArrayInt *ret1=0;
2168 DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
2169 PyObject *ret=PyTuple_New(2);
2170 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2171 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2177 class DataArrayDoubleTuple;
2179 class DataArrayDoubleIterator
2182 DataArrayDoubleIterator(DataArrayDouble *da);
2183 ~DataArrayDoubleIterator();
2188 DataArrayDoubleTuple *ret=self->nextt();
2190 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2193 PyErr_SetString(PyExc_StopIteration,"No more data.");
2200 class DataArrayDoubleTuple
2203 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
2204 DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
2207 std::string __str__() const throw(INTERP_KERNEL::Exception)
2209 return self->repr();
2212 double __float__() const throw(INTERP_KERNEL::Exception)
2214 return self->doubleValue();
2217 DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
2219 return self->buildDADouble(1,self->getNumberOfCompo());
2222 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2224 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2225 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2226 Py_XINCREF(trueSelf);
2230 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2232 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2233 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2234 Py_XINCREF(trueSelf);
2238 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2240 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2241 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2242 Py_XINCREF(trueSelf);
2246 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2248 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2249 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2250 Py_XINCREF(trueSelf);
2254 PyObject *__len__() throw(INTERP_KERNEL::Exception)
2256 return PyInt_FromLong(self->getNumberOfCompo());
2259 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2261 const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2264 std::vector<int> multiVal;
2265 std::pair<int, std::pair<int,int> > slic;
2266 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2267 const double *pt=self->getConstPointer();
2268 int nbc=self->getNumberOfCompo();
2269 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2276 std::ostringstream oss;
2277 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2278 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
2282 return PyFloat_FromDouble(pt[singleVal]);
2286 return PyFloat_FromDouble(pt[nbc+singleVal]);
2289 std::ostringstream oss;
2290 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2291 throw INTERP_KERNEL::Exception(oss.str().c_str());
2297 PyObject *t=PyTuple_New(multiVal.size());
2298 for(int j=0;j<(int)multiVal.size();j++)
2300 int cid=multiVal[j];
2303 std::ostringstream oss;
2304 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2305 throw INTERP_KERNEL::Exception(oss.str().c_str());
2307 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2313 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2314 PyObject *t=PyTuple_New(sz);
2315 for(int j=0;j<sz;j++)
2316 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2320 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2324 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2326 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2327 const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2330 std::vector<double> multiValV;
2331 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2332 int nbc=self->getNumberOfCompo();
2333 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2335 std::vector<int> multiVal;
2336 std::pair<int, std::pair<int,int> > slic;
2337 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2338 double *pt=self->getPointer();
2339 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2346 std::ostringstream oss;
2347 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2348 throw INTERP_KERNEL::Exception(oss.str().c_str());
2354 pt[singleVal]=singleValV;
2359 if(multiValV.size()!=1)
2361 std::ostringstream oss;
2362 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2363 throw INTERP_KERNEL::Exception(oss.str().c_str());
2365 pt[singleVal]=multiValV[0];
2370 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2374 throw INTERP_KERNEL::Exception(msg);
2383 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2387 std::ostringstream oss;
2388 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2389 throw INTERP_KERNEL::Exception(oss.str().c_str());
2397 if(multiVal.size()!=multiValV.size())
2399 std::ostringstream oss;
2400 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2401 throw INTERP_KERNEL::Exception(oss.str().c_str());
2403 for(int i=0;i<(int)multiVal.size();i++)
2405 int pos=multiVal[i];
2408 std::ostringstream oss;
2409 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2410 throw INTERP_KERNEL::Exception(oss.str().c_str());
2412 pt[multiVal[i]]=multiValV[i];
2418 const double *ptV=daIntTyyppV->getConstPointer();
2419 if(nbc>daIntTyyppV->getNumberOfCompo())
2421 std::ostringstream oss;
2422 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2423 throw INTERP_KERNEL::Exception(oss.str().c_str());
2425 std::copy(ptV,ptV+nbc,pt);
2429 throw INTERP_KERNEL::Exception(msg);
2434 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2439 for(int j=0;j<sz;j++)
2440 pt[slic.first+j*slic.second.second]=singleValV;
2445 if(sz!=(int)multiValV.size())
2447 std::ostringstream oss;
2448 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2449 throw INTERP_KERNEL::Exception(oss.str().c_str());
2451 for(int j=0;j<sz;j++)
2452 pt[slic.first+j*slic.second.second]=multiValV[j];
2457 const double *ptV=daIntTyyppV->getConstPointer();
2458 if(sz>daIntTyyppV->getNumberOfCompo())
2460 std::ostringstream oss;
2461 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2462 throw INTERP_KERNEL::Exception(oss.str().c_str());
2464 for(int j=0;j<sz;j++)
2465 pt[slic.first+j*slic.second.second]=ptV[j];
2469 throw INTERP_KERNEL::Exception(msg);
2473 throw INTERP_KERNEL::Exception(msg);
2479 class DataArrayIntIterator;
2481 class DataArrayInt : public DataArray
2484 static DataArrayInt *New();
2485 int intValue() const throw(INTERP_KERNEL::Exception);
2486 int getHashCode() const throw(INTERP_KERNEL::Exception);
2487 bool empty() const throw(INTERP_KERNEL::Exception);
2488 DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2489 void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2490 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2491 void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2492 int popBackSilent() throw(INTERP_KERNEL::Exception);
2493 void pack() const throw(INTERP_KERNEL::Exception);
2494 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2495 bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2496 bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2497 bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2498 DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2499 DataArrayInt *sumPerTuple() const throw(INTERP_KERNEL::Exception);
2500 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2501 void reverse() throw(INTERP_KERNEL::Exception);
2502 void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2503 bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2504 void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2505 bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2506 void fillWithZero() throw(INTERP_KERNEL::Exception);
2507 void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2508 void iota(int init=0) throw(INTERP_KERNEL::Exception);
2509 std::string repr() const throw(INTERP_KERNEL::Exception);
2510 std::string reprZip() const throw(INTERP_KERNEL::Exception);
2511 DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2512 DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2513 DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2514 DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
2515 DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2516 DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2517 DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2518 DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2519 DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2520 bool isIdentity() const throw(INTERP_KERNEL::Exception);
2521 bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2522 DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2523 void transpose() throw(INTERP_KERNEL::Exception);
2524 DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2525 void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2526 void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2527 void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2528 void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2529 void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2530 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2531 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2532 int front() const throw(INTERP_KERNEL::Exception);
2533 int back() const throw(INTERP_KERNEL::Exception);
2534 void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2535 void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2536 int *getPointer() throw(INTERP_KERNEL::Exception);
2537 const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2538 DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2539 const int *begin() const throw(INTERP_KERNEL::Exception);
2540 const int *end() const throw(INTERP_KERNEL::Exception);
2541 DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2542 DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2543 int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2544 int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2545 int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2546 int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2547 int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2548 bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2549 bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2550 bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2551 int count(int value) const throw(INTERP_KERNEL::Exception);
2552 int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2553 int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2554 int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2555 int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2556 int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2557 void abs() throw(INTERP_KERNEL::Exception);
2558 DataArrayInt *computeAbs() const throw(INTERP_KERNEL::Exception);
2559 void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2560 void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2561 void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2562 DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2563 void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2564 void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2565 void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2566 void applyPow(int val) throw(INTERP_KERNEL::Exception);
2567 void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2568 DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2569 DataArrayInt *getIdsNotInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2570 bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2571 static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2572 static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2573 static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2574 static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2575 static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2576 static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2) throw(INTERP_KERNEL::Exception);
2577 DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2578 DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2579 DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2580 DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2581 DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2582 DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2583 DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2584 void computeOffsets() throw(INTERP_KERNEL::Exception);
2585 void computeOffsets2() throw(INTERP_KERNEL::Exception);
2586 DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2587 DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2588 DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2589 DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2590 DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2591 static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2592 void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2593 static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2594 void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2595 static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2596 void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2597 static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2598 void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2599 static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2600 void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2601 static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2602 void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2604 static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2607 DataArrayInt() throw(INTERP_KERNEL::Exception)
2609 return DataArrayInt::New();
2612 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2614 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)";
2615 std::string msg(msgBase);
2617 msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2620 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2624 if(PyInt_Check(nbOfTuples))
2626 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2628 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2631 if(PyInt_Check(nbOfComp))
2632 {//DataArrayInt.New([1,3,4,5],2,2)
2633 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2635 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2636 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2637 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2638 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2642 throw INTERP_KERNEL::Exception(msg.c_str());
2645 {//DataArrayInt.New([1,3,4],3)
2646 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2648 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2649 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2654 throw INTERP_KERNEL::Exception(msg.c_str());
2657 {// DataArrayInt.New([1,3,4])
2658 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2659 int tmpp1=-1,tmpp2=-1;
2660 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2661 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2665 else if(PyInt_Check(elt0))
2667 int nbOfTuples1=PyInt_AS_LONG(elt0);
2669 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2674 if(PyInt_Check(nbOfTuples))
2675 {//DataArrayInt.New(5,2)
2676 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2678 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2679 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2680 ret->alloc(nbOfTuples1,nbOfCompo);
2684 throw INTERP_KERNEL::Exception(msg.c_str());
2687 throw INTERP_KERNEL::Exception(msg.c_str());
2690 {//DataArrayInt.New(5)
2691 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2692 ret->alloc(nbOfTuples1,1);
2697 else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2698 {//DataArrayInt.New(numpyArray)
2699 return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2703 throw INTERP_KERNEL::Exception(msg.c_str());
2704 throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
2707 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2709 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2712 std::string __str__() const throw(INTERP_KERNEL::Exception)
2714 return self->repr();
2717 int __len__() const throw(INTERP_KERNEL::Exception)
2719 if(self->isAllocated())
2721 return self->getNumberOfTuples();
2725 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2729 int __int__() const throw(INTERP_KERNEL::Exception)
2731 return self->intValue();
2734 DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2736 return self->iterator();
2739 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2741 int sz=self->getNumberOfComponents();
2742 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2743 self->accumulate(tmp);
2744 return convertIntArrToPyList(tmp,sz);
2747 DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2750 std::vector<int> val2;
2751 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2752 return self->accumulatePerChunck(bg,bg+sz);
2755 DataArrayInt *getIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
2758 std::vector<int> val2;
2759 const int *bg(convertObjToPossibleCpp1_Safe(inputTuple,sw,sz,val,val2));
2760 return self->getIdsEqualTuple(bg,bg+sz);
2763 PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
2765 std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
2766 PyObject *ret=PyList_New(slcs.size());
2767 for(std::size_t i=0;i<slcs.size();i++)
2768 PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
2772 DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const throw(INTERP_KERNEL::Exception)
2774 if(!PySlice_Check(slic))
2775 throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
2776 Py_ssize_t strt=2,stp=2,step=2;
2777 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
2778 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
2779 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
2780 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 !");
2781 return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
2784 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2786 int newNbOfTuples=-1;
2787 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2788 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2789 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2790 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2791 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2792 PyObject *ret=PyTuple_New(2);
2793 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2794 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2798 static DataArrayInt *CheckAndPreparePermutation(PyObject *arr) throw(INTERP_KERNEL::Exception)
2800 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
2801 int szArr,sw,iTypppArr;
2802 std::vector<int> stdvecTyyppArr;
2803 const int *arrPtr(convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
2804 int *pt(ParaMEDMEM::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
2805 ret->useArray(pt,true,ParaMEDMEM::C_DEALLOC,szArr,1);
2809 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2811 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 !";
2812 if(PyList_Check(li) || PyTuple_Check(li))
2816 if(PyInt_Check(nbOfTuples))
2818 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2820 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2823 if(PyInt_Check(nbOfComp))
2824 {//DataArrayInt.setValues([1,3,4,5],2,2)
2825 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2827 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2828 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2829 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2832 throw INTERP_KERNEL::Exception(msg);
2835 {//DataArrayInt.setValues([1,3,4],3)
2837 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2838 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2842 throw INTERP_KERNEL::Exception(msg);
2845 {// DataArrayInt.setValues([1,3,4])
2846 int tmpp1=-1,tmpp2=-1;
2847 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2848 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2852 throw INTERP_KERNEL::Exception(msg);
2855 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2857 const int *vals=self->getConstPointer();
2858 return convertIntArrToPyList(vals,self->getNbOfElems());
2862 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2864 return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2868 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2871 bool ret0=self->isEqualIfNotWhy(other,ret1);
2872 PyObject *ret=PyTuple_New(2);
2873 PyObject *ret0Py=ret0?Py_True:Py_False;
2875 PyTuple_SetItem(ret,0,ret0Py);
2876 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2880 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2882 const int *vals=self->getConstPointer();
2883 int nbOfComp=self->getNumberOfComponents();
2884 int nbOfTuples=self->getNumberOfTuples();
2885 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2888 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2890 std::vector<const DataArrayInt *> groups;
2891 std::vector< std::vector<int> > fidsOfGroups;
2892 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2893 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2894 PyObject *ret = PyList_New(2);
2895 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2896 int sz=fidsOfGroups.size();
2897 PyObject *ret1 = PyList_New(sz);
2898 for(int i=0;i<sz;i++)
2899 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2900 PyList_SetItem(ret,1,ret1);
2904 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2907 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2908 if (!SWIG_IsOK(res1))
2911 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2912 self->transformWithIndArr(tmp,tmp+size);
2916 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2917 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2921 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2925 std::vector<int> multiVal;
2926 std::pair<int, std::pair<int,int> > slic;
2927 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2928 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2932 return self->getIdsEqualList(&singleVal,&singleVal+1);
2934 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2936 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2938 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2942 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2946 std::vector<int> multiVal;
2947 std::pair<int, std::pair<int,int> > slic;
2948 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2949 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2953 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2955 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2957 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2959 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2963 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2965 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2967 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2968 if (!SWIG_IsOK(res1))
2971 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2972 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2976 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2978 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2979 da2->checkAllocated();
2980 int size=self->getNumberOfTuples();
2981 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
2983 PyObject *ret = PyList_New(3);
2984 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2985 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2986 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2990 DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2993 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2994 if (!SWIG_IsOK(res1))
2997 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2998 return self->transformWithIndArrR(tmp,tmp+size);
3002 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3003 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3007 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3010 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3011 if (!SWIG_IsOK(res1))
3014 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3015 if(size!=self->getNumberOfTuples())
3017 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3019 return self->renumberAndReduce(tmp,newNbOfTuple);
3023 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3025 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3026 da2->checkAllocated();
3027 int size=self->getNumberOfTuples();
3028 if(size!=self->getNumberOfTuples())
3030 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3032 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3036 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3039 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3040 if (!SWIG_IsOK(res1))
3043 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3044 if(size!=self->getNumberOfTuples())
3046 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3048 return self->renumber(tmp);
3052 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3054 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3055 da2->checkAllocated();
3056 int size=self->getNumberOfTuples();
3057 if(size!=self->getNumberOfTuples())
3059 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3061 return self->renumber(da2->getConstPointer());
3065 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3068 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3069 if (!SWIG_IsOK(res1))
3072 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3073 if(size!=self->getNumberOfTuples())
3075 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3077 return self->renumberR(tmp);
3081 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3083 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3084 da2->checkAllocated();
3085 int size=self->getNumberOfTuples();
3086 if(size!=self->getNumberOfTuples())
3088 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3090 return self->renumberR(da2->getConstPointer());
3094 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3096 std::vector<int> tmp;
3097 convertPyToNewIntArr3(li,tmp);
3098 self->setSelectedComponents(a,tmp);
3101 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3103 int sz=self->getNumberOfComponents();
3104 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
3105 self->getTuple(tupleId,tmp);
3106 return convertIntArrToPyList(tmp,sz);
3109 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
3111 DataArrayInt *arr=0;
3112 DataArrayInt *arrI=0;
3113 self->changeSurjectiveFormat(targetNb,arr,arrI);
3114 PyObject *res = PyList_New(2);
3115 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3116 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3120 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3122 std::vector<const DataArrayInt *> tmp;
3123 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3124 return DataArrayInt::Meld(tmp);
3127 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3129 std::vector<const DataArrayInt *> tmp;
3130 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3131 return DataArrayInt::Aggregate(tmp);
3134 static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
3136 std::vector<const DataArrayInt *> tmp;
3137 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3138 return DataArrayInt::AggregateIndexes(tmp);
3141 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
3143 std::vector<const DataArrayInt *> tmp;
3144 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3145 return DataArrayInt::BuildUnion(tmp);
3148 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
3150 std::vector<const DataArrayInt *> tmp;
3151 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3152 return DataArrayInt::BuildIntersection(tmp);
3155 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3158 int r1=self->getMaxValue(tmp);
3159 PyObject *ret=PyTuple_New(2);
3160 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3161 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3165 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3168 int r1=self->getMinValue(tmp);
3169 PyObject *ret=PyTuple_New(2);
3170 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3171 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3175 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3177 int nbOfCompo=self->getNumberOfComponents();
3182 if(PyInt_Check(obj))
3184 int val=(int)PyInt_AS_LONG(obj);
3185 return self->locateValue(val);
3188 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
3192 std::vector<int> arr;
3193 convertPyToNewIntArr3(obj,arr);
3194 return self->locateTuple(arr);
3199 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3201 int nbOfCompo=self->getNumberOfComponents();
3208 if(PyInt_Check(obj))
3210 int val=(int)PyInt_AS_LONG(obj);
3211 return self->presenceOfValue(val);
3214 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
3218 std::vector<int> arr;
3219 convertPyToNewIntArr3(obj,arr);
3220 return self->presenceOfTuple(arr);
3225 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3227 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
3228 const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
3229 self->checkAllocated();
3230 int nbOfTuples=self->getNumberOfTuples();
3231 int nbOfComponents=self->getNumberOfComponents();
3233 std::vector<int> vt1,vc1;
3234 std::pair<int, std::pair<int,int> > pt1,pc1;
3235 DataArrayInt *dt1=0,*dc1=0;
3237 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3238 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3243 if(nbOfComponents==1)
3244 return PyInt_FromLong(self->getIJSafe(it1,0));
3245 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3248 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3250 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3252 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3254 return PyInt_FromLong(self->getIJSafe(it1,ic1));
3257 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3258 std::vector<int> v2(1,ic1);
3259 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3263 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3264 std::vector<int> v2(1,ic1);
3265 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3269 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3270 std::vector<int> v2(1,ic1);
3271 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3275 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3276 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3280 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3281 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3285 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3286 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3290 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3291 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3295 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3296 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3297 std::vector<int> v2(nbOfComp);
3298 for(int i=0;i<nbOfComp;i++)
3299 v2[i]=pc1.first+i*pc1.second.second;
3300 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3304 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3305 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3306 std::vector<int> v2(nbOfComp);
3307 for(int i=0;i<nbOfComp;i++)
3308 v2[i]=pc1.first+i*pc1.second.second;
3309 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3313 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3314 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3315 std::vector<int> v2(nbOfComp);
3316 for(int i=0;i<nbOfComp;i++)
3317 v2[i]=pc1.first+i*pc1.second.second;
3318 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3322 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3323 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3324 std::vector<int> v2(nbOfComp);
3325 for(int i=0;i<nbOfComp;i++)
3326 v2[i]=pc1.first+i*pc1.second.second;
3327 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3330 throw INTERP_KERNEL::Exception(msg);
3334 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3336 self->checkAllocated();
3337 const char msg[]="Unexpected situation in __setitem__ !";
3338 int nbOfTuples=self->getNumberOfTuples();
3339 int nbOfComponents=self->getNumberOfComponents();
3342 std::vector<int> v1;
3344 DataArrayIntTuple *dd1=0;
3345 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3347 std::vector<int> vt1,vc1;
3348 std::pair<int, std::pair<int,int> > pt1,pc1;
3349 DataArrayInt *dt1=0,*dc1=0;
3350 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3351 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3359 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3362 tmp=DataArrayInt::New();
3363 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3364 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3367 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3370 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3371 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3374 throw INTERP_KERNEL::Exception(msg);
3383 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3386 tmp=DataArrayInt::New();
3387 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3388 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3391 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3394 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3395 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3398 throw INTERP_KERNEL::Exception(msg);
3407 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3410 tmp=DataArrayInt::New();
3411 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3412 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3415 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3418 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3419 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3422 throw INTERP_KERNEL::Exception(msg);
3431 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3434 tmp=DataArrayInt::New();
3435 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3436 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3439 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3442 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3443 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3446 throw INTERP_KERNEL::Exception(msg);
3455 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3458 tmp=DataArrayInt::New();
3459 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3460 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3463 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3466 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3467 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3470 throw INTERP_KERNEL::Exception(msg);
3479 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3482 tmp=DataArrayInt::New();
3483 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3484 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3487 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3490 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3491 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3494 throw INTERP_KERNEL::Exception(msg);
3503 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3506 tmp=DataArrayInt::New();
3507 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3508 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3511 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3514 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3515 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3518 throw INTERP_KERNEL::Exception(msg);
3527 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3530 tmp=DataArrayInt::New();
3531 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3532 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3535 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3538 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3539 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3542 throw INTERP_KERNEL::Exception(msg);
3551 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3554 tmp=DataArrayInt::New();
3555 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3556 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3559 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3562 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3563 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3566 throw INTERP_KERNEL::Exception(msg);
3575 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3578 tmp=DataArrayInt::New();
3579 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3580 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3583 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3586 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3587 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3590 throw INTERP_KERNEL::Exception(msg);
3599 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3602 tmp=DataArrayInt::New();
3603 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3604 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3607 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3610 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3611 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3614 throw INTERP_KERNEL::Exception(msg);
3623 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3626 tmp=DataArrayInt::New();
3627 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3628 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3631 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3634 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3635 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3638 throw INTERP_KERNEL::Exception(msg);
3647 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3650 tmp=DataArrayInt::New();
3651 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3652 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3655 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3658 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3659 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3662 throw INTERP_KERNEL::Exception(msg);
3671 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3674 tmp=DataArrayInt::New();
3675 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3676 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3679 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3682 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3683 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3686 throw INTERP_KERNEL::Exception(msg);
3695 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3698 tmp=DataArrayInt::New();
3699 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3700 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3703 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3706 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3707 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3710 throw INTERP_KERNEL::Exception(msg);
3719 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3722 tmp=DataArrayInt::New();
3723 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3724 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3727 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3730 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3731 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3734 throw INTERP_KERNEL::Exception(msg);
3739 throw INTERP_KERNEL::Exception(msg);
3744 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3746 return self->negate();
3749 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3751 const char msg[]="Unexpected situation in __add__ !";
3754 std::vector<int> aa;
3755 DataArrayIntTuple *aaa;
3757 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3762 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3763 ret->applyLin(1,val);
3768 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3769 return DataArrayInt::Add(self,aaaa);
3773 return DataArrayInt::Add(self,a);
3777 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3778 return DataArrayInt::Add(self,aaaa);
3781 throw INTERP_KERNEL::Exception(msg);
3785 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3787 const char msg[]="Unexpected situation in __radd__ !";
3790 std::vector<int> aa;
3791 DataArrayIntTuple *aaa;
3793 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3798 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3799 ret->applyLin(1,val);
3804 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3805 return DataArrayInt::Add(self,aaaa);
3809 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3810 return DataArrayInt::Add(self,aaaa);
3813 throw INTERP_KERNEL::Exception(msg);
3817 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3819 const char msg[]="Unexpected situation in __iadd__ !";
3822 std::vector<int> aa;
3823 DataArrayIntTuple *aaa;
3825 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3830 self->applyLin(1,val);
3831 Py_XINCREF(trueSelf);
3836 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3838 Py_XINCREF(trueSelf);
3844 Py_XINCREF(trueSelf);
3849 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3850 self->addEqual(aaaa);
3851 Py_XINCREF(trueSelf);
3855 throw INTERP_KERNEL::Exception(msg);
3859 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3861 const char msg[]="Unexpected situation in __sub__ !";
3864 std::vector<int> aa;
3865 DataArrayIntTuple *aaa;
3867 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3872 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3873 ret->applyLin(1,-val);
3878 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3879 return DataArrayInt::Substract(self,aaaa);
3883 return DataArrayInt::Substract(self,a);
3887 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3888 return DataArrayInt::Substract(self,aaaa);
3891 throw INTERP_KERNEL::Exception(msg);
3895 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3897 const char msg[]="Unexpected situation in __rsub__ !";
3900 std::vector<int> aa;
3901 DataArrayIntTuple *aaa;
3903 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3908 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3909 ret->applyLin(-1,val);
3914 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3915 return DataArrayInt::Substract(aaaa,self);
3919 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3920 return DataArrayInt::Substract(aaaa,self);
3923 throw INTERP_KERNEL::Exception(msg);
3927 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3929 const char msg[]="Unexpected situation in __isub__ !";
3932 std::vector<int> aa;
3933 DataArrayIntTuple *aaa;
3935 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3940 self->applyLin(1,-val);
3941 Py_XINCREF(trueSelf);
3946 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3947 self->substractEqual(bb);
3948 Py_XINCREF(trueSelf);
3953 self->substractEqual(a);
3954 Py_XINCREF(trueSelf);
3959 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3960 self->substractEqual(aaaa);
3961 Py_XINCREF(trueSelf);
3965 throw INTERP_KERNEL::Exception(msg);
3969 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3971 const char msg[]="Unexpected situation in __mul__ !";
3974 std::vector<int> aa;
3975 DataArrayIntTuple *aaa;
3977 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3982 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3983 ret->applyLin(val,0);
3988 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3989 return DataArrayInt::Multiply(self,aaaa);
3993 return DataArrayInt::Multiply(self,a);
3997 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3998 return DataArrayInt::Multiply(self,aaaa);
4001 throw INTERP_KERNEL::Exception(msg);
4005 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4007 const char msg[]="Unexpected situation in __rmul__ !";
4010 std::vector<int> aa;
4011 DataArrayIntTuple *aaa;
4013 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4018 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4019 ret->applyLin(val,0);
4024 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4025 return DataArrayInt::Multiply(self,aaaa);
4029 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4030 return DataArrayInt::Multiply(self,aaaa);
4033 throw INTERP_KERNEL::Exception(msg);
4037 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4039 const char msg[]="Unexpected situation in __imul__ !";
4042 std::vector<int> aa;
4043 DataArrayIntTuple *aaa;
4045 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4050 self->applyLin(val,0);
4051 Py_XINCREF(trueSelf);
4056 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4057 self->multiplyEqual(bb);
4058 Py_XINCREF(trueSelf);
4063 self->multiplyEqual(a);
4064 Py_XINCREF(trueSelf);
4069 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4070 self->multiplyEqual(aaaa);
4071 Py_XINCREF(trueSelf);
4075 throw INTERP_KERNEL::Exception(msg);
4079 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4081 const char msg[]="Unexpected situation in __div__ !";
4084 std::vector<int> aa;
4085 DataArrayIntTuple *aaa;
4087 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4092 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4093 ret->applyDivideBy(val);
4098 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4099 return DataArrayInt::Divide(self,aaaa);
4103 return DataArrayInt::Divide(self,a);
4107 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4108 return DataArrayInt::Divide(self,aaaa);
4111 throw INTERP_KERNEL::Exception(msg);
4115 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4117 const char msg[]="Unexpected situation in __rdiv__ !";
4120 std::vector<int> aa;
4121 DataArrayIntTuple *aaa;
4123 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4128 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4134 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4135 return DataArrayInt::Divide(aaaa,self);
4139 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4140 return DataArrayInt::Divide(aaaa,self);
4143 throw INTERP_KERNEL::Exception(msg);
4147 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4149 const char msg[]="Unexpected situation in __idiv__ !";
4152 std::vector<int> aa;
4153 DataArrayIntTuple *aaa;
4155 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4160 self->applyDivideBy(val);
4161 Py_XINCREF(trueSelf);
4166 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4167 self->divideEqual(bb);
4168 Py_XINCREF(trueSelf);
4173 self->divideEqual(a);
4174 Py_XINCREF(trueSelf);
4179 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4180 self->divideEqual(aaaa);
4181 Py_XINCREF(trueSelf);
4185 throw INTERP_KERNEL::Exception(msg);
4189 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4191 const char msg[]="Unexpected situation in __mod__ !";
4194 std::vector<int> aa;
4195 DataArrayIntTuple *aaa;
4197 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4202 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4203 ret->applyModulus(val);
4208 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4209 return DataArrayInt::Modulus(self,aaaa);
4213 return DataArrayInt::Modulus(self,a);
4217 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4218 return DataArrayInt::Modulus(self,aaaa);
4221 throw INTERP_KERNEL::Exception(msg);
4225 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4227 const char msg[]="Unexpected situation in __rmod__ !";
4230 std::vector<int> aa;
4231 DataArrayIntTuple *aaa;
4233 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4238 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4239 ret->applyRModulus(val);
4244 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4245 return DataArrayInt::Modulus(aaaa,self);
4249 return DataArrayInt::Modulus(a,self);
4253 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4254 return DataArrayInt::Modulus(aaaa,self);
4257 throw INTERP_KERNEL::Exception(msg);
4261 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4263 const char msg[]="Unexpected situation in __imod__ !";
4266 std::vector<int> aa;
4267 DataArrayIntTuple *aaa;
4269 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4274 self->applyModulus(val);
4275 Py_XINCREF(trueSelf);
4280 self->modulusEqual(a);
4281 Py_XINCREF(trueSelf);
4286 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4287 self->modulusEqual(aaaa);
4288 Py_XINCREF(trueSelf);
4292 throw INTERP_KERNEL::Exception(msg);
4296 DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4298 const char msg[]="Unexpected situation in __pow__ !";
4301 std::vector<int> aa;
4302 DataArrayIntTuple *aaa;
4304 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4309 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4315 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4316 return DataArrayInt::Pow(self,aaaa);
4320 return DataArrayInt::Pow(self,a);
4324 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4325 return DataArrayInt::Pow(self,aaaa);
4328 throw INTERP_KERNEL::Exception(msg);
4332 DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4334 const char msg[]="Unexpected situation in __rpow__ !";
4337 std::vector<int> aa;
4338 DataArrayIntTuple *aaa;
4340 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4345 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4346 ret->applyRPow(val);
4351 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4352 return DataArrayInt::Pow(aaaa,self);
4356 return DataArrayInt::Pow(a,self);
4360 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4361 return DataArrayInt::Pow(aaaa,self);
4364 throw INTERP_KERNEL::Exception(msg);
4368 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4370 const char msg[]="Unexpected situation in __ipow__ !";
4373 std::vector<int> aa;
4374 DataArrayIntTuple *aaa;
4376 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4381 self->applyPow(val);
4382 Py_XINCREF(trueSelf);
4388 Py_XINCREF(trueSelf);
4393 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4394 self->powEqual(aaaa);
4395 Py_XINCREF(trueSelf);
4399 throw INTERP_KERNEL::Exception(msg);
4403 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4405 std::ostringstream oss;
4406 self->reprQuickOverview(oss);
4410 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4412 int szArr,sw,iTypppArr;
4413 std::vector<int> stdvecTyyppArr;
4414 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4415 self->pushBackValsSilent(tmp,tmp+szArr);
4418 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4420 std::vector<int> ret1;
4421 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4422 std::size_t sz=ret0.size();
4423 PyObject *pyRet=PyTuple_New(2);
4424 PyObject *pyRet0=PyList_New((int)sz);
4425 PyObject *pyRet1=PyList_New((int)sz);
4426 for(std::size_t i=0;i<sz;i++)
4428 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4429 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4431 PyTuple_SetItem(pyRet,0,pyRet0);
4432 PyTuple_SetItem(pyRet,1,pyRet1);
4436 PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4438 DataArrayInt *ret0=0,*ret1=0;
4439 self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4440 PyObject *pyRet=PyTuple_New(2);
4441 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4442 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4448 class DataArrayIntTuple;
4450 class DataArrayIntIterator
4453 DataArrayIntIterator(DataArrayInt *da);
4454 ~DataArrayIntIterator();
4459 DataArrayIntTuple *ret=self->nextt();
4461 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4464 PyErr_SetString(PyExc_StopIteration,"No more data.");
4471 class DataArrayIntTuple
4474 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4475 DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4478 std::string __str__() const throw(INTERP_KERNEL::Exception)
4480 return self->repr();
4483 int __int__() const throw(INTERP_KERNEL::Exception)
4485 return self->intValue();
4488 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4490 return self->buildDAInt(1,self->getNumberOfCompo());
4493 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4495 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4496 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4497 Py_XINCREF(trueSelf);
4501 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4503 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4504 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4505 Py_XINCREF(trueSelf);
4509 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4511 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4512 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4513 Py_XINCREF(trueSelf);
4517 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4519 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4520 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4521 Py_XINCREF(trueSelf);
4525 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4527 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4528 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4529 Py_XINCREF(trueSelf);
4533 PyObject *__len__() throw(INTERP_KERNEL::Exception)
4535 return PyInt_FromLong(self->getNumberOfCompo());
4538 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4540 const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4543 std::vector<int> multiVal;
4544 std::pair<int, std::pair<int,int> > slic;
4545 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4546 const int *pt=self->getConstPointer();
4547 int nbc=self->getNumberOfCompo();
4548 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4555 std::ostringstream oss;
4556 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4557 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4561 return PyInt_FromLong(pt[singleVal]);
4565 return PyInt_FromLong(pt[nbc+singleVal]);
4568 std::ostringstream oss;
4569 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4570 throw INTERP_KERNEL::Exception(oss.str().c_str());
4576 PyObject *t=PyTuple_New(multiVal.size());
4577 for(int j=0;j<(int)multiVal.size();j++)
4579 int cid=multiVal[j];
4582 std::ostringstream oss;
4583 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4584 throw INTERP_KERNEL::Exception(oss.str().c_str());
4586 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4592 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4593 PyObject *t=PyTuple_New(sz);
4594 for(int j=0;j<sz;j++)
4595 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4599 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4603 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4605 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4606 const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4609 std::vector<int> multiValV;
4610 std::pair<int, std::pair<int,int> > slicV;
4611 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4612 int nbc=self->getNumberOfCompo();
4613 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4615 std::vector<int> multiVal;
4616 std::pair<int, std::pair<int,int> > slic;
4617 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4618 int *pt=self->getPointer();
4619 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4626 std::ostringstream oss;
4627 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4628 throw INTERP_KERNEL::Exception(oss.str().c_str());
4634 pt[singleVal]=singleValV;
4639 if(multiValV.size()!=1)
4641 std::ostringstream oss;
4642 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4643 throw INTERP_KERNEL::Exception(oss.str().c_str());
4645 pt[singleVal]=multiValV[0];
4650 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4654 throw INTERP_KERNEL::Exception(msg);
4663 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4667 std::ostringstream oss;
4668 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4669 throw INTERP_KERNEL::Exception(oss.str().c_str());
4677 if(multiVal.size()!=multiValV.size())
4679 std::ostringstream oss;
4680 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4681 throw INTERP_KERNEL::Exception(oss.str().c_str());
4683 for(int i=0;i<(int)multiVal.size();i++)
4685 int pos=multiVal[i];
4688 std::ostringstream oss;
4689 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4690 throw INTERP_KERNEL::Exception(oss.str().c_str());
4692 pt[multiVal[i]]=multiValV[i];
4698 const int *ptV=daIntTyyppV->getConstPointer();
4699 if(nbc>daIntTyyppV->getNumberOfCompo())
4701 std::ostringstream oss;
4702 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4703 throw INTERP_KERNEL::Exception(oss.str().c_str());
4705 std::copy(ptV,ptV+nbc,pt);
4709 throw INTERP_KERNEL::Exception(msg);
4714 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4719 for(int j=0;j<sz;j++)
4720 pt[slic.first+j*slic.second.second]=singleValV;
4725 if(sz!=(int)multiValV.size())
4727 std::ostringstream oss;
4728 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4729 throw INTERP_KERNEL::Exception(oss.str().c_str());
4731 for(int j=0;j<sz;j++)
4732 pt[slic.first+j*slic.second.second]=multiValV[j];
4737 const int *ptV=daIntTyyppV->getConstPointer();
4738 if(sz>daIntTyyppV->getNumberOfCompo())
4740 std::ostringstream oss;
4741 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4742 throw INTERP_KERNEL::Exception(oss.str().c_str());
4744 for(int j=0;j<sz;j++)
4745 pt[slic.first+j*slic.second.second]=ptV[j];
4749 throw INTERP_KERNEL::Exception(msg);
4753 throw INTERP_KERNEL::Exception(msg);
4759 class DataArrayChar : public DataArray
4762 virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4763 int getHashCode() const throw(INTERP_KERNEL::Exception);
4764 bool empty() const throw(INTERP_KERNEL::Exception);
4765 void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4766 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4767 void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4768 char popBackSilent() throw(INTERP_KERNEL::Exception);
4769 void pack() const throw(INTERP_KERNEL::Exception);
4770 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4771 bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4772 bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4773 void reverse() throw(INTERP_KERNEL::Exception);
4774 void fillWithZero() throw(INTERP_KERNEL::Exception);
4775 void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4776 std::string repr() const throw(INTERP_KERNEL::Exception);
4777 std::string reprZip() const throw(INTERP_KERNEL::Exception);
4778 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4779 DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4780 DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4781 DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4782 bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4783 DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4784 DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4785 void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4786 void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4787 char front() const throw(INTERP_KERNEL::Exception);
4788 char back() const throw(INTERP_KERNEL::Exception);
4789 void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4790 void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4791 char *getPointer() throw(INTERP_KERNEL::Exception);
4792 DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4793 DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4794 int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4795 bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4796 char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4797 char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4798 char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4799 char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4800 DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4801 static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4802 static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4805 int __len__() const throw(INTERP_KERNEL::Exception)
4807 if(self->isAllocated())
4809 return self->getNumberOfTuples();
4813 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4817 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4820 bool ret0=self->isEqualIfNotWhy(other,ret1);
4821 PyObject *ret=PyTuple_New(2);
4822 PyObject *ret0Py=ret0?Py_True:Py_False;
4824 PyTuple_SetItem(ret,0,ret0Py);
4825 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4829 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4832 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4833 if (!SWIG_IsOK(res1))
4836 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4837 if(size!=self->getNumberOfTuples())
4839 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4841 return self->renumber(tmp);
4845 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4847 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4848 da2->checkAllocated();
4849 int size=self->getNumberOfTuples();
4850 if(size!=self->getNumberOfTuples())
4852 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4854 return self->renumber(da2->getConstPointer());
4858 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4861 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4862 if (!SWIG_IsOK(res1))
4865 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4866 if(size!=self->getNumberOfTuples())
4868 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4870 return self->renumberR(tmp);
4874 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4876 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4877 da2->checkAllocated();
4878 int size=self->getNumberOfTuples();
4879 if(size!=self->getNumberOfTuples())
4881 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4883 return self->renumberR(da2->getConstPointer());
4887 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4890 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4891 if (!SWIG_IsOK(res1))
4894 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4895 if(size!=self->getNumberOfTuples())
4897 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4899 return self->renumberAndReduce(tmp,newNbOfTuple);
4903 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4905 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4906 da2->checkAllocated();
4907 int size=self->getNumberOfTuples();
4908 if(size!=self->getNumberOfTuples())
4910 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4912 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4916 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4918 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4919 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4920 return DataArrayChar::Aggregate(tmp);
4923 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4925 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4926 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4927 return DataArrayChar::Meld(tmp);
4932 class DataArrayByteIterator;
4934 class DataArrayByte : public DataArrayChar
4937 static DataArrayByte *New();
4938 DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4939 DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4940 char byteValue() const throw(INTERP_KERNEL::Exception);
4943 DataArrayByte() throw(INTERP_KERNEL::Exception)
4945 return DataArrayByte::New();
4948 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4950 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) !";
4951 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4955 if(PyInt_Check(nbOfTuples))
4957 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4959 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4962 if(PyInt_Check(nbOfComp))
4963 {//DataArrayByte.New([1,3,4,5],2,2)
4964 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4966 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4967 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4968 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4969 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4973 throw INTERP_KERNEL::Exception(msg);
4976 {//DataArrayByte.New([1,3,4],3)
4977 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4979 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4980 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4985 throw INTERP_KERNEL::Exception(msg);
4988 {// DataArrayByte.New([1,3,4])
4989 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
4990 int tmpp1=-1,tmpp2=-1;
4991 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4992 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4996 else if(PyInt_Check(elt0))
4998 int nbOfTuples1=PyInt_AS_LONG(elt0);
5000 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
5005 if(PyInt_Check(nbOfTuples))
5006 {//DataArrayByte.New(5,2)
5007 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5009 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
5010 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5011 ret->alloc(nbOfTuples1,nbOfCompo);
5015 throw INTERP_KERNEL::Exception(msg);
5018 throw INTERP_KERNEL::Exception(msg);
5021 {//DataArrayByte.New(5)
5022 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5023 ret->alloc(nbOfTuples1,1);
5028 throw INTERP_KERNEL::Exception(msg);
5031 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5033 return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5036 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5038 std::ostringstream oss;
5039 self->reprQuickOverview(oss);
5043 int __int__() const throw(INTERP_KERNEL::Exception)
5045 return (int) self->byteValue();
5048 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
5050 return self->iterator();
5053 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5055 return (int)self->getIJ(tupleId,compoId);
5058 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5060 return (int)self->getIJSafe(tupleId,compoId);
5063 std::string __str__() const throw(INTERP_KERNEL::Exception)
5065 return self->repr();
5068 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5070 const char *vals=self->getConstPointer();
5071 int nbOfComp=self->getNumberOfComponents();
5072 int nbOfTuples=self->getNumberOfTuples();
5073 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5076 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5079 int ival=-1; std::vector<int> ivval;
5080 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5081 std::vector<char> vals(sz);
5082 std::copy(pt,pt+sz,vals.begin());
5083 return self->presenceOfTuple(vals);
5086 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5089 int ival=-1; std::vector<int> ivval;
5090 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5091 std::vector<char> vals2(sz);
5092 std::copy(pt,pt+sz,vals2.begin());
5093 return self->presenceOfValue(vals2);
5096 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5099 int ival=-1; std::vector<int> ivval;
5100 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5101 std::vector<char> vals2(sz);
5102 std::copy(pt,pt+sz,vals2.begin());
5103 return self->locateValue(vals2);
5106 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5109 int ival=-1; std::vector<int> ivval;
5110 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5111 std::vector<char> vals(sz);
5112 std::copy(pt,pt+sz,vals.begin());
5113 return self->locateTuple(vals);
5116 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5119 int ival=-1; std::vector<int> ivval;
5120 const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
5121 std::vector<char> vals(sz);
5122 std::copy(pt,pt+sz,vals.begin());
5123 return self->search(vals);
5126 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5128 int sz=self->getNumberOfComponents();
5129 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
5130 self->getTuple(tupleId,tmp);
5131 PyObject *ret=PyTuple_New(sz);
5132 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
5136 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5139 int r1=(int)self->getMaxValue(tmp);
5140 PyObject *ret=PyTuple_New(2);
5141 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5142 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5146 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5149 int r1=(int)self->getMinValue(tmp);
5150 PyObject *ret=PyTuple_New(2);
5151 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5152 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5156 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5158 int nbOfCompo=self->getNumberOfComponents();
5163 if(PyInt_Check(obj))
5165 int val=(int)PyInt_AS_LONG(obj);
5166 return self->locateValue(val);
5169 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
5172 return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
5176 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5178 int nbOfCompo=self->getNumberOfComponents();
5185 if(PyInt_Check(obj))
5187 int val=(int)PyInt_AS_LONG(obj);
5188 return self->presenceOfValue(val);
5191 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5194 return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
5198 DataArrayByte *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5200 self->checkAllocated();
5201 const char msg[]="Unexpected situation in __setitem__ !";
5202 int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
5205 std::vector<int> v1;
5207 DataArrayIntTuple *dd1=0;
5208 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5210 std::vector<int> vt1,vc1;
5211 std::pair<int, std::pair<int,int> > pt1,pc1;
5212 DataArrayInt *dt1=0,*dc1=0;
5213 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5214 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5222 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5225 throw INTERP_KERNEL::Exception(msg);
5234 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5237 throw INTERP_KERNEL::Exception(msg);
5246 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5249 throw INTERP_KERNEL::Exception(msg);
5258 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5261 throw INTERP_KERNEL::Exception(msg);
5270 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5273 throw INTERP_KERNEL::Exception(msg);
5282 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5285 throw INTERP_KERNEL::Exception(msg);
5294 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5297 throw INTERP_KERNEL::Exception(msg);
5306 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5309 throw INTERP_KERNEL::Exception(msg);
5318 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5321 throw INTERP_KERNEL::Exception(msg);
5330 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5333 throw INTERP_KERNEL::Exception(msg);
5342 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5345 throw INTERP_KERNEL::Exception(msg);
5354 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5357 throw INTERP_KERNEL::Exception(msg);
5366 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5369 throw INTERP_KERNEL::Exception(msg);
5378 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5381 throw INTERP_KERNEL::Exception(msg);
5390 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5393 throw INTERP_KERNEL::Exception(msg);
5402 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5405 throw INTERP_KERNEL::Exception(msg);
5410 throw INTERP_KERNEL::Exception(msg);
5417 class DataArrayByteTuple;
5419 class DataArrayByteIterator
5422 DataArrayByteIterator(DataArrayByte *da);
5423 ~DataArrayByteIterator();
5426 class DataArrayByteTuple
5429 std::string repr() const throw(INTERP_KERNEL::Exception);
5430 DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5433 std::string __str__() const throw(INTERP_KERNEL::Exception)
5435 return self->repr();
5438 char __int__() const throw(INTERP_KERNEL::Exception)
5440 return self->byteValue();
5443 DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5445 return self->buildDAByte(1,self->getNumberOfCompo());
5450 class DataArrayAsciiCharIterator;
5452 class DataArrayAsciiChar : public DataArrayChar
5455 static DataArrayAsciiChar *New();
5456 DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5457 DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5458 char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5461 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5463 return DataArrayAsciiChar::New();
5466 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5468 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) !";
5469 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5473 if(PyInt_Check(nbOfTuples))
5475 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5477 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5480 if(PyInt_Check(nbOfComp))
5481 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5482 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5484 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5485 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5486 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5487 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5491 throw INTERP_KERNEL::Exception(msg);
5494 {//DataArrayAsciiChar.New([1,3,4],3)
5495 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5497 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5498 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5502 else if(PyString_Check(nbOfTuples))
5504 if(PyString_Size(nbOfTuples)!=1)
5505 throw INTERP_KERNEL::Exception(msg);
5506 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5507 std::vector<std::string> tmp;
5508 if(fillStringVector(elt0,tmp))
5509 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5511 throw INTERP_KERNEL::Exception(msg);
5514 throw INTERP_KERNEL::Exception(msg);
5518 std::vector<std::string> tmmp;
5519 if(fillStringVector(elt0,tmmp))
5520 //DataArrayAsciiChar.New(["abc","de","fghi"])
5521 return DataArrayAsciiChar::New(tmmp,' ');
5524 // DataArrayAsciiChar.New([1,3,4])
5525 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5526 int tmpp1=-1,tmpp2=-1;
5527 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5528 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5533 else if(PyInt_Check(elt0))
5535 int nbOfTuples1=PyInt_AS_LONG(elt0);
5537 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5542 if(PyInt_Check(nbOfTuples))
5543 {//DataArrayAsciiChar.New(5,2)
5544 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5546 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5547 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5548 ret->alloc(nbOfTuples1,nbOfCompo);
5552 throw INTERP_KERNEL::Exception(msg);
5555 throw INTERP_KERNEL::Exception(msg);
5558 {//DataArrayAsciiChar.New(5)
5559 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5560 ret->alloc(nbOfTuples1,1);
5565 throw INTERP_KERNEL::Exception(msg);
5568 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5570 return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5573 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5575 std::ostringstream oss;
5576 self->reprQuickOverview(oss);
5580 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5582 return self->iterator();
5585 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5587 char tmp[2]; tmp[1]='\0';
5588 tmp[0]=self->getIJ(tupleId,compoId);
5589 return std::string(tmp);
5592 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5594 char tmp[2]; tmp[1]='\0';
5595 tmp[0]=self->getIJSafe(tupleId,compoId);
5596 return std::string(tmp);
5599 std::string __str__() const throw(INTERP_KERNEL::Exception)
5601 return self->repr();
5604 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5606 const char *vals=self->getConstPointer();
5607 int nbOfComp=self->getNumberOfComponents();
5608 int nbOfTuples=self->getNumberOfTuples();
5609 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5612 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5614 if(PyString_Check(tupl))
5616 Py_ssize_t sz=PyString_Size(tupl);
5617 std::vector<char> vals(sz);
5618 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5619 return self->presenceOfTuple(vals);
5622 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5625 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5627 if(PyString_Check(vals))
5629 Py_ssize_t sz=PyString_Size(vals);
5630 std::vector<char> vals2(sz);
5631 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5632 return self->presenceOfValue(vals2);
5635 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5638 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5640 if(PyString_Check(vals))
5642 Py_ssize_t sz=PyString_Size(vals);
5643 std::vector<char> vals2(sz);
5644 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5645 return self->locateValue(vals2);
5648 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5651 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5653 if(PyString_Check(tupl))
5655 Py_ssize_t sz=PyString_Size(tupl);
5656 std::vector<char> vals(sz);
5657 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5658 return self->locateTuple(vals);
5661 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5664 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5666 if(PyString_Check(strOrListOfInt))
5668 Py_ssize_t sz=PyString_Size(strOrListOfInt);
5669 std::vector<char> vals(sz);
5670 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5671 return self->search(vals);
5674 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5677 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5679 int sz=self->getNumberOfComponents();
5680 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5681 self->getTuple(tupleId,tmp);
5682 return PyString_FromString(tmp);
5685 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5688 char tmp2[2]; tmp2[1]='\0';
5689 tmp2[0]=self->getMaxValue(tmp);
5690 PyObject *ret=PyTuple_New(2);
5691 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5692 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5696 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5699 char tmp2[2]; tmp2[1]='\0';
5700 tmp2[0]=self->getMinValue(tmp);
5701 PyObject *ret=PyTuple_New(2);
5702 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5703 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5707 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5709 int nbOfCompo=self->getNumberOfComponents();
5714 if(PyString_Check(obj))
5716 Py_ssize_t sz=PyString_Size(obj);
5717 char *pt=PyString_AsString(obj);
5719 return self->locateValue(pt[0]);
5721 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5724 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5727 return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5731 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5733 int nbOfCompo=self->getNumberOfComponents();
5740 if(PyString_Check(obj))
5742 Py_ssize_t sz=PyString_Size(obj);
5743 char *pt=PyString_AsString(obj);
5745 return self->presenceOfValue(pt[0]);
5747 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5750 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5753 return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5757 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5760 std::vector<int> stdvecTyyppArr;
5761 std::pair<int, std::pair<int,int> > sTyyppArr;
5762 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5763 convertObjToPossibleCpp2WithNegIntInterp(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5767 return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5769 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5771 return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5773 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5775 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5779 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5781 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.";
5783 std::vector<int> stdvecTyyppArr;
5784 std::pair<int, std::pair<int,int> > sTyyppArr;
5785 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5786 int nbOfCompo=self->getNumberOfComponents();
5787 int nbOfTuples=self->getNumberOfTuples();
5788 convertObjToPossibleCpp2WithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5790 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5791 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5800 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5806 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5807 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5810 //value vector<string>
5813 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5814 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5817 //value DataArrayChar
5820 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5824 throw INTERP_KERNEL::Exception(msg);
5828 {//obj list-tuple[int]
5834 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5840 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5841 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5844 //value vector<string>
5847 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5848 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5851 //value DataArrayChar
5854 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5858 throw INTERP_KERNEL::Exception(msg);
5869 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5875 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5876 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5879 //value vector<string>
5882 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5883 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5886 //value DataArrayChar
5889 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5893 throw INTERP_KERNEL::Exception(msg);
5904 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5910 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5911 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5914 //value vector<string>
5917 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5918 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5921 //value DataArrayChar
5924 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5928 throw INTERP_KERNEL::Exception(msg);
5933 throw INTERP_KERNEL::Exception(msg);
5939 class DataArrayAsciiCharTuple;
5941 class DataArrayAsciiCharIterator
5944 DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5945 ~DataArrayAsciiCharIterator();
5950 DataArrayAsciiCharTuple *ret=self->nextt();
5952 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5955 PyErr_SetString(PyExc_StopIteration,"No more data.");
5962 class DataArrayAsciiCharTuple
5965 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5966 DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5969 std::string __str__() const throw(INTERP_KERNEL::Exception)
5971 return self->repr();
5974 DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5976 return self->buildDAAsciiChar(1,self->getNumberOfCompo());