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::getIdsStrictlyNegative;
77 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
78 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
79 %newobject ParaMEDMEM::DataArrayInt::Meld;
80 %newobject ParaMEDMEM::DataArrayInt::Add;
81 %newobject ParaMEDMEM::DataArrayInt::Substract;
82 %newobject ParaMEDMEM::DataArrayInt::Multiply;
83 %newobject ParaMEDMEM::DataArrayInt::Divide;
84 %newobject ParaMEDMEM::DataArrayInt::Pow;
85 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
86 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
87 %newobject ParaMEDMEM::DataArrayInt::Range;
88 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
89 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
90 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
91 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
92 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
93 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
94 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
95 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
96 %newobject ParaMEDMEM::DataArrayInt::buildUniqueNotSorted;
97 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
98 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
99 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
100 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
101 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
102 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
103 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
104 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
105 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
106 %newobject ParaMEDMEM::DataArrayInt::FindPermutationFromFirstToSecond;
107 %newobject ParaMEDMEM::DataArrayInt::CheckAndPreparePermutation;
108 %newobject ParaMEDMEM::DataArrayInt::__neg__;
109 %newobject ParaMEDMEM::DataArrayInt::__add__;
110 %newobject ParaMEDMEM::DataArrayInt::__radd__;
111 %newobject ParaMEDMEM::DataArrayInt::__sub__;
112 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
113 %newobject ParaMEDMEM::DataArrayInt::__mul__;
114 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
115 %newobject ParaMEDMEM::DataArrayInt::__div__;
116 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
117 %newobject ParaMEDMEM::DataArrayInt::__mod__;
118 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
119 %newobject ParaMEDMEM::DataArrayInt::__pow__;
120 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
121 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
122 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
123 %newobject ParaMEDMEM::DataArrayChar::renumber;
124 %newobject ParaMEDMEM::DataArrayChar::renumberR;
125 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
126 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
127 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
128 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
129 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
130 %newobject ParaMEDMEM::DataArrayChar::Meld;
131 %newobject ParaMEDMEM::DataArrayByte::New;
132 %newobject ParaMEDMEM::DataArrayByte::__iter__;
133 %newobject ParaMEDMEM::DataArrayByte::performCpy;
134 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
135 %newobject ParaMEDMEM::DataArrayChar::substr;
136 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
137 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
138 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
139 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
140 %newobject ParaMEDMEM::DataArrayDouble::New;
141 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
142 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
143 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
144 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
145 %newobject ParaMEDMEM::DataArrayDouble::Meld;
146 %newobject ParaMEDMEM::DataArrayDouble::Dot;
147 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
148 %newobject ParaMEDMEM::DataArrayDouble::Add;
149 %newobject ParaMEDMEM::DataArrayDouble::Substract;
150 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
151 %newobject ParaMEDMEM::DataArrayDouble::Divide;
152 %newobject ParaMEDMEM::DataArrayDouble::Pow;
153 %newobject ParaMEDMEM::DataArrayDouble::substr;
154 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
155 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
156 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
157 %newobject ParaMEDMEM::DataArrayDouble::getIdsNotInRange;
158 %newobject ParaMEDMEM::DataArrayDouble::negate;
159 %newobject ParaMEDMEM::DataArrayDouble::computeAbs;
160 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
161 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
162 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
163 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
164 %newobject ParaMEDMEM::DataArrayDouble::determinant;
165 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
166 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
167 %newobject ParaMEDMEM::DataArrayDouble::inverse;
168 %newobject ParaMEDMEM::DataArrayDouble::trace;
169 %newobject ParaMEDMEM::DataArrayDouble::deviator;
170 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
171 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
172 %newobject ParaMEDMEM::DataArrayDouble::sumPerTuple;
173 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
174 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
175 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
176 %newobject ParaMEDMEM::DataArrayDouble::renumber;
177 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
178 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
179 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
180 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
181 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
182 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
183 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
184 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
185 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
186 %newobject ParaMEDMEM::DataArrayDouble::computeNbOfInteractionsWith;
187 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
188 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
189 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
190 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
191 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
192 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
193 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
194 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
195 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
197 %feature("unref") DataArray "$this->decrRef();"
198 %feature("unref") DataArrayDouble "$this->decrRef();"
199 %feature("unref") DataArrayInt "$this->decrRef();"
200 %feature("unref") DataArrayChar "$this->decrRef();"
201 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
202 %feature("unref") DataArrayByte "$this->decrRef();"
206 class DataArray : public RefCountObject, public TimeLabel
209 void setName(const std::string& name);
210 void copyStringInfoFrom(const DataArray& other) throw(INTERP_KERNEL::Exception);
211 void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
212 void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other) throw(INTERP_KERNEL::Exception);
213 bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const throw(INTERP_KERNEL::Exception);
214 bool areInfoEquals(const DataArray& other) const throw(INTERP_KERNEL::Exception);
215 std::string cppRepr(const std::string& varName) const throw(INTERP_KERNEL::Exception);
216 std::string getName() const;
217 void setInfoOnComponents(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
218 void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
219 std::vector<std::string> getVarsOnComponent() const throw(INTERP_KERNEL::Exception);
220 std::vector<std::string> getUnitsOnComponent() const throw(INTERP_KERNEL::Exception);
221 std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);
222 std::string getVarOnComponent(int i) const throw(INTERP_KERNEL::Exception);
223 std::string getUnitOnComponent(int i) const throw(INTERP_KERNEL::Exception);
224 void setInfoOnComponent(int i, const std::string& info) throw(INTERP_KERNEL::Exception);
225 int getNumberOfComponents() const;
226 virtual void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
227 virtual void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
228 virtual bool isAllocated() const throw(INTERP_KERNEL::Exception);
229 virtual void checkAllocated() const throw(INTERP_KERNEL::Exception);
230 virtual void desallocate() throw(INTERP_KERNEL::Exception);
231 virtual int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
232 virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
233 virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
234 virtual DataArray *deepCpy() const throw(INTERP_KERNEL::Exception);
235 virtual DataArray *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
236 virtual void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
237 void checkNbOfTuples(int nbOfTuples, const std::string& msg) const throw(INTERP_KERNEL::Exception);
238 void checkNbOfComps(int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
239 void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const throw(INTERP_KERNEL::Exception);
240 void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
241 void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const throw(INTERP_KERNEL::Exception);
242 static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
243 static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
244 static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
245 static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
246 static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
247 static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit) throw(INTERP_KERNEL::Exception);
248 void updateTime() const;
251 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
253 const std::vector<std::string>& comps=self->getInfoOnComponents();
254 PyObject *ret=PyList_New((int)comps.size());
255 for(int i=0;i<(int)comps.size();i++)
256 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
260 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
262 std::vector<int> tmp;
263 convertPyToNewIntArr3(li,tmp);
264 self->copyPartOfStringInfoFrom(other,tmp);
267 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
269 std::vector<int> tmp;
270 convertPyToNewIntArr3(li,tmp);
271 self->copyPartOfStringInfoFrom2(tmp,other);
274 virtual void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
277 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
278 if (!SWIG_IsOK(res1))
281 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
282 if(size!=self->getNumberOfTuples())
284 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
286 self->renumberInPlace(tmp);
290 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
292 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
293 da2->checkAllocated();
294 int size=self->getNumberOfTuples();
295 if(size!=self->getNumberOfTuples())
297 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
299 self->renumberInPlace(da2->getConstPointer());
303 virtual void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
306 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
307 if (!SWIG_IsOK(res1))
310 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
311 if(size!=self->getNumberOfTuples())
313 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
315 self->renumberInPlaceR(tmp);
319 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
321 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
322 da2->checkAllocated();
323 int size=self->getNumberOfTuples();
324 if(size!=self->getNumberOfTuples())
326 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
328 self->renumberInPlaceR(da2->getConstPointer());
332 //tuplesSelec in PyObject * because DataArrayInt is not already existing !
333 virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec) throw(INTERP_KERNEL::Exception)
335 static const char msg[]="DataArray::setContigPartOfSelectedValues2 : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
336 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 3rd parameter \"aBase\" should be of type DataArray");
337 DataArray *tuplesSelecPtr=CheckAndRetrieveDataArrayInstance(tuplesSelec,msg);
338 DataArrayInt *tuplesSelecPtr2=0;
341 tuplesSelecPtr2=dynamic_cast<DataArrayInt *>(tuplesSelecPtr);
343 throw INTERP_KERNEL::Exception(msg);
345 self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
348 virtual void setContigPartOfSelectedValues2(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
350 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 2nd parameter \"aBase\" should be of type DataArray");
351 self->setContigPartOfSelectedValues2(tupleIdStart,a,bg,end2,step);
354 virtual DataArray *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
356 std::vector<std::pair<int,int> > ranges;
357 convertPyToVectorPairInt(li,ranges);
358 return self->selectByTupleRanges(ranges);
361 virtual DataArray *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
364 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
365 if (!SWIG_IsOK(res1))
368 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
369 return self->selectByTupleId(tmp,tmp+size);
373 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
375 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
376 da2->checkAllocated();
377 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
381 virtual DataArray *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
384 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
385 if (!SWIG_IsOK(res1))
388 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
389 return self->selectByTupleIdSafe(tmp,tmp+size);
393 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
395 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
396 da2->checkAllocated();
397 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
401 virtual PyObject *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
403 std::vector<int> tmp;
404 convertPyToNewIntArr3(li,tmp);
405 DataArray *ret=self->keepSelectedComponents(tmp);
406 return convertDataArray(ret,SWIG_POINTER_OWN | 0 );
409 static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices) throw(INTERP_KERNEL::Exception)
411 if(!PySlice_Check(slic))
412 throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
413 Py_ssize_t strt=2,stp=2,step=2;
414 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
415 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetSlice (wrap) : the input slice is invalid !");
417 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
418 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
421 PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
423 if(!PySlice_Check(slic))
424 throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
425 Py_ssize_t strt=2,stp=2,step=2;
426 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
427 GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getSlice (wrap) : the input slice is invalid !");
429 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
430 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
433 static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
435 if(!PySlice_Check(slic))
436 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
437 Py_ssize_t strt=2,stp=2,step=2;
438 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
439 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
440 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
443 static int GetNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
445 if(!PySlice_Check(slic))
446 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
447 Py_ssize_t strt=2,stp=2,step=2;
448 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
449 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
450 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
453 static DataArray *Aggregate(PyObject *arrs) throw(INTERP_KERNEL::Exception)
455 std::vector<const DataArray *> tmp;
456 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArray *>(arrs,SWIGTYPE_p_ParaMEDMEM__DataArray,"DataArray",tmp);
457 return DataArray::Aggregate(tmp);
460 int getNumberOfItemGivenBES(PyObject *slic) const throw(INTERP_KERNEL::Exception)
462 if(!PySlice_Check(slic))
463 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
464 Py_ssize_t strt=2,stp=2,step=2;
465 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
466 GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
467 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
470 int getNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
472 if(!PySlice_Check(slic))
473 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
474 Py_ssize_t strt=2,stp=2,step=2;
475 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
476 GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
477 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
483 class DataArrayDoubleIterator;
485 class DataArrayDouble : public DataArray
488 static DataArrayDouble *New();
489 double doubleValue() const throw(INTERP_KERNEL::Exception);
490 bool empty() const throw(INTERP_KERNEL::Exception);
491 DataArrayDouble *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
492 void cpyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
493 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
494 void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
495 double popBackSilent() throw(INTERP_KERNEL::Exception);
496 void pack() const throw(INTERP_KERNEL::Exception);
497 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
498 void fillWithZero() throw(INTERP_KERNEL::Exception);
499 void fillWithValue(double val) throw(INTERP_KERNEL::Exception);
500 void iota(double init=0.) throw(INTERP_KERNEL::Exception);
501 bool isUniform(double val, double eps) const throw(INTERP_KERNEL::Exception);
502 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
503 void reverse() throw(INTERP_KERNEL::Exception);
504 void checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
505 bool isMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
506 std::string repr() const throw(INTERP_KERNEL::Exception);
507 std::string reprZip() const throw(INTERP_KERNEL::Exception);
508 bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
509 bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
510 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
511 DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
512 DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
513 DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
514 void transpose() throw(INTERP_KERNEL::Exception);
515 DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
516 void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
517 DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
518 DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception);
519 DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
520 DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const throw(INTERP_KERNEL::Exception);
521 void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
522 void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
523 void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
524 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
525 double front() const throw(INTERP_KERNEL::Exception);
526 double back() const throw(INTERP_KERNEL::Exception);
527 double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
528 void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
529 void setIJSilent(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
530 double *getPointer() throw(INTERP_KERNEL::Exception);
531 void checkNoNullValues() const throw(INTERP_KERNEL::Exception);
532 DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const throw(INTERP_KERNEL::Exception);
533 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
534 double getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
535 double getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
536 double getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
537 double getMinValueInArray() const throw(INTERP_KERNEL::Exception);
538 int count(double value, double eps) const throw(INTERP_KERNEL::Exception);
539 double getAverageValue() const throw(INTERP_KERNEL::Exception);
540 double norm2() const throw(INTERP_KERNEL::Exception);
541 double normMax() const throw(INTERP_KERNEL::Exception);
542 double normMin() const throw(INTERP_KERNEL::Exception);
543 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
544 DataArrayDouble *fromPolarToCart() const throw(INTERP_KERNEL::Exception);
545 DataArrayDouble *fromCylToCart() const throw(INTERP_KERNEL::Exception);
546 DataArrayDouble *fromSpherToCart() const throw(INTERP_KERNEL::Exception);
547 DataArrayDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
548 DataArrayDouble *determinant() const throw(INTERP_KERNEL::Exception);
549 DataArrayDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
550 DataArrayDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
551 DataArrayDouble *inverse() const throw(INTERP_KERNEL::Exception);
552 DataArrayDouble *trace() const throw(INTERP_KERNEL::Exception);
553 DataArrayDouble *deviator() const throw(INTERP_KERNEL::Exception);
554 DataArrayDouble *magnitude() const throw(INTERP_KERNEL::Exception);
555 DataArrayDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
556 DataArrayDouble *sumPerTuple() const throw(INTERP_KERNEL::Exception);
557 DataArrayDouble *buildEuclidianDistanceDenseMatrix() const throw(INTERP_KERNEL::Exception);
558 DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
559 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
560 void abs() throw(INTERP_KERNEL::Exception);
561 DataArrayDouble *computeAbs() const throw(INTERP_KERNEL::Exception);
562 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
563 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
564 void applyInv(double numerator) throw(INTERP_KERNEL::Exception);
565 void applyPow(double val) throw(INTERP_KERNEL::Exception);
566 void applyRPow(double val) throw(INTERP_KERNEL::Exception);
567 DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
568 DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
569 DataArrayDouble *applyFunc(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
570 DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
571 void applyFuncOnThis(const std::string& func, bool isSafe=true) throw(INTERP_KERNEL::Exception);
572 DataArrayDouble *applyFunc2(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
573 DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
574 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
575 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
576 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
577 DataArrayInt *getIdsNotInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
578 static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
579 static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
580 static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
581 static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
582 static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
583 static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
584 static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
585 void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
586 static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
587 void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
588 static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
589 void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
590 static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
591 void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
592 static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
593 void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
596 DataArrayDouble() throw(INTERP_KERNEL::Exception)
598 return DataArrayDouble::New();
601 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
603 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)";
604 std::string msg(msgBase);
606 msg+="\n-DataArrayDouble.New(numpy array with dtype=float64)";
609 if(PyList_Check(elt0) || PyTuple_Check(elt0))
613 if(PyInt_Check(nbOfTuples))
615 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
617 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
620 if(PyInt_Check(elt2))
621 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
622 int nbOfCompo=PyInt_AS_LONG(elt2);
624 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
625 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
626 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
627 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
631 throw INTERP_KERNEL::Exception(msg.c_str());
634 {//DataArrayDouble.New([1.,3.,4.],3)
635 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
637 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
638 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
643 throw INTERP_KERNEL::Exception(msg.c_str());
646 {// DataArrayDouble.New([1.,3.,4.])
647 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
648 int tmpp1=-1,tmpp2=-1;
649 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
650 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
654 else if(PyInt_Check(elt0))
656 int nbOfTuples1=PyInt_AS_LONG(elt0);
658 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
663 if(PyInt_Check(nbOfTuples))
664 {//DataArrayDouble.New(5,2)
665 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
667 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
668 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
669 ret->alloc(nbOfTuples1,nbOfCompo);
673 throw INTERP_KERNEL::Exception(msg.c_str());
676 throw INTERP_KERNEL::Exception(msg.c_str());
679 {//DataArrayDouble.New(5)
680 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
681 ret->alloc(nbOfTuples1,1);
686 else if(PyArray_Check(elt0) && nbOfTuples==NULL && elt2==NULL)
687 {//DataArrayDouble.New(numpyArray)
688 return BuildNewInstance<DataArrayDouble,double>(elt0,NPY_DOUBLE,&PyCallBackDataArrayDouble_RefType,"FLOAT64");
692 throw INTERP_KERNEL::Exception(msg.c_str());
693 throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
696 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
698 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
701 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
704 std::vector<double> bb;
706 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
707 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
708 self->pushBackValsSilent(tmp,tmp+nbTuples);
711 std::string __repr__() const throw(INTERP_KERNEL::Exception)
713 std::ostringstream oss;
714 self->reprQuickOverview(oss);
718 std::string __str__() const throw(INTERP_KERNEL::Exception)
723 double __float__() const throw(INTERP_KERNEL::Exception)
725 return self->doubleValue();
728 int __len__() const throw(INTERP_KERNEL::Exception)
730 if(self->isAllocated())
732 return self->getNumberOfTuples();
736 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
740 DataArrayDoubleIterator *__iter__() throw(INTERP_KERNEL::Exception)
742 return self->iterator();
745 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
747 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 !";
748 if(PyList_Check(li) || PyTuple_Check(li))
752 if(PyInt_Check(nbOfTuples))
754 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
756 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
759 if(PyInt_Check(nbOfComp))
760 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
761 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
763 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
764 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
765 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
768 throw INTERP_KERNEL::Exception(msg);
771 {//DataArrayDouble.setValues([1.,3.,4.],3)
773 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
774 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
778 throw INTERP_KERNEL::Exception(msg);
781 {// DataArrayDouble.setValues([1.,3.,4.])
782 int tmpp1=-1,tmpp2=-1;
783 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
784 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
788 throw INTERP_KERNEL::Exception(msg);
791 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
793 const double *vals=self->getConstPointer();
794 return convertDblArrToPyList(vals,self->getNbOfElems());
798 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
800 return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
804 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
807 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
808 PyObject *ret=PyTuple_New(2);
809 PyObject *ret0Py=ret0?Py_True:Py_False;
811 PyTuple_SetItem(ret,0,ret0Py);
812 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
816 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
818 const double *vals=self->getConstPointer();
819 int nbOfComp=self->getNumberOfComponents();
820 int nbOfTuples=self->getNumberOfTuples();
821 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
824 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
827 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
828 if (!SWIG_IsOK(res1))
831 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
832 if(size!=self->getNumberOfTuples())
834 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
836 return self->renumber(tmp);
840 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
842 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
843 da2->checkAllocated();
844 int size=self->getNumberOfTuples();
845 if(size!=self->getNumberOfTuples())
847 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
849 return self->renumber(da2->getConstPointer());
853 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
856 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
857 if (!SWIG_IsOK(res1))
860 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
861 if(size!=self->getNumberOfTuples())
863 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
865 return self->renumberR(tmp);
869 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
871 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
872 da2->checkAllocated();
873 int size=self->getNumberOfTuples();
874 if(size!=self->getNumberOfTuples())
876 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
878 return self->renumberR(da2->getConstPointer());
882 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
885 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
886 if (!SWIG_IsOK(res1))
889 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
890 if(size!=self->getNumberOfTuples())
892 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
894 return self->renumberAndReduce(tmp,newNbOfTuple);
898 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
900 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
901 da2->checkAllocated();
902 int size=self->getNumberOfTuples();
903 if(size!=self->getNumberOfTuples())
905 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
907 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
911 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
913 int thisTupleId,otherTupleId;
914 double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
915 PyObject *ret=PyTuple_New(3);
916 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
917 PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
918 PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
922 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
925 double r1=self->getMaxValue(tmp);
926 PyObject *ret=PyTuple_New(2);
927 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
928 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
932 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
935 double r1=self->getMaxValue2(tmp);
936 PyObject *ret=PyTuple_New(2);
937 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
938 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
942 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
945 double r1=self->getMinValue(tmp);
946 PyObject *ret=PyTuple_New(2);
947 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
948 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
952 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
955 double r1=self->getMinValue2(tmp);
956 PyObject *ret=PyTuple_New(2);
957 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
958 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
962 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
964 int nbOfCompo=self->getNumberOfComponents();
965 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
966 self->getMinMaxPerComponent(tmp);
967 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
971 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
973 int sz=self->getNumberOfComponents();
974 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
975 self->accumulate(tmp);
976 return convertDblArrToPyList(tmp,sz);
979 DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
982 std::vector<int> val2;
983 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
984 return self->accumulatePerChunck(bg,bg+sz);
987 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
989 DataArrayInt *comm, *commIndex;
990 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
991 PyObject *res = PyList_New(2);
992 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
993 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
997 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
1001 DataArrayDoubleTuple *aa;
1002 std::vector<double> bb;
1004 int tupleId=-1,nbOfCompo=self->getNumberOfComponents();
1005 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
1007 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
1008 PyObject *ret=PyTuple_New(2);
1009 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1010 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
1014 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
1016 std::vector<int> tmp;
1017 convertPyToNewIntArr3(li,tmp);
1018 self->setSelectedComponents(a,tmp);
1021 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
1023 int sz=self->getNumberOfComponents();
1024 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
1025 self->getTuple(tupleId,tmp);
1026 return convertDblArrToPyList(tmp,sz);
1029 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
1031 std::vector<const DataArrayDouble *> tmp;
1032 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
1033 return DataArrayDouble::Aggregate(tmp);
1036 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
1038 std::vector<const DataArrayDouble *> tmp;
1039 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
1040 return DataArrayDouble::Meld(tmp);
1043 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1047 DataArrayDoubleTuple *aa;
1048 std::vector<double> bb;
1050 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
1051 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
1052 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
1053 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
1054 DataArrayInt *c=0,*cI=0;
1055 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
1056 PyObject *ret=PyTuple_New(2);
1057 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1058 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1062 PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const throw(INTERP_KERNEL::Exception)
1064 DataArrayInt *ret1=0;
1065 bool ret0=self->areIncludedInMe(other,prec,ret1);
1066 PyObject *ret=PyTuple_New(2);
1067 PyObject *ret0Py=ret0?Py_True:Py_False;
1069 PyTuple_SetItem(ret,0,ret0Py);
1070 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1074 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1076 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
1077 const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
1078 self->checkAllocated();
1079 int nbOfTuples=self->getNumberOfTuples();
1080 int nbOfComponents=self->getNumberOfComponents();
1082 std::vector<int> vt1,vc1;
1083 std::pair<int, std::pair<int,int> > pt1,pc1;
1084 DataArrayInt *dt1=0,*dc1=0;
1086 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1087 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
1091 if(nbOfComponents==1)
1092 return PyFloat_FromDouble(self->getIJSafe(it1,0));
1093 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1095 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1097 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1099 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1101 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
1104 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1105 std::vector<int> v2(1,ic1);
1106 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1110 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1111 std::vector<int> v2(1,ic1);
1112 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1116 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1117 std::vector<int> v2(1,ic1);
1118 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1122 ret=self->selectByTupleIdSafe(&it1,&it1+1);
1123 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1127 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1128 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1132 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1133 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1137 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1138 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1142 ret=self->selectByTupleIdSafe(&it1,&it1+1);
1143 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1144 std::vector<int> v2(nbOfComp);
1145 for(int i=0;i<nbOfComp;i++)
1146 v2[i]=pc1.first+i*pc1.second.second;
1147 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1151 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
1152 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1153 std::vector<int> v2(nbOfComp);
1154 for(int i=0;i<nbOfComp;i++)
1155 v2[i]=pc1.first+i*pc1.second.second;
1156 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1160 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
1161 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1162 std::vector<int> v2(nbOfComp);
1163 for(int i=0;i<nbOfComp;i++)
1164 v2[i]=pc1.first+i*pc1.second.second;
1165 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1169 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
1170 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
1171 std::vector<int> v2(nbOfComp);
1172 for(int i=0;i<nbOfComp;i++)
1173 v2[i]=pc1.first+i*pc1.second.second;
1174 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1177 throw INTERP_KERNEL::Exception(msg);
1181 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
1183 self->checkAllocated();
1184 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
1185 int nbOfTuples=self->getNumberOfTuples();
1186 int nbOfComponents=self->getNumberOfComponents();
1189 std::vector<double> v1;
1190 DataArrayDouble *d1=0;
1191 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
1193 std::vector<int> vt1,vc1;
1194 std::pair<int, std::pair<int,int> > pt1,pc1;
1195 DataArrayInt *dt1=0,*dc1=0;
1196 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
1197 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
1205 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
1208 tmp=DataArrayDouble::New();
1209 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1210 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
1213 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
1216 throw INTERP_KERNEL::Exception(msg);
1225 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1228 tmp=DataArrayDouble::New();
1229 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1230 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
1233 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
1236 throw INTERP_KERNEL::Exception(msg);
1245 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1248 tmp=DataArrayDouble::New();
1249 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1250 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
1253 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
1256 throw INTERP_KERNEL::Exception(msg);
1265 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1268 tmp=DataArrayDouble::New();
1269 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1270 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
1273 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
1276 throw INTERP_KERNEL::Exception(msg);
1285 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
1288 tmp=DataArrayDouble::New();
1289 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1290 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
1293 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
1296 throw INTERP_KERNEL::Exception(msg);
1305 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1308 tmp=DataArrayDouble::New();
1309 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1310 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
1313 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
1316 throw INTERP_KERNEL::Exception(msg);
1325 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1328 tmp=DataArrayDouble::New();
1329 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1330 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
1333 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
1336 throw INTERP_KERNEL::Exception(msg);
1345 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1348 tmp=DataArrayDouble::New();
1349 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1350 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
1353 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
1356 throw INTERP_KERNEL::Exception(msg);
1365 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1368 tmp=DataArrayDouble::New();
1369 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1370 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
1373 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
1376 throw INTERP_KERNEL::Exception(msg);
1385 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1388 tmp=DataArrayDouble::New();
1389 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1390 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
1393 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
1396 throw INTERP_KERNEL::Exception(msg);
1405 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1408 tmp=DataArrayDouble::New();
1409 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1410 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
1413 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
1416 throw INTERP_KERNEL::Exception(msg);
1425 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1428 tmp=DataArrayDouble::New();
1429 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1430 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
1433 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
1436 throw INTERP_KERNEL::Exception(msg);
1445 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1448 tmp=DataArrayDouble::New();
1449 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1450 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
1453 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
1456 throw INTERP_KERNEL::Exception(msg);
1465 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1468 tmp=DataArrayDouble::New();
1469 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1470 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
1473 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
1476 throw INTERP_KERNEL::Exception(msg);
1485 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1488 tmp=DataArrayDouble::New();
1489 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1490 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
1493 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
1496 throw INTERP_KERNEL::Exception(msg);
1505 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1508 tmp=DataArrayDouble::New();
1509 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
1510 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
1513 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
1516 throw INTERP_KERNEL::Exception(msg);
1521 throw INTERP_KERNEL::Exception(msg);
1526 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
1528 return self->negate();
1531 PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1533 const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
1536 DataArrayDoubleTuple *aa;
1537 std::vector<double> bb;
1540 #ifndef WITHOUT_AUTOFIELD
1542 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1544 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1547 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1548 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1550 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1553 throw INTERP_KERNEL::Exception(msg);
1557 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1562 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1563 ret->applyLin(1.,val);
1564 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1568 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1572 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1573 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1577 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1578 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1581 throw INTERP_KERNEL::Exception(msg);
1585 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1587 const char msg[]="Unexpected situation in __radd__ !";
1590 DataArrayDoubleTuple *aa;
1591 std::vector<double> bb;
1593 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1598 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1599 ret->applyLin(1.,val);
1604 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1605 return DataArrayDouble::Add(self,aaa);
1609 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1610 return DataArrayDouble::Add(self,aaa);
1613 throw INTERP_KERNEL::Exception(msg);
1617 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1619 const char msg[]="Unexpected situation in __iadd__ !";
1622 DataArrayDoubleTuple *aa;
1623 std::vector<double> bb;
1625 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1630 self->applyLin(1.,val);
1631 Py_XINCREF(trueSelf);
1637 Py_XINCREF(trueSelf);
1642 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1643 self->addEqual(aaa);
1644 Py_XINCREF(trueSelf);
1649 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1650 self->addEqual(aaa);
1651 Py_XINCREF(trueSelf);
1655 throw INTERP_KERNEL::Exception(msg);
1659 PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1661 const char msg[]="Unexpected situation in __sub__ !";
1664 DataArrayDoubleTuple *aa;
1665 std::vector<double> bb;
1668 #ifndef WITHOUT_AUTOFIELD
1670 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1672 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1675 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1676 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1678 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1681 throw INTERP_KERNEL::Exception(msg);
1685 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1690 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1691 ret->applyLin(1.,-val);
1692 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1696 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1700 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1701 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1705 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1706 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1709 throw INTERP_KERNEL::Exception(msg);
1713 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1715 const char msg[]="Unexpected situation in __rsub__ !";
1718 DataArrayDoubleTuple *aa;
1719 std::vector<double> bb;
1721 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1726 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1727 ret->applyLin(-1.,val);
1732 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1733 return DataArrayDouble::Substract(aaa,self);
1737 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1738 return DataArrayDouble::Substract(aaa,self);
1741 throw INTERP_KERNEL::Exception(msg);
1745 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1747 const char msg[]="Unexpected situation in __isub__ !";
1750 DataArrayDoubleTuple *aa;
1751 std::vector<double> bb;
1753 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1758 self->applyLin(1,-val);
1759 Py_XINCREF(trueSelf);
1764 self->substractEqual(a);
1765 Py_XINCREF(trueSelf);
1770 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1771 self->substractEqual(aaa);
1772 Py_XINCREF(trueSelf);
1777 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1778 self->substractEqual(aaa);
1779 Py_XINCREF(trueSelf);
1783 throw INTERP_KERNEL::Exception(msg);
1787 PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1789 const char msg[]="Unexpected situation in __mul__ !";
1792 DataArrayDoubleTuple *aa;
1793 std::vector<double> bb;
1796 #ifndef WITHOUT_AUTOFIELD
1798 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1800 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1803 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1804 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1806 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1809 throw INTERP_KERNEL::Exception(msg);
1813 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1818 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1819 ret->applyLin(val,0.);
1820 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1824 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1828 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1829 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1833 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1834 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1837 throw INTERP_KERNEL::Exception(msg);
1841 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1843 const char msg[]="Unexpected situation in __rmul__ !";
1846 DataArrayDoubleTuple *aa;
1847 std::vector<double> bb;
1849 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1854 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1855 ret->applyLin(val,0.);
1860 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1861 return DataArrayDouble::Multiply(self,aaa);
1865 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1866 return DataArrayDouble::Multiply(self,aaa);
1869 throw INTERP_KERNEL::Exception(msg);
1873 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1875 const char msg[]="Unexpected situation in __imul__ !";
1878 DataArrayDoubleTuple *aa;
1879 std::vector<double> bb;
1881 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1886 self->applyLin(val,0.);
1887 Py_XINCREF(trueSelf);
1892 self->multiplyEqual(a);
1893 Py_XINCREF(trueSelf);
1898 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1899 self->multiplyEqual(aaa);
1900 Py_XINCREF(trueSelf);
1905 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1906 self->multiplyEqual(aaa);
1907 Py_XINCREF(trueSelf);
1911 throw INTERP_KERNEL::Exception(msg);
1915 PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1917 const char msg[]="Unexpected situation in __div__ !";
1920 DataArrayDoubleTuple *aa;
1921 std::vector<double> bb;
1924 #ifndef WITHOUT_AUTOFIELD
1926 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
1928 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
1931 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
1932 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1934 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1937 throw INTERP_KERNEL::Exception(msg);
1941 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1947 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1948 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1949 ret->applyLin(1/val,0.);
1950 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1954 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1958 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1959 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1963 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1964 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1967 throw INTERP_KERNEL::Exception(msg);
1971 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1973 const char msg[]="Unexpected situation in __rdiv__ !";
1976 DataArrayDoubleTuple *aa;
1977 std::vector<double> bb;
1979 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
1984 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
1990 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1991 return DataArrayDouble::Divide(aaa,self);
1995 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1996 return DataArrayDouble::Divide(aaa,self);
1999 throw INTERP_KERNEL::Exception(msg);
2003 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2005 const char msg[]="Unexpected situation in __idiv__ !";
2008 DataArrayDoubleTuple *aa;
2009 std::vector<double> bb;
2011 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2017 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
2018 self->applyLin(1./val,0.);
2019 Py_XINCREF(trueSelf);
2024 self->divideEqual(a);
2025 Py_XINCREF(trueSelf);
2030 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2031 self->divideEqual(aaa);
2032 Py_XINCREF(trueSelf);
2037 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2038 self->divideEqual(aaa);
2039 Py_XINCREF(trueSelf);
2043 throw INTERP_KERNEL::Exception(msg);
2047 DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2049 const char msg[]="Unexpected situation in __pow__ !";
2052 DataArrayDoubleTuple *aa;
2053 std::vector<double> bb;
2055 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2060 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2066 return DataArrayDouble::Pow(self,a);
2070 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2071 return DataArrayDouble::Pow(self,aaa);
2075 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2076 return DataArrayDouble::Pow(self,aaa);
2079 throw INTERP_KERNEL::Exception(msg);
2083 DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2085 const char msg[]="Unexpected situation in __rpow__ !";
2088 DataArrayDoubleTuple *aa;
2089 std::vector<double> bb;
2091 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2096 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
2097 ret->applyRPow(val);
2102 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2103 return DataArrayDouble::Pow(aaa,self);
2107 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2108 return DataArrayDouble::Pow(aaa,self);
2111 throw INTERP_KERNEL::Exception(msg);
2115 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2117 const char msg[]="Unexpected situation in __ipow__ !";
2120 DataArrayDoubleTuple *aa;
2121 std::vector<double> bb;
2123 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
2128 self->applyPow(val);
2129 Py_XINCREF(trueSelf);
2135 Py_XINCREF(trueSelf);
2140 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
2141 self->powEqual(aaa);
2142 Py_XINCREF(trueSelf);
2147 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
2148 self->powEqual(aaa);
2149 Py_XINCREF(trueSelf);
2153 throw INTERP_KERNEL::Exception(msg);
2157 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
2159 DataArrayInt *c=0,*cI=0;
2161 self->computeTupleIdsNearTuples(other,eps,c,cI);
2162 PyObject *ret=PyTuple_New(2);
2163 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2164 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2168 PyObject *maxPerTupleWithCompoId() const throw(INTERP_KERNEL::Exception)
2170 DataArrayInt *ret1=0;
2171 DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
2172 PyObject *ret=PyTuple_New(2);
2173 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2174 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2180 class DataArrayDoubleTuple;
2182 class DataArrayDoubleIterator
2185 DataArrayDoubleIterator(DataArrayDouble *da);
2186 ~DataArrayDoubleIterator();
2191 DataArrayDoubleTuple *ret=self->nextt();
2193 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2196 PyErr_SetString(PyExc_StopIteration,"No more data.");
2203 class DataArrayDoubleTuple
2206 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
2207 DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
2210 std::string __str__() const throw(INTERP_KERNEL::Exception)
2212 return self->repr();
2215 double __float__() const throw(INTERP_KERNEL::Exception)
2217 return self->doubleValue();
2220 DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
2222 return self->buildDADouble(1,self->getNumberOfCompo());
2225 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2227 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2228 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2229 Py_XINCREF(trueSelf);
2233 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2235 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2236 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2237 Py_XINCREF(trueSelf);
2241 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2243 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2244 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2245 Py_XINCREF(trueSelf);
2249 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2251 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2252 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2253 Py_XINCREF(trueSelf);
2257 PyObject *__len__() throw(INTERP_KERNEL::Exception)
2259 return PyInt_FromLong(self->getNumberOfCompo());
2262 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2264 const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2267 std::vector<int> multiVal;
2268 std::pair<int, std::pair<int,int> > slic;
2269 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2270 const double *pt=self->getConstPointer();
2271 int nbc=self->getNumberOfCompo();
2272 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2279 std::ostringstream oss;
2280 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2281 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
2285 return PyFloat_FromDouble(pt[singleVal]);
2289 return PyFloat_FromDouble(pt[nbc+singleVal]);
2292 std::ostringstream oss;
2293 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2294 throw INTERP_KERNEL::Exception(oss.str().c_str());
2300 PyObject *t=PyTuple_New(multiVal.size());
2301 for(int j=0;j<(int)multiVal.size();j++)
2303 int cid=multiVal[j];
2306 std::ostringstream oss;
2307 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2308 throw INTERP_KERNEL::Exception(oss.str().c_str());
2310 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2316 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2317 PyObject *t=PyTuple_New(sz);
2318 for(int j=0;j<sz;j++)
2319 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2323 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2327 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2329 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2330 const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2333 std::vector<double> multiValV;
2334 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2335 int nbc=self->getNumberOfCompo();
2336 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2338 std::vector<int> multiVal;
2339 std::pair<int, std::pair<int,int> > slic;
2340 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2341 double *pt=self->getPointer();
2342 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2349 std::ostringstream oss;
2350 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2351 throw INTERP_KERNEL::Exception(oss.str().c_str());
2357 pt[singleVal]=singleValV;
2362 if(multiValV.size()!=1)
2364 std::ostringstream oss;
2365 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2366 throw INTERP_KERNEL::Exception(oss.str().c_str());
2368 pt[singleVal]=multiValV[0];
2373 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2377 throw INTERP_KERNEL::Exception(msg);
2386 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2390 std::ostringstream oss;
2391 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2392 throw INTERP_KERNEL::Exception(oss.str().c_str());
2400 if(multiVal.size()!=multiValV.size())
2402 std::ostringstream oss;
2403 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2404 throw INTERP_KERNEL::Exception(oss.str().c_str());
2406 for(int i=0;i<(int)multiVal.size();i++)
2408 int pos=multiVal[i];
2411 std::ostringstream oss;
2412 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2413 throw INTERP_KERNEL::Exception(oss.str().c_str());
2415 pt[multiVal[i]]=multiValV[i];
2421 const double *ptV=daIntTyyppV->getConstPointer();
2422 if(nbc>daIntTyyppV->getNumberOfCompo())
2424 std::ostringstream oss;
2425 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2426 throw INTERP_KERNEL::Exception(oss.str().c_str());
2428 std::copy(ptV,ptV+nbc,pt);
2432 throw INTERP_KERNEL::Exception(msg);
2437 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2442 for(int j=0;j<sz;j++)
2443 pt[slic.first+j*slic.second.second]=singleValV;
2448 if(sz!=(int)multiValV.size())
2450 std::ostringstream oss;
2451 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2452 throw INTERP_KERNEL::Exception(oss.str().c_str());
2454 for(int j=0;j<sz;j++)
2455 pt[slic.first+j*slic.second.second]=multiValV[j];
2460 const double *ptV=daIntTyyppV->getConstPointer();
2461 if(sz>daIntTyyppV->getNumberOfCompo())
2463 std::ostringstream oss;
2464 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2465 throw INTERP_KERNEL::Exception(oss.str().c_str());
2467 for(int j=0;j<sz;j++)
2468 pt[slic.first+j*slic.second.second]=ptV[j];
2472 throw INTERP_KERNEL::Exception(msg);
2476 throw INTERP_KERNEL::Exception(msg);
2482 class DataArrayIntIterator;
2484 class DataArrayInt : public DataArray
2487 static DataArrayInt *New();
2488 int intValue() const throw(INTERP_KERNEL::Exception);
2489 int getHashCode() const throw(INTERP_KERNEL::Exception);
2490 bool empty() const throw(INTERP_KERNEL::Exception);
2491 DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
2492 void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2493 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2494 void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2495 int popBackSilent() throw(INTERP_KERNEL::Exception);
2496 void pack() const throw(INTERP_KERNEL::Exception);
2497 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2498 bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2499 bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2500 bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2501 DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2502 DataArrayInt *sumPerTuple() const throw(INTERP_KERNEL::Exception);
2503 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2504 void reverse() throw(INTERP_KERNEL::Exception);
2505 void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2506 bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2507 void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2508 bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2509 void fillWithZero() throw(INTERP_KERNEL::Exception);
2510 void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2511 void iota(int init=0) throw(INTERP_KERNEL::Exception);
2512 void replaceOneValByInThis(int valToBeReplaced, int replacedBy) throw(INTERP_KERNEL::Exception);
2513 std::string repr() const throw(INTERP_KERNEL::Exception);
2514 std::string reprZip() const throw(INTERP_KERNEL::Exception);
2515 DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2516 DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2517 DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2518 DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
2519 DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2520 DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2521 DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2522 DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2523 DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2524 bool isIdentity() const throw(INTERP_KERNEL::Exception);
2525 bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2526 DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2527 void transpose() throw(INTERP_KERNEL::Exception);
2528 DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2529 void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2530 void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2531 void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2532 void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2533 void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2534 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2535 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2536 int front() const throw(INTERP_KERNEL::Exception);
2537 int back() const throw(INTERP_KERNEL::Exception);
2538 void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2539 void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2540 int *getPointer() throw(INTERP_KERNEL::Exception);
2541 const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2542 DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2543 const int *begin() const throw(INTERP_KERNEL::Exception);
2544 const int *end() const throw(INTERP_KERNEL::Exception);
2545 DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2546 DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2547 int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2548 int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2549 int locateValue(int value) const throw(INTERP_KERNEL::Exception);
2550 int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2551 int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2552 bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2553 bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2554 bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2555 int count(int value) const throw(INTERP_KERNEL::Exception);
2556 int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2557 int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2558 int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2559 int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
2560 int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2561 void abs() throw(INTERP_KERNEL::Exception);
2562 DataArrayInt *computeAbs() const throw(INTERP_KERNEL::Exception);
2563 void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2564 void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2565 void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2566 DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2567 void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2568 void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2569 void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2570 void applyPow(int val) throw(INTERP_KERNEL::Exception);
2571 void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2572 DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2573 DataArrayInt *getIdsNotInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2574 DataArrayInt *getIdsStrictlyNegative() const throw(INTERP_KERNEL::Exception);
2575 bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2576 static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2577 static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2578 static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2579 static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2580 static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2581 static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2) throw(INTERP_KERNEL::Exception);
2582 DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2583 DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2584 DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2585 DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2586 DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2587 DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2588 DataArrayInt *buildUniqueNotSorted() const throw(INTERP_KERNEL::Exception);
2589 DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2590 void computeOffsets() throw(INTERP_KERNEL::Exception);
2591 void computeOffsets2() throw(INTERP_KERNEL::Exception);
2592 DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2593 DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2594 DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2595 void sortEachPairToMakeALinkedList() throw(INTERP_KERNEL::Exception);
2596 DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2597 DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2598 static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2599 void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2600 static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2601 void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2602 static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2603 void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2604 static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2605 void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2606 static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2607 void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2608 static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2609 void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2611 static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2614 DataArrayInt() throw(INTERP_KERNEL::Exception)
2616 return DataArrayInt::New();
2619 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2621 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)";
2622 std::string msg(msgBase);
2624 msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2627 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2631 if(PyInt_Check(nbOfTuples))
2633 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2635 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2638 if(PyInt_Check(nbOfComp))
2639 {//DataArrayInt.New([1,3,4,5],2,2)
2640 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2642 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2643 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2644 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2645 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2649 throw INTERP_KERNEL::Exception(msg.c_str());
2652 {//DataArrayInt.New([1,3,4],3)
2653 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2655 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2656 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2661 throw INTERP_KERNEL::Exception(msg.c_str());
2664 {// DataArrayInt.New([1,3,4])
2665 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2666 int tmpp1=-1,tmpp2=-1;
2667 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2668 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2672 else if(PyInt_Check(elt0))
2674 int nbOfTuples1=PyInt_AS_LONG(elt0);
2676 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2681 if(PyInt_Check(nbOfTuples))
2682 {//DataArrayInt.New(5,2)
2683 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2685 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2686 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2687 ret->alloc(nbOfTuples1,nbOfCompo);
2691 throw INTERP_KERNEL::Exception(msg.c_str());
2694 throw INTERP_KERNEL::Exception(msg.c_str());
2697 {//DataArrayInt.New(5)
2698 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
2699 ret->alloc(nbOfTuples1,1);
2704 else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2705 {//DataArrayInt.New(numpyArray)
2706 return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2710 throw INTERP_KERNEL::Exception(msg.c_str());
2711 throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
2714 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2716 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2719 std::string __str__() const throw(INTERP_KERNEL::Exception)
2721 return self->repr();
2724 int __len__() const throw(INTERP_KERNEL::Exception)
2726 if(self->isAllocated())
2728 return self->getNumberOfTuples();
2732 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2736 int __int__() const throw(INTERP_KERNEL::Exception)
2738 return self->intValue();
2741 DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2743 return self->iterator();
2746 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2748 int sz=self->getNumberOfComponents();
2749 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2750 self->accumulate(tmp);
2751 return convertIntArrToPyList(tmp,sz);
2754 DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2757 std::vector<int> val2;
2758 const int *bg=convertObjToPossibleCpp1_Safe(indexArr,sw,sz,val,val2);
2759 return self->accumulatePerChunck(bg,bg+sz);
2762 DataArrayInt *getIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
2765 std::vector<int> val2;
2766 const int *bg(convertObjToPossibleCpp1_Safe(inputTuple,sw,sz,val,val2));
2767 return self->getIdsEqualTuple(bg,bg+sz);
2770 PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
2772 std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
2773 PyObject *ret=PyList_New(slcs.size());
2774 for(std::size_t i=0;i<slcs.size();i++)
2775 PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
2779 DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const throw(INTERP_KERNEL::Exception)
2781 if(!PySlice_Check(slic))
2782 throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
2783 Py_ssize_t strt=2,stp=2,step=2;
2784 PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
2785 GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
2786 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
2787 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 !");
2788 return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
2791 PyObject *getMinMaxValues() const throw(INTERP_KERNEL::Exception)
2794 self->getMinMaxValues(a,b);
2795 PyObject *ret=PyTuple_New(2);
2796 PyTuple_SetItem(ret,0,PyInt_FromLong(a));
2797 PyTuple_SetItem(ret,1,PyInt_FromLong(b));
2801 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2803 int newNbOfTuples=-1;
2804 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2805 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2806 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2807 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2808 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2809 PyObject *ret=PyTuple_New(2);
2810 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2811 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2815 static DataArrayInt *CheckAndPreparePermutation(PyObject *arr) throw(INTERP_KERNEL::Exception)
2817 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
2818 int szArr,sw,iTypppArr;
2819 std::vector<int> stdvecTyyppArr;
2820 const int *arrPtr(convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
2821 int *pt(ParaMEDMEM::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
2822 ret->useArray(pt,true,ParaMEDMEM::C_DEALLOC,szArr,1);
2826 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2828 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 !";
2829 if(PyList_Check(li) || PyTuple_Check(li))
2833 if(PyInt_Check(nbOfTuples))
2835 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2837 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2840 if(PyInt_Check(nbOfComp))
2841 {//DataArrayInt.setValues([1,3,4,5],2,2)
2842 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2844 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2845 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2846 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2849 throw INTERP_KERNEL::Exception(msg);
2852 {//DataArrayInt.setValues([1,3,4],3)
2854 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2855 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2859 throw INTERP_KERNEL::Exception(msg);
2862 {// DataArrayInt.setValues([1,3,4])
2863 int tmpp1=-1,tmpp2=-1;
2864 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2865 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2869 throw INTERP_KERNEL::Exception(msg);
2872 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2874 const int *vals=self->getConstPointer();
2875 return convertIntArrToPyList(vals,self->getNbOfElems());
2879 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2881 return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2885 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2888 bool ret0=self->isEqualIfNotWhy(other,ret1);
2889 PyObject *ret=PyTuple_New(2);
2890 PyObject *ret0Py=ret0?Py_True:Py_False;
2892 PyTuple_SetItem(ret,0,ret0Py);
2893 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2897 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2899 const int *vals=self->getConstPointer();
2900 int nbOfComp=self->getNumberOfComponents();
2901 int nbOfTuples=self->getNumberOfTuples();
2902 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2905 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2907 std::vector<const DataArrayInt *> groups;
2908 std::vector< std::vector<int> > fidsOfGroups;
2909 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
2910 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2911 PyObject *ret = PyList_New(2);
2912 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2913 int sz=fidsOfGroups.size();
2914 PyObject *ret1 = PyList_New(sz);
2915 for(int i=0;i<sz;i++)
2916 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2917 PyList_SetItem(ret,1,ret1);
2921 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2924 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2925 if (!SWIG_IsOK(res1))
2928 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2929 self->transformWithIndArr(tmp,tmp+size);
2933 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2934 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2938 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2942 std::vector<int> multiVal;
2943 std::pair<int, std::pair<int,int> > slic;
2944 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2945 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2949 return self->getIdsEqualList(&singleVal,&singleVal+1);
2951 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2953 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2955 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2959 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2963 std::vector<int> multiVal;
2964 std::pair<int, std::pair<int,int> > slic;
2965 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2966 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2970 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
2972 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2974 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2976 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2980 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2982 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2984 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2985 if (!SWIG_IsOK(res1))
2988 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2989 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2993 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2995 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2996 da2->checkAllocated();
2997 int size=self->getNumberOfTuples();
2998 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
3000 PyObject *ret = PyList_New(3);
3001 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3002 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3003 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3007 DataArrayInt *transformWithIndArrR(PyObject *li) const 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 return self->transformWithIndArrR(tmp,tmp+size);
3019 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3020 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3024 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3027 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3028 if (!SWIG_IsOK(res1))
3031 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3032 if(size!=self->getNumberOfTuples())
3034 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3036 return self->renumberAndReduce(tmp,newNbOfTuple);
3040 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3042 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3043 da2->checkAllocated();
3044 int size=self->getNumberOfTuples();
3045 if(size!=self->getNumberOfTuples())
3047 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3049 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3053 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3056 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3057 if (!SWIG_IsOK(res1))
3060 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3061 if(size!=self->getNumberOfTuples())
3063 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3065 return self->renumber(tmp);
3069 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3071 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3072 da2->checkAllocated();
3073 int size=self->getNumberOfTuples();
3074 if(size!=self->getNumberOfTuples())
3076 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3078 return self->renumber(da2->getConstPointer());
3082 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3085 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3086 if (!SWIG_IsOK(res1))
3089 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3090 if(size!=self->getNumberOfTuples())
3092 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3094 return self->renumberR(tmp);
3098 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3100 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3101 da2->checkAllocated();
3102 int size=self->getNumberOfTuples();
3103 if(size!=self->getNumberOfTuples())
3105 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3107 return self->renumberR(da2->getConstPointer());
3111 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3113 std::vector<int> tmp;
3114 convertPyToNewIntArr3(li,tmp);
3115 self->setSelectedComponents(a,tmp);
3118 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3120 int sz=self->getNumberOfComponents();
3121 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
3122 self->getTuple(tupleId,tmp);
3123 return convertIntArrToPyList(tmp,sz);
3126 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
3128 DataArrayInt *arr=0;
3129 DataArrayInt *arrI=0;
3130 self->changeSurjectiveFormat(targetNb,arr,arrI);
3131 PyObject *res = PyList_New(2);
3132 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3133 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3137 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3139 std::vector<const DataArrayInt *> tmp;
3140 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3141 return DataArrayInt::Meld(tmp);
3144 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3146 std::vector<const DataArrayInt *> tmp;
3147 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3148 return DataArrayInt::Aggregate(tmp);
3151 static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
3153 std::vector<const DataArrayInt *> tmp;
3154 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3155 return DataArrayInt::AggregateIndexes(tmp);
3158 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
3160 std::vector<const DataArrayInt *> tmp;
3161 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3162 return DataArrayInt::BuildUnion(tmp);
3165 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
3167 std::vector<const DataArrayInt *> tmp;
3168 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
3169 return DataArrayInt::BuildIntersection(tmp);
3172 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3175 int r1=self->getMaxValue(tmp);
3176 PyObject *ret=PyTuple_New(2);
3177 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3178 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3182 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3185 int r1=self->getMinValue(tmp);
3186 PyObject *ret=PyTuple_New(2);
3187 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3188 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3192 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3194 int nbOfCompo=self->getNumberOfComponents();
3199 if(PyInt_Check(obj))
3201 int val=(int)PyInt_AS_LONG(obj);
3202 return self->locateValue(val);
3205 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
3209 std::vector<int> arr;
3210 convertPyToNewIntArr3(obj,arr);
3211 return self->locateTuple(arr);
3216 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3218 int nbOfCompo=self->getNumberOfComponents();
3225 if(PyInt_Check(obj))
3227 int val=(int)PyInt_AS_LONG(obj);
3228 return self->presenceOfValue(val);
3231 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
3235 std::vector<int> arr;
3236 convertPyToNewIntArr3(obj,arr);
3237 return self->presenceOfTuple(arr);
3242 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3244 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
3245 const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
3246 self->checkAllocated();
3247 int nbOfTuples=self->getNumberOfTuples();
3248 int nbOfComponents=self->getNumberOfComponents();
3250 std::vector<int> vt1,vc1;
3251 std::pair<int, std::pair<int,int> > pt1,pc1;
3252 DataArrayInt *dt1=0,*dc1=0;
3254 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3255 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
3260 if(nbOfComponents==1)
3261 return PyInt_FromLong(self->getIJSafe(it1,0));
3262 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3265 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3267 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3269 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3271 return PyInt_FromLong(self->getIJSafe(it1,ic1));
3274 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3275 std::vector<int> v2(1,ic1);
3276 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3280 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3281 std::vector<int> v2(1,ic1);
3282 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3286 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3287 std::vector<int> v2(1,ic1);
3288 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3292 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3293 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3297 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3298 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3302 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3303 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3307 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3308 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3312 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3313 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3314 std::vector<int> v2(nbOfComp);
3315 for(int i=0;i<nbOfComp;i++)
3316 v2[i]=pc1.first+i*pc1.second.second;
3317 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3321 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3322 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3323 std::vector<int> v2(nbOfComp);
3324 for(int i=0;i<nbOfComp;i++)
3325 v2[i]=pc1.first+i*pc1.second.second;
3326 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3330 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3331 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3332 std::vector<int> v2(nbOfComp);
3333 for(int i=0;i<nbOfComp;i++)
3334 v2[i]=pc1.first+i*pc1.second.second;
3335 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3339 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3340 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3341 std::vector<int> v2(nbOfComp);
3342 for(int i=0;i<nbOfComp;i++)
3343 v2[i]=pc1.first+i*pc1.second.second;
3344 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3347 throw INTERP_KERNEL::Exception(msg);
3351 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3353 self->checkAllocated();
3354 const char msg[]="Unexpected situation in __setitem__ !";
3355 int nbOfTuples=self->getNumberOfTuples();
3356 int nbOfComponents=self->getNumberOfComponents();
3359 std::vector<int> v1;
3361 DataArrayIntTuple *dd1=0;
3362 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
3364 std::vector<int> vt1,vc1;
3365 std::pair<int, std::pair<int,int> > pt1,pc1;
3366 DataArrayInt *dt1=0,*dc1=0;
3367 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3368 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
3376 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3379 tmp=DataArrayInt::New();
3380 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3381 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3384 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3387 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3388 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3391 throw INTERP_KERNEL::Exception(msg);
3400 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3403 tmp=DataArrayInt::New();
3404 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3405 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3408 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3411 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3412 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3415 throw INTERP_KERNEL::Exception(msg);
3424 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3427 tmp=DataArrayInt::New();
3428 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3429 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3432 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3435 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3436 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3439 throw INTERP_KERNEL::Exception(msg);
3448 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3451 tmp=DataArrayInt::New();
3452 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3453 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3456 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3459 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3460 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3463 throw INTERP_KERNEL::Exception(msg);
3472 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3475 tmp=DataArrayInt::New();
3476 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3477 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3480 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3483 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3484 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3487 throw INTERP_KERNEL::Exception(msg);
3496 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3499 tmp=DataArrayInt::New();
3500 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3501 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3504 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3507 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3508 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3511 throw INTERP_KERNEL::Exception(msg);
3520 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3523 tmp=DataArrayInt::New();
3524 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3525 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3528 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3531 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3532 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3535 throw INTERP_KERNEL::Exception(msg);
3544 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3547 tmp=DataArrayInt::New();
3548 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3549 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3552 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3555 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3556 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3559 throw INTERP_KERNEL::Exception(msg);
3568 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3571 tmp=DataArrayInt::New();
3572 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3573 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3576 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3579 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3580 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3583 throw INTERP_KERNEL::Exception(msg);
3592 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3595 tmp=DataArrayInt::New();
3596 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3597 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3600 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3603 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3604 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3607 throw INTERP_KERNEL::Exception(msg);
3616 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3619 tmp=DataArrayInt::New();
3620 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3621 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3624 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3627 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3628 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3631 throw INTERP_KERNEL::Exception(msg);
3640 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3643 tmp=DataArrayInt::New();
3644 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3645 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3648 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3651 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3652 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3655 throw INTERP_KERNEL::Exception(msg);
3664 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3667 tmp=DataArrayInt::New();
3668 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3669 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3672 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3675 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3676 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3679 throw INTERP_KERNEL::Exception(msg);
3688 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3691 tmp=DataArrayInt::New();
3692 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3693 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3696 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3699 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3700 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3703 throw INTERP_KERNEL::Exception(msg);
3712 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3715 tmp=DataArrayInt::New();
3716 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3717 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3720 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3723 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3724 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3727 throw INTERP_KERNEL::Exception(msg);
3736 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3739 tmp=DataArrayInt::New();
3740 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3741 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3744 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3747 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3748 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3751 throw INTERP_KERNEL::Exception(msg);
3756 throw INTERP_KERNEL::Exception(msg);
3761 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3763 return self->negate();
3766 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3768 const char msg[]="Unexpected situation in __add__ !";
3771 std::vector<int> aa;
3772 DataArrayIntTuple *aaa;
3774 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3779 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3780 ret->applyLin(1,val);
3785 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3786 return DataArrayInt::Add(self,aaaa);
3790 return DataArrayInt::Add(self,a);
3794 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3795 return DataArrayInt::Add(self,aaaa);
3798 throw INTERP_KERNEL::Exception(msg);
3802 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3804 const char msg[]="Unexpected situation in __radd__ !";
3807 std::vector<int> aa;
3808 DataArrayIntTuple *aaa;
3810 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3815 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3816 ret->applyLin(1,val);
3821 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3822 return DataArrayInt::Add(self,aaaa);
3826 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3827 return DataArrayInt::Add(self,aaaa);
3830 throw INTERP_KERNEL::Exception(msg);
3834 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3836 const char msg[]="Unexpected situation in __iadd__ !";
3839 std::vector<int> aa;
3840 DataArrayIntTuple *aaa;
3842 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3847 self->applyLin(1,val);
3848 Py_XINCREF(trueSelf);
3853 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3855 Py_XINCREF(trueSelf);
3861 Py_XINCREF(trueSelf);
3866 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3867 self->addEqual(aaaa);
3868 Py_XINCREF(trueSelf);
3872 throw INTERP_KERNEL::Exception(msg);
3876 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3878 const char msg[]="Unexpected situation in __sub__ !";
3881 std::vector<int> aa;
3882 DataArrayIntTuple *aaa;
3884 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3889 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3890 ret->applyLin(1,-val);
3895 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3896 return DataArrayInt::Substract(self,aaaa);
3900 return DataArrayInt::Substract(self,a);
3904 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3905 return DataArrayInt::Substract(self,aaaa);
3908 throw INTERP_KERNEL::Exception(msg);
3912 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3914 const char msg[]="Unexpected situation in __rsub__ !";
3917 std::vector<int> aa;
3918 DataArrayIntTuple *aaa;
3920 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3925 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
3926 ret->applyLin(-1,val);
3931 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3932 return DataArrayInt::Substract(aaaa,self);
3936 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3937 return DataArrayInt::Substract(aaaa,self);
3940 throw INTERP_KERNEL::Exception(msg);
3944 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3946 const char msg[]="Unexpected situation in __isub__ !";
3949 std::vector<int> aa;
3950 DataArrayIntTuple *aaa;
3952 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3957 self->applyLin(1,-val);
3958 Py_XINCREF(trueSelf);
3963 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3964 self->substractEqual(bb);
3965 Py_XINCREF(trueSelf);
3970 self->substractEqual(a);
3971 Py_XINCREF(trueSelf);
3976 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3977 self->substractEqual(aaaa);
3978 Py_XINCREF(trueSelf);
3982 throw INTERP_KERNEL::Exception(msg);
3986 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3988 const char msg[]="Unexpected situation in __mul__ !";
3991 std::vector<int> aa;
3992 DataArrayIntTuple *aaa;
3994 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
3999 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4000 ret->applyLin(val,0);
4005 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4006 return DataArrayInt::Multiply(self,aaaa);
4010 return DataArrayInt::Multiply(self,a);
4014 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4015 return DataArrayInt::Multiply(self,aaaa);
4018 throw INTERP_KERNEL::Exception(msg);
4022 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4024 const char msg[]="Unexpected situation in __rmul__ !";
4027 std::vector<int> aa;
4028 DataArrayIntTuple *aaa;
4030 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4035 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4036 ret->applyLin(val,0);
4041 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4042 return DataArrayInt::Multiply(self,aaaa);
4046 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4047 return DataArrayInt::Multiply(self,aaaa);
4050 throw INTERP_KERNEL::Exception(msg);
4054 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4056 const char msg[]="Unexpected situation in __imul__ !";
4059 std::vector<int> aa;
4060 DataArrayIntTuple *aaa;
4062 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4067 self->applyLin(val,0);
4068 Py_XINCREF(trueSelf);
4073 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4074 self->multiplyEqual(bb);
4075 Py_XINCREF(trueSelf);
4080 self->multiplyEqual(a);
4081 Py_XINCREF(trueSelf);
4086 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4087 self->multiplyEqual(aaaa);
4088 Py_XINCREF(trueSelf);
4092 throw INTERP_KERNEL::Exception(msg);
4096 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4098 const char msg[]="Unexpected situation in __div__ !";
4101 std::vector<int> aa;
4102 DataArrayIntTuple *aaa;
4104 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4109 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4110 ret->applyDivideBy(val);
4115 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4116 return DataArrayInt::Divide(self,aaaa);
4120 return DataArrayInt::Divide(self,a);
4124 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4125 return DataArrayInt::Divide(self,aaaa);
4128 throw INTERP_KERNEL::Exception(msg);
4132 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4134 const char msg[]="Unexpected situation in __rdiv__ !";
4137 std::vector<int> aa;
4138 DataArrayIntTuple *aaa;
4140 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4145 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4151 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4152 return DataArrayInt::Divide(aaaa,self);
4156 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4157 return DataArrayInt::Divide(aaaa,self);
4160 throw INTERP_KERNEL::Exception(msg);
4164 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4166 const char msg[]="Unexpected situation in __idiv__ !";
4169 std::vector<int> aa;
4170 DataArrayIntTuple *aaa;
4172 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4177 self->applyDivideBy(val);
4178 Py_XINCREF(trueSelf);
4183 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4184 self->divideEqual(bb);
4185 Py_XINCREF(trueSelf);
4190 self->divideEqual(a);
4191 Py_XINCREF(trueSelf);
4196 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4197 self->divideEqual(aaaa);
4198 Py_XINCREF(trueSelf);
4202 throw INTERP_KERNEL::Exception(msg);
4206 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4208 const char msg[]="Unexpected situation in __mod__ !";
4211 std::vector<int> aa;
4212 DataArrayIntTuple *aaa;
4214 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4219 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4220 ret->applyModulus(val);
4225 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4226 return DataArrayInt::Modulus(self,aaaa);
4230 return DataArrayInt::Modulus(self,a);
4234 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4235 return DataArrayInt::Modulus(self,aaaa);
4238 throw INTERP_KERNEL::Exception(msg);
4242 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4244 const char msg[]="Unexpected situation in __rmod__ !";
4247 std::vector<int> aa;
4248 DataArrayIntTuple *aaa;
4250 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4255 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4256 ret->applyRModulus(val);
4261 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4262 return DataArrayInt::Modulus(aaaa,self);
4266 return DataArrayInt::Modulus(a,self);
4270 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4271 return DataArrayInt::Modulus(aaaa,self);
4274 throw INTERP_KERNEL::Exception(msg);
4278 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4280 const char msg[]="Unexpected situation in __imod__ !";
4283 std::vector<int> aa;
4284 DataArrayIntTuple *aaa;
4286 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4291 self->applyModulus(val);
4292 Py_XINCREF(trueSelf);
4297 self->modulusEqual(a);
4298 Py_XINCREF(trueSelf);
4303 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4304 self->modulusEqual(aaaa);
4305 Py_XINCREF(trueSelf);
4309 throw INTERP_KERNEL::Exception(msg);
4313 DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4315 const char msg[]="Unexpected situation in __pow__ !";
4318 std::vector<int> aa;
4319 DataArrayIntTuple *aaa;
4321 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4326 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4332 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4333 return DataArrayInt::Pow(self,aaaa);
4337 return DataArrayInt::Pow(self,a);
4341 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4342 return DataArrayInt::Pow(self,aaaa);
4345 throw INTERP_KERNEL::Exception(msg);
4349 DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4351 const char msg[]="Unexpected situation in __rpow__ !";
4354 std::vector<int> aa;
4355 DataArrayIntTuple *aaa;
4357 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4362 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
4363 ret->applyRPow(val);
4368 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4369 return DataArrayInt::Pow(aaaa,self);
4373 return DataArrayInt::Pow(a,self);
4377 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4378 return DataArrayInt::Pow(aaaa,self);
4381 throw INTERP_KERNEL::Exception(msg);
4385 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4387 const char msg[]="Unexpected situation in __ipow__ !";
4390 std::vector<int> aa;
4391 DataArrayIntTuple *aaa;
4393 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
4398 self->applyPow(val);
4399 Py_XINCREF(trueSelf);
4405 Py_XINCREF(trueSelf);
4410 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4411 self->powEqual(aaaa);
4412 Py_XINCREF(trueSelf);
4416 throw INTERP_KERNEL::Exception(msg);
4420 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4422 std::ostringstream oss;
4423 self->reprQuickOverview(oss);
4427 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4429 int szArr,sw,iTypppArr;
4430 std::vector<int> stdvecTyyppArr;
4431 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4432 self->pushBackValsSilent(tmp,tmp+szArr);
4435 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4437 std::vector<int> ret1;
4438 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4439 std::size_t sz=ret0.size();
4440 PyObject *pyRet=PyTuple_New(2);
4441 PyObject *pyRet0=PyList_New((int)sz);
4442 PyObject *pyRet1=PyList_New((int)sz);
4443 for(std::size_t i=0;i<sz;i++)
4445 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4446 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4448 PyTuple_SetItem(pyRet,0,pyRet0);
4449 PyTuple_SetItem(pyRet,1,pyRet1);
4453 PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4455 DataArrayInt *ret0=0,*ret1=0;
4456 self->searchRangesInListOfIds(listOfIds,ret0,ret1);
4457 PyObject *pyRet=PyTuple_New(2);
4458 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4459 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4463 PyObject *isRange() const throw(INTERP_KERNEL::Exception)
4466 bool ret(self->isRange(a,b,c));
4467 PyObject *pyRet=PyTuple_New(2);
4468 PyObject *ret0Py=ret?Py_True:Py_False,*ret1Py(0);
4470 PyTuple_SetItem(pyRet,0,ret0Py);
4472 ret1Py=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
4478 PyTuple_SetItem(pyRet,1,ret1Py);
4484 class DataArrayIntTuple;
4486 class DataArrayIntIterator
4489 DataArrayIntIterator(DataArrayInt *da);
4490 ~DataArrayIntIterator();
4495 DataArrayIntTuple *ret=self->nextt();
4497 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4500 PyErr_SetString(PyExc_StopIteration,"No more data.");
4507 class DataArrayIntTuple
4510 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4511 DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4514 std::string __str__() const throw(INTERP_KERNEL::Exception)
4516 return self->repr();
4519 int __int__() const throw(INTERP_KERNEL::Exception)
4521 return self->intValue();
4524 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4526 return self->buildDAInt(1,self->getNumberOfCompo());
4529 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4531 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4532 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4533 Py_XINCREF(trueSelf);
4537 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4539 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4540 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4541 Py_XINCREF(trueSelf);
4545 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4547 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4548 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4549 Py_XINCREF(trueSelf);
4553 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4555 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4556 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4557 Py_XINCREF(trueSelf);
4561 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4563 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4564 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4565 Py_XINCREF(trueSelf);
4569 PyObject *__len__() throw(INTERP_KERNEL::Exception)
4571 return PyInt_FromLong(self->getNumberOfCompo());
4574 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4576 const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4579 std::vector<int> multiVal;
4580 std::pair<int, std::pair<int,int> > slic;
4581 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4582 const int *pt=self->getConstPointer();
4583 int nbc=self->getNumberOfCompo();
4584 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4591 std::ostringstream oss;
4592 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4593 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4597 return PyInt_FromLong(pt[singleVal]);
4601 return PyInt_FromLong(pt[nbc+singleVal]);
4604 std::ostringstream oss;
4605 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4606 throw INTERP_KERNEL::Exception(oss.str().c_str());
4612 PyObject *t=PyTuple_New(multiVal.size());
4613 for(int j=0;j<(int)multiVal.size();j++)
4615 int cid=multiVal[j];
4618 std::ostringstream oss;
4619 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4620 throw INTERP_KERNEL::Exception(oss.str().c_str());
4622 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4628 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4629 PyObject *t=PyTuple_New(sz);
4630 for(int j=0;j<sz;j++)
4631 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4635 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4639 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4641 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4642 const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4645 std::vector<int> multiValV;
4646 std::pair<int, std::pair<int,int> > slicV;
4647 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4648 int nbc=self->getNumberOfCompo();
4649 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4651 std::vector<int> multiVal;
4652 std::pair<int, std::pair<int,int> > slic;
4653 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4654 int *pt=self->getPointer();
4655 convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4662 std::ostringstream oss;
4663 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4664 throw INTERP_KERNEL::Exception(oss.str().c_str());
4670 pt[singleVal]=singleValV;
4675 if(multiValV.size()!=1)
4677 std::ostringstream oss;
4678 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4679 throw INTERP_KERNEL::Exception(oss.str().c_str());
4681 pt[singleVal]=multiValV[0];
4686 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4690 throw INTERP_KERNEL::Exception(msg);
4699 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4703 std::ostringstream oss;
4704 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4705 throw INTERP_KERNEL::Exception(oss.str().c_str());
4713 if(multiVal.size()!=multiValV.size())
4715 std::ostringstream oss;
4716 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4717 throw INTERP_KERNEL::Exception(oss.str().c_str());
4719 for(int i=0;i<(int)multiVal.size();i++)
4721 int pos=multiVal[i];
4724 std::ostringstream oss;
4725 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4726 throw INTERP_KERNEL::Exception(oss.str().c_str());
4728 pt[multiVal[i]]=multiValV[i];
4734 const int *ptV=daIntTyyppV->getConstPointer();
4735 if(nbc>daIntTyyppV->getNumberOfCompo())
4737 std::ostringstream oss;
4738 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4739 throw INTERP_KERNEL::Exception(oss.str().c_str());
4741 std::copy(ptV,ptV+nbc,pt);
4745 throw INTERP_KERNEL::Exception(msg);
4750 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4755 for(int j=0;j<sz;j++)
4756 pt[slic.first+j*slic.second.second]=singleValV;
4761 if(sz!=(int)multiValV.size())
4763 std::ostringstream oss;
4764 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4765 throw INTERP_KERNEL::Exception(oss.str().c_str());
4767 for(int j=0;j<sz;j++)
4768 pt[slic.first+j*slic.second.second]=multiValV[j];
4773 const int *ptV=daIntTyyppV->getConstPointer();
4774 if(sz>daIntTyyppV->getNumberOfCompo())
4776 std::ostringstream oss;
4777 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4778 throw INTERP_KERNEL::Exception(oss.str().c_str());
4780 for(int j=0;j<sz;j++)
4781 pt[slic.first+j*slic.second.second]=ptV[j];
4785 throw INTERP_KERNEL::Exception(msg);
4789 throw INTERP_KERNEL::Exception(msg);
4795 class DataArrayChar : public DataArray
4798 virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4799 int getHashCode() const throw(INTERP_KERNEL::Exception);
4800 bool empty() const throw(INTERP_KERNEL::Exception);
4801 void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4802 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4803 void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4804 char popBackSilent() throw(INTERP_KERNEL::Exception);
4805 void pack() const throw(INTERP_KERNEL::Exception);
4806 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4807 bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4808 bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4809 void reverse() throw(INTERP_KERNEL::Exception);
4810 void fillWithZero() throw(INTERP_KERNEL::Exception);
4811 void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4812 std::string repr() const throw(INTERP_KERNEL::Exception);
4813 std::string reprZip() const throw(INTERP_KERNEL::Exception);
4814 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4815 DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4816 DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4817 DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4818 bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4819 DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4820 DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4821 void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4822 void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
4823 char front() const throw(INTERP_KERNEL::Exception);
4824 char back() const throw(INTERP_KERNEL::Exception);
4825 void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4826 void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4827 char *getPointer() throw(INTERP_KERNEL::Exception);
4828 DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4829 DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4830 int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4831 bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4832 char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4833 char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4834 char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4835 char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4836 DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4837 static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4838 static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4841 int __len__() const throw(INTERP_KERNEL::Exception)
4843 if(self->isAllocated())
4845 return self->getNumberOfTuples();
4849 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4853 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4856 bool ret0=self->isEqualIfNotWhy(other,ret1);
4857 PyObject *ret=PyTuple_New(2);
4858 PyObject *ret0Py=ret0?Py_True:Py_False;
4860 PyTuple_SetItem(ret,0,ret0Py);
4861 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4865 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4868 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4869 if (!SWIG_IsOK(res1))
4872 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4873 if(size!=self->getNumberOfTuples())
4875 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4877 return self->renumber(tmp);
4881 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4883 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4884 da2->checkAllocated();
4885 int size=self->getNumberOfTuples();
4886 if(size!=self->getNumberOfTuples())
4888 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4890 return self->renumber(da2->getConstPointer());
4894 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4897 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4898 if (!SWIG_IsOK(res1))
4901 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4902 if(size!=self->getNumberOfTuples())
4904 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4906 return self->renumberR(tmp);
4910 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4912 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4913 da2->checkAllocated();
4914 int size=self->getNumberOfTuples();
4915 if(size!=self->getNumberOfTuples())
4917 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4919 return self->renumberR(da2->getConstPointer());
4923 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4926 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4927 if (!SWIG_IsOK(res1))
4930 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4931 if(size!=self->getNumberOfTuples())
4933 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4935 return self->renumberAndReduce(tmp,newNbOfTuple);
4939 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4941 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4942 da2->checkAllocated();
4943 int size=self->getNumberOfTuples();
4944 if(size!=self->getNumberOfTuples())
4946 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4948 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4952 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4954 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4955 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4956 return DataArrayChar::Aggregate(tmp);
4959 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4961 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
4962 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
4963 return DataArrayChar::Meld(tmp);
4968 class DataArrayByteIterator;
4970 class DataArrayByte : public DataArrayChar
4973 static DataArrayByte *New();
4974 DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4975 DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
4976 char byteValue() const throw(INTERP_KERNEL::Exception);
4979 DataArrayByte() throw(INTERP_KERNEL::Exception)
4981 return DataArrayByte::New();
4984 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4986 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) !";
4987 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4991 if(PyInt_Check(nbOfTuples))
4993 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4995 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4998 if(PyInt_Check(nbOfComp))
4999 {//DataArrayByte.New([1,3,4,5],2,2)
5000 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5002 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
5003 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5004 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5005 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5009 throw INTERP_KERNEL::Exception(msg);
5012 {//DataArrayByte.New([1,3,4],3)
5013 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5015 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5016 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5021 throw INTERP_KERNEL::Exception(msg);
5024 {// DataArrayByte.New([1,3,4])
5025 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5026 int tmpp1=-1,tmpp2=-1;
5027 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5028 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5032 else if(PyInt_Check(elt0))
5034 int nbOfTuples1=PyInt_AS_LONG(elt0);
5036 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
5041 if(PyInt_Check(nbOfTuples))
5042 {//DataArrayByte.New(5,2)
5043 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5045 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
5046 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5047 ret->alloc(nbOfTuples1,nbOfCompo);
5051 throw INTERP_KERNEL::Exception(msg);
5054 throw INTERP_KERNEL::Exception(msg);
5057 {//DataArrayByte.New(5)
5058 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
5059 ret->alloc(nbOfTuples1,1);
5064 throw INTERP_KERNEL::Exception(msg);
5067 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5069 return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5072 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5074 std::ostringstream oss;
5075 self->reprQuickOverview(oss);
5079 int __int__() const throw(INTERP_KERNEL::Exception)
5081 return (int) self->byteValue();
5084 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
5086 return self->iterator();
5089 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5091 return (int)self->getIJ(tupleId,compoId);
5094 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5096 return (int)self->getIJSafe(tupleId,compoId);
5099 std::string __str__() const throw(INTERP_KERNEL::Exception)
5101 return self->repr();
5104 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5106 const char *vals=self->getConstPointer();
5107 int nbOfComp=self->getNumberOfComponents();
5108 int nbOfTuples=self->getNumberOfTuples();
5109 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5112 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5115 int ival=-1; std::vector<int> ivval;
5116 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5117 std::vector<char> vals(sz);
5118 std::copy(pt,pt+sz,vals.begin());
5119 return self->presenceOfTuple(vals);
5122 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5125 int ival=-1; std::vector<int> ivval;
5126 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5127 std::vector<char> vals2(sz);
5128 std::copy(pt,pt+sz,vals2.begin());
5129 return self->presenceOfValue(vals2);
5132 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5135 int ival=-1; std::vector<int> ivval;
5136 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
5137 std::vector<char> vals2(sz);
5138 std::copy(pt,pt+sz,vals2.begin());
5139 return self->locateValue(vals2);
5142 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5145 int ival=-1; std::vector<int> ivval;
5146 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
5147 std::vector<char> vals(sz);
5148 std::copy(pt,pt+sz,vals.begin());
5149 return self->locateTuple(vals);
5152 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5155 int ival=-1; std::vector<int> ivval;
5156 const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
5157 std::vector<char> vals(sz);
5158 std::copy(pt,pt+sz,vals.begin());
5159 return self->search(vals);
5162 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5164 int sz=self->getNumberOfComponents();
5165 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
5166 self->getTuple(tupleId,tmp);
5167 PyObject *ret=PyTuple_New(sz);
5168 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
5172 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5175 int r1=(int)self->getMaxValue(tmp);
5176 PyObject *ret=PyTuple_New(2);
5177 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5178 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5182 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5185 int r1=(int)self->getMinValue(tmp);
5186 PyObject *ret=PyTuple_New(2);
5187 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5188 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5192 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5194 int nbOfCompo=self->getNumberOfComponents();
5199 if(PyInt_Check(obj))
5201 int val=(int)PyInt_AS_LONG(obj);
5202 return self->locateValue(val);
5205 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
5208 return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
5212 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5214 int nbOfCompo=self->getNumberOfComponents();
5221 if(PyInt_Check(obj))
5223 int val=(int)PyInt_AS_LONG(obj);
5224 return self->presenceOfValue(val);
5227 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5230 return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
5234 DataArrayByte *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5236 self->checkAllocated();
5237 const char msg[]="Unexpected situation in __setitem__ !";
5238 int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
5241 std::vector<int> v1;
5243 DataArrayIntTuple *dd1=0;
5244 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5246 std::vector<int> vt1,vc1;
5247 std::pair<int, std::pair<int,int> > pt1,pc1;
5248 DataArrayInt *dt1=0,*dc1=0;
5249 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5250 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5258 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5261 throw INTERP_KERNEL::Exception(msg);
5270 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5273 throw INTERP_KERNEL::Exception(msg);
5282 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5285 throw INTERP_KERNEL::Exception(msg);
5294 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5297 throw INTERP_KERNEL::Exception(msg);
5306 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5309 throw INTERP_KERNEL::Exception(msg);
5318 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5321 throw INTERP_KERNEL::Exception(msg);
5330 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5333 throw INTERP_KERNEL::Exception(msg);
5342 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5345 throw INTERP_KERNEL::Exception(msg);
5354 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5357 throw INTERP_KERNEL::Exception(msg);
5366 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5369 throw INTERP_KERNEL::Exception(msg);
5378 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5381 throw INTERP_KERNEL::Exception(msg);
5390 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5393 throw INTERP_KERNEL::Exception(msg);
5402 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5405 throw INTERP_KERNEL::Exception(msg);
5414 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5417 throw INTERP_KERNEL::Exception(msg);
5426 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5429 throw INTERP_KERNEL::Exception(msg);
5438 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5441 throw INTERP_KERNEL::Exception(msg);
5446 throw INTERP_KERNEL::Exception(msg);
5453 class DataArrayByteTuple;
5455 class DataArrayByteIterator
5458 DataArrayByteIterator(DataArrayByte *da);
5459 ~DataArrayByteIterator();
5462 class DataArrayByteTuple
5465 std::string repr() const throw(INTERP_KERNEL::Exception);
5466 DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5469 std::string __str__() const throw(INTERP_KERNEL::Exception)
5471 return self->repr();
5474 char __int__() const throw(INTERP_KERNEL::Exception)
5476 return self->byteValue();
5479 DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5481 return self->buildDAByte(1,self->getNumberOfCompo());
5486 class DataArrayAsciiCharIterator;
5488 class DataArrayAsciiChar : public DataArrayChar
5491 static DataArrayAsciiChar *New();
5492 DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5493 DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
5494 char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5497 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5499 return DataArrayAsciiChar::New();
5502 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5504 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) !";
5505 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5509 if(PyInt_Check(nbOfTuples))
5511 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5513 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5516 if(PyInt_Check(nbOfComp))
5517 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5518 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5520 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5521 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5522 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5523 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5527 throw INTERP_KERNEL::Exception(msg);
5530 {//DataArrayAsciiChar.New([1,3,4],3)
5531 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5533 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5534 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5538 else if(PyString_Check(nbOfTuples))
5540 if(PyString_Size(nbOfTuples)!=1)
5541 throw INTERP_KERNEL::Exception(msg);
5542 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5543 std::vector<std::string> tmp;
5544 if(fillStringVector(elt0,tmp))
5545 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5547 throw INTERP_KERNEL::Exception(msg);
5550 throw INTERP_KERNEL::Exception(msg);
5554 std::vector<std::string> tmmp;
5555 if(fillStringVector(elt0,tmmp))
5556 //DataArrayAsciiChar.New(["abc","de","fghi"])
5557 return DataArrayAsciiChar::New(tmmp,' ');
5560 // DataArrayAsciiChar.New([1,3,4])
5561 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5562 int tmpp1=-1,tmpp2=-1;
5563 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5564 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5569 else if(PyInt_Check(elt0))
5571 int nbOfTuples1=PyInt_AS_LONG(elt0);
5573 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5578 if(PyInt_Check(nbOfTuples))
5579 {//DataArrayAsciiChar.New(5,2)
5580 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5582 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5583 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5584 ret->alloc(nbOfTuples1,nbOfCompo);
5588 throw INTERP_KERNEL::Exception(msg);
5591 throw INTERP_KERNEL::Exception(msg);
5594 {//DataArrayAsciiChar.New(5)
5595 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5596 ret->alloc(nbOfTuples1,1);
5601 throw INTERP_KERNEL::Exception(msg);
5604 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5606 return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5609 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5611 std::ostringstream oss;
5612 self->reprQuickOverview(oss);
5616 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5618 return self->iterator();
5621 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5623 char tmp[2]; tmp[1]='\0';
5624 tmp[0]=self->getIJ(tupleId,compoId);
5625 return std::string(tmp);
5628 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5630 char tmp[2]; tmp[1]='\0';
5631 tmp[0]=self->getIJSafe(tupleId,compoId);
5632 return std::string(tmp);
5635 std::string __str__() const throw(INTERP_KERNEL::Exception)
5637 return self->repr();
5640 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5642 const char *vals=self->getConstPointer();
5643 int nbOfComp=self->getNumberOfComponents();
5644 int nbOfTuples=self->getNumberOfTuples();
5645 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5648 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5650 if(PyString_Check(tupl))
5652 Py_ssize_t sz=PyString_Size(tupl);
5653 std::vector<char> vals(sz);
5654 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5655 return self->presenceOfTuple(vals);
5658 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5661 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5663 if(PyString_Check(vals))
5665 Py_ssize_t sz=PyString_Size(vals);
5666 std::vector<char> vals2(sz);
5667 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5668 return self->presenceOfValue(vals2);
5671 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5674 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5676 if(PyString_Check(vals))
5678 Py_ssize_t sz=PyString_Size(vals);
5679 std::vector<char> vals2(sz);
5680 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5681 return self->locateValue(vals2);
5684 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
5687 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5689 if(PyString_Check(tupl))
5691 Py_ssize_t sz=PyString_Size(tupl);
5692 std::vector<char> vals(sz);
5693 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5694 return self->locateTuple(vals);
5697 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
5700 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5702 if(PyString_Check(strOrListOfInt))
5704 Py_ssize_t sz=PyString_Size(strOrListOfInt);
5705 std::vector<char> vals(sz);
5706 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5707 return self->search(vals);
5710 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5713 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5715 int sz=self->getNumberOfComponents();
5716 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5717 self->getTuple(tupleId,tmp);
5718 return PyString_FromString(tmp);
5721 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5724 char tmp2[2]; tmp2[1]='\0';
5725 tmp2[0]=self->getMaxValue(tmp);
5726 PyObject *ret=PyTuple_New(2);
5727 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5728 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5732 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5735 char tmp2[2]; tmp2[1]='\0';
5736 tmp2[0]=self->getMinValue(tmp);
5737 PyObject *ret=PyTuple_New(2);
5738 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5739 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5743 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5745 int nbOfCompo=self->getNumberOfComponents();
5750 if(PyString_Check(obj))
5752 Py_ssize_t sz=PyString_Size(obj);
5753 char *pt=PyString_AsString(obj);
5755 return self->locateValue(pt[0]);
5757 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5760 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5763 return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
5767 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5769 int nbOfCompo=self->getNumberOfComponents();
5776 if(PyString_Check(obj))
5778 Py_ssize_t sz=PyString_Size(obj);
5779 char *pt=PyString_AsString(obj);
5781 return self->presenceOfValue(pt[0]);
5783 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5786 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5789 return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
5793 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5796 std::vector<int> stdvecTyyppArr;
5797 std::pair<int, std::pair<int,int> > sTyyppArr;
5798 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5799 convertObjToPossibleCpp2WithNegIntInterp(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5803 return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
5805 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5807 return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5809 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5811 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5815 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5817 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.";
5819 std::vector<int> stdvecTyyppArr;
5820 std::pair<int, std::pair<int,int> > sTyyppArr;
5821 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5822 int nbOfCompo=self->getNumberOfComponents();
5823 int nbOfTuples=self->getNumberOfTuples();
5824 convertObjToPossibleCpp2WithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5826 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5827 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5836 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5842 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5843 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5846 //value vector<string>
5849 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5850 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5853 //value DataArrayChar
5856 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5860 throw INTERP_KERNEL::Exception(msg);
5864 {//obj list-tuple[int]
5870 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5876 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5877 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5880 //value vector<string>
5883 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5884 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5887 //value DataArrayChar
5890 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5894 throw INTERP_KERNEL::Exception(msg);
5905 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5911 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5912 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5915 //value vector<string>
5918 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5919 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5922 //value DataArrayChar
5925 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5929 throw INTERP_KERNEL::Exception(msg);
5940 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5946 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5947 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5950 //value vector<string>
5953 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5954 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5957 //value DataArrayChar
5960 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5964 throw INTERP_KERNEL::Exception(msg);
5969 throw INTERP_KERNEL::Exception(msg);
5975 class DataArrayAsciiCharTuple;
5977 class DataArrayAsciiCharIterator
5980 DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5981 ~DataArrayAsciiCharIterator();
5986 DataArrayAsciiCharTuple *ret=self->nextt();
5988 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5991 PyErr_SetString(PyExc_StopIteration,"No more data.");
5998 class DataArrayAsciiCharTuple
6001 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
6002 DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
6005 std::string __str__() const throw(INTERP_KERNEL::Exception)
6007 return self->repr();
6010 DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
6012 return self->buildDAAsciiChar(1,self->getNumberOfCompo());