1 // Copyright (C) 2007-2016 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 (EDF R&D)
22 %typemap(out) MEDCoupling::DataArray*
24 $result=convertDataArray($1,$owner);
27 %typemap(out) DataArray*
29 $result=convertDataArray($1,$owner);
34 %typemap(out) MEDCoupling::DataArrayChar*
36 $result=convertDataArrayChar($1,$owner);
39 %typemap(out) DataArrayChar*
41 $result=convertDataArrayChar($1,$owner);
44 %typemap(out) MCAuto<MEDCoupling::DataArrayInt>
46 $result=SWIG_NewPointerObj(SWIG_as_voidptr($1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN|0);
49 %typemap(out) MCAuto<MEDCoupling::DataArrayDouble>
51 $result=SWIG_NewPointerObj(SWIG_as_voidptr($1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN|0);
54 %typemap(out) MCAuto<MEDCoupling::DataArrayFloat>
56 $result=SWIG_NewPointerObj(SWIG_as_voidptr($1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayFloat,SWIG_POINTER_OWN|0);
59 %typemap(out) MCAuto<MEDCoupling::MapII>
61 $result=SWIG_NewPointerObj(SWIG_as_voidptr($1.retn()),SWIGTYPE_p_MEDCoupling__MapII,SWIG_POINTER_OWN|0);
65 %newobject MEDCoupling::DataArray::deepCopy;
66 %newobject MEDCoupling::DataArray::buildNewEmptyInstance;
67 %newobject MEDCoupling::DataArray::selectByTupleRanges;
68 %newobject MEDCoupling::DataArray::selectByTupleId;
69 %newobject MEDCoupling::DataArray::selectByTupleIdSafe;
70 %newobject MEDCoupling::DataArray::selectByTupleIdSafeSlice;
71 %newobject MEDCoupling::DataArray::Aggregate;
72 %newobject MEDCoupling::DataArrayFloat::New;
73 %newobject MEDCoupling::DataArrayFloat::iterator;
74 %newobject MEDCoupling::DataArrayFloat::__iter__;
75 %newobject MEDCoupling::DataArrayFloat::Meld;
76 %newobject MEDCoupling::DataArrayFloat::__rmul__;
77 %newobject MEDCoupling::DataArrayInt::New;
78 %newobject MEDCoupling::DataArrayInt::__iter__;
79 %newobject MEDCoupling::DataArrayInt::performCopyOrIncrRef;
80 %newobject MEDCoupling::DataArrayInt::subArray;
81 %newobject MEDCoupling::DataArrayInt::changeNbOfComponents;
82 %newobject MEDCoupling::DataArrayInt::accumulatePerChunck;
83 %newobject MEDCoupling::DataArrayInt::checkAndPreparePermutation;
84 %newobject MEDCoupling::DataArrayInt::transformWithIndArrR;
85 %newobject MEDCoupling::DataArrayInt::renumber;
86 %newobject MEDCoupling::DataArrayInt::renumberR;
87 %newobject MEDCoupling::DataArrayInt::renumberAndReduce;
88 %newobject MEDCoupling::DataArrayInt::invertArrayO2N2N2O;
89 %newobject MEDCoupling::DataArrayInt::invertArrayN2O2O2N;
90 %newobject MEDCoupling::DataArrayInt::invertArrayO2N2N2OBis;
91 %newobject MEDCoupling::DataArrayInt::findIdsEqual;
92 %newobject MEDCoupling::DataArrayInt::findIdsNotEqual;
93 %newobject MEDCoupling::DataArrayInt::findIdsEqualList;
94 %newobject MEDCoupling::DataArrayInt::findIdsNotEqualList;
95 %newobject MEDCoupling::DataArrayInt::findIdsEqualTuple;
96 %newobject MEDCoupling::DataArrayInt::findIdForEach;
97 %newobject MEDCoupling::DataArrayInt::sumPerTuple;
98 %newobject MEDCoupling::DataArrayInt::negate;
99 %newobject MEDCoupling::DataArrayInt::computeAbs;
100 %newobject MEDCoupling::DataArrayInt::findIdsInRange;
101 %newobject MEDCoupling::DataArrayInt::findIdsNotInRange;
102 %newobject MEDCoupling::DataArrayInt::findIdsStrictlyNegative;
103 %newobject MEDCoupling::DataArrayInt::Aggregate;
104 %newobject MEDCoupling::DataArrayInt::AggregateIndexes;
105 %newobject MEDCoupling::DataArrayInt::Meld;
106 %newobject MEDCoupling::DataArrayInt::Add;
107 %newobject MEDCoupling::DataArrayInt::Substract;
108 %newobject MEDCoupling::DataArrayInt::Multiply;
109 %newobject MEDCoupling::DataArrayInt::Divide;
110 %newobject MEDCoupling::DataArrayInt::Pow;
111 %newobject MEDCoupling::DataArrayInt::BuildUnion;
112 %newobject MEDCoupling::DataArrayInt::BuildIntersection;
113 %newobject MEDCoupling::DataArrayInt::Range;
114 %newobject MEDCoupling::DataArrayInt::indicesOfSubPart;
115 %newobject MEDCoupling::DataArrayInt::fromNoInterlace;
116 %newobject MEDCoupling::DataArrayInt::toNoInterlace;
117 %newobject MEDCoupling::DataArrayInt::buildComplement;
118 %newobject MEDCoupling::DataArrayInt::buildUnion;
119 %newobject MEDCoupling::DataArrayInt::buildSubstraction;
120 %newobject MEDCoupling::DataArrayInt::buildSubstractionOptimized;
121 %newobject MEDCoupling::DataArrayInt::buildIntersection;
122 %newobject MEDCoupling::DataArrayInt::buildUnique;
123 %newobject MEDCoupling::DataArrayInt::buildUniqueNotSorted;
124 %newobject MEDCoupling::DataArrayInt::deltaShiftIndex;
125 %newobject MEDCoupling::DataArrayInt::buildExplicitArrByRanges;
126 %newobject MEDCoupling::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
127 %newobject MEDCoupling::DataArrayInt::findRangeIdForEachTuple;
128 %newobject MEDCoupling::DataArrayInt::findIdInRangeForEachTuple;
129 %newobject MEDCoupling::DataArrayInt::duplicateEachTupleNTimes;
130 %newobject MEDCoupling::DataArrayInt::buildPermutationArr;
131 %newobject MEDCoupling::DataArrayInt::buildPermArrPerLevel;
132 %newobject MEDCoupling::DataArrayInt::getDifferentValues;
133 %newobject MEDCoupling::DataArrayInt::FindPermutationFromFirstToSecond;
134 %newobject MEDCoupling::DataArrayInt::CheckAndPreparePermutation;
135 %newobject MEDCoupling::DataArrayInt::__neg__;
136 %newobject MEDCoupling::DataArrayInt::__add__;
137 %newobject MEDCoupling::DataArrayInt::__radd__;
138 %newobject MEDCoupling::DataArrayInt::__sub__;
139 %newobject MEDCoupling::DataArrayInt::__rsub__;
140 %newobject MEDCoupling::DataArrayInt::__mul__;
141 %newobject MEDCoupling::DataArrayInt::__rmul__;
142 %newobject MEDCoupling::DataArrayInt::__div__;
143 %newobject MEDCoupling::DataArrayInt::__rdiv__;
144 %newobject MEDCoupling::DataArrayInt::__mod__;
145 %newobject MEDCoupling::DataArrayInt::__rmod__;
146 %newobject MEDCoupling::DataArrayInt::__pow__;
147 %newobject MEDCoupling::DataArrayInt::__rpow__;
148 %newobject MEDCoupling::DataArrayIntTuple::buildDAInt;
149 %newobject MEDCoupling::DataArrayChar::convertToIntArr;
150 %newobject MEDCoupling::DataArrayChar::renumber;
151 %newobject MEDCoupling::DataArrayChar::renumberR;
152 %newobject MEDCoupling::DataArrayChar::renumberAndReduce;
153 %newobject MEDCoupling::DataArrayChar::changeNbOfComponents;
154 %newobject MEDCoupling::DataArrayChar::findIdsEqual;
155 %newobject MEDCoupling::DataArrayChar::findIdsNotEqual;
156 %newobject MEDCoupling::DataArrayChar::Aggregate;
157 %newobject MEDCoupling::DataArrayChar::Meld;
158 %newobject MEDCoupling::DataArrayByte::New;
159 %newobject MEDCoupling::DataArrayByte::__iter__;
160 %newobject MEDCoupling::DataArrayByte::performCopyOrIncrRef;
161 %newobject MEDCoupling::DataArrayByteTuple::buildDAByte;
162 %newobject MEDCoupling::DataArrayChar::subArray;
163 %newobject MEDCoupling::DataArrayAsciiChar::New;
164 %newobject MEDCoupling::DataArrayAsciiChar::__iter__;
165 %newobject MEDCoupling::DataArrayAsciiChar::performCopyOrIncrRef;
166 %newobject MEDCoupling::DataArrayAsciiCharTuple::buildDAAsciiChar;
167 %newobject MEDCoupling::DataArrayDouble::New;
168 %newobject MEDCoupling::DataArrayDouble::__iter__;
169 %newobject MEDCoupling::DataArrayDouble::performCopyOrIncrRef;
170 %newobject MEDCoupling::DataArrayDouble::Aggregate;
171 %newobject MEDCoupling::DataArrayDouble::Meld;
172 %newobject MEDCoupling::DataArrayDouble::Dot;
173 %newobject MEDCoupling::DataArrayDouble::CrossProduct;
174 %newobject MEDCoupling::DataArrayDouble::Add;
175 %newobject MEDCoupling::DataArrayDouble::Substract;
176 %newobject MEDCoupling::DataArrayDouble::Multiply;
177 %newobject MEDCoupling::DataArrayDouble::Divide;
178 %newobject MEDCoupling::DataArrayDouble::Pow;
179 %newobject MEDCoupling::DataArrayDouble::symmetry3DPlane;
180 %newobject MEDCoupling::DataArrayDouble::subArray;
181 %newobject MEDCoupling::DataArrayDouble::changeNbOfComponents;
182 %newobject MEDCoupling::DataArrayDouble::accumulatePerChunck;
183 %newobject MEDCoupling::DataArrayDouble::findIdsInRange;
184 %newobject MEDCoupling::DataArrayDouble::findIdsNotInRange;
185 %newobject MEDCoupling::DataArrayDouble::findIdsStrictlyNegative;
186 %newobject MEDCoupling::DataArrayDouble::negate;
187 %newobject MEDCoupling::DataArrayDouble::computeAbs;
188 %newobject MEDCoupling::DataArrayDouble::applyFunc;
189 %newobject MEDCoupling::DataArrayDouble::applyFuncCompo;
190 %newobject MEDCoupling::DataArrayDouble::applyFuncNamedCompo;
191 %newobject MEDCoupling::DataArrayDouble::doublyContractedProduct;
192 %newobject MEDCoupling::DataArrayDouble::determinant;
193 %newobject MEDCoupling::DataArrayDouble::eigenValues;
194 %newobject MEDCoupling::DataArrayDouble::eigenVectors;
195 %newobject MEDCoupling::DataArrayDouble::inverse;
196 %newobject MEDCoupling::DataArrayDouble::trace;
197 %newobject MEDCoupling::DataArrayDouble::deviator;
198 %newobject MEDCoupling::DataArrayDouble::magnitude;
199 %newobject MEDCoupling::DataArrayDouble::maxPerTuple;
200 %newobject MEDCoupling::DataArrayDouble::sumPerTuple;
201 %newobject MEDCoupling::DataArrayDouble::computeBBoxPerTuple;
202 %newobject MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
203 %newobject MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
204 %newobject MEDCoupling::DataArrayDouble::renumber;
205 %newobject MEDCoupling::DataArrayDouble::renumberR;
206 %newobject MEDCoupling::DataArrayDouble::renumberAndReduce;
207 %newobject MEDCoupling::DataArrayDouble::fromNoInterlace;
208 %newobject MEDCoupling::DataArrayDouble::toNoInterlace;
209 %newobject MEDCoupling::DataArrayDouble::fromPolarToCart;
210 %newobject MEDCoupling::DataArrayDouble::fromCylToCart;
211 %newobject MEDCoupling::DataArrayDouble::fromSpherToCart;
212 %newobject MEDCoupling::DataArrayDouble::fromCartToPolar;
213 %newobject MEDCoupling::DataArrayDouble::fromCartToCyl;
214 %newobject MEDCoupling::DataArrayDouble::fromCartToSpher;
215 %newobject MEDCoupling::DataArrayDouble::fromCartToCylGiven;
216 %newobject MEDCoupling::DataArrayDouble::cartesianize;
217 %newobject MEDCoupling::DataArrayDouble::getDifferentValues;
218 %newobject MEDCoupling::DataArrayDouble::findClosestTupleId;
219 %newobject MEDCoupling::DataArrayDouble::computeNbOfInteractionsWith;
220 %newobject MEDCoupling::DataArrayDouble::duplicateEachTupleNTimes;
221 %newobject MEDCoupling::DataArrayDouble::__neg__;
222 %newobject MEDCoupling::DataArrayDouble::__radd__;
223 %newobject MEDCoupling::DataArrayDouble::__rsub__;
224 %newobject MEDCoupling::DataArrayDouble::__rmul__;
225 %newobject MEDCoupling::DataArrayDouble::__rdiv__;
226 %newobject MEDCoupling::DataArrayDouble::__pow__;
227 %newobject MEDCoupling::DataArrayDouble::__rpow__;
228 %newobject MEDCoupling::DataArrayDoubleTuple::buildDADouble;
230 %newobject MEDCoupling::PartDefinition::New;
231 %newobject MEDCoupling::PartDefinition::toDAI;
232 %newobject MEDCoupling::PartDefinition::__add__;
233 %newobject MEDCoupling::PartDefinition::composeWith;
234 %newobject MEDCoupling::PartDefinition::tryToSimplify;
235 %newobject MEDCoupling::DataArrayPartDefinition::New;
236 %newobject MEDCoupling::SlicePartDefinition::New;
239 %feature("unref") DataArray "$this->decrRef();"
240 %feature("unref") DataArrayDouble "$this->decrRef();"
241 %feature("unref") DataArrayInt "$this->decrRef();"
242 %feature("unref") DataArrayChar "$this->decrRef();"
243 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
244 %feature("unref") DataArrayByte "$this->decrRef();"
246 %feature("unref") MapII "$this->decrRef();"
247 %feature("unref") PartDefinition "$this->decrRef();"
248 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
249 %feature("unref") SlicePartDefinition "$this->decrRef();"
251 namespace MEDCoupling
258 } MEDCouplingAxisType;
262 class MapII : public RefCountObject, public TimeLabel
265 static MCAuto< MapII > New();
268 class PartDefinition : public RefCountObject, public TimeLabel
271 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
272 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
273 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
274 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
275 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
276 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
277 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
278 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
281 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
283 return (*self)+other;
286 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
289 bool ret0(self->isEqual(other,ret1));
290 PyObject *ret=PyTuple_New(2);
291 PyObject *ret0Py=ret0?Py_True:Py_False;
293 PyTuple_SetItem(ret,0,ret0Py);
294 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
298 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
300 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
304 virtual ~PartDefinition();
307 class DataArrayPartDefinition : public PartDefinition
310 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
313 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
315 return DataArrayPartDefinition::New(listOfIds);
318 std::string __str__() const throw(INTERP_KERNEL::Exception)
320 return self->getRepr();
323 std::string __repr__() const throw(INTERP_KERNEL::Exception)
325 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
326 oss << self->getRepr();
331 virtual ~DataArrayPartDefinition();
334 class SlicePartDefinition : public PartDefinition
337 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
338 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
341 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
343 return SlicePartDefinition::New(start,stop,step);
346 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
349 self->getSlice(a,b,c);
350 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
353 std::string __str__() const throw(INTERP_KERNEL::Exception)
355 return self->getRepr();
358 std::string __repr__() const throw(INTERP_KERNEL::Exception)
360 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
361 oss << self->getRepr();
366 virtual ~SlicePartDefinition();
369 class DataArray : public RefCountObject, public TimeLabel
372 void setName(const std::string& name);
373 void copyStringInfoFrom(const DataArray& other) throw(INTERP_KERNEL::Exception);
374 void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
375 void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other) throw(INTERP_KERNEL::Exception);
376 bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const throw(INTERP_KERNEL::Exception);
377 bool areInfoEquals(const DataArray& other) const throw(INTERP_KERNEL::Exception);
378 std::string cppRepr(const std::string& varName) const throw(INTERP_KERNEL::Exception);
379 std::string getName() const;
380 void setInfoOnComponents(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
381 void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
382 std::vector<std::string> getVarsOnComponent() const throw(INTERP_KERNEL::Exception);
383 std::vector<std::string> getUnitsOnComponent() const throw(INTERP_KERNEL::Exception);
384 std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);
385 std::string getVarOnComponent(int i) const throw(INTERP_KERNEL::Exception);
386 std::string getUnitOnComponent(int i) const throw(INTERP_KERNEL::Exception);
387 void setInfoOnComponent(int i, const std::string& info) throw(INTERP_KERNEL::Exception);
388 int getNumberOfComponents() const;
389 virtual void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
390 virtual void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
391 virtual bool isAllocated() const throw(INTERP_KERNEL::Exception);
392 virtual void checkAllocated() const throw(INTERP_KERNEL::Exception);
393 virtual void desallocate() throw(INTERP_KERNEL::Exception);
394 virtual int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
395 virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
396 virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
397 virtual DataArray *deepCopy() const throw(INTERP_KERNEL::Exception);
398 virtual DataArray *buildNewEmptyInstance() const throw(INTERP_KERNEL::Exception);
399 virtual DataArray *selectByTupleIdSafeSlice(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
400 virtual void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
401 virtual void circularPermutation(int nbOfShift=1) throw(INTERP_KERNEL::Exception);
402 virtual void circularPermutationPerTuple(int nbOfShift=1) throw(INTERP_KERNEL::Exception);
403 virtual void reversePerTuple() throw(INTERP_KERNEL::Exception);
404 void checkNbOfTuples(int nbOfTuples, const std::string& msg) const throw(INTERP_KERNEL::Exception);
405 void checkNbOfComps(int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
406 void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const throw(INTERP_KERNEL::Exception);
407 void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
408 void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const throw(INTERP_KERNEL::Exception);
409 static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
410 static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
411 static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
412 static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
413 static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
414 static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit) throw(INTERP_KERNEL::Exception);
415 static std::string GetAxisTypeRepr(MEDCouplingAxisType at) throw(INTERP_KERNEL::Exception);
416 void updateTime() const;
419 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
421 const std::vector<std::string>& comps=self->getInfoOnComponents();
422 PyObject *ret=PyList_New((int)comps.size());
423 for(int i=0;i<(int)comps.size();i++)
424 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
428 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
430 std::vector<int> tmp;
431 convertPyToNewIntArr3(li,tmp);
432 self->copyPartOfStringInfoFrom(other,tmp);
435 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
437 std::vector<int> tmp;
438 convertPyToNewIntArr3(li,tmp);
439 self->copyPartOfStringInfoFrom2(tmp,other);
442 virtual void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
445 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
446 if (!SWIG_IsOK(res1))
449 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
450 if(size!=self->getNumberOfTuples())
452 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
454 self->renumberInPlace(tmp);
458 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
460 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
461 da2->checkAllocated();
462 int size=self->getNumberOfTuples();
463 if(size!=self->getNumberOfTuples())
465 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
467 self->renumberInPlace(da2->getConstPointer());
471 virtual void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
474 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
475 if (!SWIG_IsOK(res1))
478 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
479 if(size!=self->getNumberOfTuples())
481 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
483 self->renumberInPlaceR(tmp);
487 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
489 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
490 da2->checkAllocated();
491 int size=self->getNumberOfTuples();
492 if(size!=self->getNumberOfTuples())
494 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
496 self->renumberInPlaceR(da2->getConstPointer());
500 //tuplesSelec in PyObject * because DataArrayInt is not already existing !
501 virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec) throw(INTERP_KERNEL::Exception)
503 static const char msg[]="DataArray::setContigPartOfSelectedValuesSlice : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
504 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValuesSlice : 3rd parameter \"aBase\" should be of type DataArray");
505 DataArray *tuplesSelecPtr=CheckAndRetrieveDataArrayInstance(tuplesSelec,msg);
506 DataArrayInt *tuplesSelecPtr2=0;
509 tuplesSelecPtr2=dynamic_cast<DataArrayInt *>(tuplesSelecPtr);
511 throw INTERP_KERNEL::Exception(msg);
513 self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
516 virtual void setContigPartOfSelectedValuesSlice(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
518 DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValuesSlice : 2nd parameter \"aBase\" should be of type DataArray");
519 self->setContigPartOfSelectedValuesSlice(tupleIdStart,a,bg,end2,step);
522 virtual DataArray *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
524 std::vector<std::pair<int,int> > ranges;
525 convertPyToVectorPairInt(li,ranges);
526 return self->selectByTupleRanges(ranges);
529 virtual DataArray *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
532 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
533 if (!SWIG_IsOK(res1))
536 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
537 return self->selectByTupleId(tmp,tmp+size);
541 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
543 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
544 da2->checkAllocated();
545 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
549 virtual DataArray *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
552 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
553 if (!SWIG_IsOK(res1))
556 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
557 return self->selectByTupleIdSafe(tmp,tmp+size);
561 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
563 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
564 da2->checkAllocated();
565 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
569 virtual PyObject *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
571 std::vector<int> tmp;
572 convertPyToNewIntArr3(li,tmp);
573 DataArray *ret=self->keepSelectedComponents(tmp);
574 return convertDataArray(ret,SWIG_POINTER_OWN | 0 );
577 static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices) throw(INTERP_KERNEL::Exception)
579 if(!PySlice_Check(slic))
580 throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
581 Py_ssize_t strt=2,stp=2,step=2;
582 GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetSlice (wrap) : the input slice is invalid !");
584 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
585 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
588 PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
590 if(!PySlice_Check(slic))
591 throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
592 Py_ssize_t strt=2,stp=2,step=2;
593 GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getSlice (wrap) : the input slice is invalid !");
595 DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
596 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
599 static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
601 if(!PySlice_Check(slic))
602 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
603 Py_ssize_t strt=2,stp=2,step=2;
604 GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
605 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
608 static int GetNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
610 if(!PySlice_Check(slic))
611 throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
612 Py_ssize_t strt=2,stp=2,step=2;
613 GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
614 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
617 static DataArray *Aggregate(PyObject *arrs) throw(INTERP_KERNEL::Exception)
619 std::vector<const DataArray *> tmp;
620 convertFromPyObjVectorOfObj<const MEDCoupling::DataArray *>(arrs,SWIGTYPE_p_MEDCoupling__DataArray,"DataArray",tmp);
621 return DataArray::Aggregate(tmp);
624 int getNumberOfItemGivenBES(PyObject *slic) const throw(INTERP_KERNEL::Exception)
626 if(!PySlice_Check(slic))
627 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
628 Py_ssize_t strt=2,stp=2,step=2;
629 GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
630 return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
633 int getNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
635 if(!PySlice_Check(slic))
636 throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
637 Py_ssize_t strt=2,stp=2,step=2;
638 GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
639 return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
642 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
644 PyObject *ret(PyTuple_New(2));
645 std::string a0(self->getName());
646 const std::vector<std::string> &a1(self->getInfoOnComponents());
647 PyTuple_SetItem(ret,0,PyString_FromString(a0.c_str()));
650 PyObject *ret1(PyList_New(sz));
651 for(int i=0;i<sz;i++)
652 PyList_SetItem(ret1,i,PyString_FromString(a1[i].c_str()));
653 PyTuple_SetItem(ret,1,ret1);
658 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
660 static const char MSG[]="DataArrayDouble.__setstate__ : expected input is a tuple of size 2 with string as 1st arg and list of string as 2nd arg !";
661 if(!PyTuple_Check(inp))
662 throw INTERP_KERNEL::Exception("DataArrayDouble.__setstate__ : invalid input ! Invalid overwrite of __getstate__ ?");
663 int sz(PyTuple_Size(inp));
665 throw INTERP_KERNEL::Exception("DataArrayDouble.__setstate__ : invalid tuple in input ! Should be of size 2 ! Invalid overwrite of __getstate__ ?");
666 PyObject *a0(PyTuple_GetItem(inp,0));
667 self->setName(convertPyObjectToStr(a0,MSG));
668 PyObject *a1(PyTuple_GetItem(inp,1));
669 std::vector<std::string> a1cpp;
670 if(!fillStringVector(a1,a1cpp))
671 throw INTERP_KERNEL::Exception(MSG);
672 self->setInfoOnComponents(a1cpp);
677 class DataArrayDouble;
679 class DataArrayFloat : public DataArray
682 static DataArrayFloat *New();
683 void fillWithValue(float val) throw(INTERP_KERNEL::Exception);
684 bool isEqual(const DataArrayFloat& other, float prec) const throw(INTERP_KERNEL::Exception);
685 bool isEqualWithoutConsideringStr(const DataArrayFloat& other, float prec) const throw(INTERP_KERNEL::Exception);
686 bool isUniform(float val, float eps) const throw(INTERP_KERNEL::Exception);
687 void pushBackSilent(float val) throw(INTERP_KERNEL::Exception);
688 void iota(float init=0.) throw(INTERP_KERNEL::Exception);
689 DataArrayFloatIterator *iterator() throw(INTERP_KERNEL::Exception);
690 MCAuto<DataArrayDouble> convertToDblArr() const throw(INTERP_KERNEL::Exception);
691 static DataArrayFloat *Meld(const DataArrayFloat *a1, const DataArrayFloat *a2) throw(INTERP_KERNEL::Exception);
694 DataArrayFloat() throw(INTERP_KERNEL::Exception)
696 return DataArrayFloat::New();
699 static DataArrayFloat *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
701 return DataArrayT_New<float>(elt0,nbOfTuples,elt2);
704 DataArrayFloat(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
706 return MEDCoupling_DataArrayFloat_New__SWIG_1(elt0,nbOfTuples,elt2);
709 DataArrayFloatIterator *__iter__() throw(INTERP_KERNEL::Exception)
711 return self->iterator();
714 std::string __repr__() const throw(INTERP_KERNEL::Exception)
716 std::ostringstream oss;
717 self->reprQuickOverview(oss);
721 std::string __str__() const throw(INTERP_KERNEL::Exception)
723 return self->reprNotTooLong();
726 int __len__() const throw(INTERP_KERNEL::Exception)
728 if(self->isAllocated())
730 return self->getNumberOfTuples();
734 throw INTERP_KERNEL::Exception("DataArrayFloat::__len__ : Instance is NOT allocated !");
738 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
740 const float *vals(self->begin());
741 return convertDblArrToPyList<float>(vals,self->getNbOfElems());
744 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
746 const float *vals(self->begin());
747 int nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
748 return convertDblArrToPyListOfTuple<float>(vals,nbOfComp,nbOfTuples);
751 PyObject *isEqualIfNotWhy(const DataArrayFloat& other, float prec) const throw(INTERP_KERNEL::Exception)
754 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
755 PyObject *ret=PyTuple_New(2);
756 PyObject *ret0Py=ret0?Py_True:Py_False;
758 PyTuple_SetItem(ret,0,ret0Py);
759 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
763 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
765 return DataArrayT__getitem<float>(self,obj);
768 DataArrayFloat *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
770 return DataArrayT__setitem__<float>(self,obj,value);
773 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
775 return DataArrayT_iadd<float>(trueSelf,obj,self);
778 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
780 return DataArrayT_isub<float>(trueSelf,obj,self);
783 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
785 return DataArrayT_imul<float>(trueSelf,obj,self);
788 DataArrayFloat *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
790 return DataArrayFPT_rmul<float>(self,obj);
793 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
795 return DataArrayT_idiv<float>(trueSelf,obj,self);
799 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
801 return ToNumPyArray<DataArrayFloat,float>(self,NPY_FLOAT,"DataArrayFloat");
807 class DataArrayFloatTuple;
809 class DataArrayFloatIterator
812 DataArrayFloatIterator(DataArrayFloat *da);
813 ~DataArrayFloatIterator();
818 DataArrayFloatTuple *ret=self->nextt();
820 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple,SWIG_POINTER_OWN|0);
823 PyErr_SetString(PyExc_StopIteration,"No more data.");
830 class DataArrayFloatTuple
833 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
834 DataArrayFloat *buildDAFloat(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
837 std::string __str__() const throw(INTERP_KERNEL::Exception)
842 float __float__() const throw(INTERP_KERNEL::Exception)
844 return self->floatValue();
847 DataArrayFloat *buildDAFloat() throw(INTERP_KERNEL::Exception)
849 return self->buildDAFloat(1,self->getNumberOfCompo());
852 /*PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
854 MCAuto<DataArrayFloat> ret=self->buildDAFloat(1,self->getNumberOfCompo());
855 MEDCoupling_DataArrayFloat____imul___(ret,0,obj);
856 Py_XINCREF(trueSelf);
860 PyObject *__len__() throw(INTERP_KERNEL::Exception)
862 return PyInt_FromLong(self->getNumberOfCompo());
868 class DataArrayDoubleIterator;
870 class DataArrayDouble : public DataArray
873 static DataArrayDouble *New();
874 double doubleValue() const throw(INTERP_KERNEL::Exception);
875 bool empty() const throw(INTERP_KERNEL::Exception);
876 void aggregate(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
877 DataArrayDouble *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
878 void deepCopyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
879 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
880 void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
881 double popBackSilent() throw(INTERP_KERNEL::Exception);
882 void pack() const throw(INTERP_KERNEL::Exception);
883 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
884 void fillWithZero() throw(INTERP_KERNEL::Exception);
885 void fillWithValue(double val) throw(INTERP_KERNEL::Exception);
886 void iota(double init=0.) throw(INTERP_KERNEL::Exception);
887 bool isUniform(double val, double eps) const throw(INTERP_KERNEL::Exception);
888 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
889 void reverse() throw(INTERP_KERNEL::Exception);
890 void checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
891 bool isMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
892 std::string repr() const throw(INTERP_KERNEL::Exception);
893 std::string reprZip() const throw(INTERP_KERNEL::Exception);
894 std::string reprNotTooLong() const throw(INTERP_KERNEL::Exception);
895 bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
896 bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
897 DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
898 DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
899 DataArrayDouble *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
900 void transpose() throw(INTERP_KERNEL::Exception);
901 DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
902 void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
903 DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
904 DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception);
905 DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
906 DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const throw(INTERP_KERNEL::Exception);
907 void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
908 void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
909 void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
910 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
911 double front() const throw(INTERP_KERNEL::Exception);
912 double back() const throw(INTERP_KERNEL::Exception);
913 double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
914 void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
915 void setIJSilent(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
916 double *getPointer() throw(INTERP_KERNEL::Exception);
917 void checkNoNullValues() const throw(INTERP_KERNEL::Exception);
918 DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const throw(INTERP_KERNEL::Exception);
919 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
920 double getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
921 double getMaxAbsValueInArray() const throw(INTERP_KERNEL::Exception);
922 double getMinValueInArray() const throw(INTERP_KERNEL::Exception);
923 int count(double value, double eps) const throw(INTERP_KERNEL::Exception);
924 double getAverageValue() const throw(INTERP_KERNEL::Exception);
925 double norm2() const throw(INTERP_KERNEL::Exception);
926 double normMax() const throw(INTERP_KERNEL::Exception);
927 double normMin() const throw(INTERP_KERNEL::Exception);
928 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
929 DataArrayDouble *fromPolarToCart() const throw(INTERP_KERNEL::Exception);
930 DataArrayDouble *fromCylToCart() const throw(INTERP_KERNEL::Exception);
931 DataArrayDouble *fromSpherToCart() const throw(INTERP_KERNEL::Exception);
932 DataArrayDouble *fromCartToPolar() const throw(INTERP_KERNEL::Exception);
933 DataArrayDouble *fromCartToCyl() const throw(INTERP_KERNEL::Exception);
934 DataArrayDouble *fromCartToSpher() const throw(INTERP_KERNEL::Exception);
935 DataArrayDouble *cartesianize(MEDCouplingAxisType atOfThis) const throw(INTERP_KERNEL::Exception);
936 DataArrayDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
937 DataArrayDouble *determinant() const throw(INTERP_KERNEL::Exception);
938 DataArrayDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
939 DataArrayDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
940 DataArrayDouble *inverse() const throw(INTERP_KERNEL::Exception);
941 DataArrayDouble *trace() const throw(INTERP_KERNEL::Exception);
942 DataArrayDouble *deviator() const throw(INTERP_KERNEL::Exception);
943 DataArrayDouble *magnitude() const throw(INTERP_KERNEL::Exception);
944 DataArrayDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
945 DataArrayDouble *sumPerTuple() const throw(INTERP_KERNEL::Exception);
946 DataArrayDouble *buildEuclidianDistanceDenseMatrix() const throw(INTERP_KERNEL::Exception);
947 DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
948 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
949 void abs() throw(INTERP_KERNEL::Exception);
950 DataArrayDouble *computeAbs() const throw(INTERP_KERNEL::Exception);
951 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
952 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
953 void applyInv(double numerator) throw(INTERP_KERNEL::Exception);
954 void applyPow(double val) throw(INTERP_KERNEL::Exception);
955 void applyRPow(double val) throw(INTERP_KERNEL::Exception);
956 DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
957 DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
958 DataArrayDouble *applyFunc(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
959 DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
960 void applyFuncOnThis(const std::string& func, bool isSafe=true) throw(INTERP_KERNEL::Exception);
961 DataArrayDouble *applyFuncCompo(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
962 DataArrayDouble *applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
963 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
964 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
965 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
966 DataArrayInt *findIdsNotInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
967 DataArrayInt *findIdsStrictlyNegative() const throw(INTERP_KERNEL::Exception);
968 static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
969 static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
970 static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
971 static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
972 static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
973 static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
974 static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
975 void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
976 static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
977 void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
978 static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
979 void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
980 static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
981 void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
982 static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
983 void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
984 MCAuto<DataArrayInt> findIdsGreaterOrEqualTo(double val) const throw(INTERP_KERNEL::Exception);
985 MCAuto<DataArrayInt> findIdsGreaterThan(double val) const throw(INTERP_KERNEL::Exception);
986 MCAuto<DataArrayInt> findIdsLowerOrEqualTo(double val) const throw(INTERP_KERNEL::Exception);
987 MCAuto<DataArrayInt> findIdsLowerThan(double val) const throw(INTERP_KERNEL::Exception);
988 MCAuto<DataArrayInt> convertToIntArr() const throw(INTERP_KERNEL::Exception);
989 MCAuto<DataArrayDouble> selectPartDef(const PartDefinition* pd) const throw(INTERP_KERNEL::Exception);
990 MCAuto<DataArrayDouble> cumSum() const throw(INTERP_KERNEL::Exception);
991 MCAuto<DataArrayFloat> convertToFloatArr() const throw(INTERP_KERNEL::Exception);
994 DataArrayDouble() throw(INTERP_KERNEL::Exception)
996 return DataArrayDouble::New();
999 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
1001 return DataArrayT_New<double>(elt0,nbOfTuples,elt2);
1004 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
1006 return MEDCoupling_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
1009 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
1012 std::vector<double> bb;
1014 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
1015 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
1016 self->pushBackValsSilent(tmp,tmp+nbTuples);
1019 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1021 std::ostringstream oss;
1022 self->reprQuickOverview(oss);
1026 std::string __str__() const throw(INTERP_KERNEL::Exception)
1028 return self->reprNotTooLong();
1031 double __float__() const throw(INTERP_KERNEL::Exception)
1033 return self->doubleValue();
1036 int __len__() const throw(INTERP_KERNEL::Exception)
1038 if(self->isAllocated())
1040 return self->getNumberOfTuples();
1044 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
1048 PyObject *asArcOfCircle() const throw(INTERP_KERNEL::Exception)
1050 double center[2],radius,ang;
1051 self->asArcOfCircle(center,radius,ang);
1052 PyObject *ret(PyTuple_New(3));
1054 PyObject *ret0(PyList_New(2));
1055 PyList_SetItem(ret0,0,PyFloat_FromDouble(center[0]));
1056 PyList_SetItem(ret0,1,PyFloat_FromDouble(center[1]));
1057 PyTuple_SetItem(ret,0,ret0);
1059 PyTuple_SetItem(ret,1,PyFloat_FromDouble(radius));
1060 PyTuple_SetItem(ret,2,PyFloat_FromDouble(ang));
1064 DataArrayDoubleIterator *__iter__() throw(INTERP_KERNEL::Exception)
1066 return self->iterator();
1069 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
1071 const char *msg="MEDCoupling::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 !";
1072 if(PyList_Check(li) || PyTuple_Check(li))
1076 if(PyInt_Check(nbOfTuples))
1078 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
1080 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
1083 if(PyInt_Check(nbOfComp))
1084 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
1085 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
1087 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
1088 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
1089 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
1092 throw INTERP_KERNEL::Exception(msg);
1095 {//DataArrayDouble.setValues([1.,3.,4.],3)
1097 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
1098 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
1102 throw INTERP_KERNEL::Exception(msg);
1105 {// DataArrayDouble.setValues([1.,3.,4.])
1106 int tmpp1=-1,tmpp2=-1;
1107 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
1108 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
1112 throw INTERP_KERNEL::Exception(msg);
1115 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
1117 const double *vals(self->begin());
1118 return convertDblArrToPyList<double>(vals,self->getNbOfElems());
1122 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
1124 return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
1128 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
1131 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
1132 PyObject *ret=PyTuple_New(2);
1133 PyObject *ret0Py=ret0?Py_True:Py_False;
1135 PyTuple_SetItem(ret,0,ret0Py);
1136 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
1140 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
1142 const double *vals(self->begin());
1143 int nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
1144 return convertDblArrToPyListOfTuple<double>(vals,nbOfComp,nbOfTuples);
1147 DataArrayDouble *symmetry3DPlane(PyObject *point, PyObject *normalVector) throw(INTERP_KERNEL::Exception)
1149 const char msg[]="Python wrap of DataArrayDouble::symmetry3DPlane : ";
1151 DataArrayDouble *a,*a2;
1152 DataArrayDoubleTuple *aa,*aa2;
1153 std::vector<double> bb,bb2;
1155 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1156 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1157 MCAuto<DataArrayDouble> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1161 static PyObject *GiveBaseForPlane(PyObject *normalVector) throw(INTERP_KERNEL::Exception)
1163 const char msg[]="Python wrap of DataArrayDouble::GiveBaseForPlane : ";
1165 DataArrayDouble *a,*a2;
1166 DataArrayDoubleTuple *aa,*aa2;
1167 std::vector<double> bb,bb2;
1169 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val,a,aa,bb,msg,1,3,true));
1171 DataArrayDouble::GiveBaseForPlane(vectorPtr,res);
1172 return convertDblArrToPyListOfTuple<double>(res,3,3);
1175 DataArrayDouble *fromCartToCylGiven(const DataArrayDouble *coords, PyObject *center, PyObject *vector) const
1177 const char msg[]="Python wrap of DataArrayDouble::fromCartToCylGiven : ";
1179 DataArrayDouble *a,*a2;
1180 DataArrayDoubleTuple *aa,*aa2;
1181 std::vector<double> bb,bb2;
1183 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
1184 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
1185 return self->fromCartToCylGiven(coords,centerPtr,vectorPtr);
1188 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
1191 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1192 if (!SWIG_IsOK(res1))
1195 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1196 if(size!=self->getNumberOfTuples())
1198 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1200 return self->renumber(tmp);
1204 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1206 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1207 da2->checkAllocated();
1208 int size=self->getNumberOfTuples();
1209 if(size!=self->getNumberOfTuples())
1211 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1213 return self->renumber(da2->getConstPointer());
1217 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
1220 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1221 if (!SWIG_IsOK(res1))
1224 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1225 if(size!=self->getNumberOfTuples())
1227 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1229 return self->renumberR(tmp);
1233 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1235 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1236 da2->checkAllocated();
1237 int size=self->getNumberOfTuples();
1238 if(size!=self->getNumberOfTuples())
1240 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1242 return self->renumberR(da2->getConstPointer());
1246 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
1249 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1250 if (!SWIG_IsOK(res1))
1253 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1254 if(size!=self->getNumberOfTuples())
1256 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1258 return self->renumberAndReduce(tmp,newNbOfTuple);
1262 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1264 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1265 da2->checkAllocated();
1266 int size=self->getNumberOfTuples();
1267 if(size!=self->getNumberOfTuples())
1269 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1271 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
1275 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
1277 int thisTupleId,otherTupleId;
1278 double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
1279 PyObject *ret=PyTuple_New(3);
1280 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
1281 PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
1282 PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
1286 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
1289 double r1=self->getMaxValue(tmp);
1290 PyObject *ret=PyTuple_New(2);
1291 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
1292 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
1296 PyObject *getMaxAbsValue() const throw(INTERP_KERNEL::Exception)
1299 double r1=self->getMaxAbsValue(tmp);
1300 PyObject *ret=PyTuple_New(2);
1301 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
1302 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
1306 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
1309 double r1=self->getMaxValue2(tmp);
1310 PyObject *ret=PyTuple_New(2);
1311 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
1312 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1316 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
1319 double r1=self->getMinValue(tmp);
1320 PyObject *ret=PyTuple_New(2);
1321 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
1322 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
1326 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
1329 double r1=self->getMinValue2(tmp);
1330 PyObject *ret=PyTuple_New(2);
1331 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
1332 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1336 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
1338 int nbOfCompo(self->getNumberOfComponents());
1339 INTERP_KERNEL::AutoPtr<double> tmp(new double[2*nbOfCompo]);
1340 self->getMinMaxPerComponent(tmp);
1341 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,nbOfCompo);
1345 PyObject *normMaxPerComponent() const throw(INTERP_KERNEL::Exception)
1347 int nbOfCompo(self->getNumberOfComponents());
1348 INTERP_KERNEL::AutoPtr<double> tmp(new double[nbOfCompo]);
1349 self->normMaxPerComponent(tmp);
1350 return convertDblArrToPyList<double>(tmp,nbOfCompo);
1353 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
1355 int sz=self->getNumberOfComponents();
1356 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
1357 self->accumulate(tmp);
1358 return convertDblArrToPyList<double>(tmp,sz);
1361 DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
1364 std::vector<int> val2;
1365 const int *bg=convertIntStarLikePyObjToCppIntStar(indexArr,sw,sz,val,val2);
1366 return self->accumulatePerChunck(bg,bg+sz);
1369 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
1371 DataArrayInt *comm, *commIndex;
1372 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
1373 PyObject *res = PyList_New(2);
1374 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1375 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1379 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
1383 DataArrayDoubleTuple *aa;
1384 std::vector<double> bb;
1386 int tupleId=-1,nbOfCompo=self->getNumberOfComponents();
1387 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
1389 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
1390 PyObject *ret=PyTuple_New(2);
1391 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1392 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
1396 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
1398 std::vector<int> tmp;
1399 convertPyToNewIntArr3(li,tmp);
1400 self->setSelectedComponents(a,tmp);
1403 PyObject *explodeComponents() const throw(INTERP_KERNEL::Exception)
1405 std::vector< MCAuto<DataArrayDouble> > retCpp(self->explodeComponents());
1406 std::size_t sz(retCpp.size());
1407 PyObject *res(PyList_New(sz));
1408 for(std::size_t i=0;i<sz;i++)
1409 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i].retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1413 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
1415 int sz=self->getNumberOfComponents();
1416 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
1417 self->getTuple(tupleId,tmp);
1418 return convertDblArrToPyList<double>(tmp,sz);
1421 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
1423 std::vector<const DataArrayDouble *> tmp;
1424 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
1425 return DataArrayDouble::Aggregate(tmp);
1428 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
1430 std::vector<const DataArrayDouble *> tmp;
1431 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
1432 return DataArrayDouble::Meld(tmp);
1435 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1439 DataArrayDoubleTuple *aa;
1440 std::vector<double> bb;
1442 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
1443 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
1444 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
1445 MCAuto<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
1446 DataArrayInt *c=0,*cI=0;
1447 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
1448 PyObject *ret=PyTuple_New(2);
1449 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1450 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1454 PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const throw(INTERP_KERNEL::Exception)
1456 DataArrayInt *ret1=0;
1457 bool ret0=self->areIncludedInMe(other,prec,ret1);
1458 PyObject *ret=PyTuple_New(2);
1459 PyObject *ret0Py=ret0?Py_True:Py_False;
1461 PyTuple_SetItem(ret,0,ret0Py);
1462 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1466 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1468 return DataArrayT__getitem<double>(self,obj);
1471 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
1473 return DataArrayT__setitem__<double>(self,obj,value);
1476 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
1478 return self->negate();
1481 PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1483 const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
1486 DataArrayDoubleTuple *aa;
1487 std::vector<double> bb;
1490 #ifndef WITHOUT_AUTOFIELD
1492 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
1494 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
1497 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
1498 MCAuto<MEDCouplingFieldDouble> ret=MEDCoupling_MEDCouplingFieldDouble___radd__Impl(other,tmp);
1500 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1503 throw INTERP_KERNEL::Exception(msg);
1507 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1512 MCAuto<DataArrayDouble> ret=self->deepCopy();
1513 ret->applyLin(1.,val);
1514 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1518 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1522 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1523 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1527 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1528 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1531 throw INTERP_KERNEL::Exception(msg);
1535 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1537 const char msg[]="Unexpected situation in __radd__ !";
1540 DataArrayDoubleTuple *aa;
1541 std::vector<double> bb;
1543 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1548 MCAuto<DataArrayDouble> ret=self->deepCopy();
1549 ret->applyLin(1.,val);
1554 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1555 return DataArrayDouble::Add(self,aaa);
1559 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1560 return DataArrayDouble::Add(self,aaa);
1563 throw INTERP_KERNEL::Exception(msg);
1567 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1569 return DataArrayT_iadd<double>(trueSelf,obj,self);
1572 PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1574 const char msg[]="Unexpected situation in __sub__ !";
1577 DataArrayDoubleTuple *aa;
1578 std::vector<double> bb;
1581 #ifndef WITHOUT_AUTOFIELD
1583 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
1585 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
1588 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
1589 MCAuto<MEDCouplingFieldDouble> ret=MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
1591 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1594 throw INTERP_KERNEL::Exception(msg);
1598 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1603 MCAuto<DataArrayDouble> ret=self->deepCopy();
1604 ret->applyLin(1.,-val);
1605 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1609 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1613 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1614 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1618 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1619 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1622 throw INTERP_KERNEL::Exception(msg);
1626 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1628 const char msg[]="Unexpected situation in __rsub__ !";
1631 DataArrayDoubleTuple *aa;
1632 std::vector<double> bb;
1634 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1639 MCAuto<DataArrayDouble> ret=self->deepCopy();
1640 ret->applyLin(-1.,val);
1645 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1646 return DataArrayDouble::Substract(aaa,self);
1650 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1651 return DataArrayDouble::Substract(aaa,self);
1654 throw INTERP_KERNEL::Exception(msg);
1658 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1660 return DataArrayT_isub<double>(trueSelf,obj,self);
1663 PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1665 const char msg[]="Unexpected situation in __mul__ !";
1668 DataArrayDoubleTuple *aa;
1669 std::vector<double> bb;
1672 #ifndef WITHOUT_AUTOFIELD
1674 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
1676 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
1679 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
1680 MCAuto<MEDCouplingFieldDouble> ret=MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
1682 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1685 throw INTERP_KERNEL::Exception(msg);
1689 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1694 MCAuto<DataArrayDouble> ret=self->deepCopy();
1695 ret->applyLin(val,0.);
1696 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1700 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1704 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1705 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1709 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1710 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1713 throw INTERP_KERNEL::Exception(msg);
1717 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1719 return DataArrayFPT_rmul<double>(self,obj);
1722 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1724 return DataArrayT_imul<double>(trueSelf,obj,self);
1727 PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1729 const char msg[]="Unexpected situation in __div__ !";
1732 DataArrayDoubleTuple *aa;
1733 std::vector<double> bb;
1736 #ifndef WITHOUT_AUTOFIELD
1738 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
1740 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
1743 PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
1744 MCAuto<MEDCouplingFieldDouble> ret=MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
1746 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
1749 throw INTERP_KERNEL::Exception(msg);
1753 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1759 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
1760 MCAuto<DataArrayDouble> ret=self->deepCopy();
1761 ret->applyLin(1/val,0.);
1762 return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1766 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1770 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1771 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1775 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1776 return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
1779 throw INTERP_KERNEL::Exception(msg);
1783 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1785 const char msg[]="Unexpected situation in __rdiv__ !";
1788 DataArrayDoubleTuple *aa;
1789 std::vector<double> bb;
1791 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1796 MCAuto<DataArrayDouble> ret=self->deepCopy();
1802 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1803 return DataArrayDouble::Divide(aaa,self);
1807 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1808 return DataArrayDouble::Divide(aaa,self);
1811 throw INTERP_KERNEL::Exception(msg);
1815 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1817 return DataArrayT_idiv<double>(trueSelf,obj,self);
1820 DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1822 const char msg[]="Unexpected situation in __pow__ !";
1825 DataArrayDoubleTuple *aa;
1826 std::vector<double> bb;
1828 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1833 MCAuto<DataArrayDouble> ret=self->deepCopy();
1839 return DataArrayDouble::Pow(self,a);
1843 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1844 return DataArrayDouble::Pow(self,aaa);
1848 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1849 return DataArrayDouble::Pow(self,aaa);
1852 throw INTERP_KERNEL::Exception(msg);
1856 DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1858 const char msg[]="Unexpected situation in __rpow__ !";
1861 DataArrayDoubleTuple *aa;
1862 std::vector<double> bb;
1864 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1869 MCAuto<DataArrayDouble> ret=self->deepCopy();
1870 ret->applyRPow(val);
1875 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1876 return DataArrayDouble::Pow(aaa,self);
1880 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1881 return DataArrayDouble::Pow(aaa,self);
1884 throw INTERP_KERNEL::Exception(msg);
1888 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
1890 const char msg[]="Unexpected situation in __ipow__ !";
1893 DataArrayDoubleTuple *aa;
1894 std::vector<double> bb;
1896 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
1901 self->applyPow(val);
1902 Py_XINCREF(trueSelf);
1908 Py_XINCREF(trueSelf);
1913 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
1914 self->powEqual(aaa);
1915 Py_XINCREF(trueSelf);
1920 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
1921 self->powEqual(aaa);
1922 Py_XINCREF(trueSelf);
1926 throw INTERP_KERNEL::Exception(msg);
1930 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
1932 DataArrayInt *c=0,*cI=0;
1934 self->computeTupleIdsNearTuples(other,eps,c,cI);
1935 PyObject *ret=PyTuple_New(2);
1936 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1937 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1941 PyObject *maxPerTupleWithCompoId() const throw(INTERP_KERNEL::Exception)
1943 DataArrayInt *ret1=0;
1944 DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
1945 PyObject *ret=PyTuple_New(2);
1946 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1947 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1953 class DataArrayDoubleTuple;
1955 class DataArrayDoubleIterator
1958 DataArrayDoubleIterator(DataArrayDouble *da);
1959 ~DataArrayDoubleIterator();
1964 DataArrayDoubleTuple *ret=self->nextt();
1966 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
1969 PyErr_SetString(PyExc_StopIteration,"No more data.");
1976 class DataArrayDoubleTuple
1979 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
1980 DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
1983 std::string __str__() const throw(INTERP_KERNEL::Exception)
1985 return self->repr();
1988 double __float__() const throw(INTERP_KERNEL::Exception)
1990 return self->doubleValue();
1993 DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
1995 return self->buildDADouble(1,self->getNumberOfCompo());
1998 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2000 MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2001 MEDCoupling_DataArrayDouble____iadd___(ret,0,obj);
2002 Py_XINCREF(trueSelf);
2006 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2008 MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2009 MEDCoupling_DataArrayDouble____isub___(ret,0,obj);
2010 Py_XINCREF(trueSelf);
2014 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2016 MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2017 MEDCoupling_DataArrayDouble____imul___(ret,0,obj);
2018 Py_XINCREF(trueSelf);
2022 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2024 MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2025 MEDCoupling_DataArrayDouble____idiv___(ret,0,obj);
2026 Py_XINCREF(trueSelf);
2030 PyObject *__len__() throw(INTERP_KERNEL::Exception)
2032 return PyInt_FromLong(self->getNumberOfCompo());
2035 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2037 const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
2040 std::vector<int> multiVal;
2041 std::pair<int, std::pair<int,int> > slic;
2042 MEDCoupling::DataArrayInt *daIntTyypp=0;
2043 const double *pt=self->getConstPointer();
2044 int nbc=self->getNumberOfCompo();
2045 convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2052 std::ostringstream oss;
2053 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2054 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
2058 return PyFloat_FromDouble(pt[singleVal]);
2062 return PyFloat_FromDouble(pt[nbc+singleVal]);
2065 std::ostringstream oss;
2066 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2067 throw INTERP_KERNEL::Exception(oss.str().c_str());
2073 PyObject *t=PyTuple_New(multiVal.size());
2074 for(int j=0;j<(int)multiVal.size();j++)
2076 int cid=multiVal[j];
2079 std::ostringstream oss;
2080 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2081 throw INTERP_KERNEL::Exception(oss.str().c_str());
2083 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2089 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2090 PyObject *t=PyTuple_New(sz);
2091 for(int j=0;j<sz;j++)
2092 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2096 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2100 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2102 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2103 const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
2106 std::vector<double> multiValV;
2107 MEDCoupling::DataArrayDoubleTuple *daIntTyyppV=0;
2108 int nbc=self->getNumberOfCompo();
2109 convertDoubleStarLikePyObjToCpp(value,sw1,singleValV,multiValV,daIntTyyppV);
2111 std::vector<int> multiVal;
2112 std::pair<int, std::pair<int,int> > slic;
2113 MEDCoupling::DataArrayInt *daIntTyypp=0;
2114 double *pt=self->getPointer();
2115 convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2122 std::ostringstream oss;
2123 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2124 throw INTERP_KERNEL::Exception(oss.str().c_str());
2130 pt[singleVal]=singleValV;
2135 if(multiValV.size()!=1)
2137 std::ostringstream oss;
2138 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2139 throw INTERP_KERNEL::Exception(oss.str().c_str());
2141 pt[singleVal]=multiValV[0];
2146 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2150 throw INTERP_KERNEL::Exception(msg);
2159 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2163 std::ostringstream oss;
2164 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2165 throw INTERP_KERNEL::Exception(oss.str().c_str());
2173 if(multiVal.size()!=multiValV.size())
2175 std::ostringstream oss;
2176 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2177 throw INTERP_KERNEL::Exception(oss.str().c_str());
2179 for(int i=0;i<(int)multiVal.size();i++)
2181 int pos=multiVal[i];
2184 std::ostringstream oss;
2185 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2186 throw INTERP_KERNEL::Exception(oss.str().c_str());
2188 pt[multiVal[i]]=multiValV[i];
2194 const double *ptV=daIntTyyppV->getConstPointer();
2195 if(nbc>daIntTyyppV->getNumberOfCompo())
2197 std::ostringstream oss;
2198 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2199 throw INTERP_KERNEL::Exception(oss.str().c_str());
2201 std::copy(ptV,ptV+nbc,pt);
2205 throw INTERP_KERNEL::Exception(msg);
2210 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
2215 for(int j=0;j<sz;j++)
2216 pt[slic.first+j*slic.second.second]=singleValV;
2221 if(sz!=(int)multiValV.size())
2223 std::ostringstream oss;
2224 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2225 throw INTERP_KERNEL::Exception(oss.str().c_str());
2227 for(int j=0;j<sz;j++)
2228 pt[slic.first+j*slic.second.second]=multiValV[j];
2233 const double *ptV=daIntTyyppV->getConstPointer();
2234 if(sz>daIntTyyppV->getNumberOfCompo())
2236 std::ostringstream oss;
2237 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2238 throw INTERP_KERNEL::Exception(oss.str().c_str());
2240 for(int j=0;j<sz;j++)
2241 pt[slic.first+j*slic.second.second]=ptV[j];
2245 throw INTERP_KERNEL::Exception(msg);
2249 throw INTERP_KERNEL::Exception(msg);
2255 class DataArrayIntIterator;
2257 class DataArrayInt : public DataArray
2260 static DataArrayInt *New();
2261 int intValue() const throw(INTERP_KERNEL::Exception);
2262 int getHashCode() const throw(INTERP_KERNEL::Exception);
2263 bool empty() const throw(INTERP_KERNEL::Exception);
2264 void aggregate(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2265 DataArrayInt *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
2266 void deepCopyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
2267 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
2268 void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
2269 int popBackSilent() throw(INTERP_KERNEL::Exception);
2270 void pack() const throw(INTERP_KERNEL::Exception);
2271 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
2272 bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2273 bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2274 bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2275 DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
2276 DataArrayInt *sumPerTuple() const throw(INTERP_KERNEL::Exception);
2277 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
2278 void reverse() throw(INTERP_KERNEL::Exception);
2279 void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2280 bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2281 void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2282 bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
2283 void fillWithZero() throw(INTERP_KERNEL::Exception);
2284 void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
2285 void iota(int init=0) throw(INTERP_KERNEL::Exception);
2286 std::string repr() const throw(INTERP_KERNEL::Exception);
2287 std::string reprZip() const throw(INTERP_KERNEL::Exception);
2288 std::string reprNotTooLong() const throw(INTERP_KERNEL::Exception);
2289 DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2290 DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
2291 DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
2292 MCAuto< MapII > invertArrayN2O2O2NOptimized() const throw(INTERP_KERNEL::Exception);
2293 MCAuto< MapII > giveN2OOptimized() const throw(INTERP_KERNEL::Exception);
2294 DataArrayInt *indicesOfSubPart(const DataArrayInt& partOfThis) const throw(INTERP_KERNEL::Exception);
2295 DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
2296 DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
2297 DataArrayInt *selectByTupleIdSafeSlice(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
2298 DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
2299 DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
2300 bool isIota(int sizeExpected) const throw(INTERP_KERNEL::Exception);
2301 bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
2302 int checkUniformAndGuess() const throw(INTERP_KERNEL::Exception);
2303 bool hasUniqueValues() const throw(INTERP_KERNEL::Exception);
2304 DataArrayInt *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
2305 void transpose() throw(INTERP_KERNEL::Exception);
2306 DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
2307 void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2308 void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
2309 void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
2310 void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
2311 void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
2312 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2313 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2314 int front() const throw(INTERP_KERNEL::Exception);
2315 int back() const throw(INTERP_KERNEL::Exception);
2316 void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2317 void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
2318 int *getPointer() throw(INTERP_KERNEL::Exception);
2319 const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
2320 DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
2321 const int *begin() const throw(INTERP_KERNEL::Exception);
2322 const int *end() const throw(INTERP_KERNEL::Exception);
2323 DataArrayInt *findIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
2324 DataArrayInt *findIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
2325 int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
2326 int findIdFirstEqualTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2327 int findIdFirstEqual(int value) const throw(INTERP_KERNEL::Exception);
2328 int findIdFirstEqual(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2329 int findIdSequence(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2330 bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
2331 bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
2332 bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
2333 int count(int value) const throw(INTERP_KERNEL::Exception);
2334 int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2335 int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
2336 int getMaxAbsValueInArray() const throw(INTERP_KERNEL::Exception);
2337 int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
2338 void abs() throw(INTERP_KERNEL::Exception);
2339 DataArrayInt *computeAbs() const throw(INTERP_KERNEL::Exception);
2340 void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
2341 void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
2342 void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
2343 DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
2344 void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
2345 void applyModulus(int val) throw(INTERP_KERNEL::Exception);
2346 void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
2347 void applyPow(int val) throw(INTERP_KERNEL::Exception);
2348 void applyRPow(int val) throw(INTERP_KERNEL::Exception);
2349 DataArrayInt *findIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2350 DataArrayInt *findIdsNotInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2351 DataArrayInt *findIdsStrictlyNegative() const throw(INTERP_KERNEL::Exception);
2352 bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
2353 static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
2354 static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2355 static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
2356 static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2357 static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
2358 static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2) throw(INTERP_KERNEL::Exception);
2359 DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
2360 DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2361 DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2362 DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2363 DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
2364 DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
2365 DataArrayInt *buildUniqueNotSorted() const throw(INTERP_KERNEL::Exception);
2366 DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
2367 void computeOffsets() throw(INTERP_KERNEL::Exception);
2368 void computeOffsetsFull() throw(INTERP_KERNEL::Exception);
2369 DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
2370 DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2371 DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
2372 void sortEachPairToMakeALinkedList() throw(INTERP_KERNEL::Exception);
2373 DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
2374 DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
2375 static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2376 void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2377 static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2378 void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2379 static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2380 void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2381 static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2382 void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2383 static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2384 void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2385 static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
2386 void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
2387 MCAuto<DataArrayInt> fromLinkedListOfPairToList() const throw(INTERP_KERNEL::Exception);
2388 MCAuto<DataArrayInt> findIdsGreaterOrEqualTo(int val) const throw(INTERP_KERNEL::Exception);
2389 MCAuto<DataArrayInt> findIdsGreaterThan(int val) const throw(INTERP_KERNEL::Exception);
2390 MCAuto<DataArrayInt> findIdsLowerOrEqualTo(int val) const throw(INTERP_KERNEL::Exception);
2391 MCAuto<DataArrayInt> findIdsLowerThan(int val) const throw(INTERP_KERNEL::Exception);
2392 MCAuto<DataArrayInt> selectPartDef(const PartDefinition* pd) const throw(INTERP_KERNEL::Exception);
2393 MCAuto<DataArrayDouble> convertToDblArr() const throw(INTERP_KERNEL::Exception);
2394 MCAuto<DataArrayFloat> convertToFloatArr() const throw(INTERP_KERNEL::Exception);
2396 static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
2399 DataArrayInt() throw(INTERP_KERNEL::Exception)
2401 return DataArrayInt::New();
2404 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2406 const char *msgBase="MEDCoupling::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)";
2407 std::string msg(msgBase);
2409 msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
2412 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2416 if(PyInt_Check(nbOfTuples))
2418 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2420 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2423 if(PyInt_Check(nbOfComp))
2424 {//DataArrayInt.New([1,3,4,5],2,2)
2425 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2427 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2428 MCAuto<DataArrayInt> ret=DataArrayInt::New();
2429 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
2430 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2434 throw INTERP_KERNEL::Exception(msg.c_str());
2437 {//DataArrayInt.New([1,3,4],3)
2438 MCAuto<DataArrayInt> ret=DataArrayInt::New();
2440 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
2441 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2446 throw INTERP_KERNEL::Exception(msg.c_str());
2449 {// DataArrayInt.New([1,3,4])
2450 MCAuto<DataArrayInt> ret=DataArrayInt::New();
2451 int tmpp1=-1,tmpp2=-1;
2452 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
2453 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2457 else if(PyInt_Check(elt0))
2459 int nbOfTuples1=PyInt_AS_LONG(elt0);
2461 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
2466 if(PyInt_Check(nbOfTuples))
2467 {//DataArrayInt.New(5,2)
2468 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2470 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
2471 MCAuto<DataArrayInt> ret=DataArrayInt::New();
2472 ret->alloc(nbOfTuples1,nbOfCompo);
2476 throw INTERP_KERNEL::Exception(msg.c_str());
2479 throw INTERP_KERNEL::Exception(msg.c_str());
2482 {//DataArrayInt.New(5)
2483 MCAuto<DataArrayInt> ret=DataArrayInt::New();
2484 ret->alloc(nbOfTuples1,1);
2489 else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
2490 {//DataArrayInt.New(numpyArray)
2491 return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
2495 throw INTERP_KERNEL::Exception(msg.c_str());
2496 throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
2499 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2501 return MEDCoupling_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
2504 std::string __str__() const throw(INTERP_KERNEL::Exception)
2506 return self->reprNotTooLong();
2509 int __len__() const throw(INTERP_KERNEL::Exception)
2511 if(self->isAllocated())
2513 return self->getNumberOfTuples();
2517 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
2521 int __int__() const throw(INTERP_KERNEL::Exception)
2523 return self->intValue();
2526 DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
2528 return self->iterator();
2531 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
2533 int sz=self->getNumberOfComponents();
2534 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2535 self->accumulate(tmp);
2536 return convertIntArrToPyList(tmp,sz);
2539 DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
2542 std::vector<int> val2;
2543 const int *bg=convertIntStarLikePyObjToCppIntStar(indexArr,sw,sz,val,val2);
2544 return self->accumulatePerChunck(bg,bg+sz);
2547 DataArrayInt *findIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
2550 std::vector<int> val2;
2551 const int *bg(convertIntStarLikePyObjToCppIntStar(inputTuple,sw,sz,val,val2));
2552 return self->findIdsEqualTuple(bg,bg+sz);
2555 DataArrayInt *findIdForEach(PyObject *vals) const throw(INTERP_KERNEL::Exception)
2558 std::vector<int> val2;
2559 const int *bg(convertIntStarLikePyObjToCppIntStar(vals,sw,sz,val,val2));
2560 MCAuto<DataArrayInt> ret(self->findIdForEach(bg,bg+sz));
2564 PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
2566 std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
2567 PyObject *ret=PyList_New(slcs.size());
2568 for(std::size_t i=0;i<slcs.size();i++)
2569 PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
2573 DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const throw(INTERP_KERNEL::Exception)
2575 if(!PySlice_Check(slic))
2576 throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
2577 Py_ssize_t strt=2,stp=2,step=2;
2578 GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
2579 if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
2580 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 !");
2581 return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
2584 PyObject *getMinMaxValues() const throw(INTERP_KERNEL::Exception)
2587 self->getMinMaxValues(a,b);
2588 PyObject *ret=PyTuple_New(2);
2589 PyTuple_SetItem(ret,0,PyInt_FromLong(a));
2590 PyTuple_SetItem(ret,1,PyInt_FromLong(b));
2594 static PyObject *ConvertIndexArrayToO2N(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
2596 int newNbOfTuples=-1;
2597 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
2598 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
2599 const int *arrPtr=convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
2600 const int *arrIPtr=convertIntStarLikePyObjToCppIntStar(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
2601 DataArrayInt *ret0=MEDCoupling::DataArrayInt::ConvertIndexArrayToO2N(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
2602 PyObject *ret=PyTuple_New(2);
2603 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
2604 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
2608 static DataArrayInt *CheckAndPreparePermutation(PyObject *arr) throw(INTERP_KERNEL::Exception)
2610 MCAuto<DataArrayInt> ret(DataArrayInt::New());
2611 int szArr,sw,iTypppArr;
2612 std::vector<int> stdvecTyyppArr;
2613 const int *arrPtr(convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
2614 int *pt(MEDCoupling::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
2615 ret->useArray(pt,true,MEDCoupling::C_DEALLOC,szArr,1);
2619 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2621 const char *msg="MEDCoupling::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 !";
2622 if(PyList_Check(li) || PyTuple_Check(li))
2624 if(nbOfTuples && nbOfTuples != Py_None)
2626 if(PyInt_Check(nbOfTuples))
2628 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2630 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
2631 if(nbOfComp && nbOfComp != Py_None)
2633 if(PyInt_Check(nbOfComp))
2634 {//DataArrayInt.setValues([1,3,4,5],2,2)
2635 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2637 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
2638 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
2639 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2642 throw INTERP_KERNEL::Exception(msg);
2645 {//DataArrayInt.setValues([1,3,4],3)
2647 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
2648 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2652 throw INTERP_KERNEL::Exception(msg);
2655 {// DataArrayInt.setValues([1,3,4])
2656 int tmpp1=-1,tmpp2=-1;
2657 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
2658 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2662 throw INTERP_KERNEL::Exception(msg);
2665 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
2667 const int *vals=self->getConstPointer();
2668 return convertIntArrToPyList(vals,self->getNbOfElems());
2672 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
2674 return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
2678 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
2681 bool ret0=self->isEqualIfNotWhy(other,ret1);
2682 PyObject *ret=PyTuple_New(2);
2683 PyObject *ret0Py=ret0?Py_True:Py_False;
2685 PyTuple_SetItem(ret,0,ret0Py);
2686 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2690 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
2692 const int *vals=self->getConstPointer();
2693 int nbOfComp=self->getNumberOfComponents();
2694 int nbOfTuples=self->getNumberOfTuples();
2695 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2698 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
2700 std::vector<const DataArrayInt *> groups;
2701 std::vector< std::vector<int> > fidsOfGroups;
2702 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(gps,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",groups);
2703 MEDCoupling::DataArrayInt *ret0=MEDCoupling::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
2704 PyObject *ret = PyList_New(2);
2705 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2706 int sz=fidsOfGroups.size();
2707 PyObject *ret1 = PyList_New(sz);
2708 for(int i=0;i<sz;i++)
2709 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
2710 PyList_SetItem(ret,1,ret1);
2714 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
2717 int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 ));
2718 if (!SWIG_IsOK(res1))
2720 int res2(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
2723 MapII *m=reinterpret_cast<MapII *>(da);
2724 self->transformWithIndArr(*m);
2729 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2730 self->transformWithIndArr(tmp,tmp+size);
2735 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2736 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2740 DataArrayInt *findIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2744 std::vector<int> multiVal;
2745 std::pair<int, std::pair<int,int> > slic;
2746 MEDCoupling::DataArrayInt *daIntTyypp=0;
2747 convertIntStarOrSliceLikePyObjToCpp(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2751 return self->findIdsEqualList(&singleVal,&singleVal+1);
2753 return self->findIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2755 return self->findIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
2757 throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2761 DataArrayInt *findIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
2765 std::vector<int> multiVal;
2766 std::pair<int, std::pair<int,int> > slic;
2767 MEDCoupling::DataArrayInt *daIntTyypp=0;
2768 convertIntStarOrSliceLikePyObjToCpp(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
2772 return self->findIdsNotEqualList(&singleVal,&singleVal+1);
2774 return self->findIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
2776 return self->findIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
2778 throw INTERP_KERNEL::Exception("DataArrayInt::findIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2782 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
2784 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
2786 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
2787 if (!SWIG_IsOK(res1))
2790 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2791 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
2795 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2797 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2798 da2->checkAllocated();
2799 self->splitByValueRange(da2->begin(),da2->end(),ret0,ret1,ret2);
2801 PyObject *ret = PyList_New(3);
2802 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2803 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2804 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2808 DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
2811 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
2812 if (!SWIG_IsOK(res1))
2815 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2816 return self->transformWithIndArrR(tmp,tmp+size);
2820 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2821 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
2825 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2828 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
2829 if (!SWIG_IsOK(res1))
2832 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2833 if(size!=self->getNumberOfTuples())
2835 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2837 return self->renumberAndReduce(tmp,newNbOfTuple);
2841 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2843 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2844 da2->checkAllocated();
2845 int size=self->getNumberOfTuples();
2846 if(size!=self->getNumberOfTuples())
2848 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2850 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
2854 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
2857 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
2858 if (!SWIG_IsOK(res1))
2861 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2862 if(size!=self->getNumberOfTuples())
2864 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2866 return self->renumber(tmp);
2870 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2872 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2873 da2->checkAllocated();
2874 int size=self->getNumberOfTuples();
2875 if(size!=self->getNumberOfTuples())
2877 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2879 return self->renumber(da2->getConstPointer());
2883 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
2886 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
2887 if (!SWIG_IsOK(res1))
2890 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2891 if(size!=self->getNumberOfTuples())
2893 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2895 return self->renumberR(tmp);
2899 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2901 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2902 da2->checkAllocated();
2903 int size=self->getNumberOfTuples();
2904 if(size!=self->getNumberOfTuples())
2906 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2908 return self->renumberR(da2->getConstPointer());
2912 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
2914 std::vector<int> tmp;
2915 convertPyToNewIntArr3(li,tmp);
2916 self->setSelectedComponents(a,tmp);
2919 PyObject *explodeComponents() const throw(INTERP_KERNEL::Exception)
2921 std::vector< MCAuto<DataArrayInt> > retCpp(self->explodeComponents());
2922 std::size_t sz(retCpp.size());
2923 PyObject *res(PyList_New(sz));
2924 for(std::size_t i=0;i<sz;i++)
2925 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i].retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2929 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
2931 int sz=self->getNumberOfComponents();
2932 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
2933 self->getTuple(tupleId,tmp);
2934 return convertIntArrToPyList(tmp,sz);
2937 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
2939 DataArrayInt *arr=0;
2940 DataArrayInt *arrI=0;
2941 self->changeSurjectiveFormat(targetNb,arr,arrI);
2942 PyObject *res = PyList_New(2);
2943 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
2944 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
2948 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
2950 std::vector<const DataArrayInt *> tmp;
2951 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
2952 return DataArrayInt::Meld(tmp);
2955 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
2957 std::vector<const DataArrayInt *> tmp;
2958 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
2959 return DataArrayInt::Aggregate(tmp);
2962 static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
2964 std::vector<const DataArrayInt *> tmp;
2965 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
2966 return DataArrayInt::AggregateIndexes(tmp);
2969 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
2971 std::vector<const DataArrayInt *> tmp;
2972 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
2973 return DataArrayInt::BuildUnion(tmp);
2976 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
2978 std::vector<const DataArrayInt *> tmp;
2979 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
2980 return DataArrayInt::BuildIntersection(tmp);
2983 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
2986 int r1=self->getMaxValue(tmp);
2987 PyObject *ret=PyTuple_New(2);
2988 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2989 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
2993 PyObject *getMaxAbsValue(std::size_t& tupleId) const throw(INTERP_KERNEL::Exception)
2996 int r1=self->getMaxAbsValue(tmp);
2997 PyObject *ret=PyTuple_New(2);
2998 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
2999 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3003 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3006 int r1=self->getMinValue(tmp);
3007 PyObject *ret=PyTuple_New(2);
3008 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
3009 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3013 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3015 int nbOfCompo=self->getNumberOfComponents();
3020 if(PyInt_Check(obj))
3022 int val=(int)PyInt_AS_LONG(obj);
3023 return self->findIdFirstEqual(val);
3026 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
3030 std::vector<int> arr;
3031 convertPyToNewIntArr3(obj,arr);
3032 return self->findIdFirstEqualTuple(arr);
3037 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
3039 int nbOfCompo=self->getNumberOfComponents();
3046 if(PyInt_Check(obj))
3048 int val=(int)PyInt_AS_LONG(obj);
3049 return self->presenceOfValue(val);
3052 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
3056 std::vector<int> arr;
3057 convertPyToNewIntArr3(obj,arr);
3058 return self->presenceOfTuple(arr);
3063 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3065 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
3066 const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
3067 self->checkAllocated();
3068 int nbOfTuples=self->getNumberOfTuples();
3069 int nbOfComponents=self->getNumberOfComponents();
3071 std::vector<int> vt1,vc1;
3072 std::pair<int, std::pair<int,int> > pt1,pc1;
3073 DataArrayInt *dt1=0,*dc1=0;
3075 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3076 MCAuto<DataArrayInt> ret;
3081 if(nbOfComponents==1)
3082 return PyInt_FromLong(self->getIJSafe(it1,0));
3083 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3086 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3088 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3090 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3092 return PyInt_FromLong(self->getIJSafe(it1,ic1));
3095 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3096 std::vector<int> v2(1,ic1);
3097 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3101 ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
3102 std::vector<int> v2(1,ic1);
3103 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3107 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3108 std::vector<int> v2(1,ic1);
3109 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3113 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3114 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3118 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3119 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3123 ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
3124 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3128 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3129 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3133 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3134 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3135 std::vector<int> v2(nbOfComp);
3136 for(int i=0;i<nbOfComp;i++)
3137 v2[i]=pc1.first+i*pc1.second.second;
3138 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3142 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3143 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3144 std::vector<int> v2(nbOfComp);
3145 for(int i=0;i<nbOfComp;i++)
3146 v2[i]=pc1.first+i*pc1.second.second;
3147 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3151 ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
3152 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3153 std::vector<int> v2(nbOfComp);
3154 for(int i=0;i<nbOfComp;i++)
3155 v2[i]=pc1.first+i*pc1.second.second;
3156 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3160 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3161 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
3162 std::vector<int> v2(nbOfComp);
3163 for(int i=0;i<nbOfComp;i++)
3164 v2[i]=pc1.first+i*pc1.second.second;
3165 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3168 throw INTERP_KERNEL::Exception(msg);
3172 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3174 self->checkAllocated();
3175 const char msg[]="Unexpected situation in __setitem__ !";
3176 int nbOfTuples=self->getNumberOfTuples();
3177 int nbOfComponents=self->getNumberOfComponents();
3180 std::vector<int> v1;
3182 DataArrayIntTuple *dd1=0;
3183 convertIntStarLikePyObjToCpp(value,sw1,i1,v1,d1,dd1);
3185 std::vector<int> vt1,vc1;
3186 std::pair<int, std::pair<int,int> > pt1,pc1;
3187 DataArrayInt *dt1=0,*dc1=0;
3188 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3189 MCAuto<DataArrayInt> tmp;
3197 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3200 tmp=DataArrayInt::New();
3201 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3202 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3205 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3208 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3209 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
3212 throw INTERP_KERNEL::Exception(msg);
3221 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3224 tmp=DataArrayInt::New();
3225 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3226 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3229 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3232 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3233 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3236 throw INTERP_KERNEL::Exception(msg);
3245 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3248 tmp=DataArrayInt::New();
3249 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3250 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3253 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3256 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3257 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3260 throw INTERP_KERNEL::Exception(msg);
3269 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3272 tmp=DataArrayInt::New();
3273 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3274 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3277 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3280 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3281 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3284 throw INTERP_KERNEL::Exception(msg);
3293 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3296 tmp=DataArrayInt::New();
3297 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3298 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3301 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3304 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3305 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
3308 throw INTERP_KERNEL::Exception(msg);
3317 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3320 tmp=DataArrayInt::New();
3321 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3322 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3325 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3328 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3329 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3332 throw INTERP_KERNEL::Exception(msg);
3341 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3344 tmp=DataArrayInt::New();
3345 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3346 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3349 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3352 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3353 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3356 throw INTERP_KERNEL::Exception(msg);
3365 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3368 tmp=DataArrayInt::New();
3369 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3370 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3373 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3376 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3377 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3380 throw INTERP_KERNEL::Exception(msg);
3389 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3392 tmp=DataArrayInt::New();
3393 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3394 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3397 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3400 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3401 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3404 throw INTERP_KERNEL::Exception(msg);
3413 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3416 tmp=DataArrayInt::New();
3417 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3418 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3421 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3424 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3425 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3428 throw INTERP_KERNEL::Exception(msg);
3437 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3440 tmp=DataArrayInt::New();
3441 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3442 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3445 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3448 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3449 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3452 throw INTERP_KERNEL::Exception(msg);
3461 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3464 tmp=DataArrayInt::New();
3465 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3466 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3469 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3472 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3473 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3476 throw INTERP_KERNEL::Exception(msg);
3485 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3488 tmp=DataArrayInt::New();
3489 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3490 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3493 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3496 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3497 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3500 throw INTERP_KERNEL::Exception(msg);
3509 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3512 tmp=DataArrayInt::New();
3513 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3514 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3517 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3520 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3521 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3524 throw INTERP_KERNEL::Exception(msg);
3533 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3536 tmp=DataArrayInt::New();
3537 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3538 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3541 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3544 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3545 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3548 throw INTERP_KERNEL::Exception(msg);
3557 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3560 tmp=DataArrayInt::New();
3561 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3562 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3565 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3568 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
3569 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3572 throw INTERP_KERNEL::Exception(msg);
3577 throw INTERP_KERNEL::Exception(msg);
3582 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
3584 return self->negate();
3587 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3589 const char msg[]="Unexpected situation in __add__ !";
3592 std::vector<int> aa;
3593 DataArrayIntTuple *aaa;
3595 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3600 MCAuto<DataArrayInt> ret=self->deepCopy();
3601 ret->applyLin(1,val);
3606 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3607 return DataArrayInt::Add(self,aaaa);
3611 return DataArrayInt::Add(self,a);
3615 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3616 return DataArrayInt::Add(self,aaaa);
3619 throw INTERP_KERNEL::Exception(msg);
3623 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3625 const char msg[]="Unexpected situation in __radd__ !";
3628 std::vector<int> aa;
3629 DataArrayIntTuple *aaa;
3631 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3636 MCAuto<DataArrayInt> ret=self->deepCopy();
3637 ret->applyLin(1,val);
3642 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3643 return DataArrayInt::Add(self,aaaa);
3647 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3648 return DataArrayInt::Add(self,aaaa);
3651 throw INTERP_KERNEL::Exception(msg);
3655 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3657 const char msg[]="Unexpected situation in __iadd__ !";
3660 std::vector<int> aa;
3661 DataArrayIntTuple *aaa;
3663 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3668 self->applyLin(1,val);
3669 Py_XINCREF(trueSelf);
3674 MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3676 Py_XINCREF(trueSelf);
3682 Py_XINCREF(trueSelf);
3687 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3688 self->addEqual(aaaa);
3689 Py_XINCREF(trueSelf);
3693 throw INTERP_KERNEL::Exception(msg);
3697 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3699 const char msg[]="Unexpected situation in __sub__ !";
3702 std::vector<int> aa;
3703 DataArrayIntTuple *aaa;
3705 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3710 MCAuto<DataArrayInt> ret=self->deepCopy();
3711 ret->applyLin(1,-val);
3716 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3717 return DataArrayInt::Substract(self,aaaa);
3721 return DataArrayInt::Substract(self,a);
3725 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3726 return DataArrayInt::Substract(self,aaaa);
3729 throw INTERP_KERNEL::Exception(msg);
3733 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3735 const char msg[]="Unexpected situation in __rsub__ !";
3738 std::vector<int> aa;
3739 DataArrayIntTuple *aaa;
3741 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3746 MCAuto<DataArrayInt> ret=self->deepCopy();
3747 ret->applyLin(-1,val);
3752 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3753 return DataArrayInt::Substract(aaaa,self);
3757 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3758 return DataArrayInt::Substract(aaaa,self);
3761 throw INTERP_KERNEL::Exception(msg);
3765 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3767 const char msg[]="Unexpected situation in __isub__ !";
3770 std::vector<int> aa;
3771 DataArrayIntTuple *aaa;
3773 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3778 self->applyLin(1,-val);
3779 Py_XINCREF(trueSelf);
3784 MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3785 self->substractEqual(bb);
3786 Py_XINCREF(trueSelf);
3791 self->substractEqual(a);
3792 Py_XINCREF(trueSelf);
3797 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3798 self->substractEqual(aaaa);
3799 Py_XINCREF(trueSelf);
3803 throw INTERP_KERNEL::Exception(msg);
3807 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3809 const char msg[]="Unexpected situation in __mul__ !";
3812 std::vector<int> aa;
3813 DataArrayIntTuple *aaa;
3815 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3820 MCAuto<DataArrayInt> ret=self->deepCopy();
3821 ret->applyLin(val,0);
3826 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3827 return DataArrayInt::Multiply(self,aaaa);
3831 return DataArrayInt::Multiply(self,a);
3835 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3836 return DataArrayInt::Multiply(self,aaaa);
3839 throw INTERP_KERNEL::Exception(msg);
3843 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3845 const char msg[]="Unexpected situation in __rmul__ !";
3848 std::vector<int> aa;
3849 DataArrayIntTuple *aaa;
3851 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3856 MCAuto<DataArrayInt> ret=self->deepCopy();
3857 ret->applyLin(val,0);
3862 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3863 return DataArrayInt::Multiply(self,aaaa);
3867 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3868 return DataArrayInt::Multiply(self,aaaa);
3871 throw INTERP_KERNEL::Exception(msg);
3875 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3877 const char msg[]="Unexpected situation in __imul__ !";
3880 std::vector<int> aa;
3881 DataArrayIntTuple *aaa;
3883 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3888 self->applyLin(val,0);
3889 Py_XINCREF(trueSelf);
3894 MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3895 self->multiplyEqual(bb);
3896 Py_XINCREF(trueSelf);
3901 self->multiplyEqual(a);
3902 Py_XINCREF(trueSelf);
3907 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3908 self->multiplyEqual(aaaa);
3909 Py_XINCREF(trueSelf);
3913 throw INTERP_KERNEL::Exception(msg);
3917 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3919 const char msg[]="Unexpected situation in __div__ !";
3922 std::vector<int> aa;
3923 DataArrayIntTuple *aaa;
3925 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3930 MCAuto<DataArrayInt> ret=self->deepCopy();
3931 ret->applyDivideBy(val);
3936 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3937 return DataArrayInt::Divide(self,aaaa);
3941 return DataArrayInt::Divide(self,a);
3945 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3946 return DataArrayInt::Divide(self,aaaa);
3949 throw INTERP_KERNEL::Exception(msg);
3953 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3955 const char msg[]="Unexpected situation in __rdiv__ !";
3958 std::vector<int> aa;
3959 DataArrayIntTuple *aaa;
3961 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3966 MCAuto<DataArrayInt> ret=self->deepCopy();
3972 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
3973 return DataArrayInt::Divide(aaaa,self);
3977 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
3978 return DataArrayInt::Divide(aaaa,self);
3981 throw INTERP_KERNEL::Exception(msg);
3985 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3987 const char msg[]="Unexpected situation in __idiv__ !";
3990 std::vector<int> aa;
3991 DataArrayIntTuple *aaa;
3993 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
3998 self->applyDivideBy(val);
3999 Py_XINCREF(trueSelf);
4004 MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4005 self->divideEqual(bb);
4006 Py_XINCREF(trueSelf);
4011 self->divideEqual(a);
4012 Py_XINCREF(trueSelf);
4017 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4018 self->divideEqual(aaaa);
4019 Py_XINCREF(trueSelf);
4023 throw INTERP_KERNEL::Exception(msg);
4027 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4029 const char msg[]="Unexpected situation in __mod__ !";
4032 std::vector<int> aa;
4033 DataArrayIntTuple *aaa;
4035 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
4040 MCAuto<DataArrayInt> ret=self->deepCopy();
4041 ret->applyModulus(val);
4046 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4047 return DataArrayInt::Modulus(self,aaaa);
4051 return DataArrayInt::Modulus(self,a);
4055 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4056 return DataArrayInt::Modulus(self,aaaa);
4059 throw INTERP_KERNEL::Exception(msg);
4063 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4065 const char msg[]="Unexpected situation in __rmod__ !";
4068 std::vector<int> aa;
4069 DataArrayIntTuple *aaa;
4071 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
4076 MCAuto<DataArrayInt> ret=self->deepCopy();
4077 ret->applyRModulus(val);
4082 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4083 return DataArrayInt::Modulus(aaaa,self);
4087 return DataArrayInt::Modulus(a,self);
4091 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4092 return DataArrayInt::Modulus(aaaa,self);
4095 throw INTERP_KERNEL::Exception(msg);
4099 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4101 const char msg[]="Unexpected situation in __imod__ !";
4104 std::vector<int> aa;
4105 DataArrayIntTuple *aaa;
4107 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
4112 self->applyModulus(val);
4113 Py_XINCREF(trueSelf);
4118 self->modulusEqual(a);
4119 Py_XINCREF(trueSelf);
4124 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4125 self->modulusEqual(aaaa);
4126 Py_XINCREF(trueSelf);
4130 throw INTERP_KERNEL::Exception(msg);
4134 DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4136 const char msg[]="Unexpected situation in __pow__ !";
4139 std::vector<int> aa;
4140 DataArrayIntTuple *aaa;
4142 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
4147 MCAuto<DataArrayInt> ret=self->deepCopy();
4153 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4154 return DataArrayInt::Pow(self,aaaa);
4158 return DataArrayInt::Pow(self,a);
4162 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4163 return DataArrayInt::Pow(self,aaaa);
4166 throw INTERP_KERNEL::Exception(msg);
4170 DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4172 const char msg[]="Unexpected situation in __rpow__ !";
4175 std::vector<int> aa;
4176 DataArrayIntTuple *aaa;
4178 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
4183 MCAuto<DataArrayInt> ret=self->deepCopy();
4184 ret->applyRPow(val);
4189 MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
4190 return DataArrayInt::Pow(aaaa,self);
4194 return DataArrayInt::Pow(a,self);
4198 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4199 return DataArrayInt::Pow(aaaa,self);
4202 throw INTERP_KERNEL::Exception(msg);
4206 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4208 const char msg[]="Unexpected situation in __ipow__ !";
4211 std::vector<int> aa;
4212 DataArrayIntTuple *aaa;
4214 convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
4219 self->applyPow(val);
4220 Py_XINCREF(trueSelf);
4226 Py_XINCREF(trueSelf);
4231 MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
4232 self->powEqual(aaaa);
4233 Py_XINCREF(trueSelf);
4237 throw INTERP_KERNEL::Exception(msg);
4241 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4243 std::ostringstream oss;
4244 self->reprQuickOverview(oss);
4248 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4250 int szArr,sw,iTypppArr;
4251 std::vector<int> stdvecTyyppArr;
4252 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4253 self->pushBackValsSilent(tmp,tmp+szArr);
4256 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
4258 std::vector<int> ret1;
4259 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
4260 std::size_t sz=ret0.size();
4261 PyObject *pyRet=PyTuple_New(2);
4262 PyObject *pyRet0=PyList_New((int)sz);
4263 PyObject *pyRet1=PyList_New((int)sz);
4264 for(std::size_t i=0;i<sz;i++)
4266 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4267 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
4269 PyTuple_SetItem(pyRet,0,pyRet0);
4270 PyTuple_SetItem(pyRet,1,pyRet1);
4274 PyObject *findIdsRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
4276 DataArrayInt *ret0=0,*ret1=0;
4277 self->findIdsRangesInListOfIds(listOfIds,ret0,ret1);
4278 PyObject *pyRet=PyTuple_New(2);
4279 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4280 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4284 PyObject *isRange() const throw(INTERP_KERNEL::Exception)
4287 bool ret(self->isRange(a,b,c));
4288 PyObject *pyRet=PyTuple_New(2);
4289 PyObject *ret0Py=ret?Py_True:Py_False,*ret1Py(0);
4291 PyTuple_SetItem(pyRet,0,ret0Py);
4293 ret1Py=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
4299 PyTuple_SetItem(pyRet,1,ret1Py);
4305 class DataArrayIntTuple;
4307 class DataArrayIntIterator
4310 DataArrayIntIterator(DataArrayInt *da);
4311 ~DataArrayIntIterator();
4316 DataArrayIntTuple *ret=self->nextt();
4318 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4321 PyErr_SetString(PyExc_StopIteration,"No more data.");
4328 class DataArrayIntTuple
4331 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
4332 DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
4335 std::string __str__() const throw(INTERP_KERNEL::Exception)
4337 return self->repr();
4340 int __int__() const throw(INTERP_KERNEL::Exception)
4342 return self->intValue();
4345 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
4347 return self->buildDAInt(1,self->getNumberOfCompo());
4350 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4352 MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4353 MEDCoupling_DataArrayInt____iadd___(ret,0,obj);
4354 Py_XINCREF(trueSelf);
4358 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4360 MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4361 MEDCoupling_DataArrayInt____isub___(ret,0,obj);
4362 Py_XINCREF(trueSelf);
4366 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4368 MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4369 MEDCoupling_DataArrayInt____imul___(ret,0,obj);
4370 Py_XINCREF(trueSelf);
4373 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4375 MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4376 MEDCoupling_DataArrayInt____idiv___(ret,0,obj);
4377 Py_XINCREF(trueSelf);
4381 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4383 MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4384 MEDCoupling_DataArrayInt____imod___(ret,0,obj);
4385 Py_XINCREF(trueSelf);
4389 PyObject *__len__() throw(INTERP_KERNEL::Exception)
4391 return PyInt_FromLong(self->getNumberOfCompo());
4394 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4396 const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
4399 std::vector<int> multiVal;
4400 std::pair<int, std::pair<int,int> > slic;
4401 MEDCoupling::DataArrayInt *daIntTyypp=0;
4402 const int *pt=self->getConstPointer();
4403 int nbc=self->getNumberOfCompo();
4404 convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4411 std::ostringstream oss;
4412 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4413 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4417 return PyInt_FromLong(pt[singleVal]);
4421 return PyInt_FromLong(pt[nbc+singleVal]);
4424 std::ostringstream oss;
4425 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4426 throw INTERP_KERNEL::Exception(oss.str().c_str());
4432 PyObject *t=PyTuple_New(multiVal.size());
4433 for(int j=0;j<(int)multiVal.size();j++)
4435 int cid=multiVal[j];
4438 std::ostringstream oss;
4439 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4440 throw INTERP_KERNEL::Exception(oss.str().c_str());
4442 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4448 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4449 PyObject *t=PyTuple_New(sz);
4450 for(int j=0;j<sz;j++)
4451 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4455 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4459 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4461 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4462 const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
4465 std::vector<int> multiValV;
4466 std::pair<int, std::pair<int,int> > slicV;
4467 MEDCoupling::DataArrayIntTuple *daIntTyyppV=0;
4468 int nbc=self->getNumberOfCompo();
4469 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4471 std::vector<int> multiVal;
4472 std::pair<int, std::pair<int,int> > slic;
4473 MEDCoupling::DataArrayInt *daIntTyypp=0;
4474 int *pt=self->getPointer();
4475 convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4482 std::ostringstream oss;
4483 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4484 throw INTERP_KERNEL::Exception(oss.str().c_str());
4490 pt[singleVal]=singleValV;
4495 if(multiValV.size()!=1)
4497 std::ostringstream oss;
4498 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4499 throw INTERP_KERNEL::Exception(oss.str().c_str());
4501 pt[singleVal]=multiValV[0];
4506 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4510 throw INTERP_KERNEL::Exception(msg);
4519 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4523 std::ostringstream oss;
4524 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4525 throw INTERP_KERNEL::Exception(oss.str().c_str());
4533 if(multiVal.size()!=multiValV.size())
4535 std::ostringstream oss;
4536 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4537 throw INTERP_KERNEL::Exception(oss.str().c_str());
4539 for(int i=0;i<(int)multiVal.size();i++)
4541 int pos=multiVal[i];
4544 std::ostringstream oss;
4545 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4546 throw INTERP_KERNEL::Exception(oss.str().c_str());
4548 pt[multiVal[i]]=multiValV[i];
4554 const int *ptV=daIntTyyppV->getConstPointer();
4555 if(nbc>daIntTyyppV->getNumberOfCompo())
4557 std::ostringstream oss;
4558 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4559 throw INTERP_KERNEL::Exception(oss.str().c_str());
4561 std::copy(ptV,ptV+nbc,pt);
4565 throw INTERP_KERNEL::Exception(msg);
4570 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
4575 for(int j=0;j<sz;j++)
4576 pt[slic.first+j*slic.second.second]=singleValV;
4581 if(sz!=(int)multiValV.size())
4583 std::ostringstream oss;
4584 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4585 throw INTERP_KERNEL::Exception(oss.str().c_str());
4587 for(int j=0;j<sz;j++)
4588 pt[slic.first+j*slic.second.second]=multiValV[j];
4593 const int *ptV=daIntTyyppV->getConstPointer();
4594 if(sz>daIntTyyppV->getNumberOfCompo())
4596 std::ostringstream oss;
4597 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4598 throw INTERP_KERNEL::Exception(oss.str().c_str());
4600 for(int j=0;j<sz;j++)
4601 pt[slic.first+j*slic.second.second]=ptV[j];
4605 throw INTERP_KERNEL::Exception(msg);
4609 throw INTERP_KERNEL::Exception(msg);
4615 class DataArrayChar : public DataArray
4618 virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
4619 int getHashCode() const throw(INTERP_KERNEL::Exception);
4620 bool empty() const throw(INTERP_KERNEL::Exception);
4621 void deepCopyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
4622 void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
4623 void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
4624 char popBackSilent() throw(INTERP_KERNEL::Exception);
4625 void pack() const throw(INTERP_KERNEL::Exception);
4626 void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
4627 bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4628 bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
4629 void reverse() throw(INTERP_KERNEL::Exception);
4630 void fillWithZero() throw(INTERP_KERNEL::Exception);
4631 void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
4632 std::string repr() const throw(INTERP_KERNEL::Exception);
4633 std::string reprZip() const throw(INTERP_KERNEL::Exception);
4634 DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
4635 DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
4636 DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
4637 DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
4638 bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
4639 void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
4640 DataArrayChar *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
4641 DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
4642 void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
4643 void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
4644 char front() const throw(INTERP_KERNEL::Exception);
4645 char back() const throw(INTERP_KERNEL::Exception);
4646 void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4647 void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
4648 char *getPointer() throw(INTERP_KERNEL::Exception);
4649 DataArrayInt *findIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
4650 DataArrayInt *findIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
4651 int findIdFirstEqualTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4652 bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
4653 char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4654 char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
4655 char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
4656 char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
4657 DataArrayInt *findIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
4658 static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4659 static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
4662 int __len__() const throw(INTERP_KERNEL::Exception)
4664 if(self->isAllocated())
4666 return self->getNumberOfTuples();
4670 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
4674 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
4677 bool ret0=self->isEqualIfNotWhy(other,ret1);
4678 PyObject *ret=PyTuple_New(2);
4679 PyObject *ret0Py=ret0?Py_True:Py_False;
4681 PyTuple_SetItem(ret,0,ret0Py);
4682 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4686 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4689 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
4690 if (!SWIG_IsOK(res1))
4693 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4694 if(size!=self->getNumberOfTuples())
4696 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4698 return self->renumber(tmp);
4702 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4704 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4705 da2->checkAllocated();
4706 int size=self->getNumberOfTuples();
4707 if(size!=self->getNumberOfTuples())
4709 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4711 return self->renumber(da2->getConstPointer());
4715 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4718 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
4719 if (!SWIG_IsOK(res1))
4722 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4723 if(size!=self->getNumberOfTuples())
4725 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4727 return self->renumberR(tmp);
4731 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4733 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4734 da2->checkAllocated();
4735 int size=self->getNumberOfTuples();
4736 if(size!=self->getNumberOfTuples())
4738 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4740 return self->renumberR(da2->getConstPointer());
4744 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4747 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
4748 if (!SWIG_IsOK(res1))
4751 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4752 if(size!=self->getNumberOfTuples())
4754 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4756 return self->renumberAndReduce(tmp,newNbOfTuple);
4760 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4762 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4763 da2->checkAllocated();
4764 int size=self->getNumberOfTuples();
4765 if(size!=self->getNumberOfTuples())
4767 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4769 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4773 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4775 std::vector<const MEDCoupling::DataArrayChar *> tmp;
4776 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
4777 return DataArrayChar::Aggregate(tmp);
4780 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
4782 std::vector<const MEDCoupling::DataArrayChar *> tmp;
4783 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
4784 return DataArrayChar::Meld(tmp);
4789 class DataArrayByteIterator;
4791 class DataArrayByte : public DataArrayChar
4794 static DataArrayByte *New();
4795 DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
4796 DataArrayByte *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
4797 char byteValue() const throw(INTERP_KERNEL::Exception);
4800 DataArrayByte() throw(INTERP_KERNEL::Exception)
4802 return DataArrayByte::New();
4805 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4807 const char *msg="MEDCoupling::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) !";
4808 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4812 if(PyInt_Check(nbOfTuples))
4814 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4816 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4819 if(PyInt_Check(nbOfComp))
4820 {//DataArrayByte.New([1,3,4,5],2,2)
4821 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4823 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4824 MCAuto<DataArrayByte> ret=DataArrayByte::New();
4825 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4826 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4830 throw INTERP_KERNEL::Exception(msg);
4833 {//DataArrayByte.New([1,3,4],3)
4834 MCAuto<DataArrayByte> ret=DataArrayByte::New();
4836 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4837 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4842 throw INTERP_KERNEL::Exception(msg);
4845 {// DataArrayByte.New([1,3,4])
4846 MCAuto<DataArrayByte> ret=DataArrayByte::New();
4847 int tmpp1=-1,tmpp2=-1;
4848 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4849 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4853 else if(PyInt_Check(elt0))
4855 int nbOfTuples1=PyInt_AS_LONG(elt0);
4857 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
4862 if(PyInt_Check(nbOfTuples))
4863 {//DataArrayByte.New(5,2)
4864 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4866 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
4867 MCAuto<DataArrayByte> ret=DataArrayByte::New();
4868 ret->alloc(nbOfTuples1,nbOfCompo);
4872 throw INTERP_KERNEL::Exception(msg);
4875 throw INTERP_KERNEL::Exception(msg);
4878 {//DataArrayByte.New(5)
4879 MCAuto<DataArrayByte> ret=DataArrayByte::New();
4880 ret->alloc(nbOfTuples1,1);
4885 else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
4886 {//DataArrayDouble.New(numpyArray)
4887 return BuildNewInstance<DataArrayByte,char>(elt0,NPY_INT8,&PyCallBackDataArrayChar_RefType,"INT8");
4891 throw INTERP_KERNEL::Exception(msg);
4894 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4896 return MEDCoupling_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4899 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4901 std::ostringstream oss;
4902 self->reprQuickOverview(oss);
4906 int __int__() const throw(INTERP_KERNEL::Exception)
4908 return (int) self->byteValue();
4911 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
4913 return self->iterator();
4916 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4918 return (int)self->getIJ(tupleId,compoId);
4921 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
4923 return (int)self->getIJSafe(tupleId,compoId);
4926 std::string __str__() const throw(INTERP_KERNEL::Exception)
4928 return self->repr();
4931 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
4933 const char *vals=self->getConstPointer();
4934 int nbOfComp=self->getNumberOfComponents();
4935 int nbOfTuples=self->getNumberOfTuples();
4936 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4939 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4942 int ival=-1; std::vector<int> ivval;
4943 const int *pt=convertIntStarLikePyObjToCppIntStar(tupl,sw,sz,ival,ivval);
4944 std::vector<char> vals(sz);
4945 std::copy(pt,pt+sz,vals.begin());
4946 return self->presenceOfTuple(vals);
4949 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4952 int ival=-1; std::vector<int> ivval;
4953 const int *pt=convertIntStarLikePyObjToCppIntStar(vals,sw,sz,ival,ivval);
4954 std::vector<char> vals2(sz);
4955 std::copy(pt,pt+sz,vals2.begin());
4956 return self->presenceOfValue(vals2);
4959 int findIdFirstEqual(PyObject *vals) const throw(INTERP_KERNEL::Exception)
4962 int ival=-1; std::vector<int> ivval;
4963 const int *pt=convertIntStarLikePyObjToCppIntStar(vals,sw,sz,ival,ivval);
4964 std::vector<char> vals2(sz);
4965 std::copy(pt,pt+sz,vals2.begin());
4966 return self->findIdFirstEqual(vals2);
4969 int findIdFirstEqualTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
4972 int ival=-1; std::vector<int> ivval;
4973 const int *pt=convertIntStarLikePyObjToCppIntStar(tupl,sw,sz,ival,ivval);
4974 std::vector<char> vals(sz);
4975 std::copy(pt,pt+sz,vals.begin());
4976 return self->findIdFirstEqualTuple(vals);
4979 int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
4982 int ival=-1; std::vector<int> ivval;
4983 const int *pt=convertIntStarLikePyObjToCppIntStar(strOrListOfInt,sw,sz,ival,ivval);
4984 std::vector<char> vals(sz);
4985 std::copy(pt,pt+sz,vals.begin());
4986 return self->findIdSequence(vals);
4989 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
4991 int sz=self->getNumberOfComponents();
4992 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
4993 self->getTuple(tupleId,tmp);
4994 PyObject *ret=PyTuple_New(sz);
4995 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
4999 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5002 int r1=(int)self->getMaxValue(tmp);
5003 PyObject *ret=PyTuple_New(2);
5004 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5005 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5009 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5012 int r1=(int)self->getMinValue(tmp);
5013 PyObject *ret=PyTuple_New(2);
5014 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5015 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5019 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5021 int nbOfCompo=self->getNumberOfComponents();
5026 if(PyInt_Check(obj))
5028 int val=(int)PyInt_AS_LONG(obj);
5029 return self->findIdFirstEqual(val);
5032 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
5035 return MEDCoupling_DataArrayByte_findIdFirstEqualTuple(self,obj);
5039 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5041 int nbOfCompo=self->getNumberOfComponents();
5048 if(PyInt_Check(obj))
5050 int val=(int)PyInt_AS_LONG(obj);
5051 return self->presenceOfValue(val);
5054 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5057 return MEDCoupling_DataArrayByte_presenceOfTuple(self,obj);
5062 PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5064 return ToNumPyArray<DataArrayByte,char>(self,NPY_INT8,"DataArrayByte");
5068 DataArrayByte *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5070 self->checkAllocated();
5071 const char msg[]="Unexpected situation in __setitem__ !";
5072 int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
5075 std::vector<int> v1;
5077 DataArrayIntTuple *dd1=0;
5078 convertIntStarLikePyObjToCpp(value,sw1,i1,v1,d1,dd1);
5080 std::vector<int> vt1,vc1;
5081 std::pair<int, std::pair<int,int> > pt1,pc1;
5082 DataArrayInt *dt1=0,*dc1=0;
5083 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5084 MCAuto<DataArrayInt> tmp;
5092 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5095 throw INTERP_KERNEL::Exception(msg);
5104 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5107 throw INTERP_KERNEL::Exception(msg);
5116 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5119 throw INTERP_KERNEL::Exception(msg);
5128 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5131 throw INTERP_KERNEL::Exception(msg);
5140 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5143 throw INTERP_KERNEL::Exception(msg);
5152 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5155 throw INTERP_KERNEL::Exception(msg);
5164 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5167 throw INTERP_KERNEL::Exception(msg);
5176 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5179 throw INTERP_KERNEL::Exception(msg);
5188 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5191 throw INTERP_KERNEL::Exception(msg);
5200 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5203 throw INTERP_KERNEL::Exception(msg);
5212 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5215 throw INTERP_KERNEL::Exception(msg);
5224 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5227 throw INTERP_KERNEL::Exception(msg);
5236 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5239 throw INTERP_KERNEL::Exception(msg);
5248 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5251 throw INTERP_KERNEL::Exception(msg);
5260 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5263 throw INTERP_KERNEL::Exception(msg);
5272 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5275 throw INTERP_KERNEL::Exception(msg);
5280 throw INTERP_KERNEL::Exception(msg);
5287 class DataArrayByteTuple;
5289 class DataArrayByteIterator
5292 DataArrayByteIterator(DataArrayByte *da);
5293 ~DataArrayByteIterator();
5296 class DataArrayByteTuple
5299 std::string repr() const throw(INTERP_KERNEL::Exception);
5300 DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5303 std::string __str__() const throw(INTERP_KERNEL::Exception)
5305 return self->repr();
5308 char __int__() const throw(INTERP_KERNEL::Exception)
5310 return self->byteValue();
5313 DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
5315 return self->buildDAByte(1,self->getNumberOfCompo());
5320 class DataArrayAsciiCharIterator;
5322 class DataArrayAsciiChar : public DataArrayChar
5325 static DataArrayAsciiChar *New();
5326 DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
5327 DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
5328 char asciiCharValue() const throw(INTERP_KERNEL::Exception);
5331 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
5333 return DataArrayAsciiChar::New();
5336 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5338 const char *msg="MEDCoupling::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) !";
5339 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5343 if(PyInt_Check(nbOfTuples))
5345 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5347 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5350 if(PyInt_Check(nbOfComp))
5351 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
5352 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5354 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5355 MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5356 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5357 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5361 throw INTERP_KERNEL::Exception(msg);
5364 {//DataArrayAsciiChar.New([1,3,4],3)
5365 MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5367 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5368 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5372 else if(PyString_Check(nbOfTuples))
5374 if(PyString_Size(nbOfTuples)!=1)
5375 throw INTERP_KERNEL::Exception(msg);
5376 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5377 std::vector<std::string> tmp;
5378 if(fillStringVector(elt0,tmp))
5379 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
5381 throw INTERP_KERNEL::Exception(msg);
5383 %#if PY_VERSION_HEX >= 0x03000000
5384 else if(PyUnicode_Check(nbOfTuples))
5386 if(PyUnicode_GET_LENGTH(nbOfTuples)!=1)
5387 throw INTERP_KERNEL::Exception(msg);
5388 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
5389 std::vector<std::string> tmp;
5390 if(fillStringVector(elt0,tmp))
5391 return DataArrayAsciiChar::New(tmp,PyUnicode_AsUTF8(nbOfTuples)[0]);
5393 throw INTERP_KERNEL::Exception(msg);
5397 throw INTERP_KERNEL::Exception(msg);
5401 std::vector<std::string> tmmp;
5402 if(fillStringVector(elt0,tmmp))
5403 //DataArrayAsciiChar.New(["abc","de","fghi"])
5404 return DataArrayAsciiChar::New(tmmp,' ');
5407 // DataArrayAsciiChar.New([1,3,4])
5408 MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5409 int tmpp1=-1,tmpp2=-1;
5410 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5411 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5416 else if(PyInt_Check(elt0))
5418 int nbOfTuples1=PyInt_AS_LONG(elt0);
5420 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
5425 if(PyInt_Check(nbOfTuples))
5426 {//DataArrayAsciiChar.New(5,2)
5427 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5429 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
5430 MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5431 ret->alloc(nbOfTuples1,nbOfCompo);
5435 throw INTERP_KERNEL::Exception(msg);
5438 throw INTERP_KERNEL::Exception(msg);
5441 {//DataArrayAsciiChar.New(5)
5442 MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
5443 ret->alloc(nbOfTuples1,1);
5448 throw INTERP_KERNEL::Exception(msg);
5451 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5453 return MEDCoupling_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5456 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5458 std::ostringstream oss;
5459 self->reprQuickOverview(oss);
5463 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
5465 return self->iterator();
5468 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5470 char tmp[2]; tmp[1]='\0';
5471 tmp[0]=self->getIJ(tupleId,compoId);
5472 return std::string(tmp);
5475 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
5477 char tmp[2]; tmp[1]='\0';
5478 tmp[0]=self->getIJSafe(tupleId,compoId);
5479 return std::string(tmp);
5482 std::string __str__() const throw(INTERP_KERNEL::Exception)
5484 return self->repr();
5487 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
5489 const char *vals=self->getConstPointer();
5490 int nbOfComp=self->getNumberOfComponents();
5491 int nbOfTuples=self->getNumberOfTuples();
5492 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5495 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5497 if(PyString_Check(tupl))
5499 Py_ssize_t sz=PyString_Size(tupl);
5500 std::vector<char> vals(sz);
5501 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5502 return self->presenceOfTuple(vals);
5504 %#if PY_VERSION_HEX >= 0x03000000
5505 else if(PyUnicode_Check(tupl))
5507 Py_ssize_t sz=PyUnicode_GET_LENGTH(tupl);
5508 std::vector<char> vals(sz);
5509 std::copy(PyUnicode_AsUTF8(tupl),PyUnicode_AsUTF8(tupl)+sz,vals.begin());
5510 return self->presenceOfTuple(vals);
5514 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
5517 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5519 if(PyString_Check(vals))
5521 Py_ssize_t sz=PyString_Size(vals);
5522 std::vector<char> vals2(sz);
5523 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5524 return self->presenceOfValue(vals2);
5526 %#if PY_VERSION_HEX >= 0x03000000
5527 if(PyUnicode_Check(vals))
5529 Py_ssize_t sz=PyUnicode_GET_LENGTH(vals);
5530 std::vector<char> vals2(sz);
5531 std::copy(PyUnicode_AsUTF8(vals),PyUnicode_AsUTF8(vals)+sz,vals2.begin());
5532 return self->presenceOfValue(vals2);
5536 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
5539 int findIdFirstEqual(PyObject *vals) const throw(INTERP_KERNEL::Exception)
5541 if(PyString_Check(vals))
5543 Py_ssize_t sz=PyString_Size(vals);
5544 std::vector<char> vals2(sz);
5545 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
5546 return self->findIdFirstEqual(vals2);
5548 %#if PY_VERSION_HEX >= 0x03000000
5549 if(PyUnicode_Check(vals))
5551 Py_ssize_t sz=PyUnicode_GET_LENGTH(vals);
5552 std::vector<char> vals2(sz);
5553 std::copy(PyUnicode_AsUTF8(vals),PyUnicode_AsUTF8(vals)+sz,vals2.begin());
5554 return self->findIdFirstEqual(vals2);
5558 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqual : only strings in input supported !");
5561 int findIdFirstEqualTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
5563 if(PyString_Check(tupl))
5565 Py_ssize_t sz=PyString_Size(tupl);
5566 std::vector<char> vals(sz);
5567 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
5568 return self->findIdFirstEqualTuple(vals);
5570 %#if PY_VERSION_HEX >= 0x03000000
5571 if(PyUnicode_Check(tupl))
5573 Py_ssize_t sz=PyUnicode_GET_LENGTH(tupl);
5574 std::vector<char> vals(sz);
5575 std::copy(PyUnicode_AsUTF8(tupl),PyUnicode_AsUTF8(tupl)+sz,vals.begin());
5576 return self->findIdFirstEqualTuple(vals);
5580 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqualTuple : only strings in input supported !");
5583 int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
5585 if(PyString_Check(strOrListOfInt))
5587 Py_ssize_t sz=PyString_Size(strOrListOfInt);
5588 std::vector<char> vals(sz);
5589 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
5590 return self->findIdSequence(vals);
5592 %#if PY_VERSION_HEX >= 0x03000000
5593 else if(PyUnicode_Check(strOrListOfInt))
5595 Py_ssize_t sz=PyUnicode_GET_LENGTH(strOrListOfInt);
5596 std::vector<char> vals(sz);
5597 std::copy(PyUnicode_AsUTF8(strOrListOfInt),PyUnicode_AsUTF8(strOrListOfInt)+sz,vals.begin());
5598 return self->findIdSequence(vals);
5602 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
5605 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
5607 int sz=self->getNumberOfComponents();
5608 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
5609 self->getTuple(tupleId,tmp);
5610 return PyString_FromString(tmp);
5613 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5616 char tmp2[2]; tmp2[1]='\0';
5617 tmp2[0]=self->getMaxValue(tmp);
5618 PyObject *ret=PyTuple_New(2);
5619 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5620 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5624 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5627 char tmp2[2]; tmp2[1]='\0';
5628 tmp2[0]=self->getMinValue(tmp);
5629 PyObject *ret=PyTuple_New(2);
5630 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
5631 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5635 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5637 int nbOfCompo=self->getNumberOfComponents();
5642 if(PyString_Check(obj))
5644 Py_ssize_t sz=PyString_Size(obj);
5645 char *pt=PyString_AsString(obj);
5647 return self->findIdFirstEqual(pt[0]);
5649 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5651 %#if PY_VERSION_HEX >= 0x03000000
5652 if(PyUnicode_Check(obj))
5655 char *pt=PyUnicode_AsUTF8AndSize(obj, &sz);
5657 return self->findIdFirstEqual(pt[0]);
5659 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
5663 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
5666 return MEDCoupling_DataArrayAsciiChar_findIdFirstEqualTuple(self,obj);
5670 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5672 int nbOfCompo=self->getNumberOfComponents();
5679 if(PyString_Check(obj))
5681 Py_ssize_t sz=PyString_Size(obj);
5682 char *pt=PyString_AsString(obj);
5684 return self->presenceOfValue(pt[0]);
5686 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5688 %#if PY_VERSION_HEX >= 0x03000000
5689 if(PyUnicode_Check(obj))
5692 char *pt=PyUnicode_AsUTF8AndSize(obj, &sz);
5694 return self->presenceOfValue(pt[0]);
5696 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
5700 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5703 return MEDCoupling_DataArrayAsciiChar_presenceOfTuple(self,obj);
5707 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5710 std::vector<int> stdvecTyyppArr;
5711 std::pair<int, std::pair<int,int> > sTyyppArr;
5712 MEDCoupling::DataArrayInt *daIntTyypp=0;
5713 convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5717 return MEDCoupling_DataArrayAsciiChar_getTuple(self,iTypppArr);
5719 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
5721 return convertDataArrayChar(self->selectByTupleIdSafeSlice(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
5723 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
5725 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
5729 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5731 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.";
5733 std::vector<int> stdvecTyyppArr;
5734 std::pair<int, std::pair<int,int> > sTyyppArr;
5735 MEDCoupling::DataArrayInt *daIntTyypp=0;
5736 int nbOfCompo=self->getNumberOfComponents();
5737 int nbOfTuples=self->getNumberOfTuples();
5738 convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
5740 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
5741 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
5750 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
5756 MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5757 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5760 //value vector<string>
5763 MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5764 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5767 //value DataArrayChar
5770 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
5774 throw INTERP_KERNEL::Exception(msg);
5778 {//obj list-tuple[int]
5784 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
5790 MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5791 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5794 //value vector<string>
5797 MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5798 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5801 //value DataArrayChar
5804 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
5808 throw INTERP_KERNEL::Exception(msg);
5819 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
5825 MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5826 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5829 //value vector<string>
5832 MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5833 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5836 //value DataArrayChar
5839 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
5843 throw INTERP_KERNEL::Exception(msg);
5854 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
5860 MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
5861 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5864 //value vector<string>
5867 MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
5868 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5871 //value DataArrayChar
5874 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
5878 throw INTERP_KERNEL::Exception(msg);
5883 throw INTERP_KERNEL::Exception(msg);
5889 class DataArrayAsciiCharTuple;
5891 class DataArrayAsciiCharIterator
5894 DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
5895 ~DataArrayAsciiCharIterator();
5900 DataArrayAsciiCharTuple *ret=self->nextt();
5902 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
5905 PyErr_SetString(PyExc_StopIteration,"No more data.");
5912 class DataArrayAsciiCharTuple
5915 int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
5916 DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
5919 std::string __str__() const throw(INTERP_KERNEL::Exception)
5921 return self->repr();
5924 DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
5926 return self->buildDAAsciiChar(1,self->getNumberOfCompo());
5933 def MEDCouplingStdReduceFunct(cls,params):
5935 ret=object.__new__(cls)
5940 def MEDCouplingDataArrayDoubleReduce(self):
5941 if not MEDCouplingHasNumPyBindings():
5942 raise InterpKernelException("PyWrap of DataArrayDouble.__reduce__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !")
5943 return MEDCouplingStdReduceFunct,(DataArrayDouble,((self.toNumPyArray(),),(self.__getstate__()),))
5945 def MEDCouplingDataArrayIntReduce(self):
5946 if not MEDCouplingHasNumPyBindings():
5947 raise InterpKernelException("PyWrap of DataArrayInt.__reduce__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !")
5948 return MEDCouplingStdReduceFunct,(DataArrayInt,((self.toNumPyArray(),),(self.__getstate__()),))
5950 def MEDCouplingDataArrayByteReduce(self):
5951 if not MEDCouplingHasNumPyBindings():
5952 raise InterpKernelException("PyWrap of DataArrayByte.__reduce__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !")
5953 return MEDCouplingStdReduceFunct,(DataArrayByte,((self.toNumPyArray(),),(self.__getstate__()),))
5955 def MEDCouplingDataArrayFloatReduce(self):
5956 if not MEDCouplingHasNumPyBindings():
5957 raise InterpKernelException("PyWrap of DataArrayFloat.__reduce__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !")
5958 return MEDCouplingStdReduceFunct,(DataArrayFloat,((self.toNumPyArray(),),(self.__getstate__()),))