SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow")
ENDIF()
SET(SWIG_MODULE_MEDCoupling_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
+IF(MEDCOUPLING_USE_64BIT_IDS)
+ STRING(APPEND SWIG_MODULE_MEDCoupling_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS")
+ENDIF(MEDCOUPLING_USE_64BIT_IDS)
SET (MEDCoupling_SWIG_DPYS_FILES
MEDCouplingCommon.i
MEDCouplingMemArray.i
+ DataArrayInt.i
MEDCouplingFieldDiscretization.i
MEDCouplingFinalize.i
MEDCouplingTypemaps.i)
MEDCouplingRemapperCommon.i
MEDCouplingRefCountObject.i
MEDCouplingMemArray.i
+ DataArrayInt.i
MEDCouplingFieldDiscretization.i
MEDCouplingTimeDiscretization.i
MEDCouplingFinalize.i
SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_DEFINITIONS "-shadow")
ENDIF()
SET(SWIG_MODULE_MEDCouplingRemapper_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
+IF(MEDCOUPLING_USE_64BIT_IDS)
+ STRING(APPEND SWIG_MODULE_MEDCouplingRemapper_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS")
+ENDIF(MEDCOUPLING_USE_64BIT_IDS)
# _ABR_ Ensure dependency mechanism on all SWIG files and headers
SET (SWIG_MODULE_MEDCouplingRemapper_EXTRA_DEPS ${MEDCoupling_SWIG_DPYS_FILES}
--- /dev/null
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay (EDF R&D)
+
+%include "MEDCouplingMemArray.i"
+
+namespace MEDCoupling
+{
+ class DataArrayInt32Iterator;
+
+ class DataArrayInt32 : public DataArray
+ {
+ public:
+ static DataArrayInt32 *New();
+ int intValue() const;
+ int getHashCode() const;
+ bool empty() const;
+ void aggregate(const DataArrayInt32 *other);
+ DataArrayInt32 *performCopyOrIncrRef(bool deepCopy) const;
+ void deepCopyFrom(const DataArrayInt32& other);
+ void reserve(std::size_t nbOfElems);
+ void pushBackSilent(int val);
+ int popBackSilent();
+ void pack() const;
+ void allocIfNecessary(int nbOfTuple, int nbOfCompo);
+ bool isEqual(const DataArrayInt32& other) const;
+ bool isEqualWithoutConsideringStr(const DataArrayInt32& other) const;
+ bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt32& other) const;
+ DataArrayInt32 *buildPermutationArr(const DataArrayInt32& other) const;
+ DataArrayInt32 *sumPerTuple() const;
+ void sort(bool asc=true);
+ void reverse();
+ void checkMonotonic(bool increasing) const;
+ bool isMonotonic(bool increasing) const;
+ void checkStrictlyMonotonic(bool increasing) const;
+ bool isStrictlyMonotonic(bool increasing) const;
+ void fillWithZero();
+ void fillWithValue(int val);
+ void iota(int init=0);
+ std::string repr() const;
+ std::string reprZip() const;
+ std::string reprNotTooLong() const;
+ DataArrayInt32 *invertArrayO2N2N2O(int newNbOfElem) const;
+ DataArrayInt32 *invertArrayN2O2O2N(int oldNbOfElem) const;
+ DataArrayInt32 *invertArrayO2N2N2OBis(int newNbOfElem) const;
+#ifndef MEDCOUPLING_USE_64BIT_IDS
+ MCAuto< MapII > invertArrayN2O2O2NOptimized() const;
+ MCAuto< MapII > giveN2OOptimized() const;
+#endif
+ DataArrayInt32 *indicesOfSubPart(const DataArrayInt32& partOfThis) const;
+ DataArrayInt32 *fromNoInterlace() const;
+ DataArrayInt32 *toNoInterlace() const;
+ DataArrayInt32 *selectByTupleIdSafeSlice(int bg, int end, int step) const;
+ DataArrayInt32 *checkAndPreparePermutation() const;
+ DataArrayInt32 *buildPermArrPerLevel() const;
+ bool isIota(int sizeExpected) const;
+ bool isUniform(int val) const;
+ int checkUniformAndGuess() const;
+ bool hasUniqueValues() const;
+ DataArrayInt32 *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
+ void transpose();
+ DataArrayInt32 *changeNbOfComponents(int newNbOfComp, int dftValue) const;
+ void meldWith(const DataArrayInt32 *other);
+ void setPartOfValues1(const DataArrayInt32 *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
+ void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
+ void setPartOfValuesAdv(const DataArrayInt32 *a, const DataArrayIdType *tuplesSelec);
+ void getTuple(int tupleId, int *res) const;
+ int getIJ(int tupleId, int compoId) const;
+ int getIJSafe(int tupleId, int compoId) const;
+ int front() const;
+ int back() const;
+ void setIJ(int tupleId, int compoId, int newVal);
+ void setIJSilent(int tupleId, int compoId, int newVal);
+ int *getPointer();
+ const int *getConstPointer() const;
+ DataArrayInt32Iterator *iterator();
+ const int *begin() const;
+ const int *end() const;
+ DataArrayInt32 *findIdsEqual(int val) const;
+ DataArrayInt32 *findIdsNotEqual(int val) const;
+ int changeValue(int oldValue, int newValue);
+ int findIdFirstEqualTuple(const std::vector<int>& tupl) const;
+ int findIdFirstEqual(int value) const;
+ int findIdFirstEqual(const std::vector<int>& vals) const;
+ int findIdSequence(const std::vector<int>& vals) const;
+ bool presenceOfTuple(const std::vector<int>& tupl) const;
+ bool presenceOfValue(int value) const;
+ bool presenceOfValue(const std::vector<int>& vals) const;
+ int count(int value) const;
+ int accumulate(int compId) const;
+ int getMaxValueInArray() const;
+ int getMaxAbsValueInArray() const;
+ int getMinValueInArray() const;
+ void abs();
+ DataArrayInt32 *computeAbs() const;
+ void applyLin(int a, int b, int compoId);
+ void applyLin(int a, int b);
+ void applyInv(int numerator);
+ DataArrayInt32 *negate() const;
+ void applyDivideBy(int val);
+ void applyModulus(int val);
+ void applyRModulus(int val);
+ void applyPow(int val);
+ void applyRPow(int val);
+ DataArrayInt32 *findIdsInRange(int vmin, int vmax) const;
+ DataArrayInt32 *findIdsNotInRange(int vmin, int vmax) const;
+ DataArrayInt32 *findIdsStrictlyNegative() const;
+ bool checkAllIdsInRange(int vmin, int vmax) const;
+ static DataArrayInt32 *Aggregate(const DataArrayInt32 *a1, const DataArrayInt32 *a2, int offsetA2);
+ static DataArrayInt32 *Meld(const DataArrayInt32 *a1, const DataArrayInt32 *a2);
+ static DataArrayIdType *MakePartition(const std::vector<const DataArrayInt32 *>& groups, mcIdType newNb, std::vector< std::vector<mcIdType> >& fidsOfGroups);
+ static DataArrayInt32 *BuildUnion(const std::vector<const DataArrayInt32 *>& arr);
+ static DataArrayInt32 *BuildIntersection(const std::vector<const DataArrayInt32 *>& arr);
+ static DataArrayInt32 *FindPermutationFromFirstToSecond(const DataArrayInt32 *ids1, const DataArrayInt32 *ids2);
+ DataArrayInt32 *buildComplement(int nbOfElement) const;
+ DataArrayInt32 *buildSubstraction(const DataArrayInt32 *other) const;
+ DataArrayInt32 *buildSubstractionOptimized(const DataArrayInt32 *other) const;
+ DataArrayInt32 *buildUnion(const DataArrayInt32 *other) const;
+ DataArrayInt32 *buildIntersection(const DataArrayInt32 *other) const;
+ DataArrayInt32 *buildUnique() const;
+ DataArrayInt32 *buildUniqueNotSorted() const;
+ DataArrayInt32 *deltaShiftIndex() const;
+ void computeOffsets();
+ void computeOffsetsFull();
+ DataArrayInt32 *buildExplicitArrByRanges(const DataArrayInt32 *offsets) const;
+ DataArrayInt32 *findRangeIdForEachTuple(const DataArrayInt32 *ranges) const;
+ DataArrayInt32 *findIdInRangeForEachTuple(const DataArrayInt32 *ranges) const;
+ void sortEachPairToMakeALinkedList();
+ DataArrayInt32 *duplicateEachTupleNTimes(int nbTimes) const;
+ DataArrayInt32 *getDifferentValues() const;
+ static DataArrayInt32 *Add(const DataArrayInt32 *a1, const DataArrayInt32 *a2);
+ void addEqual(const DataArrayInt32 *other);
+ static DataArrayInt32 *Substract(const DataArrayInt32 *a1, const DataArrayInt32 *a2);
+ void substractEqual(const DataArrayInt32 *other);
+ static DataArrayInt32 *Multiply(const DataArrayInt32 *a1, const DataArrayInt32 *a2);
+ void multiplyEqual(const DataArrayInt32 *other);
+ static DataArrayInt32 *Divide(const DataArrayInt32 *a1, const DataArrayInt32 *a2);
+ void divideEqual(const DataArrayInt32 *other);
+ static DataArrayInt32 *Modulus(const DataArrayInt32 *a1, const DataArrayInt32 *a2);
+ void modulusEqual(const DataArrayInt32 *other);
+ static DataArrayInt32 *Pow(const DataArrayInt32 *a1, const DataArrayInt32 *a2);
+ void powEqual(const DataArrayInt32 *other);
+ MCAuto<DataArrayInt32> fromLinkedListOfPairToList() const;
+ MCAuto<DataArrayIdType> findIdsGreaterOrEqualTo(int val) const;
+ MCAuto<DataArrayIdType> findIdsGreaterThan(int val) const;
+ MCAuto<DataArrayIdType> findIdsLowerOrEqualTo(int val) const;
+ MCAuto<DataArrayIdType> findIdsLowerThan(int val) const;
+ MCAuto<DataArrayInt32> selectPartDef(const PartDefinition* pd) const;
+ MCAuto<DataArrayDouble> convertToDblArr() const;
+ MCAuto<DataArrayFloat> convertToFloatArr() const;
+ public:
+ static DataArrayInt32 *Range(int begin, int end, int step);
+ %extend
+ {
+ DataArrayInt32()
+ {
+ return DataArrayInt32::New();
+ }
+
+ static DataArrayInt32 *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
+ {
+ const char *msgBase="MEDCoupling::DataArrayInt32::New : Available API are : \n-DataArrayInt32.New()\n-DataArrayInt32.New([1,3,4])\n-DataArrayInt32.New([1,3,4],3)\n-DataArrayInt32.New([1,3,4,5],2,2)\n-DataArrayInt32.New([1,3,4,5,7,8],3,2)\n-DataArrayInt32.New([(1,3),(4,5),(7,8)])\n-DataArrayInt32.New(5)\n-DataArrayInt32.New(5,2)";
+ std::string msg(msgBase);
+#ifdef WITH_NUMPY
+ msg+="\n-DataArrayInt32.New(numpy array with dtype=int32)";
+#endif
+ msg+=" !";
+ if(PyList_Check(elt0) || PyTuple_Check(elt0))
+ {
+ if(nbOfTuples)
+ {
+ if(PyInt_Check(nbOfTuples))
+ {
+ mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ if(nbOfTuples1<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::New : should be a positive set of allocated memory !");
+ if(nbOfComp)
+ {
+ if(PyInt_Check(nbOfComp))
+ {//DataArrayInt32.New([1,3,4,5],2,2)
+ mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ if(nbOfCompo<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::New : should be a positive number of components !");
+ MCAuto<DataArrayInt32> ret=DataArrayInt32::New();
+ std::vector<int> tmp=fillArrayWithPyListInt2<int>(elt0,nbOfTuples1,nbOfCompo);
+ ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
+ return ret.retn();
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ }
+ else
+ {//DataArrayInt32.New([1,3,4],3)
+ MCAuto<DataArrayInt32> ret=DataArrayInt32::New();
+ mcIdType tmpp1=-1;
+ std::vector<int> tmp=fillArrayWithPyListInt2<int>(elt0,nbOfTuples1,tmpp1);
+ ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
+ return ret.retn();
+ }
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ }
+ else
+ {// DataArrayInt32.New([1,3,4])
+ MCAuto<DataArrayInt32> ret=DataArrayInt32::New();
+ mcIdType tmpp1=-1,tmpp2=-1;
+ std::vector<int> tmp=fillArrayWithPyListInt2<int>(elt0,tmpp1,tmpp2);
+ ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
+ return ret.retn();
+ }
+ }
+ else if(PyInt_Check(elt0))
+ {
+ int nbOfTuples1=PyInt_AS_LONG(elt0);
+ if(nbOfTuples1<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::New : should be a positive set of allocated memory !");
+ if(nbOfTuples)
+ {
+ if(!nbOfComp)
+ {
+ if(PyInt_Check(nbOfTuples))
+ {//DataArrayInt32.New(5,2)
+ int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+ if(nbOfCompo<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::New : should be a positive number of components !");
+ MCAuto<DataArrayInt32> ret=DataArrayInt32::New();
+ ret->alloc(nbOfTuples1,nbOfCompo);
+ return ret.retn();
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ }
+ else
+ {//DataArrayInt32.New(5)
+ MCAuto<DataArrayInt32> ret=DataArrayInt32::New();
+ ret->alloc(nbOfTuples1,1);
+ return ret.retn();
+ }
+ }
+#ifdef WITH_NUMPY
+ else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
+ {//DataArrayInt32.New(numpyArray)
+ return BuildNewInstance<DataArrayInt32,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
+ }
+#endif
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
+ }
+
+ DataArrayInt32(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
+ {
+ return MEDCoupling_DataArrayInt32_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
+ }
+
+ std::string __str__() const
+ {
+ return self->reprNotTooLong();
+ }
+
+ int __len__() const
+ {
+ if(self->isAllocated())
+ {
+ return self->getNumberOfTuples();
+ }
+ else
+ {
+ throw INTERP_KERNEL::Exception("DataArrayInt32::__len__ : Instance is NOT allocated !");
+ }
+ }
+
+ int __int__() const
+ {
+ return self->intValue();
+ }
+
+ DataArrayInt32Iterator *__iter__()
+ {
+ return self->iterator();
+ }
+
+ PyObject *accumulate() const
+ {
+ mcIdType sz=self->getNumberOfComponents();
+ INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
+ self->accumulate((int *)tmp);
+ return convertIntArrToPyList((const int *)tmp,sz);
+ }
+
+ DataArrayInt32 *accumulatePerChunck(PyObject *indexArr) const
+ {
+ mcIdType sw,sz,val;
+ std::vector<mcIdType> val2;
+ const mcIdType *bg=convertIntStarLikePyObjToCppIntStar(indexArr,sw,sz,val,val2);
+ return self->accumulatePerChunck(bg,bg+sz);
+ }
+
+ DataArrayIdType *findIdsEqualTuple(PyObject *inputTuple) const
+ {
+ mcIdType sw,sz;
+ int val;
+ std::vector<int> val2;
+ const int *bg(convertIntStarLikePyObjToCppIntStar(inputTuple,sw,sz,val,val2));
+ return self->findIdsEqualTuple(bg,bg+sz);
+ }
+
+ DataArrayIdType *findIdForEach(PyObject *vals) const
+ {
+ mcIdType sw,sz;
+ int val;
+ std::vector<int> val2;
+ const int *bg(convertIntStarLikePyObjToCppIntStar(vals,sw,sz,val,val2));
+ MCAuto<DataArrayIdType> ret(self->findIdForEach(bg,bg+sz));
+ return ret.retn();
+ }
+
+ PyObject *splitInBalancedSlices(mcIdType nbOfSlices) const
+ {
+ std::vector< std::pair<mcIdType,mcIdType> > slcs(self->splitInBalancedSlices(nbOfSlices));
+ PyObject *ret=PyList_New(slcs.size());
+ for(std::size_t i=0;i<slcs.size();i++)
+ PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
+ return ret;
+ }
+
+ DataArrayInt32 *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const
+ {
+ if(!PySlice_Check(slic))
+ throw INTERP_KERNEL::Exception("DataArrayInt32::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
+ Py_ssize_t strt=2,stp=2,step=2;
+ GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArrayInt32::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
+ if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
+ throw INTERP_KERNEL::Exception("DataArrayInt32::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice contains some unknowns that can't be determined in static method ! Call DataArray::getSlice (non static) instead !");
+ return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
+ }
+
+ PyObject *getMinMaxValues() const
+ {
+ int a,b;
+ self->getMinMaxValues(a,b);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,PyInt_FromLong(a));
+ PyTuple_SetItem(ret,1,PyInt_FromLong(b));
+ return ret;
+ }
+
+ static PyObject *ConvertIndexArrayToO2N(mcIdType nbOfOldTuples, PyObject *arr, PyObject *arrI)
+ {
+ mcIdType newNbOfTuples=-1;
+ mcIdType szArr,szArrI,sw,iTypppArrI;
+ int iTypppArr;
+ std::vector<int> stdvecTyyppArr;
+ std::vector<mcIdType> stdvecTyyppArrI;
+ const int *arrPtr=convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
+ const mcIdType *arrIPtr=convertIntStarLikePyObjToCppIntStar(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
+ DataArrayIdType *ret0=MEDCoupling::DataArrayInt32::ConvertIndexArrayToO2N(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
+ PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
+ return ret;
+ }
+
+ static DataArrayIdType *CheckAndPreparePermutation(PyObject *arr)
+ {
+ MCAuto<DataArrayIdType> ret(DataArrayIdType::New());
+ mcIdType szArr,sw;
+ int iTypppArr;
+ std::vector<int> stdvecTyyppArr;
+ const int *arrPtr(convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
+ mcIdType *pt(MEDCoupling::DataArrayInt32::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
+ ret->useArray(pt,true,MEDCoupling::DeallocType::C_DEALLOC,szArr,1);
+ return ret.retn();
+ }
+
+ void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
+ {
+ const char *msg="MEDCoupling::DataArrayInt32::setValues : Available API are : \n-DataArrayInt32.setValues([1,3,4])\n-DataArrayInt32.setValues([1,3,4],3)\n-DataArrayInt32.setValues([1,3,4,5],2,2)\n-DataArrayInt32.New(5)\n !";
+ if(PyList_Check(li) || PyTuple_Check(li))
+ {
+ if(nbOfTuples && nbOfTuples != Py_None)
+ {
+ if(PyInt_Check(nbOfTuples))
+ {
+ mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ if(nbOfTuples1<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::setValue : should be a positive set of allocated memory !");
+ if(nbOfComp && nbOfComp != Py_None)
+ {
+ if(PyInt_Check(nbOfComp))
+ {//DataArrayInt32.setValues([1,3,4,5],2,2)
+ mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ if(nbOfCompo<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::setValue : should be a positive number of components !");
+ std::vector<int> tmp=fillArrayWithPyListInt2<int>(li,nbOfTuples1,nbOfCompo);
+ self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ else
+ {//DataArrayInt32.setValues([1,3,4],3)
+ mcIdType tmpp1=-1;
+ std::vector<int> tmp=fillArrayWithPyListInt2<int>(li,nbOfTuples1,tmpp1);
+ self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
+ }
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ else
+ {// DataArrayInt32.setValues([1,3,4])
+ mcIdType tmpp1=-1,tmpp2=-1;
+ std::vector<int> tmp=fillArrayWithPyListInt2<int>(li,tmpp1,tmpp2);
+ self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
+ }
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg);
+ }
+
+ PyObject *getValues() const
+ {
+ const int *vals=self->getConstPointer();
+ return convertIntArrToPyList(vals,self->getNbOfElems());
+ }
+
+#ifdef WITH_NUMPY
+ PyObject *toNumPyArray() // not const. It is not a bug !
+ {
+ return ToNumPyArray<DataArrayInt32,int>(self,NPY_INT32,"DataArrayInt32");
+ }
+#endif
+
+ PyObject *isEqualIfNotWhy(const DataArrayInt32& other) const
+ {
+ std::string ret1;
+ bool ret0=self->isEqualIfNotWhy(other,ret1);
+ PyObject *ret=PyTuple_New(2);
+ PyObject *ret0Py=ret0?Py_True:Py_False;
+ Py_XINCREF(ret0Py);
+ PyTuple_SetItem(ret,0,ret0Py);
+ PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
+ return ret;
+ }
+
+ PyObject *getValuesAsTuple() const
+ {
+ const int *vals=self->getConstPointer();
+ mcIdType nbOfComp=self->getNumberOfComponents();
+ mcIdType nbOfTuples=self->getNumberOfTuples();
+ return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
+ }
+
+ static PyObject *MakePartition(PyObject *gps, mcIdType newNb)
+ {
+ std::vector<const DataArrayInt32 *> groups;
+ std::vector< std::vector<mcIdType> > fidsOfGroups;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt32 *>(gps,SWIGTITraits<mcIdType>::TI,"DataArrayInt32",groups);
+ DataArrayIdType *ret0=MEDCoupling::DataArrayInt32::MakePartition(groups,newNb,fidsOfGroups);
+ PyObject *ret = PyList_New(2);
+ PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ mcIdType sz=fidsOfGroups.size();
+ PyObject *ret1 = PyList_New(sz);
+ for(mcIdType i=0;i<sz;i++)
+ PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
+ PyList_SetItem(ret,1,ret1);
+ return ret;
+ }
+
+#ifndef MEDCOUPLING_USE_64BIT_IDS
+ void transformWithIndArr(PyObject *li)
+ {
+ void *da=0;
+ int res1(SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 ));
+ if (!SWIG_IsOK(res1))
+ {
+ int res2(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
+ if(SWIG_IsOK(res2))
+ {
+ MapII *m=reinterpret_cast<MapII *>(da);
+ self->transformWithIndArr(*m);
+ }
+ else
+ {
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2<int>(li,&size);
+ self->transformWithIndArr(tmp,tmp+size);
+ }
+ }
+ else
+ {
+ DataArrayInt32 *da2=reinterpret_cast< DataArrayInt32 * >(da);
+ self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
+ }
+ }
+#endif
+ DataArrayIdType *findIdsEqualList(PyObject *obj)
+ {
+ mcIdType sw;
+ int singleVal;
+ std::vector<int> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ DataArrayInt32 *daIntTyypp=0;
+ convertIntStarOrSliceLikePyObjToCpp(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ return self->findIdsEqualList(&singleVal,&singleVal+1);
+ case 2:
+ return self->findIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
+ case 4:
+ return self->findIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
+ default:
+ throw INTERP_KERNEL::Exception("DataArrayInt32::findIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt32 !");
+ }
+ }
+
+ DataArrayIdType *findIdsNotEqualList(PyObject *obj)
+ {
+ mcIdType sw;
+ int singleVal;
+ std::vector<int> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ DataArrayInt32 *daIntTyypp=0;
+ convertIntStarOrSliceLikePyObjToCpp(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ return self->findIdsNotEqualList(&singleVal,&singleVal+1);
+ case 2:
+ return self->findIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
+ case 4:
+ return self->findIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
+ default:
+ throw INTERP_KERNEL::Exception("DataArrayInt32::findIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt32 !");
+ }
+ }
+
+ PyObject *splitByValueRange(PyObject *li) const
+ {
+ DataArrayInt32 *ret0=0,*ret1=0,*ret2=0;
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2<int>(li,&size);
+ self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
+ }
+ else
+ {
+ DataArrayInt32 *da2=reinterpret_cast< DataArrayInt32 * >(da);
+ if(!da2)
+ throw INTERP_KERNEL::Exception("Not null DataArrayInt32 instance expected !");
+ da2->checkAllocated();
+ self->splitByValueRange(da2->begin(),da2->end(),ret0,ret1,ret2);
+ }
+ PyObject *ret = PyList_New(3);
+ PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ DataArrayIdType *transformWithIndArrR(PyObject *li) const
+ {
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2<int>(li,&size);
+ return self->transformWithIndArrR(tmp,tmp+size);
+ }
+ else
+ {
+ DataArrayInt32 *da2=reinterpret_cast< DataArrayInt32 * >(da);
+ return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
+ }
+ }
+
+ DataArrayInt32 *renumberAndReduce(PyObject *li, mcIdType newNbOfTuple)
+ {
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumberAndReduce(tmp,newNbOfTuple);
+ }
+ else
+ {
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
+ if(!da2)
+ throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ da2->checkAllocated();
+ mcIdType size=self->getNumberOfTuples();
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
+ }
+ }
+
+ DataArrayInt32 *renumber(PyObject *li)
+ {
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumber(tmp);
+ }
+ else
+ {
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
+ if(!da2)
+ throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ da2->checkAllocated();
+ mcIdType size=self->getNumberOfTuples();
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumber(da2->getConstPointer());
+ }
+ }
+
+ DataArrayInt32 *renumberR(PyObject *li)
+ {
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumberR(tmp);
+ }
+ else
+ {
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
+ if(!da2)
+ throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ da2->checkAllocated();
+ mcIdType size=self->getNumberOfTuples();
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumberR(da2->getConstPointer());
+ }
+ }
+
+ void setSelectedComponents(const DataArrayInt32 *a, PyObject *li)
+ {
+ std::vector<std::size_t> tmp;
+ convertPyToNewIntArr3(li,tmp);
+ self->setSelectedComponents(a,tmp);
+ }
+
+ PyObject *explodeComponents() const
+ {
+ std::vector< MCAuto<DataArrayInt32> > retCpp(self->explodeComponents());
+ std::size_t sz(retCpp.size());
+ PyObject *res(PyList_New(sz));
+ for(std::size_t i=0;i<sz;i++)
+ PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i].retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ return res;
+ }
+
+ PyObject *getTuple(mcIdType tupleId)
+ {
+ mcIdType sz=self->getNumberOfComponents();
+ INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
+ self->getTuple(tupleId,tmp);
+ return convertIntArrToPyList((const int*)tmp,sz);
+ }
+
+ PyObject *changeSurjectiveFormat(int targetNb) const
+ {
+ DataArrayIdType *arr=0;
+ DataArrayIdType *arrI=0;
+ self->changeSurjectiveFormat(targetNb,arr,arrI);
+ PyObject *res = PyList_New(2);
+ PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
+ PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
+ return res;
+ }
+
+ static DataArrayInt32 *Meld(PyObject *li)
+ {
+ std::vector<const DataArrayInt32 *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt32 *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt32",tmp);
+ return DataArrayInt32::Meld(tmp);
+ }
+
+ static DataArrayInt32 *Aggregate(PyObject *li)
+ {
+ std::vector<const DataArrayInt32 *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt32 *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt32",tmp);
+ return DataArrayInt32::Aggregate(tmp);
+ }
+
+ static DataArrayInt32 *AggregateIndexes(PyObject *li)
+ {
+ std::vector<const DataArrayInt32 *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt32 *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt32",tmp);
+ return DataArrayInt32::AggregateIndexes(tmp);
+ }
+
+ static DataArrayInt32 *BuildUnion(PyObject *li)
+ {
+ std::vector<const DataArrayInt32 *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt32 *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt32",tmp);
+ return DataArrayInt32::BuildUnion(tmp);
+ }
+
+ static DataArrayInt32 *BuildIntersection(PyObject *li)
+ {
+ std::vector<const DataArrayInt32 *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt32 *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt32",tmp);
+ return DataArrayInt32::BuildIntersection(tmp);
+ }
+
+ PyObject *getMaxValue() const
+ {
+ mcIdType tmp;
+ int r1=self->getMaxValue(tmp);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
+ PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ return ret;
+ }
+
+ PyObject *getMaxAbsValue(std::size_t& tupleId) const
+ {
+ std::size_t tmp;
+ int r1=self->getMaxAbsValue(tmp);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
+ PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ return ret;
+ }
+
+ PyObject *getMinValue() const
+ {
+ mcIdType tmp;
+ int r1=self->getMinValue(tmp);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
+ PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ return ret;
+ }
+
+ mcIdType index(PyObject *obj) const
+ {
+ mcIdType nbOfCompo=self->getNumberOfComponents();
+ switch(nbOfCompo)
+ {
+ case 1:
+ {
+ if(PyInt_Check(obj))
+ {
+ int val=(int)PyInt_AS_LONG(obj);
+ return self->findIdFirstEqual(val);
+ }
+ else
+ throw INTERP_KERNEL::Exception("DataArrayInt32::index : 'this' contains one component and trying to find an element which is not an integer !");
+ }
+ default:
+ {
+ std::vector<int> arr;
+ convertPyToNewIntArr3(obj,arr);
+ return self->findIdFirstEqualTuple(arr);
+ }
+ }
+ }
+
+ bool __contains__(PyObject *obj) const
+ {
+ mcIdType nbOfCompo=self->getNumberOfComponents();
+ switch(nbOfCompo)
+ {
+ case 0:
+ return false;
+ case 1:
+ {
+ if(PyInt_Check(obj))
+ {
+ int val=(int)PyInt_AS_LONG(obj);
+ return self->presenceOfValue(val);
+ }
+ else
+ throw INTERP_KERNEL::Exception("DataArrayInt32::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
+ }
+ default:
+ {
+ std::vector<int> arr;
+ convertPyToNewIntArr3(obj,arr);
+ return self->presenceOfTuple(arr);
+ }
+ }
+ }
+
+ PyObject *__getitem__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in DataArrayInt32::__getitem__ !";
+ const char msg2[]="DataArrayInt32::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
+ self->checkAllocated();
+ mcIdType nbOfTuples=self->getNumberOfTuples();
+ mcIdType nbOfComponents=self->getNumberOfComponents();
+ mcIdType it1;
+ std::size_t ic1;
+ std::vector<mcIdType> vt1;
+ std::vector<std::size_t> vc1;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > pt1,pc1;
+ DataArrayIdType *dt1=0,*dc1=0;
+ mcIdType sw;
+ convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
+ MCAuto<DataArrayInt32> ret;
+ switch(sw)
+ {
+ case 1:
+ {
+ if(nbOfComponents==1)
+ return PyInt_FromLong(self->getIJSafe(it1,0));
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 2:
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ case 3:
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ case 4:
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ case 5:
+ return PyInt_FromLong(self->getIJSafe(it1,ic1));
+ case 6:
+ {
+ ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
+ std::vector<std::size_t> v2(1,ic1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 7:
+ {
+ ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
+ std::vector<std::size_t> v2(1,ic1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 8:
+ {
+ ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
+ std::vector<std::size_t> v2(1,ic1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 9:
+ {
+ ret=self->selectByTupleIdSafe(&it1,&it1+1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 10:
+ {
+ ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 11:
+ {
+ ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 12:
+ {
+ ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 13:
+ {
+ ret=self->selectByTupleIdSafe(&it1,&it1+1);
+ mcIdType nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
+ std::vector<std::size_t> v2(nbOfComp);
+ for(int i=0;i<nbOfComp;i++)
+ v2[i]=pc1.first+i*pc1.second.second;
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 14:
+ {
+ ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
+ mcIdType nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
+ std::vector<std::size_t> v2(nbOfComp);
+ for(int i=0;i<nbOfComp;i++)
+ v2[i]=pc1.first+i*pc1.second.second;
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 15:
+ {
+ ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
+ mcIdType nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
+ std::vector<std::size_t> v2(nbOfComp);
+ for(mcIdType i=0;i<nbOfComp;i++)
+ v2[i]=pc1.first+i*pc1.second.second;
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ case 16:
+ {
+ ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
+ mcIdType nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
+ std::vector<std::size_t> v2(nbOfComp);
+ for(int i=0;i<nbOfComp;i++)
+ v2[i]=pc1.first+i*pc1.second.second;
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__setitem__(PyObject *obj, PyObject *value)
+ {
+ self->checkAllocated();
+ const char msg[]="Unexpected situation in __setitem__ !";
+ mcIdType nbOfTuples=self->getNumberOfTuples();
+ mcIdType nbOfComponents=self->getNumberOfComponents();
+ mcIdType sw1,sw2;
+ int i1;
+ std::vector<int> v1;
+ DataArrayInt32 *d1=0;
+ DataArrayInt32Tuple *dd1=0;
+ convertIntStarLikePyObjToCpp(value,sw1,i1,v1,d1,dd1);
+ mcIdType it1,ic1;
+ std::vector<mcIdType> vt1,vc1;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > pt1,pc1;
+ DataArrayIdType *dt1=0,*dc1=0;
+ convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
+ MCAuto<DataArrayInt32> tmp;
+ switch(sw2)
+ {
+ case 1:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
+ return self;
+ case 3:
+ self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 2:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
+ return self;
+ case 3:
+ self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 3:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
+ return self;
+ case 3:
+ self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 4:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
+ return self;
+ case 3:
+ self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 5:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
+ return self;
+ case 3:
+ self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 6:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
+ return self;
+ case 3:
+ self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 7:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
+ return self;
+ case 3:
+ self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 8:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
+ return self;
+ case 3:
+ self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 9:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
+ return self;
+ case 3:
+ self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 10:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
+ return self;
+ case 3:
+ self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 11:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
+ return self;
+ case 3:
+ self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 12:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
+ return self;
+ case 3:
+ self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 13:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
+ return self;
+ case 3:
+ self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 14:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
+ return self;
+ case 3:
+ self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 15:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
+ return self;
+ case 3:
+ self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ case 16:
+ {
+ switch(sw1)
+ {
+ case 1:
+ self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ case 2:
+ tmp=DataArrayInt32::New();
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
+ self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
+ return self;
+ case 3:
+ self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ case 4:
+ tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
+ self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
+ return self;
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ break;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ return self;
+ }
+
+ DataArrayInt32 *__neg__() const
+ {
+ return self->negate();
+ }
+
+ DataArrayInt32 *__add__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __add__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayIntTuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyLin(1,val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Add(self,aaaa);
+ }
+ case 3:
+ {
+ return DataArrayInt32::Add(self,a);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Add(self,aaaa);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__radd__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __radd__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayIntTuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyLin(1,val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Add(self,aaaa);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Add(self,aaaa);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __iadd__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ self->applyLin(1,val);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> bb=DataArrayInt32::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ self->addEqual(bb);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 3:
+ {
+ self->addEqual(a);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ self->addEqual(aaaa);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__sub__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __sub__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyLin(1,-val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Substract(self,aaaa);
+ }
+ case 3:
+ {
+ return DataArrayInt32::Substract(self,a);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Substract(self,aaaa);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__rsub__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __rsub__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyLin(-1,val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Substract(aaaa,self);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Substract(aaaa,self);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __isub__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ self->applyLin(1,-val);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> bb=DataArrayInt32::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ self->substractEqual(bb);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 3:
+ {
+ self->substractEqual(a);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ self->substractEqual(aaaa);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__mul__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __mul__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyLin(val,0);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Multiply(self,aaaa);
+ }
+ case 3:
+ {
+ return DataArrayInt32::Multiply(self,a);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Multiply(self,aaaa);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__rmul__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __rmul__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyLin(val,0);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Multiply(self,aaaa);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Multiply(self,aaaa);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __imul__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ self->applyLin(val,0);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> bb=DataArrayInt32::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ self->multiplyEqual(bb);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 3:
+ {
+ self->multiplyEqual(a);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ self->multiplyEqual(aaaa);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__div__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __div__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyDivideBy(val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Divide(self,aaaa);
+ }
+ case 3:
+ {
+ return DataArrayInt32::Divide(self,a);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Divide(self,aaaa);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__rdiv__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __rdiv__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyInv(val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Divide(aaaa,self);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Divide(aaaa,self);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __idiv__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ self->applyDivideBy(val);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> bb=DataArrayInt32::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ self->divideEqual(bb);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 3:
+ {
+ self->divideEqual(a);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ self->divideEqual(aaaa);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__mod__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __mod__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyModulus(val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Modulus(self,aaaa);
+ }
+ case 3:
+ {
+ return DataArrayInt32::Modulus(self,a);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Modulus(self,aaaa);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__rmod__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __rmod__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyRModulus(val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Modulus(aaaa,self);
+ }
+ case 3:
+ {
+ return DataArrayInt32::Modulus(a,self);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Modulus(aaaa,self);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ PyObject *___imod___(PyObject *trueSelf, PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __imod__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ self->applyModulus(val);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 3:
+ {
+ self->modulusEqual(a);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ self->modulusEqual(aaaa);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__pow__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __pow__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyPow(val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Pow(self,aaaa);
+ }
+ case 3:
+ {
+ return DataArrayInt32::Pow(self,a);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Pow(self,aaaa);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ DataArrayInt32 *__rpow__(PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __rpow__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ MCAuto<DataArrayInt32> ret=self->deepCopy();
+ ret->applyRPow(val);
+ return ret.retn();
+ }
+ case 2:
+ {
+ MCAuto<DataArrayInt32> aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size());
+ return DataArrayInt32::Pow(aaaa,self);
+ }
+ case 3:
+ {
+ return DataArrayInt32::Pow(a,self);
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ return DataArrayInt32::Pow(aaaa,self);
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
+ {
+ const char msg[]="Unexpected situation in __ipow__ !";
+ int val;
+ DataArrayInt32 *a;
+ std::vector<int> aa;
+ DataArrayInt32Tuple *aaa;
+ mcIdType sw;
+ convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
+ switch(sw)
+ {
+ case 1:
+ {
+ self->applyPow(val);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 3:
+ {
+ self->powEqual(a);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ case 4:
+ {
+ MCAuto<DataArrayInt32> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ self->powEqual(aaaa);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+
+ std::string __repr__() const
+ {
+ std::ostringstream oss;
+ self->reprQuickOverview(oss);
+ return oss.str();
+ }
+
+ void pushBackValsSilent(PyObject *li)
+ {
+ mcIdType szArr,sw;
+ int iTypppArr;
+ std::vector<int> stdvecTyyppArr;
+ const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ self->pushBackValsSilent(tmp,tmp+szArr);
+ }
+
+ PyObject *partitionByDifferentValues() const
+ {
+ std::vector<int> ret1;
+ std::vector<DataArrayIdType *> ret0=self->partitionByDifferentValues(ret1);
+ std::size_t sz=ret0.size();
+ PyObject *pyRet=PyTuple_New(2);
+ PyObject *pyRet0=PyList_New((int)sz);
+ PyObject *pyRet1=PyList_New((int)sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
+ }
+ PyTuple_SetItem(pyRet,0,pyRet0);
+ PyTuple_SetItem(pyRet,1,pyRet1);
+ return pyRet;
+ }
+
+ PyObject *findIdsRangesInListOfIds(const DataArrayInt32 *listOfIds) const
+ {
+ DataArrayIdType *ret0=0;
+ DataArrayInt32 *ret1=0;
+ self->findIdsRangesInListOfIds(listOfIds,ret0,ret1);
+ PyObject *pyRet=PyTuple_New(2);
+ PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<int>::TI, SWIG_POINTER_OWN | 0 ));
+ return pyRet;
+ }
+
+ PyObject *isRange() const
+ {
+ int a(0),b(0),c(0);
+ bool ret(self->isRange(a,b,c));
+ PyObject *pyRet=PyTuple_New(2);
+ PyObject *ret0Py=ret?Py_True:Py_False,*ret1Py(0);
+ Py_XINCREF(ret0Py);
+ PyTuple_SetItem(pyRet,0,ret0Py);
+ if(ret)
+ ret1Py=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
+ else
+ {
+ ret1Py=Py_None;
+ Py_XINCREF(ret1Py);
+ }
+ PyTuple_SetItem(pyRet,1,ret1Py);
+ return pyRet;
+ }
+
+ static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt32 *arr, DataArrayIdType *arrIndx, mcIdType offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
+ {
+ mcIdType sw;
+ int singleVal;
+ std::vector<int> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayInt32 *daIntTyypp=0;
+ if(!arrIndx)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
+ convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ return DataArrayInt32::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
+ case 2:
+ return DataArrayInt32::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
+ case 4:
+ return DataArrayInt32::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
+ default:
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt32 !");
+ }
+ }
+
+ static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn) throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayInt32 *arrOut=0;
+ DataArrayIdType *arrIndexOut=0;
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
+ if(!arrIndxIn)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
+ convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ {
+ DataArrayInt32::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
+ break;
+ }
+ case 2:
+ {
+ DataArrayInt32::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
+ break;
+ }
+ case 4:
+ {
+ DataArrayInt32::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
+ break;
+ }
+ default:
+ throw INTERP_KERNEL::Exception("DataArrayInt32::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt32 !");
+ }
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ static PyObject *ExtractFromIndexedArraysSlice(mcIdType strt, mcIdType stp, mcIdType step, const DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn) throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayInt32 *arrOut=0;
+ DataArrayIdType *arrIndexOut=0;
+ DataArrayInt32::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn) throw(INTERP_KERNEL::Exception)
+ {
+ if(!PySlice_Check(slic))
+ throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
+ Py_ssize_t strt=2,stp=2,step=2;
+ if(!arrIndxIn)
+ throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
+ arrIndxIn->checkAllocated();
+ if(arrIndxIn->getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
+ GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
+ DataArrayInt32 *arrOut=0;
+ DataArrayIdType *arrIndexOut=0;
+ DataArrayInt32::ExtractFromIndexedArraysSlice(ToIdType(strt),ToIdType(stp),ToIdType(step),arrIn,arrIndxIn,arrOut,arrIndexOut);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ static PyObject *SetPartOfIndexedArrays(PyObject *li,
+ const DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn,
+ const DataArrayInt32 *srcArr, const DataArrayIdType *srcArrIndex) throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayInt32 *arrOut=0;
+ DataArrayIdType *arrIndexOut=0;
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
+ if(!arrIndxIn)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::SetPartOfIndexedArrays : null pointer as arrIndex !");
+ convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ {
+ DataArrayInt32::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
+ break;
+ }
+ case 2:
+ {
+ DataArrayInt32::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
+ break;
+ }
+ case 4:
+ {
+ DataArrayInt32::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
+ break;
+ }
+ default:
+ throw INTERP_KERNEL::Exception("DataArrayInt32::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt32 !");
+ }
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn,
+ const DataArrayInt32 *srcArr, const DataArrayIdType *srcArrIndex) throw(INTERP_KERNEL::Exception)
+ {
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
+ if(!arrIndxIn)
+ throw INTERP_KERNEL::Exception("DataArrayInt32::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
+ convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ {
+ DataArrayInt32::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
+ break;
+ }
+ case 2:
+ {
+ DataArrayInt32::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
+ break;
+ }
+ case 4:
+ {
+ DataArrayInt32::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
+ break;
+ }
+ default:
+ throw INTERP_KERNEL::Exception("DataArrayInt32::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt32 !");
+ }
+ }
+
+ } // end extent
+ };
+
+ class DataArrayInt32Tuple;
+
+ class DataArrayInt32Iterator
+ {
+ public:
+ DataArrayInt32Iterator(DataArrayInt32 *da);
+ ~DataArrayInt32Iterator();
+ %extend
+ {
+ PyObject *next()
+ {
+ DataArrayInt32Tuple *ret=self->nextt();
+ if(ret)
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt32Tuple,SWIG_POINTER_OWN | 0);
+ else
+ {
+ PyErr_SetString(PyExc_StopIteration,"No more data.");
+ return 0;
+ }
+ }
+ }
+ };
+
+ class DataArrayInt32Tuple
+ {
+ public:
+ std::size_t getNumberOfCompo() const;
+ DataArrayInt32 *buildDAInt(int nbOfTuples, int nbOfCompo) const;
+ %extend
+ {
+ std::string __str__() const
+ {
+ return self->repr();
+ }
+
+ int __int__() const
+ {
+ return self->intValue();
+ }
+
+ DataArrayInt32 *buildDAInt()
+ {
+ return self->buildDAInt(1,self->getNumberOfCompo());
+ }
+
+ PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
+ {
+ MCAuto<DataArrayInt32> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt32____iadd___(ret,0,obj);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+
+ PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
+ {
+ MCAuto<DataArrayInt32> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt32____isub___(ret,0,obj);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+
+ PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
+ {
+ MCAuto<DataArrayInt32> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt32____imul___(ret,0,obj);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+ PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
+ {
+ MCAuto<DataArrayInt32> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt32____idiv___(ret,0,obj);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+
+ PyObject *___imod___(PyObject *trueSelf, PyObject *obj)
+ {
+ MCAuto<DataArrayInt32> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt32____imod___(ret,0,obj);
+ Py_XINCREF(trueSelf);
+ return trueSelf;
+ }
+
+ PyObject *__len__()
+ {
+ return PyInt_FromLong(self->getNumberOfCompo());
+ }
+
+ PyObject *__getitem__(PyObject *obj)
+ {
+ const char msg2[]="DataArrayInt32Tuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
+ const int *pt=self->getConstPointer();
+ int nbc=self->getNumberOfCompo();
+ convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ {
+ if(singleVal>=nbc)
+ {
+ std::ostringstream oss;
+ oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
+ PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
+ return 0;
+ }
+ if(singleVal>=0)
+ return PyInt_FromLong(pt[singleVal]);
+ else
+ {
+ if(nbc+singleVal>0)
+ return PyInt_FromLong(pt[nbc+singleVal]);
+ else
+ {
+ std::ostringstream oss;
+ oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
+ }
+ case 2:
+ {
+ PyObject *t=PyTuple_New(multiVal.size());
+ for(int j=0;j<(int)multiVal.size();j++)
+ {
+ int cid=multiVal[j];
+ if(cid>=nbc)
+ {
+ std::ostringstream oss;
+ oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
+ }
+ return t;
+ }
+ case 3:
+ {
+ int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
+ PyObject *t=PyTuple_New(sz);
+ for(int j=0;j<sz;j++)
+ PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
+ return t;
+ }
+ default:
+ throw INTERP_KERNEL::Exception("DataArrayInt32Tuple::__getitem__ : unrecognized type entered !");
+ }
+ }
+
+ DataArrayInt32Tuple *__setitem__(PyObject *obj, PyObject *value)
+ {
+ const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
+ const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
+ mcIdType sw1,sw2;
+ mcIdType singleValV;
+ std::vector<mcIdType> multiValV;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slicV;
+ MEDCoupling::DataArrayInt32Tuple *daIntTyyppV=0;
+ int nbc=self->getNumberOfCompo();
+ convertObjToPossibleCpp22<int>(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
+ int singleVal;
+ std::vector<int> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayInt32 *daIntTyypp=0;
+ int *pt=self->getPointer();
+ convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw2)
+ {
+ case 1:
+ {
+ if(singleVal>=nbc)
+ {
+ std::ostringstream oss;
+ oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ switch(sw1)
+ {
+ case 1:
+ {
+ pt[singleVal]=singleValV;
+ return self;
+ }
+ case 2:
+ {
+ if(multiValV.size()!=1)
+ {
+ std::ostringstream oss;
+ oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ pt[singleVal]=multiValV[0];
+ return self;
+ }
+ case 4:
+ {
+ pt[singleVal]=daIntTyyppV->getConstPointer()[0];
+ return self;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+ case 2:
+ {
+ switch(sw1)
+ {
+ case 1:
+ {
+ for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
+ {
+ if(*it>=nbc)
+ {
+ std::ostringstream oss;
+ oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ pt[*it]=singleValV;
+ }
+ return self;
+ }
+ case 2:
+ {
+ if(multiVal.size()!=multiValV.size())
+ {
+ std::ostringstream oss;
+ oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ for(int i=0;i<(int)multiVal.size();i++)
+ {
+ int pos=multiVal[i];
+ if(pos>=nbc)
+ {
+ std::ostringstream oss;
+ oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ pt[multiVal[i]]=multiValV[i];
+ }
+ return self;
+ }
+ case 4:
+ {
+ const int *ptV=daIntTyyppV->getConstPointer();
+ if(nbc>(int)daIntTyyppV->getNumberOfCompo())
+ {
+ std::ostringstream oss;
+ oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ std::copy(ptV,ptV+nbc,pt);
+ return self;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+ case 3:
+ {
+ int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
+ switch(sw1)
+ {
+ case 1:
+ {
+ for(int j=0;j<sz;j++)
+ pt[slic.first+j*slic.second.second]=singleValV;
+ return self;
+ }
+ case 2:
+ {
+ if(sz!=(int)multiValV.size())
+ {
+ std::ostringstream oss;
+ oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ for(int j=0;j<sz;j++)
+ pt[slic.first+j*slic.second.second]=multiValV[j];
+ return self;
+ }
+ case 4:
+ {
+ const int *ptV=daIntTyyppV->getConstPointer();
+ if(sz>(int)daIntTyyppV->getNumberOfCompo())
+ {
+ std::ostringstream oss;
+ oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ for(int j=0;j<sz;j++)
+ pt[slic.first+j*slic.second.second]=ptV[j];
+ return self;
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+ default:
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+ }
+ };
+}
+
+
+namespace MEDCoupling
+{
+ class DataArrayInt64 : public DataArray
+ {
+ public:
+ static DataArrayInt64 *New();
+ %extend
+ {
+ static DataArrayInt64 *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
+ {
+ const char *msgBase="MEDCoupling::DataArrayInt64::New : Available API are : \n-DataArrayInt64.New()\n-DataArrayInt64.New([1,3,4])\n-DataArrayInt64.New([1,3,4],3)\n-DataArrayInt64.New([1,3,4,5],2,2)\n-DataArrayInt64.New([1,3,4,5,7,8],3,2)\n-DataArrayInt64.New([(1,3),(4,5),(7,8)])\n-DataArrayInt64.New(5)\n-DataArrayInt64.New(5,2)";
+ std::string msg(msgBase);
+#ifdef WITH_NUMPY
+ msg+="\n-DataArrayInt64.New(numpy array with dtype=int64)";
+#endif
+ msg+=" !";
+ if(PyList_Check(elt0) || PyTuple_Check(elt0))
+ {
+ if(nbOfTuples)
+ {
+ if(PyInt_Check(nbOfTuples))
+ {
+ mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ if(nbOfTuples1<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt64::New : should be a positive set of allocated memory !");
+ if(nbOfComp)
+ {
+ if(PyInt_Check(nbOfComp))
+ {//DataArrayInt64.New([1,3,4,5],2,2)
+ mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ if(nbOfCompo<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt64::New : should be a positive number of components !");
+ MCAuto<DataArrayInt64> ret=DataArrayInt64::New();
+ std::vector<Int64> tmp=fillArrayWithPyListInt2<Int64>(elt0,nbOfTuples1,nbOfCompo);
+ ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
+ return ret.retn();
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ }
+ else
+ {//DataArrayInt64.New([1,3,4],3)
+ MCAuto<DataArrayInt64> ret=DataArrayInt64::New();
+ mcIdType tmpp1=-1;
+ std::vector<Int64> tmp=fillArrayWithPyListInt2<Int64>(elt0,nbOfTuples1,tmpp1);
+ ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
+ return ret.retn();
+ }
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ }
+ else
+ {// DataArrayInt64.New([1,3,4])
+ MCAuto<DataArrayInt64> ret=DataArrayInt64::New();
+ mcIdType tmpp1=-1,tmpp2=-1;
+ std::vector<Int64> tmp=fillArrayWithPyListInt2<Int64>(elt0,tmpp1,tmpp2);
+ ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
+ return ret.retn();
+ }
+ }
+ else if(PyInt_Check(elt0))
+ {
+ int nbOfTuples1=PyInt_AS_LONG(elt0);
+ if(nbOfTuples1<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt64::New : should be a positive set of allocated memory !");
+ if(nbOfTuples)
+ {
+ if(!nbOfComp)
+ {
+ if(PyInt_Check(nbOfTuples))
+ {//DataArrayInt64.New(5,2)
+ int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+ if(nbOfCompo<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt64::New : should be a positive number of components !");
+ MCAuto<DataArrayInt64> ret=DataArrayInt64::New();
+ ret->alloc(nbOfTuples1,nbOfCompo);
+ return ret.retn();
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ }
+ else
+ {//DataArrayInt64.New(5)
+ MCAuto<DataArrayInt64> ret=DataArrayInt64::New();
+ ret->alloc(nbOfTuples1,1);
+ return ret.retn();
+ }
+ }
+#ifdef WITH_NUMPY
+ else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
+ {//DataArrayInt64.New(numpyArray)
+ return BuildNewInstance<DataArrayInt64,Int64>(elt0,NPY_INT64,&PyCallBackDataArrayInt_RefType,"INT64");
+ }
+#endif
+ else
+ throw INTERP_KERNEL::Exception(msg.c_str());
+ throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
+ }
+
+#ifdef WITH_NUMPY
+ PyObject *toNumPyArray() // not const. It is not a bug !
+ {
+ return ToNumPyArray<DataArrayInt64,Int64>(self,NPY_INT64,"DataArrayInt64");
+ }
+#endif
+ }
+ };
+
+ class DataArrayInt64Tuple;
+
+ class DataArrayInt64Iterator
+ {
+ public:
+ DataArrayInt64Iterator(DataArrayInt64 *da);
+ ~DataArrayInt64Iterator();
+ %extend
+ {
+ PyObject *next()
+ {
+ DataArrayInt64Tuple *ret=self->nextt();
+ if(ret)
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt64Tuple,SWIG_POINTER_OWN | 0);
+ else
+ {
+ PyErr_SetString(PyExc_StopIteration,"No more data.");
+ return 0;
+ }
+ }
+ }
+ };
+
+ class DataArrayInt64Tuple
+ {
+ public:
+ std::size_t getNumberOfCompo() const;
+ DataArrayInt64 *buildDAInt(int nbOfTuples, int nbOfCompo) const;
+ // %extend
+ // {
+ // std::string __str__() const
+ // {
+ // return self->repr();
+ // }
+
+ // int __int__() const
+ // {
+ // return self->intValue();
+ // }
+
+ // DataArrayInt64 *buildDAInt()
+ // {
+ // return self->buildDAInt(1,self->getNumberOfCompo());
+ // }
+
+ // PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
+ // {
+ // MCAuto<DataArrayInt64> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ // MEDCoupling_DataArrayInt64____iadd___(ret,0,obj);
+ // Py_XINCREF(trueSelf);
+ // return trueSelf;
+ // }
+
+ // PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
+ // {
+ // MCAuto<DataArrayInt64> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ // MEDCoupling_DataArrayInt64____isub___(ret,0,obj);
+ // Py_XINCREF(trueSelf);
+ // return trueSelf;
+ // }
+
+ // PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
+ // {
+ // MCAuto<DataArrayInt64> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ // MEDCoupling_DataArrayInt64____imul___(ret,0,obj);
+ // Py_XINCREF(trueSelf);
+ // return trueSelf;
+ // }
+ // PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
+ // {
+ // MCAuto<DataArrayInt64> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ // MEDCoupling_DataArrayInt64____idiv___(ret,0,obj);
+ // Py_XINCREF(trueSelf);
+ // return trueSelf;
+ // }
+
+ // PyObject *___imod___(PyObject *trueSelf, PyObject *obj)
+ // {
+ // MCAuto<DataArrayInt64> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ // MEDCoupling_DataArrayInt64____imod___(ret,0,obj);
+ // Py_XINCREF(trueSelf);
+ // return trueSelf;
+ // }
+
+ // PyObject *__len__()
+ // {
+ // return PyInt_FromLong(self->getNumberOfCompo());
+ // }
+
+ // PyObject *__getitem__(PyObject *obj)
+ // {
+ // const char msg2[]="DataArrayInt64Tuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
+ // mcIdType sw;
+ // int singleVal;
+ // std::vector<int> multiVal;
+ // std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ // MEDCoupling::DataArrayInt64 *daIntTyypp=0;
+ // const int *pt=self->getConstPointer();
+ // int nbc=self->getNumberOfCompo();
+ // convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
+ // switch(sw)
+ // {
+ // case 1:
+ // {
+ // if(singleVal>=nbc)
+ // {
+ // std::ostringstream oss;
+ // oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
+ // PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
+ // return 0;
+ // }
+ // if(singleVal>=0)
+ // return PyInt_FromLong(pt[singleVal]);
+ // else
+ // {
+ // if(nbc+singleVal>0)
+ // return PyInt_FromLong(pt[nbc+singleVal]);
+ // else
+ // {
+ // std::ostringstream oss;
+ // oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // }
+ // }
+ // case 2:
+ // {
+ // PyObject *t=PyTuple_New(multiVal.size());
+ // for(int j=0;j<(int)multiVal.size();j++)
+ // {
+ // int cid=multiVal[j];
+ // if(cid>=nbc)
+ // {
+ // std::ostringstream oss;
+ // oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
+ // }
+ // return t;
+ // }
+ // case 3:
+ // {
+ // int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
+ // PyObject *t=PyTuple_New(sz);
+ // for(int j=0;j<sz;j++)
+ // PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
+ // return t;
+ // }
+ // default:
+ // throw INTERP_KERNEL::Exception("DataArrayInt64Tuple::__getitem__ : unrecognized type entered !");
+ // }
+ // }
+
+ // DataArrayInt64Tuple *__setitem__(PyObject *obj, PyObject *value)
+ // {
+ // const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
+ // const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
+ // mcIdType sw1,sw2;
+ // int singleValV;
+ // std::vector<int> multiValV;
+ // std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slicV;
+ // MEDCoupling::DataArrayInt64Tuple *daIntTyyppV=0;
+ // int nbc=self->getNumberOfCompo();
+ // convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
+ // int singleVal;
+ // std::vector<int> multiVal;
+ // std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ // MEDCoupling::DataArrayInt64 *daIntTyypp=0;
+ // int *pt=self->getPointer();
+ // convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
+ // switch(sw2)
+ // {
+ // case 1:
+ // {
+ // if(singleVal>=nbc)
+ // {
+ // std::ostringstream oss;
+ // oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // switch(sw1)
+ // {
+ // case 1:
+ // {
+ // pt[singleVal]=singleValV;
+ // return self;
+ // }
+ // case 2:
+ // {
+ // if(multiValV.size()!=1)
+ // {
+ // std::ostringstream oss;
+ // oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // pt[singleVal]=multiValV[0];
+ // return self;
+ // }
+ // case 4:
+ // {
+ // pt[singleVal]=daIntTyyppV->getConstPointer()[0];
+ // return self;
+ // }
+ // default:
+ // throw INTERP_KERNEL::Exception(msg);
+ // }
+ // }
+ // case 2:
+ // {
+ // switch(sw1)
+ // {
+ // case 1:
+ // {
+ // for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
+ // {
+ // if(*it>=nbc)
+ // {
+ // std::ostringstream oss;
+ // oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // pt[*it]=singleValV;
+ // }
+ // return self;
+ // }
+ // case 2:
+ // {
+ // if(multiVal.size()!=multiValV.size())
+ // {
+ // std::ostringstream oss;
+ // oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // for(int i=0;i<(int)multiVal.size();i++)
+ // {
+ // int pos=multiVal[i];
+ // if(pos>=nbc)
+ // {
+ // std::ostringstream oss;
+ // oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // pt[multiVal[i]]=multiValV[i];
+ // }
+ // return self;
+ // }
+ // case 4:
+ // {
+ // const int *ptV=daIntTyyppV->getConstPointer();
+ // if(nbc>(int)daIntTyyppV->getNumberOfCompo())
+ // {
+ // std::ostringstream oss;
+ // oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // std::copy(ptV,ptV+nbc,pt);
+ // return self;
+ // }
+ // default:
+ // throw INTERP_KERNEL::Exception(msg);
+ // }
+ // }
+ // case 3:
+ // {
+ // int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
+ // switch(sw1)
+ // {
+ // case 1:
+ // {
+ // for(int j=0;j<sz;j++)
+ // pt[slic.first+j*slic.second.second]=singleValV;
+ // return self;
+ // }
+ // case 2:
+ // {
+ // if(sz!=(int)multiValV.size())
+ // {
+ // std::ostringstream oss;
+ // oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // for(int j=0;j<sz;j++)
+ // pt[slic.first+j*slic.second.second]=multiValV[j];
+ // return self;
+ // }
+ // case 4:
+ // {
+ // const int *ptV=daIntTyyppV->getConstPointer();
+ // if(sz>(int)daIntTyyppV->getNumberOfCompo())
+ // {
+ // std::ostringstream oss;
+ // oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
+ // throw INTERP_KERNEL::Exception(oss.str().c_str());
+ // }
+ // for(int j=0;j<sz;j++)
+ // pt[slic.first+j*slic.second.second]=ptV[j];
+ // return self;
+ // }
+ // default:
+ // throw INTERP_KERNEL::Exception(msg);
+ // }
+ // }
+ // default:
+ // throw INTERP_KERNEL::Exception(msg);
+ // }
+ // }
+ // }
+ };
+
+}
def MEDCouplingFieldDoubleIpow(self,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingFieldDouble____ipow___(self, self, *args)
-def MEDCouplingDataArrayIntIadd(self,*args):
+def MEDCouplingDataArrayInt32Iadd(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayInt____iadd___(self, self, *args)
-def MEDCouplingDataArrayIntIsub(self,*args):
+ return _MEDCoupling.DataArrayInt32____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32Isub(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayInt____isub___(self, self, *args)
-def MEDCouplingDataArrayIntImul(self,*args):
+ return _MEDCoupling.DataArrayInt32____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32Imul(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayInt____imul___(self, self, *args)
-def MEDCouplingDataArrayIntIdiv(self,*args):
+ return _MEDCoupling.DataArrayInt32____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32Idiv(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayInt____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntImod(self,*args):
+ return _MEDCoupling.DataArrayInt32____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32Imod(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayInt____imod___(self, self, *args)
-def MEDCouplingDataArrayIntIpow(self,*args):
+ return _MEDCoupling.DataArrayInt32____imod___(self, self, *args)
+def MEDCouplingDataArrayInt32Ipow(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayInt____ipow___(self, self, *args)
+ return _MEDCoupling.DataArrayInt32____ipow___(self, self, *args)
+def MEDCouplingDataArrayInt64Iadd(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt64____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64Isub(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt64____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64Imul(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt64____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64Idiv(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt64____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64Imod(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt64____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64Ipow(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt64____ipow___(self, self, *args)
def MEDCouplingDataArrayFloatIadd(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayFloat____iadd___(self, self, *args)
def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDoubleTuple____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIadd(self,*args):
+def MEDCouplingDataArrayInt32TupleIadd(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt32Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIsub(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt32Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImul(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt32Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIdiv(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt32Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImod(self,*args):
+ import _MEDCoupling
+ return _MEDCoupling.DataArrayInt32Tuple____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIadd(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayIntTuple____iadd___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIsub(self,*args):
+ return _MEDCoupling.DataArrayInt64Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIsub(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayIntTuple____isub___(self, self, *args)
-def MEDCouplingDataArrayIntTupleImul(self,*args):
+ return _MEDCoupling.DataArrayInt64Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImul(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayIntTuple____imul___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIdiv(self,*args):
+ return _MEDCoupling.DataArrayInt64Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIdiv(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayIntTuple____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntTupleImod(self,*args):
+ return _MEDCoupling.DataArrayInt64Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImod(self,*args):
import _MEDCoupling
- return _MEDCoupling.DataArrayIntTuple____imod___(self, self, *args)
+ return _MEDCoupling.DataArrayInt64Tuple____imod___(self, self, *args)
def MEDCouplingDenseMatrixIadd(self,*args):
import _MEDCoupling
return _MEDCoupling.DenseMatrix____iadd___(self, self, *args)
{// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
- SWIGTITraits<int>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt;
+ SWIGTITraits<Int32>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt32;
+ SWIGTITraits<Int64>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt64;
SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
- SWIGTITraits<int>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayIntTuple;
+ SWIGTITraits<Int32>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt32Tuple;
+ SWIGTITraits<Int64>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt64Tuple;
}
%}
auto szOut(maxElt+1);
std::vector< int > retCpp(szOut,-1);
mcIdType id(0);
- for(const int *it=MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER;it!=MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER+sz;it++,id++)
+ for(const mcIdType *it=MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER;it!=MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER+sz;it++,id++)
{
if(*it!=-1)
retCpp[*it]=id;
IMAGE_GRID = 12
} MEDCouplingMeshType;
- class DataArrayInt;
+ class DataArrayInt32;
+ class DataArrayInt64;
class DataArrayDouble;
class MEDCouplingUMesh;
class MEDCouplingCMesh;
virtual DataArrayDouble *getCoordinatesAndOwner() const;
virtual DataArrayDouble *computeCellCenterOfMass() const;
virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
- virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
- virtual DataArrayInt *computeNbOfNodesPerCell() const;
- virtual DataArrayInt *computeNbOfFacesPerCell() const;
- virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const;
+ virtual DataArrayIdType *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
+ virtual DataArrayIdType *computeNbOfNodesPerCell() const;
+ virtual DataArrayIdType *computeNbOfFacesPerCell() const;
+ virtual DataArrayIdType *computeEffectiveNbOfNodesPerCell() const;
virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
virtual MEDCouplingUMesh *buildUnstructured() const;
virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
- virtual DataArrayInt *simplexize(int policy);
- virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
+ virtual DataArrayIdType *simplexize(int policy);
+ virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<mcIdType>& tinyInfo, const DataArrayIdType *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type);
static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
- MCAuto<DataArrayInt> elts,eltsIndex;
+ MCAuto<DataArrayIdType> elts,eltsIndex;
self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
- MCAuto<DataArrayInt> elts,eltsIndex;
+ MCAuto<DataArrayIdType> elts,eltsIndex;
self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *getCellsContainingPoints(PyObject *p, double eps) const
{
- auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
+ auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
}
PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const
{
- auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
+ auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
}
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
- std::vector<int> elts;
+ std::vector<mcIdType> elts;
self->getCellsContainingPoint(pos,eps,elts);
- DataArrayInt *ret=DataArrayInt::New();
+ DataArrayIdType *ret=DataArrayIdType::New();
ret->alloc((int)elts.size(),1);
std::copy(elts.begin(),elts.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
virtual PyObject *getReverseNodalConnectivity() const
{
- MCAuto<DataArrayInt> d0=DataArrayInt::New();
- MCAuto<DataArrayInt> d1=DataArrayInt::New();
+ MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
self->getReverseNodalConnectivity(d0,d1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
void renumberCells(PyObject *li, bool check=true)
{
- int sw,sz(-1);
- int v0; std::vector<int> v1;
- const int *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
+ mcIdType sw,sz(-1);
+ mcIdType v0; std::vector<mcIdType> v1;
+ const mcIdType *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
self->renumberCells(ids,check);
}
PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const
{
- DataArrayInt *cellCor, *nodeCor;
+ DataArrayIdType *cellCor, *nodeCor;
self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
return res;
}
PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
{
- DataArrayInt *cellCor=0,*nodeCor=0;
+ DataArrayIdType *cellCor=0,*nodeCor=0;
self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
return res;
}
- DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
+ DataArrayIdType *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
{
- DataArrayInt *cellCor=0;
+ DataArrayIdType *cellCor=0;
self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
return cellCor;
}
- DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const
+ DataArrayIdType *getCellIdsFullyIncludedInNodeIds(PyObject *li) const
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ return self->getCellIdsFullyIncludedInNodeIds(tmp,((const mcIdType *)tmp)+size);
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da2->checkAllocated();
return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
}
}
PyObject *getNodeIdsOfCell(int cellId) const
{
- std::vector<int> conn;
+ std::vector<mcIdType> conn;
self->getNodeIdsOfCell(cellId,conn);
return convertIntArrToPyList2(conn);
}
- PyObject *getCoordinatesOfNode(int nodeId) const
+ PyObject *getCoordinatesOfNode(mcIdType nodeId) const
{
std::vector<double> coo;
self->getCoordinatesOfNode(nodeId,coo);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
PyObject *buildPart(PyObject *li) const
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
- if(sw==3)//DataArrayInt
+ if(sw==3)//DataArrayIdType
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
+ DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
PyObject *buildPartAndReduceNodes(PyObject *li) const
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- DataArrayInt *arr=0;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ DataArrayIdType *arr=0;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
- if(sw==3)//DataArrayInt
+ if(sw==3)//DataArrayIdType
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
+ DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
//
PyObject *res = PyList_New(2);
PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
- PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
PyList_SetItem(res,0,obj0);
PyList_SetItem(res,1,obj1);
return res;
}
- PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const
+ PyObject *buildPartRangeAndReduceNodes(mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds) const
{
- int a,b,c;
- DataArrayInt *arr=0;
+ mcIdType a,b,c;
+ DataArrayIdType *arr=0;
MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
PyObject *res = PyTuple_New(2);
PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
PyObject *obj1=0;
if(arr)
- obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
else
obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
PyTuple_SetItem(res,0,obj0);
PyObject *getDistributionOfTypes() const
{
- std::vector<int> vals=self->getDistributionOfTypes();
+ std::vector<mcIdType> vals=self->getDistributionOfTypes();
if(vals.size()%3!=0)
throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
- PyObject *ret=PyList_New((int)vals.size()/3);
- for(int j=0;j<(int)vals.size()/3;j++)
+ PyObject *ret=PyList_New((mcIdType)vals.size()/3);
+ for(std::size_t j=0;j<vals.size()/3;j++)
{
PyObject *ret1=PyList_New(3);
PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
return ret;
}
- DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const
+ DataArrayIdType *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const
{
- std::vector<int> code;
- std::vector<const DataArrayInt *> idsPerType;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
+ std::vector<mcIdType> code;
+ std::vector<const DataArrayIdType *> idsPerType;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li2,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",idsPerType);
convertPyToNewIntArr4(li,1,3,code);
return self->checkTypeConsistencyAndContig(code,idsPerType);
}
- PyObject *splitProfilePerType(const DataArrayInt *profile, bool smartPflKiller=true) const
+ PyObject *splitProfilePerType(const DataArrayIdType *profile, bool smartPflKiller=true) const
{
- std::vector<int> code;
- std::vector<DataArrayInt *> idsInPflPerType;
- std::vector<DataArrayInt *> idsPerType;
+ std::vector<mcIdType> code;
+ std::vector<DataArrayIdType *> idsInPflPerType;
+ std::vector<DataArrayIdType *> idsPerType;
self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
PyObject *ret=PyTuple_New(3);
//
if(code.size()%3!=0)
throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
- PyObject *ret0=PyList_New((int)code.size()/3);
- for(int j=0;j<(int)code.size()/3;j++)
+ PyObject *ret0=PyList_New((mcIdType)code.size()/3);
+ for(std::size_t j=0;j<code.size()/3;j++)
{
PyObject *ret00=PyList_New(3);
PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
//
PyObject *ret1=PyList_New(idsInPflPerType.size());
for(std::size_t j=0;j<idsInPflPerType.size();j++)
- PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,ret1);
- int n=idsPerType.size();
+ std::size_t n=idsPerType.size();
PyObject *ret2=PyList_New(n);
- for(int i=0;i<n;i++)
- PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ for(std::size_t i=0;i<n;i++)
+ PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,2,ret2);
return ret;
}
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
self->rotate(centerPtr,0,alpha);
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,spaceDim,false);//vectorPtr can be null in case of space dim 2
virtual PyObject *getTinySerializationInformation() const
{
std::vector<double> a0;
- std::vector<int> a1;
+ std::vector<mcIdType> a1;
std::vector<std::string> a2;
self->getTinySerializationInformation(a0,a1,a2);
PyObject *ret(PyTuple_New(3));
PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
- int sz(a2.size());
+ mcIdType sz(a2.size());
PyObject *ret2(PyList_New(sz));
{
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
}
PyTuple_SetItem(ret,2,ret2);
virtual PyObject *serialize() const
{
- DataArrayInt *a0Tmp(0);
+ DataArrayIdType *a0Tmp(0);
DataArrayDouble *a1Tmp(0);
self->serialize(a0Tmp,a1Tmp);
PyObject *ret(PyTuple_New(2));
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
return ret;
}
- void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const
+ void resizeForUnserialization(const std::vector<mcIdType>& tinyInfo, DataArrayIdType *a1, DataArrayDouble *a2) const
{
std::vector<std::string> littleStrings;
self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
if(!PyTuple_Check(inp))
throw INTERP_KERNEL::Exception(MSG);
- int sz(PyTuple_Size(inp));
+ mcIdType sz(PyTuple_Size(inp));
if(sz!=2)
throw INTERP_KERNEL::Exception(MSG);
PyObject *elt0(PyTuple_GetItem(inp,0));
PyObject *elt1(PyTuple_GetItem(inp,1));
std::vector<double> a0;
- std::vector<int> a1;
+ std::vector<mcIdType> a1;
std::vector<std::string> a2;
- DataArrayInt *b0(0);
+ DataArrayIdType *b0(0);
DataArrayDouble *b1(0);
{
if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
throw INTERP_KERNEL::Exception(MSG);
PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
- int tmp(-1);
+ mcIdType tmp(-1);
fillArrayWithPyListDbl3(a0py,tmp,a0);
convertPyToNewIntArr3(a1py,a1);
fillStringVector(a2py,a2);
throw INTERP_KERNEL::Exception(MSG);
PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
void *argp(0);
- int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
+ int status(SWIG_ConvertPtr(b0py,&argp,SWIGTITraits<mcIdType>::TI,0|0));
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception(MSG);
- b0=reinterpret_cast<DataArrayInt *>(argp);
+ b0=reinterpret_cast<DataArrayIdType *>(argp);
status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception(MSG);
class MEDCouplingSkyLineArray
{
public:
- static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI );
+ static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayIdType* c, const DataArrayIdType* cI );
- void set( DataArrayInt* index, DataArrayInt* value );
- void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
+ void set( DataArrayIdType* index, DataArrayIdType* value );
+ void set3( DataArrayIdType* superIndex, DataArrayIdType* index, DataArrayIdType* value );
int getSuperNumberOf() const;
int getNumberOf() const;
void deletePack(const int i, const int j);
void deleteSimplePack(const int i);
- void deleteSimplePacks(const DataArrayInt* idx);
+ void deleteSimplePacks(const DataArrayIdType* idx);
%extend
{
return MEDCouplingSkyLineArray::New();
}
- MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value)
+ MEDCouplingSkyLineArray( const std::vector<mcIdType>& index, const std::vector<mcIdType>& value)
{
return MEDCouplingSkyLineArray::New(index, value);
}
- MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value )
+ MEDCouplingSkyLineArray( DataArrayIdType* index, DataArrayIdType* value )
{
return MEDCouplingSkyLineArray::New(index, value);
}
return self->simpleRepr();
}
- DataArrayInt *getSuperIndexArray() const
+ DataArrayIdType *getSuperIndexArray() const
{
- DataArrayInt *ret(self->getSuperIndexArray());
+ DataArrayIdType *ret(self->getSuperIndexArray());
if(ret)
ret->incrRef();
return ret;
}
- DataArrayInt *getIndexArray() const
+ DataArrayIdType *getIndexArray() const
{
- DataArrayInt *ret(self->getIndexArray());
+ DataArrayIdType *ret(self->getIndexArray());
if(ret)
ret->incrRef();
return ret;
}
- DataArrayInt *getValuesArray() const
+ DataArrayIdType *getValuesArray() const
{
- DataArrayInt *ret(self->getValuesArray());
+ DataArrayIdType *ret(self->getValuesArray());
if(ret)
ret->incrRef();
return ret;
}
- PyObject *getSimplePackSafe(int absolutePackId) const
+ PyObject *getSimplePackSafe(mcIdType absolutePackId) const
{
- std::vector<int> ret;
+ std::vector<mcIdType> ret;
self->getSimplePackSafe(absolutePackId,ret);
return convertIntArrToPyList2(ret);
}
PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const
{
- std::vector<int> vpack, vspIdx, out;
+ std::vector<mcIdType> vpack, vspIdx, out;
convertPyToNewIntArr3(superPackIndices,vspIdx);
convertPyToNewIntArr3(pack,vpack);
return convertIntArrToPyList2(out);
}
- void pushBackPack(const int i, PyObject *pack)
+ void pushBackPack(const mcIdType i, PyObject *pack)
{
- std::vector<int> vpack;
+ std::vector<mcIdType> vpack;
convertPyToNewIntArr3(pack,vpack);
self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
}
- void replaceSimplePack(const int idx, PyObject *pack)
+ void replaceSimplePack(const mcIdType idx, PyObject *pack)
{
- std::vector<int> vpack;
+ std::vector<mcIdType> vpack;
convertPyToNewIntArr3(pack,vpack);
self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
}
- void replaceSimplePacks(const DataArrayInt* idx, PyObject *listePacks)
+ void replaceSimplePacks(const DataArrayIdType* idx, PyObject *listePacks)
{
- std::vector<const DataArrayInt*> packs;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt*>(listePacks,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",packs);
+ std::vector<const DataArrayIdType*> packs;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType*>(listePacks,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",packs);
self->replaceSimplePacks(idx, packs);
}
- void replacePack(const int superIdx, const int idx, PyObject *pack)
+ void replacePack(const mcIdType superIdx, const mcIdType idx, PyObject *pack)
{
- std::vector<int> vpack;
+ std::vector<mcIdType> vpack;
convertPyToNewIntArr3(pack,vpack);
self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
}
PyObject *convertToPolyhedronConn() const
{
- MCAuto<DataArrayInt> d0=DataArrayInt::New();
- MCAuto<DataArrayInt> d1=DataArrayInt::New();
+ MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
self->convertToPolyhedronConn(d0,d1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
}
virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon);
static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type);
- static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps);
- virtual DataArrayInt *computeFetchedNodeIds() const;
+ static DataArrayIdType *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps);
+ virtual DataArrayIdType *computeFetchedNodeIds() const;
virtual int getNumberOfNodesInCell(int cellId) const;
virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const;
- virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
- virtual DataArrayInt *zipCoordsTraducer();
- virtual DataArrayInt *findBoundaryNodes() const;
- virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0);
+ virtual DataArrayIdType *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
+ virtual DataArrayIdType *zipCoordsTraducer();
+ virtual DataArrayIdType *findBoundaryNodes() const;
+ virtual DataArrayIdType *zipConnectivityTraducer(int compType, int startCellId=0);
virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
virtual void checkFullyDefined() const;
- virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const;
+ virtual bool isEmptyMesh(const std::vector<mcIdType>& tinyInfo) const;
virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const;
virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
virtual void renumberNodesWithOffsetInConn(int offset);
return self->simpleRepr();
}
- PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const
+ PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayIdType *comm, const DataArrayIdType *commIndex) const
{
- int newNbOfNodes;
- DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
+ mcIdType newNbOfNodes;
+ DataArrayIdType *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
return res;
}
- PyObject *findCommonNodes(double prec, int limitTupleId=-1) const
+ PyObject *findCommonNodes(double prec, mcIdType limitTupleId=-1) const
{
- DataArrayInt *comm, *commIndex;
+ DataArrayIdType *comm, *commIndex;
self->findCommonNodes(prec,limitTupleId,comm,commIndex);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return res;
}
PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
- if(sw==3)//DataArrayInt
+ if(sw==3)//DataArrayIdType
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
+ DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
- if(sw==3)//DataArrayInt
+ if(sw==3)//DataArrayIdType
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
+ DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
- if(sw==3)//DataArrayInt
+ if(sw==3)//DataArrayIdType
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
+ DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const
+ virtual PyObject *buildPartOfMySelfKeepCoordsSlice(mcIdType start, mcIdType end, mcIdType step) const
{
MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
- if(sw==3)//DataArrayInt
+ if(sw==3)//DataArrayIdType
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
+ DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- void renumberNodes(PyObject *li, int newNbOfNodes)
+ void renumberNodes(PyObject *li, mcIdType newNbOfNodes)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
self->renumberNodes(tmp,newNbOfNodes);
}
- void renumberNodesCenter(PyObject *li, int newNbOfNodes)
+ void renumberNodesCenter(PyObject *li, mcIdType newNbOfNodes)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
self->renumberNodesCenter(tmp,newNbOfNodes);
}
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
- std::vector<int> nodes;
+ std::vector<mcIdType> nodes;
self->findNodesOnLine(p,v,eps,nodes);
- DataArrayInt *ret=DataArrayInt::New();
- ret->alloc((int)nodes.size(),1);
+ DataArrayIdType *ret=DataArrayIdType::New();
+ ret->alloc(nodes.size(),1);
std::copy(nodes.begin(),nodes.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const
{
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
- std::vector<int> nodes;
+ std::vector<mcIdType> nodes;
self->findNodesOnPlane(p,v,eps,nodes);
- DataArrayInt *ret=DataArrayInt::New();
- ret->alloc((int)nodes.size(),1);
+ DataArrayIdType *ret=DataArrayIdType::New();
+ ret->alloc(nodes.size(),1);
std::copy(nodes.begin(),nodes.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
- DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ DataArrayIdType *ret=self->getNodeIdsNearPoint(pos,eps);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
- PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const
+ PyObject *getNodeIdsNearPoints(PyObject *pt, mcIdType nbOfPoints, double eps) const
{
- DataArrayInt *c=0,*cI=0;
+ DataArrayIdType *c=0,*cI=0;
//
double val;
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const
{
- DataArrayInt *c=0,*cI=0;
+ DataArrayIdType *c=0,*cI=0;
int spaceDim=self->getSpaceDimension();
double val;
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
- int nbOfTuples=-1;
+ mcIdType sw;
+ mcIdType nbOfTuples=-1;
const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
//
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
//
- DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
- return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ DataArrayIdType *elems=self->getCellsInBoundingBox(tmp,eps);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
void duplicateNodesInCoords(PyObject *li)
{
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
case 4:
return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
default:
- throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
+ throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
}
}
- virtual PyObject *findCommonCells(int compType, int startCellId=0) const
+ virtual PyObject *findCommonCells(int compType, mcIdType startCellId=0) const
{
- DataArrayInt *v0(nullptr),*v1(nullptr);
+ DataArrayIdType *v0(nullptr),*v1(nullptr);
self->findCommonCells(compType,startCellId,v0,v1);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return res;
}
return ;
}
}
- int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 ));
+ int res1(SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 ));
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
self->renumberNodesInConn(tmp);
}
else
{
- DataArrayInt *da2(reinterpret_cast< DataArrayInt * >(da));
+ DataArrayIdType *da2(reinterpret_cast< DataArrayIdType * >(da));
if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da2->checkAllocated();
self->renumberNodesInConn(da2->getConstPointer());
}
virtual PyObject *getNodeIdsInUse() const
{
- int ret1=-1;
- DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
+ mcIdType ret1=-1;
+ DataArrayIdType *ret0=self->getNodeIdsInUse(ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
return ret;
}
- virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
+ virtual DataArrayIdType *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
{
- DataArrayInt *ret(nullptr);
+ DataArrayIdType *ret(nullptr);
//
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
return ret;
}
virtual PyObject *mergeNodes(double precision)
{
bool ret1;
- int ret2;
- DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
+ mcIdType ret2;
+ DataArrayIdType *ret0=self->mergeNodes(precision,ret1,ret2);
PyObject *res = PyList_New(3);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(res,1,SWIG_From_bool(ret1));
PyList_SetItem(res,2,SWIG_From_int(ret2));
return res;
virtual PyObject *mergeNodesCenter(double precision)
{
bool ret1;
- int ret2;
- DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
+ mcIdType ret2;
+ DataArrayIdType *ret0=self->mergeNodesCenter(precision,ret1,ret2);
PyObject *res = PyList_New(3);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(res,1,SWIG_From_bool(ret1));
PyList_SetItem(res,2,SWIG_From_int(ret2));
return res;
}
- DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const
+ DataArrayIdType *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ return self->getCellIdsLyingOnNodes(tmp,((const mcIdType *)tmp)+size,fullyIn);
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da2->checkAllocated();
return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
}
MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI)
{
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- int nbc=self->getNumberOfCells();
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
+ mcIdType nbc=self->getNumberOfCells();
convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
{
if(nbc+singleVal>0)
{
- int tmp=nbc+singleVal;
+ mcIdType tmp=nbc+singleVal;
return self->buildPartOfMySelf(&tmp,&tmp+1,true);
}
else
return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
}
default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
}
}
- static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords)
+ static void Rotate2DAlg(PyObject *center, double angle, mcIdType nbNodes, PyObject *coords)
{
- int sz;
+ mcIdType sz;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
}
static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords)
{
- int sz;
+ mcIdType sz;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
- int sw,nbNodes=0;
+ mcIdType sw,nbNodes=0;
double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
std::vector<double> val3;
const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
}
- static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords)
+ static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, mcIdType nbNodes, PyObject *coords)
{
- int sz,sz2;
+ mcIdType sz,sz2;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
}
static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords)
{
- int sz,sz2;
+ mcIdType sz,sz2;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
- int sw,nbNodes=0;
+ mcIdType sw,nbNodes=0;
double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
std::vector<double> val3;
const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
PyObject *getAllConn() const
{
- int ret2;
- const int *r=self->getAllConn(ret2);
+ mcIdType ret2;
+ const mcIdType *r=self->getAllConn(ret2);
PyObject *ret=PyTuple_New(ret2);
- for(int i=0;i<ret2;i++)
+ for(mcIdType i=0;i<ret2;i++)
PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
return ret;
}
void allocateCells(int nbOfCells=0);
void finishInsertingCells();
MEDCouplingUMeshCellByTypeEntry *cellsByType();
- void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true);
+ void setConnectivity(DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true);
INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
int getNodalConnectivityArrayLen() const;
std::string reprConnectivityOfThis() const;
MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
//tools
- DataArrayInt *conformize2D(double eps);
- DataArrayInt *conformize3D(double eps);
- DataArrayInt *colinearize2D(double eps);
- DataArrayInt *colinearizeKeepingConform2D(double eps);
+ DataArrayIdType *conformize2D(double eps);
+ DataArrayIdType *conformize3D(double eps);
+ DataArrayIdType *colinearize2D(double eps);
+ DataArrayIdType *colinearizeKeepingConform2D(double eps);
void shiftNodeNumbersInConn(int delta);
std::vector<bool> getQuadraticStatus() const;
- DataArrayInt *findCellIdsOnBoundary() const;
+ DataArrayIdType *findCellIdsOnBoundary() const;
MEDCouplingUMesh *computeSkin() const;
bool checkConsecutiveCellTypes() const;
bool checkConsecutiveCellTypesForMEDFileFrmt() const;
- DataArrayInt *rearrange2ConsecutiveCellTypes();
- DataArrayInt *sortCellsInMEDFileFrmt();
- DataArrayInt *getRenumArrForMEDFileFrmt() const;
- DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const;
- MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
- MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
- MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
- MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
+ DataArrayIdType *rearrange2ConsecutiveCellTypes();
+ DataArrayIdType *sortCellsInMEDFileFrmt();
+ DataArrayIdType *getRenumArrForMEDFileFrmt() const;
+ DataArrayIdType *convertCellArrayPerGeoType(const DataArrayIdType *da) const;
+ MEDCouplingUMesh *buildDescendingConnectivity(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
+ MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
+ MEDCouplingUMesh *explode3DMeshTo1D(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
+ MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
void orientCorrectlyPolyhedrons();
bool isPresenceOfQuadratic() const;
bool isFullyQuadratic() const;
bool isContiguous1D() const;
void tessellate2D(double eps);
void convertQuadraticCellsToLinear();
- DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0);
+ DataArrayIdType *convertLinearCellsToQuadratic(int conversionType=0);
void convertDegeneratedCells();
- DataArrayInt *convertDegeneratedCellsAndRemoveFlatOnes();
+ DataArrayIdType *convertDegeneratedCellsAndRemoveFlatOnes();
bool removeDegenerated1DCells();
bool areOnlySimplexCells() const;
MEDCouplingFieldDouble *getEdgeRatioField() const;
MEDCouplingFieldDouble *getWarpField() const;
MEDCouplingFieldDouble *getSkewField() const;
DataArrayDouble *computePlaneEquationOf3DFaces() const;
- DataArrayInt *convexEnvelop2D();
+ DataArrayIdType *convexEnvelop2D();
std::string cppRepr() const;
- DataArrayInt *findAndCorrectBadOriented3DExtrudedCells();
- DataArrayInt *findAndCorrectBadOriented3DCells();
+ DataArrayIdType *findAndCorrectBadOriented3DExtrudedCells();
+ DataArrayIdType *findAndCorrectBadOriented3DCells();
MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
MEDCouplingSkyLineArray *generateGraph() const;
- DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const;
- DataArrayInt *buildUnionOf2DMesh() const;
- DataArrayInt *buildUnionOf3DMesh() const;
- DataArrayInt *orderConsecutiveCells1D() const;
+ DataArrayIdType *convertNodalConnectivityToStaticGeoTypeMesh() const;
+ DataArrayIdType *buildUnionOf2DMesh() const;
+ DataArrayIdType *buildUnionOf3DMesh() const;
+ DataArrayIdType *orderConsecutiveCells1D() const;
DataArrayDouble *getBoundingBoxForBBTreeFast() const;
DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
void changeOrientationOfCells();
DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
- int split2DCells(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0);
+ int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
- static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn);
- static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code);
+ static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
+ static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
%extend {
MEDCouplingUMesh()
{
void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
{
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- int nbc=self->getNumberOfCells();
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
+ mcIdType nbc=self->getNumberOfCells();
convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
{
if(nbc+singleVal>0)
{
- int tmp=nbc+singleVal;
+ mcIdType tmp=nbc+singleVal;
self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
break;
}
break;
}
default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
}
}
void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
{
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- int nbc=self->getNumberOfCells();
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
+ mcIdType nbc=self->getNumberOfCells();
convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
{
if(nbc+singleVal>0)
{
- int tmp=nbc+singleVal;
+ mcIdType tmp=nbc+singleVal;
self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
break;
}
break;
}
default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayIdType instance !");
}
}
- void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li)
+ void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, PyObject *li)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
if(size>szArr)
{
std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
self->insertNextCell(type,szArr,tmp);
}
- DataArrayInt *getNodalConnectivity()
+ DataArrayIdType *getNodalConnectivity()
{
- DataArrayInt *ret=self->getNodalConnectivity();
+ DataArrayIdType *ret=self->getNodalConnectivity();
if(ret)
ret->incrRef();
return ret;
}
- DataArrayInt *getNodalConnectivityIndex()
+ DataArrayIdType *getNodalConnectivityIndex()
{
- DataArrayInt *ret=self->getNodalConnectivityIndex();
+ DataArrayIdType *ret=self->getNodalConnectivityIndex();
if(ret)
ret->incrRef();
return ret;
}
- static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1)
+ static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling=-1)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
- int nbOfDepthPeelingPerformed=0;
- DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType nbOfDepthPeelingPerformed=0;
+ DataArrayIdType *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
PyObject *res=PyTuple_New(2);
- PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
return res;
}
- static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI)
+ static PyObject *FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI)
{
- DataArrayInt *v0=0,*v1=0;
+ DataArrayIdType *v0=0,*v1=0;
MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return res;
}
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int nbOfCompo=self->getSpaceDimension();
const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
//
- int cellId=-1;
+ mcIdType cellId=-1;
double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
PyObject *distanceToPoints(const DataArrayDouble *pts) const
{
- DataArrayInt *ret1=0;
+ DataArrayIdType *ret1=0;
DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *tetrahedrize(int policy)
{
- int ret2(-1);
- DataArrayInt *ret1(0);
+ mcIdType ret2(-1);
+ DataArrayIdType *ret1(0);
MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
return ret;
}
PyObject *checkButterflyCells(double eps=1e-12)
{
- std::vector<int> cells;
+ std::vector<mcIdType> cells;
self->checkButterflyCells(cells,eps);
- DataArrayInt *ret=DataArrayInt::New();
- ret->alloc((int)cells.size(),1);
+ DataArrayIdType *ret=DataArrayIdType::New();
+ ret->alloc(cells.size(),1);
std::copy(cells.begin(),cells.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
PyObject *splitByType() const
{
std::vector<MEDCouplingUMesh *> ms=self->splitByType();
- int sz=ms.size();
+ std::size_t sz=ms.size();
PyObject *ret = PyList_New(sz);
- for(int i=0;i<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *partitionBySpreadZone() const
{
- std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
- int sz=retCpp.size();
+ std::vector<DataArrayIdType *> retCpp=self->partitionBySpreadZone();
+ std::size_t sz=retCpp.size();
PyObject *ret=PyList_New(sz);
- for(int i=0;i<sz;i++)
- PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ for(std::size_t i=0;i<sz;i++)
+ PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
- static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn)
+ static PyObject *PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
{
- std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
- int sz=retCpp.size();
+ std::vector<DataArrayIdType *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
+ std::size_t sz=retCpp.size();
PyObject *ret=PyList_New(sz);
- for(int i=0;i<sz;i++)
- PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ for(std::size_t i=0;i<sz;i++)
+ PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(ids,&size);
MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
}
bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
{
- int sz;
+ mcIdType sz;
INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
return ret;
}
- DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
+ DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
{
- int sz;
+ mcIdType sz;
INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
- DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
+ DataArrayIdType *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
return ret;
}
PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
{
- DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
+ DataArrayIdType *tmp0=0,*tmp1=0,*tmp2=0;
self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
{
- DataArrayInt *tmp0=0,*tmp1=0;
+ DataArrayIdType *tmp0=0,*tmp1=0;
self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
void duplicateNodes(PyObject *li)
{
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
case 4:
return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
}
}
- void duplicateNodesInConn(PyObject *li, int offset)
+ void duplicateNodesInConn(PyObject *li, mcIdType offset)
{
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
case 4:
return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
}
}
void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
}
PyObject *getLevArrPerCellTypes(PyObject *li) const
{
- int sz;
+ mcIdType sz;
INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
- DataArrayInt *tmp0,*tmp1=0;
+ DataArrayIdType *tmp0,*tmp1=0;
tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
{
- DataArrayInt *ret0=0,*ret1=0;
+ DataArrayIdType *ret0=0,*ret1=0;
self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
{
std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
- DataArrayInt *ret1=0,*ret2=0;
+ DataArrayIdType *ret1=0,*ret2=0;
MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
{
- int sz;
+ mcIdType sz;
std::vector<const MEDCouplingUMesh *> meshes;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
- std::vector<DataArrayInt *> corr;
+ std::vector<DataArrayIdType *> corr;
MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
sz=corr.size();
PyObject *ret1=PyList_New(sz);
for(int i=0;i<sz;i++)
- PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyObject *ret=PyList_New(2);
PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(ret,1,ret1);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
//
- std::vector<int> cells;
+ std::vector<mcIdType> cells;
self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
- DataArrayInt *ret=DataArrayInt::New();
- ret->alloc((int)cells.size(),1);
+ DataArrayIdType *ret=DataArrayIdType::New();
+ ret->alloc(cells.size(),1);
std::copy(cells.begin(),cells.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
PyObject *arePolyhedronsNotCorrectlyOriented() const
{
- std::vector<int> cells;
+ std::vector<mcIdType> cells;
self->arePolyhedronsNotCorrectlyOriented(cells);
- DataArrayInt *ret=DataArrayInt::New();
- ret->alloc((int)cells.size(),1);
+ DataArrayIdType *ret=DataArrayIdType::New();
+ ret->alloc(cells.size(),1);
std::copy(cells.begin(),cells.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
PyObject *getFastAveragePlaneOfThis() const
PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
{
- DataArrayInt *ret1;
+ DataArrayIdType *ret1;
bool ret0=self->areCellsIncludedIn(other,compType,ret1);
PyObject *ret=PyTuple_New(2);
PyObject *ret0Py=ret0?Py_True:Py_False;
Py_XINCREF(ret0Py);
PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
{
- DataArrayInt *ret1;
+ DataArrayIdType *ret1;
bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
PyObject *ret=PyTuple_New(2);
PyObject *ret0Py=ret0?Py_True:Py_False;
Py_XINCREF(ret0Py);
PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *explode3DMeshTo1D() const
{
- MCAuto<DataArrayInt> d0=DataArrayInt::New();
- MCAuto<DataArrayInt> d1=DataArrayInt::New();
- MCAuto<DataArrayInt> d2=DataArrayInt::New();
- MCAuto<DataArrayInt> d3=DataArrayInt::New();
+ MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
PyObject *ret=PyTuple_New(5);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *explodeIntoEdges() const
{
- MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
+ MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
PyObject *ret=PyTuple_New(5);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *explodeMeshIntoMicroEdges() const
{
- MCAuto<DataArrayInt> d0=DataArrayInt::New();
- MCAuto<DataArrayInt> d1=DataArrayInt::New();
- MCAuto<DataArrayInt> d2=DataArrayInt::New();
- MCAuto<DataArrayInt> d3=DataArrayInt::New();
+ MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
PyObject *ret=PyTuple_New(5);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *buildDescendingConnectivity() const
{
- MCAuto<DataArrayInt> d0=DataArrayInt::New();
- MCAuto<DataArrayInt> d1=DataArrayInt::New();
- MCAuto<DataArrayInt> d2=DataArrayInt::New();
- MCAuto<DataArrayInt> d3=DataArrayInt::New();
+ MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
PyObject *ret=PyTuple_New(5);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *buildDescendingConnectivity2() const
{
- MCAuto<DataArrayInt> d0=DataArrayInt::New();
- MCAuto<DataArrayInt> d1=DataArrayInt::New();
- MCAuto<DataArrayInt> d2=DataArrayInt::New();
- MCAuto<DataArrayInt> d3=DataArrayInt::New();
+ MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
PyObject *ret=PyTuple_New(5);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *computeNeighborsOfCells() const
{
- DataArrayInt *neighbors=0,*neighborsIdx=0;
+ DataArrayIdType *neighbors=0,*neighborsIdx=0;
self->computeNeighborsOfCells(neighbors,neighborsIdx);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *computeNeighborsOfNodes() const
{
- DataArrayInt *neighbors=0,*neighborsIdx=0;
+ DataArrayIdType *neighbors=0,*neighborsIdx=0;
self->computeNeighborsOfNodes(neighbors,neighborsIdx);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *computeEnlargedNeighborsOfNodes() const
{
- MCAuto<DataArrayInt> neighbors,neighborsIdx;
+ MCAuto<DataArrayIdType> neighbors,neighborsIdx;
self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
- PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const
+ PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI) const
{
- MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
+ MCAuto<DataArrayIdType> cellNeigh,cellNeighIndex;
self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
- static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI)
+ static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI)
{
- DataArrayInt *neighbors=0,*neighborsIdx=0;
+ DataArrayIdType *neighbors=0,*neighborsIdx=0;
MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
{
- MCAuto<DataArrayInt> d0=DataArrayInt::New();
- MCAuto<DataArrayInt> d1=DataArrayInt::New();
- DataArrayInt *d2,*d3,*d4,*dd5;
+ MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
+ MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
+ DataArrayIdType *d2,*d3,*d4,*dd5;
MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
PyObject *ret=PyTuple_New(7);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
- DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const
+ DataArrayDouble *getPartBarycenterAndOwner(DataArrayIdType *da) const
{
if(!da)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da->checkAllocated();
return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
}
- DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const
+ DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayIdType *da) const
{
if(!da)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da->checkAllocated();
return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
}
- MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const
+ MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayIdType *da) const
{
if(!da)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da->checkAllocated();
return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
}
- PyObject *getTypesOfPart(DataArrayInt *da) const
+ PyObject *getTypesOfPart(DataArrayIdType *da) const
{
if(!da)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da->checkAllocated();
std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
return res;
}
- DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const
+ DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayIdType *da) const
{
if(!da)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da->checkAllocated();
- DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
+ DataArrayIdType *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
ret->setName(da->getName().c_str());
return ret;
}
static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
{
- DataArrayInt *cellNb1=0,*cellNb2=0;
+ DataArrayIdType *cellNb1=0,*cellNb2=0;
MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
{
MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
- DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
+ DataArrayIdType *cellIdInMesh2D(0),*cellIdInMesh1D(0);
MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
PyObject *ret(PyTuple_New(4));
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
//
- DataArrayInt *cellIds=0;
+ DataArrayIdType *cellIds=0;
MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
//
- DataArrayInt *cellIds=0;
+ DataArrayIdType *cellIds=0;
MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
return ret.retn();
}
- DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
+ DataArrayIdType *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
{
int spaceDim=self->getSpaceDimension();
if(spaceDim!=3)
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
void convertToPolyTypes(PyObject *li)
{
- int sw;
- int pos1;
- std::vector<int> pos2;
- DataArrayInt *pos3=0;
- DataArrayIntTuple *pos4=0;
+ mcIdType sw;
+ mcIdType pos1;
+ std::vector<mcIdType> pos2;
+ DataArrayIdType *pos3=0;
+ DataArrayIdTypeTuple *pos4=0;
convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
switch(sw)
{
MEDCouplingUMesh *build3DUnstructuredMesh() const;
int get2DCellIdForExtrusion() const;
%extend {
- MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId)
+ MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId)
{
return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
}
}
PyObject *getMesh3DIds() const
{
- DataArrayInt *ret=self->getMesh3DIds();
+ DataArrayIdType *ret=self->getMesh3DIds();
if(ret)
ret->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
}
};
{
virtual void insertNextCell(PyObject *li)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
self->insertNextCell(tmp,tmp+szArr);
}
- virtual DataArrayInt *getNodalConnectivity() const
+ virtual DataArrayIdType *getNodalConnectivity() const
{
- DataArrayInt *ret=self->getNodalConnectivity();
+ DataArrayIdType *ret=self->getNodalConnectivity();
if(ret) ret->incrRef();
return ret;
}
public:
static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
- void setNodalConnectivity(DataArrayInt *nodalConn);
+ void setNodalConnectivity(DataArrayIdType *nodalConn);
int getNumberOfNodesPerCell() const;
static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
MEDCoupling1GTUMesh *computeDualMesh() const;
MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
- DataArrayInt *sortHexa8EachOther();
+ DataArrayIdType *sortHexa8EachOther();
%extend
{
MEDCoupling1SGTUMesh()
PyObject *structurizeMe(double eps=1e-12) const
{
- DataArrayInt *cellPerm(0),*nodePerm(0);
+ DataArrayIdType *cellPerm(0),*nodePerm(0);
MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
PyObject *ret(PyTuple_New(3));
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
public:
static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
- void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex);
+ void setNodalConnectivity(DataArrayIdType *nodalConn, DataArrayIdType *nodalConnIndex);
MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
bool isPacked() const;
%extend
return oss.str();
}
- DataArrayInt *getNodalConnectivityIndex() const
+ DataArrayIdType *getNodalConnectivityIndex() const
{
- DataArrayInt *ret=self->getNodalConnectivityIndex();
+ DataArrayIdType *ret=self->getNodalConnectivityIndex();
if(ret) ret->incrRef();
return ret;
}
PyObject *retrievePackedNodalConnectivity() const
{
- DataArrayInt *ret1=0,*ret2=0;
+ DataArrayIdType *ret1=0,*ret2=0;
bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
PyObject *ret0Py=ret0?Py_True:Py_False;
Py_XINCREF(ret0Py);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
}
- static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt)
+ static DataArrayIdType *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<mcIdType>& offsetInNodeIdsPerElt)
{
- std::vector<const MEDCoupling::DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
+ std::vector<const MEDCoupling::DataArrayIdType *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",tmp);
return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
}
}
class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
{
public:
- int getCellIdFromPos(int i, int j, int k) const;
- int getNodeIdFromPos(int i, int j, int k) const;
- int getNumberOfCellsOfSubLevelMesh() const;
+ mcIdType getCellIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
+ mcIdType getNodeIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
+ mcIdType getNumberOfCellsOfSubLevelMesh() const;
int getSpaceDimensionOnNodeStruct() const;
double computeSquareness() const;
- virtual std::vector<int> getNodeGridStructure() const;
- std::vector<int> getCellGridStructure() const;
+ virtual std::vector<mcIdType> getNodeGridStructure() const;
+ std::vector<mcIdType> getCellGridStructure() const;
MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
- std::vector<int> getLocationFromCellId(int cellId) const;
- std::vector<int> getLocationFromNodeId(int cellId) const;
+ std::vector<mcIdType> getLocationFromCellId(mcIdType cellId) const;
+ std::vector<mcIdType> getLocationFromNodeId(mcIdType cellId) const;
static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
- static int DeduceNumberOfGivenStructure(const std::vector<int>& st);
- static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev);
- static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct);
+ static mcIdType DeduceNumberOfGivenStructure(const std::vector<mcIdType>& st);
+ static DataArrayIdType *ComputeCornersGhost(const std::vector<mcIdType>& st, mcIdType ghostLev);
+ static std::vector<mcIdType> GetSplitVectFromStruct(const std::vector<mcIdType>& strct);
%extend
{
virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
{
- int tmpp1=-1,tmpp2=-1;
- std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
- std::vector< std::pair<int,int> > inp;
+ mcIdType tmpp1=-1,tmpp2=-1;
+ std::vector<mcIdType> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
if(tmpp2==2)
{
inp.resize(tmpp1);
- for(int i=0;i<tmpp1;i++)
+ for(mcIdType i=0;i<tmpp1;i++)
{ inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
}
else if(tmpp2==1)
if(tmpp1%2!=0)
throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
inp.resize(tmpp1/2);
- for(int i=0;i<tmpp1/2;i++)
+ for(mcIdType i=0;i<tmpp1/2;i++)
{ inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
}
else
return self->buildStructuredSubPart(inp);
}
- static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
+ static DataArrayIdType *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(part,inp);
//
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
- std::vector<int> tmp5(tmp4,tmp4+szArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
+ std::vector<mcIdType> tmp5(tmp4,tmp4+szArr);
//
return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
}
- static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da)
+ static void MultiplyPartOf(const std::vector<mcIdType>& st, PyObject *part, double factor, DataArrayDouble *da)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(part,inp);
MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
}
- static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da)
+ static void MultiplyPartOfByGhost(const std::vector<mcIdType>& st, PyObject *part, mcIdType ghostSize, double factor, DataArrayDouble *da)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(part,inp);
MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
}
- static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part)
+ static PyObject *PutInGhostFormat(mcIdType ghostSize, const std::vector<mcIdType>& st, PyObject *part)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(part,inp);
- std::vector<int> stWithGhost;
- std::vector< std::pair<int,int> > partWithGhost;
+ std::vector<mcIdType> stWithGhost;
+ std::vector< std::pair<mcIdType,mcIdType> > partWithGhost;
MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
PyObject *ret(PyTuple_New(2));
PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
return ret;
}
- static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
+ static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<mcIdType>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(partCompactFormat,inp);
return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
}
- static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
+ static void AssignPartOfFieldOfDoubleUsing(const std::vector<mcIdType>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(partCompactFormat,inp);
MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
}
- static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
+ static mcIdType DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(part,inp);
return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
}
- static DataArrayInt *Build1GTNodalConnectivity(PyObject *li)
+ static DataArrayIdType *Build1GTNodalConnectivity(PyObject *li)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
}
- static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
+ static DataArrayIdType *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
}
- static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
+ static std::vector<mcIdType> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(partCompactFormat,inp);
return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
}
- static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims)
+ static PyObject *GetCompactFrmtFromDimensions(const std::vector<mcIdType>& dims)
{
- std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
+ std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
PyObject *retPy=PyList_New(ret.size());
for(std::size_t i=0;i<ret.size();i++)
{
static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
{
- std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
+ std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
convertPyToVectorPairInt(r1,r1Cpp);
convertPyToVectorPairInt(r2,r2Cpp);
- std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
+ std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
PyObject *retPy=PyList_New(ret.size());
for(std::size_t i=0;i<ret.size();i++)
{
static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
{
- std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
+ std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
convertPyToVectorPairInt(r1,r1Cpp);
convertPyToVectorPairInt(r2,r2Cpp);
return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
static PyObject *IsPartStructured(PyObject *li, PyObject *st)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
- int szArr2,sw2,iTypppArr2;
- std::vector<int> stdvecTyyppArr2;
- const int *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
- std::vector<int> tmp3(tmp2,tmp2+szArr2);
- std::vector< std::pair<int,int> > partCompactFormat;
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr2,sw2,iTypppArr2;
+ std::vector<mcIdType> stdvecTyyppArr2;
+ const mcIdType *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
+ std::vector<mcIdType> tmp3(tmp2,tmp2+szArr2);
+ std::vector< std::pair<mcIdType,mcIdType> > partCompactFormat;
bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
PyObject *ret=PyTuple_New(2);
PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
{
- std::vector< std::pair<int,int> > param0,param1,ret;
+ std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
convertPyToVectorPairInt(bigInAbs,param0);
convertPyToVectorPairInt(partOfBigInAbs,param1);
MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
return retPy;
}
- static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation)
+ static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<mcIdType>& translation)
{
- std::vector< std::pair<int,int> > param0;
+ std::vector< std::pair<mcIdType,mcIdType> > param0;
convertPyToVectorPairInt(part,param0);
- std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
+ std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
PyObject *retPy(PyList_New(ret.size()));
for(std::size_t i=0;i<ret.size();i++)
{
return retPy;
}
- static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
+ static std::vector<mcIdType> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
{
- std::vector< std::pair<int,int> > param0,param1;
+ std::vector< std::pair<mcIdType,mcIdType> > param0,param1;
convertPyToVectorPairInt(startingFrom,param0);
convertPyToVectorPairInt(goingTo,param1);
return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
{
- std::vector< std::pair<int,int> > param0,param1,ret;
+ std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
convertPyToVectorPairInt(bigInAbs,param0);
convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
}
void setNodeGridStructure(PyObject *gridStruct)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
self->setNodeGridStructure(tmp,tmp+szArr);
}
}
static MEDCouplingIMesh *New();
//
void setSpaceDimension(int spaceDim);
- std::vector<int> getNodeStruct() const;
+ std::vector<mcIdType> getNodeStruct() const;
std::vector<double> getOrigin() const;
std::vector<double> getDXYZ() const;
void setAxisUnit(const std::string& unitName);
std::string getAxisUnit() const;
double getMeasureOfAnyCell() const;
MEDCouplingCMesh *convertToCartesian() const;
- void refineWithFactor(const std::vector<int>& factors);
+ void refineWithFactor(const std::vector<mcIdType>& factors);
MEDCouplingIMesh *asSingleCell() const;
- MEDCouplingIMesh *buildWithGhost(int ghostLev) const;
+ MEDCouplingIMesh *buildWithGhost(mcIdType ghostLev) const;
%extend
{
MEDCouplingIMesh()
{
return MEDCouplingIMesh::New();
}
- static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
+ static MEDCouplingIMesh *New(const std::string& meshName, mcIdType spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
{
static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
- const int *nodeStrctPtr(0);
+ const mcIdType *nodeStrctPtr(0);
const double *originPtr(0),*dxyzPtr(0);
- int sw,sz,val0;
- std::vector<int> bb0;
+ mcIdType sw,sz,val0;
+ std::vector<mcIdType> bb0;
nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
//
double val,val2;
std::vector<double> bb,bb2;
- int sz1,sz2;
+ mcIdType sz1,sz2;
originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
//
return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
}
- MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
+ MEDCouplingIMesh(const std::string& meshName, mcIdType spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
{
return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
}
void setNodeStruct(PyObject *nodeStrct)
{
- int sw,sz,val0;
- std::vector<int> bb0;
- const int *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
+ mcIdType sw,sz,val0;
+ std::vector<mcIdType> bb0;
+ const mcIdType *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
}
{
static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
double val;
- DataArrayDouble *a;
- DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw,nbTuples;
+ mcIdType sw,nbTuples;
const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
self->setOrigin(originPtr,originPtr+nbTuples);
}
{
static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
double val;
- DataArrayDouble *a;
- DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw,nbTuples;
+ mcIdType sw,nbTuples;
const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
self->setDXYZ(originPtr,originPtr+nbTuples);
}
- static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA)
+ static void CondenseFineToCoarse(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
}
- static void CondenseFineToCoarseGhost(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA, int ghostSize)
+ static void CondenseFineToCoarseGhost(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA, mcIdType ghostSize)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
}
- static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts)
+ static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
}
- static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize)
+ static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
}
- static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize)
+ static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
}
virtual void setNature(NatureOfField nat);
DataArrayDouble *getLocalizationOfDiscr() const;
MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
- int getNumberOfTuplesExpected() const;
- int getNumberOfMeshPlacesExpected() const;
+ mcIdType getNumberOfTuplesExpected() const;
+ mcIdType getNumberOfMeshPlacesExpected() const;
void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
const std::vector<double>& gsCoo, const std::vector<double>& wg);
void clearGaussLocalizations();
- MEDCouplingGaussLocalization& getGaussLocalization(int locId);
- int getNbOfGaussLocalization() const;
- int getGaussLocalizationIdOfOneCell(int cellId) const;
- const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
- int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
+ MEDCouplingGaussLocalization& getGaussLocalization(mcIdType locId);
+ mcIdType getNbOfGaussLocalization() const;
+ mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
+ const MEDCouplingGaussLocalization& getGaussLocalization(mcIdType locId) const;
+ mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
%extend {
PyObject *getMesh() const
PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
{
- std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
+ std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
return convertIntArrToPyList3(ret);
}
PyObject *buildSubMeshData(PyObject *li) const
{
- DataArrayInt *ret1=0;
+ DataArrayIdType *ret1=0;
MEDCouplingMesh *ret0=0;
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da2->checkAllocated();
ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
}
PyObject *res = PyList_New(2);
PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
+ PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
return res;
}
- PyObject *buildSubMeshDataRange(int begin, int end, int step) const
+ PyObject *buildSubMeshDataRange(mcIdType begin, mcIdType end, mcIdType step) const
{
- DataArrayInt *ret1=0;
- int bb,ee,ss;
+ DataArrayIdType *ret1=0;
+ mcIdType bb,ee,ss;
MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
PyObject *res=PyTuple_New(2);
PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
if(ret1)
- PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
+ PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
else
{
PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
return res;
}
- DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
+ DataArrayIdType *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
{
- int sw,sz(-1);
- int v0; std::vector<int> v1;
- const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
+ mcIdType sw,sz(-1);
+ mcIdType v0; std::vector<mcIdType> v1;
+ const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
}
const std::vector<double>& gsCoo, const std::vector<double>& wg)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ self->setGaussLocalizationOnCells(tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da2->checkAllocated();
self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
}
}
- PyObject *getCellIdsHavingGaussLocalization(int locId) const
+ PyObject *getCellIdsHavingGaussLocalization(mcIdType locId) const
{
- std::vector<int> tmp;
+ std::vector<mcIdType> tmp;
self->getCellIdsHavingGaussLocalization(locId,tmp);
- DataArrayInt *ret=DataArrayInt::New();
- ret->alloc((int)tmp.size(),1);
+ DataArrayIdType *ret=DataArrayIdType::New();
+ ret->alloc((mcIdType)tmp.size(),1);
std::copy(tmp.begin(),tmp.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
- int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
+ mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
{
- std::vector<int> inp0;
+ std::vector<mcIdType> inp0;
convertPyToNewIntArr4(code,1,3,inp0);
- std::vector<const DataArrayInt *> inp1;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
+ std::vector<const DataArrayIdType *> inp1;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
}
}
double normL1(int compId) const;
double normL2(int compId) const;
double normMax(int compId) const;
- DataArrayInt *findIdsInRange(double vmin, double vmax) const;
+ DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
return self->computeVectorFieldCyl(centerPtr,vectorPtr);
{
std::vector<const DataArrayDouble *> tmp;
convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
- int sz=tmp.size();
+ std::size_t sz=tmp.size();
std::vector<DataArrayDouble *> arrs(sz);
- for(int i=0;i<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
self->setArrays(arrs);
}
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
const MEDCouplingMesh *mesh=self->getMesh();
if(!mesh)
throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
return convertDblArrToPyList<double>(res,sz);
}
- PyObject *getValueOnPos(int i, int j, int k) const
+ PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> res=new double[sz];
if(!mesh)
throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
//
- int sw,nbPts;
+ mcIdType sw,nbPts;
double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
mesh->getSpaceDimension(),true,nbPts);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
const MEDCouplingMesh *mesh=self->getMesh();
if(!mesh)
throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
}
void renumberCells(PyObject *li, bool check=true)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
self->renumberCells(tmp,check);
}
void renumberCellsWithoutMesh(PyObject *li, bool check=true)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
self->renumberCellsWithoutMesh(tmp,check);
}
void renumberNodes(PyObject *li, double eps=1e-15)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
self->renumberNodes(tmp,eps);
}
- void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15)
+ void renumberNodesWithoutMesh(PyObject *li, mcIdType newNbOfNodes, double eps=1e-15)
{
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ mcIdType szArr,sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
}
PyObject *getMaxValue2() const
{
- DataArrayInt *tmp;
+ DataArrayIdType *tmp;
double r1=self->getMaxValue2(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *getMinValue2() const
{
- DataArrayInt *tmp;
+ DataArrayIdType *tmp;
double r1=self->getMinValue2(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
{
- std::vector<int> tmp;
+ std::vector<std::size_t> tmp;
convertPyToNewIntArr3(li,tmp);
return self->keepSelectedComponents(tmp);
}
void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
{
- std::vector<int> tmp;
+ std::vector<mcIdType> tmp;
convertPyToNewIntArr3(li,tmp);
self->setSelectedComponents(f,tmp);
}
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
- int spaceDim=3;
+ mcIdType sw;
+ mcIdType spaceDim=3;
const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
self->getArray()->addEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
self->getArray()->substractEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
self->getArray()->divideEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
self->getArray()->powEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
void setTimeUnit(const std::string& unit);
std::string getTimeUnit() const;
void setTime(double val, int iteration, int order);
- void setArray(DataArrayInt *array);
+ void setArray(DataArrayInt32 *array);
MEDCouplingFieldInt *deepCopy() const;
MEDCouplingFieldInt *clone(bool recDeepCpy) const;
MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const;
return fieldT__getitem__(self,li);
}
- DataArrayInt *getArray()
+ DataArrayInt32 *getArray()
{
- DataArrayInt *ret=self->getArray();
+ DataArrayInt32 *ret=self->getArray();
if(ret)
ret->incrRef();
return ret;
public:
int getNumberOfOverlapedCellsForFather() const;
bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
- std::vector<int> computeCellGridSt() const;
+ std::vector<mcIdType> computeCellGridSt() const;
%extend
{
PyObject *getBLTRRange() const
{
- const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
+ const std::vector< std::pair<mcIdType,mcIdType> >& ret(self->getBLTRRange());
return convertFromVectorPairInt(ret);
}
PyObject *getBLTRRangeRelativeToGF() const
{
- std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
+ std::vector< std::pair<mcIdType,mcIdType> > ret(self->getBLTRRangeRelativeToGF());
return convertFromVectorPairInt(ret);
}
- void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors)
+ void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(bottomLeftTopRight,inp);
self->addPatch(inp,factors);
}
- MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const
+ MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
{
const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
if(!mesh)
return ret;
}
- void __delitem__(int patchId)
+ void __delitem__(mcIdType patchId)
{
MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
if(!mesh)
mesh->removePatch(patchId);
}
- int __len__() const
+ mcIdType __len__() const
{
const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
if(!mesh)
class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
{
public:
- int getAbsoluteLevel() const;
- int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
- std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
+ mcIdType getAbsoluteLevel() const;
+ mcIdType getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
+ std::vector<mcIdType> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
int getSpaceDimension() const;
- const std::vector<int>& getFactors() const;
- void setFactors(const std::vector<int>& newFactors);
- int getMaxNumberOfLevelsRelativeToThis() const;
- int getNumberOfCellsAtCurrentLevel() const;
- int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const;
- int getNumberOfCellsRecursiveWithOverlap() const;
- int getNumberOfCellsRecursiveWithoutOverlap() const;
- bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const;
+ const std::vector<mcIdType>& getFactors() const;
+ void setFactors(const std::vector<mcIdType>& newFactors);
+ mcIdType getMaxNumberOfLevelsRelativeToThis() const;
+ mcIdType getNumberOfCellsAtCurrentLevel() const;
+ mcIdType getNumberOfCellsAtCurrentLevelGhost(mcIdType ghostLev) const;
+ mcIdType getNumberOfCellsRecursiveWithOverlap() const;
+ mcIdType getNumberOfCellsRecursiveWithoutOverlap() const;
+ bool isPatchInNeighborhoodOf(mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const;
virtual void detachFromFather();
//
- int getNumberOfPatches() const;
- int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
+ mcIdType getNumberOfPatches() const;
+ mcIdType getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
MEDCouplingUMesh *buildUnstructured() const;
- DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const;
- std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const;
+ DataArrayDouble *extractGhostFrom(mcIdType ghostSz, const DataArrayDouble *arr) const;
+ std::vector<mcIdType> getPatchIdsInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
void removeAllPatches();
- void removePatch(int patchId);
- void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors);
- void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps);
- DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const;
- void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
- void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const;
- void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const;
- void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
- void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
- void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const;
- DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const;
+ void removePatch(mcIdType patchId);
+ void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<mcIdType>& factors);
+ void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<mcIdType>& factors, double eps);
+ DataArrayDouble *createCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const;
+ void fillCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
+ void fillCellFieldOnPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const;
+ void fillCellFieldOnPatchOnlyOnGhostZone(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const;
+ void fillCellFieldOnPatchOnlyOnGhostZoneWith(mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
+ void fillCellFieldComingFromPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
+ void fillCellFieldComingFromPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const;
+ DataArrayIdType *findPatchesInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
std::string buildPythonDumpOfThis() const;
%extend
{
- void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors)
+ void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
{
- std::vector< std::pair<int,int> > inp;
+ std::vector< std::pair<mcIdType,mcIdType> > inp;
convertPyToVectorPairInt(bottomLeftTopRight,inp);
self->addPatch(inp,factors);
}
PyObject *getPatches() const
{
std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
- int sz(ps.size());
+ mcIdType sz(ps.size());
PyObject *ret = PyList_New(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
if(elt)
return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
}
- MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const
+ MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<mcIdType>& pos) const
{
const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
return ret2;
}
- MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const
+ MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<mcIdType>& pos) const
{
const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
virtual PyObject *positionRelativeToGodFather() const
{
- std::vector<int> out1;
- std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
+ std::vector<mcIdType> out1;
+ std::vector< std::pair<mcIdType,mcIdType> > out0(self->positionRelativeToGodFather(out1));
PyObject *ret(PyTuple_New(2));
PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
return ret;
}
- virtual PyObject *retrieveGridsAt(int absoluteLev) const
+ virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
{
std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
- int sz(ps.size());
+ mcIdType sz(ps.size());
PyObject *ret = PyList_New(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
return ret;
}
- MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
+ MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(mcIdType ghostSz, PyObject *recurseArrs) const
{
std::vector<const DataArrayDouble *> inp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
return ret;
}
- MEDCouplingCartesianAMRPatch *getPatch(int patchId) const
+ MEDCouplingCartesianAMRPatch *getPatch(mcIdType patchId) const
{
MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
if(ret)
return const_cast<MEDCouplingIMesh *>(ret);
}
- MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const
+ MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
{
if(patchId==self->getNumberOfPatches())
{
return ret;
}
- void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
+ void fillCellFieldOnPatchGhostAdv(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
{
std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
}
- void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
+ void fillCellFieldOnPatchOnlyGhostAdv(mcIdType patchId, mcIdType ghostLev, PyObject *arrsOnPatches) const
{
std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
}
- void __delitem__(int patchId)
+ void __delitem__(mcIdType patchId)
{
self->removePatch(patchId);
}
- int __len__() const
+ mcIdType __len__() const
{
return self->getNumberOfPatches();
}
{
static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
- const int *nodeStrctPtr(0);
+ const mcIdType *nodeStrctPtr(0);
const double *originPtr(0),*dxyzPtr(0);
- int sw,sz,val0;
- std::vector<int> bb0;
+ mcIdType sw,sz,val0;
+ std::vector<mcIdType> bb0;
nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
//
double val,val2;
std::vector<double> bb,bb2;
- int sz1,sz2;
+ mcIdType sz1,sz2;
originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
//
{
std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
- std::vector< std::vector<int> > inp2;
+ std::vector< std::vector<mcIdType> > inp2;
convertPyToVectorOfVectorOfInt(factors,inp2);
self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
}
{
public:
virtual void synchronizeFineToCoarse();
- virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev);
+ virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev);
virtual void synchronizeCoarseToFine();
- virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev);
+ virtual void synchronizeCoarseToFineBetween(mcIdType fromLev, mcIdType toLev);
virtual void synchronizeAllGhostZones();
virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
- virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level);
- virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level);
+ virtual void synchronizeAllGhostZonesAtASpecifiedLevel(mcIdType level);
+ virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(mcIdType level);
virtual void alloc();
virtual void dealloc();
%extend
class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
{
public:
- int getNumberOfLevels() const;
+ mcIdType getNumberOfLevels() const;
MEDCouplingAMRAttribute *deepCopy() const;
MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
std::string writeVTHB(const std::string& fileName) const;
%extend
{
- static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev)
+ static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
{
std::vector< std::pair<std::string,int> > fieldNamesCpp0;
std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
return ret;
}
- MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev)
+ MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
{
return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
}
void spillNatures(PyObject *nfs)
{
- std::vector<int> inp0;
+ std::vector<mcIdType> inp0;
if(!fillIntVector(nfs,inp0))
throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
std::size_t sz(inp0.size());
PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
{
std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
- int sz((int)ret.size());
+ std::size_t sz(ret.size());
PyObject *retPy(PyList_New(sz));
- for(int i=0;i<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
return retPy;
}
class DenseMatrix : public RefCountObject, public TimeLabel
{
public:
- static DenseMatrix *New(int nbRows, int nbCols);
- static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols);
+ static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
+ static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
DenseMatrix *deepCopy() const;
DenseMatrix *shallowCpy() const;
//
- int getNumberOfRows() const;
- int getNumberOfCols() const;
- int getNbOfElems() const;
- void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1);
- void reShape(int nbRows, int nbCols);
+ mcIdType getNumberOfRows() const;
+ mcIdType getNumberOfCols() const;
+ mcIdType getNbOfElems() const;
+ void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
+ void reShape(mcIdType nbRows, mcIdType nbCols);
void transpose();
//
bool isEqual(const DenseMatrix& other, double eps) const;
static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
%extend
{
- DenseMatrix(int nbRows, int nbCols)
+ DenseMatrix(mcIdType nbRows, mcIdType nbCols)
{
return DenseMatrix::New(nbRows,nbCols);
}
- DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols)
+ DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols)
{
return DenseMatrix::New(array,nbRows,nbCols);
}
#
# Forwarding DataArrayInt functions to MEDCouplingUMesh:
#
-MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt.ExtractFromIndexedArrays
-MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt.ExtractFromIndexedArraysSlice
-MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt.SetPartOfIndexedArrays
-##MEDCouplingUMesh.SetPartOfIndexedArraysSlice = DataArrayInt.SetPartOfIndexedArraysSlice
-MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt.SetPartOfIndexedArraysSameIdx
-MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt.RemoveIdsFromIndexedArrays
-##MEDCouplingUMesh.SetPartOfIndexedArraysSameIdxSlice = DataArrayInt.SetPartOfIndexedArraysSameIdxSlice
+MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt32.ExtractFromIndexedArrays
+MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt32.ExtractFromIndexedArraysSlice
+MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt32.SetPartOfIndexedArrays
+##MEDCouplingUMesh.SetPartOfIndexedArraysSlice = DataArrayInt32.SetPartOfIndexedArraysSlice
+MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt32.SetPartOfIndexedArraysSameIdx
+MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt32.RemoveIdsFromIndexedArrays
+##MEDCouplingUMesh.SetPartOfIndexedArraysSameIdxSlice = DataArrayInt32.SetPartOfIndexedArraysSameIdxSlice
%}
#include "InterpKernelAutoPtr.hxx"
#include "MEDCouplingDataArrayTraits.hxx"
+#include "MCType.hxx"
#include <sstream>
+using namespace MEDCoupling;
+
+template<class T>
+struct SWIGTITraits
+{ };
+
+template<>
+struct SWIGTITraits<double>
+{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
+
+template<>
+struct SWIGTITraits<float>
+{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
+
+template<>
+struct SWIGTITraits<Int32>
+{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
+
+template<>
+struct SWIGTITraits<Int64>
+{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
+
+swig_type_info *SWIGTITraits<double>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayDouble is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<float>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<Int32>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayInt32 is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<Int64>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayInt64 is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<double>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayDouble is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<float>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<Int32>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayInt32 is null when called here ! Postpone initialization at inlined initializeMe()
+swig_type_info *SWIGTITraits<Int64>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayInt64 is null when called here ! Postpone initialization at inlined initializeMe()
+
static PyObject *convertArray(MEDCoupling::DataArray *array, int owner)
{
PyObject *ret(NULL);
}
if(dynamic_cast<MEDCoupling::DataArrayDouble *>(array))
ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayDouble,owner);
- if(dynamic_cast<MEDCoupling::DataArrayInt *>(array))
- ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayInt,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayInt32 *>(array))
+ ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayInt32,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayInt64 *>(array))
+ ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayInt64,owner);
if(dynamic_cast<MEDCoupling::DataArrayFloat *>(array))
ret=SWIG_NewPointerObj((void*)array,SWIGTYPE_p_MEDCoupling__DataArrayFloat,owner);
if(!ret)
void **objs=new void *[2]; objs[0]=cb; objs[1]=ref;
mma.setParameterForDeallocator(objs);
mma.setSpecificDeallocator(numarrdeal2<MCData>);
- //"Impossible to share this numpy array chunk of data, because already shared by an another non numpy array object (maybe an another DataArrayInt instance) ! Release it, or perform a copy on the input array !");
+ //"Impossible to share this numpy array chunk of data, because already shared by an another non numpy array object (maybe an another DataArrayIdType instance) ! Release it, or perform a copy on the input array !");
}
else
{
return ToNumPyArrayUnderground<MCData,T>(self,npyObjectType,MCDataStr,self->getNumberOfTuples(),self->getNumberOfComponents());
}
-SWIGINTERN PyObject *MEDCoupling_DataArrayInt_toNumPyArray(MEDCoupling::DataArrayInt *self);
+SWIGINTERN PyObject *MEDCoupling_DataArrayInt32_toNumPyArray(MEDCoupling::DataArrayInt32 *self);
+SWIGINTERN PyObject *MEDCoupling_DataArrayInt64_toNumPyArray(MEDCoupling::DataArrayInt64 *self);
SWIGINTERN PyObject *MEDCoupling_DataArrayDouble_toNumPyArray(MEDCoupling::DataArrayDouble *self);
#endif
#ifdef WITH_SCIPY
-PyObject *ToCSRMatrix(const std::vector<std::map<int,double> >& m, int nbCols)
+PyObject *ToCSRMatrix(const std::vector<std::map<mcIdType,double> >& m, mcIdType nbCols)
{
- int nbRows((int)m.size());
- MEDCoupling::MCAuto<MEDCoupling::DataArrayInt> indPtr(MEDCoupling::DataArrayInt::New()),indices(MEDCoupling::DataArrayInt::New());
+ mcIdType nbRows((mcIdType)m.size());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayIdType> indPtr(MEDCoupling::DataArrayIdType::New()),indices(MEDCoupling::DataArrayIdType::New());
MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> data(MEDCoupling::DataArrayDouble::New());
indPtr->alloc(nbRows+1,1);
- int *intPtr_ptr(indPtr->getPointer()); intPtr_ptr[0]=0; intPtr_ptr++;
- int sz2(0);
- for(std::vector<std::map<int,double> >::const_iterator it0=m.begin();it0!=m.end();it0++,intPtr_ptr++)
+ mcIdType *intPtr_ptr(indPtr->getPointer()); intPtr_ptr[0]=0; intPtr_ptr++;
+ mcIdType sz2(0);
+ for(std::vector<std::map<mcIdType,double> >::const_iterator it0=m.begin();it0!=m.end();it0++,intPtr_ptr++)
{
- sz2+=(int)(*it0).size();
+ sz2+=(mcIdType)(*it0).size();
*intPtr_ptr=sz2;
}
indices->alloc(sz2,1); data->alloc(sz2,1);
- int *indices_ptr(indices->getPointer());
+ mcIdType *indices_ptr(indices->getPointer());
double *data_ptr(data->getPointer());
- for(std::vector<std::map<int,double> >::const_iterator it0=m.begin();it0!=m.end();it0++)
- for(std::map<int,double>::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++,indices_ptr++,data_ptr++)
+ for(std::vector<std::map<mcIdType,double> >::const_iterator it0=m.begin();it0!=m.end();it0++)
+ for(std::map<mcIdType,double>::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++,indices_ptr++,data_ptr++)
{
*indices_ptr=(*it1).first;
*data_ptr=(*it1).second;
}
- PyObject *a(MEDCoupling_DataArrayDouble_toNumPyArray(data)),*b(MEDCoupling_DataArrayInt_toNumPyArray(indices)),*c(MEDCoupling_DataArrayInt_toNumPyArray(indPtr));
+#ifndef MEDCOUPLING_USE_64BIT_IDS
+ PyObject *a(MEDCoupling_DataArrayDouble_toNumPyArray(data)),*b(MEDCoupling_DataArrayInt32_toNumPyArray(indices)),*c(MEDCoupling_DataArrayInt32_toNumPyArray(indPtr));
+#else
+ PyObject *a(MEDCoupling_DataArrayDouble_toNumPyArray(data)),*b(MEDCoupling_DataArrayInt64_toNumPyArray(indices)),*c(MEDCoupling_DataArrayInt64_toNumPyArray(indPtr));
+#endif
//
PyObject *args(PyTuple_New(1)),*args0(PyTuple_New(3)),*kw(PyDict_New()),*kw1(PyTuple_New(2));
PyTuple_SetItem(args0,0,a); PyTuple_SetItem(args0,1,b); PyTuple_SetItem(args0,2,c); PyTuple_SetItem(args,0,args0);
}
if(dynamic_cast<MEDCoupling::DataArrayDouble *>(dac))
ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayDouble,owner);
- if(dynamic_cast<MEDCoupling::DataArrayInt *>(dac))
- ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayInt,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayInt32 *>(dac))
+ ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayInt32,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayInt64 *>(dac))
+ ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayInt64,owner);
if(dynamic_cast<MEDCoupling::DataArrayFloat *>(dac))
ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayFloat,owner);
if(dynamic_cast<MEDCoupling::DataArrayByte *>(dac))
return ret;
}
-static PyObject *convertIntArrToPyList(const int *ptr, int size)
+template<class T>
+static PyObject *convertIntArrToPyList(const T *ptr, mcIdType size)
{
PyObject *ret=PyList_New(size);
- for(int i=0;i<size;i++)
+ for(T i=0;i<size;i++)
PyList_SetItem(ret,i,PyInt_FromLong(ptr[i]));
return ret;
}
-static PyObject *convertIntArrToPyList2(const std::vector<int>& v)
+template<class T>
+static PyObject *convertIntArrToPyList2(const std::vector<T>& v)
{
- int size=v.size();
+ T size=v.size();
PyObject *ret=PyList_New(size);
- for(int i=0;i<size;i++)
+ for(T i=0;i<size;i++)
PyList_SetItem(ret,i,PyInt_FromLong(v[i]));
return ret;
}
-static PyObject *convertIntArrToPyList3(const std::set<int>& v)
+template<class T>
+static PyObject *convertIntArrToPyList3(const std::set<T>& v)
{
- int size=v.size();
+ T size=v.size();
PyObject *ret=PyList_New(size);
- std::set<int>::const_iterator it=v.begin();
- for(int i=0;i<size;i++,it++)
+ typename std::set<T>::const_iterator it=v.begin();
+ for(T i=0;i<size;i++,it++)
PyList_SetItem(ret,i,PyInt_FromLong(*it));
return ret;
}
return ret;
}
-static PyObject *convertIntArrToPyListOfTuple(const int *vals, int nbOfComp, int nbOfTuples)
+template<class T>
+static PyObject *convertIntArrToPyListOfTuple(const T *vals, mcIdType nbOfComp, mcIdType nbOfTuples)
{
PyObject *ret=PyList_New(nbOfTuples);
- for(int i=0;i<nbOfTuples;i++)
+ for(T i=0;i<nbOfTuples;i++)
{
PyObject *t=PyTuple_New(nbOfComp);
- for(int j=0;j<nbOfComp;j++)
+ for(T j=0;j<nbOfComp;j++)
PyTuple_SetItem(t,j,PyInt_FromLong(vals[i*nbOfComp+j]));
PyList_SetItem(ret,i,t);
}
return ret;
}
-static int *convertPyToNewIntArr2(PyObject *pyLi, int *size)
+template< class T = mcIdType >
+static T *convertPyToNewIntArr2(PyObject *pyLi, mcIdType *size)
{
if(PyList_Check(pyLi))
{
*size=PyList_Size(pyLi);
- int *tmp=new int[*size];
- for(int i=0;i<*size;i++)
+ T *tmp=new T[*size];
+ for(mcIdType i=0;i<*size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(PyInt_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ T val=(T)PyInt_AS_LONG(o);
tmp[i]=val;
}
else
else if(PyTuple_Check(pyLi))
{
*size=PyTuple_Size(pyLi);
- int *tmp=new int[*size];
- for(int i=0;i<*size;i++)
+ T *tmp=new T[*size];
+ for(mcIdType i=0;i<*size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(PyInt_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ mcIdType val=(int)PyInt_AS_LONG(o);
tmp[i]=val;
}
else
}
}
-static PyObject *convertFromVectorPairInt(const std::vector< std::pair<int,int> >& arr)
+static PyObject *convertFromVectorPairInt(const std::vector< std::pair<mcIdType,mcIdType> >& arr)
{
PyObject *ret=PyList_New(arr.size());
for(std::size_t i=0;i<arr.size();i++)
return ret;
}
-static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<int,int> >& arr)
+static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<mcIdType,mcIdType> >& arr)
{
const char msg[]="list must contain tuples of 2 integers only or tuple must contain tuples of 2 integers only !";
if(PyList_Check(pyLi))
{
- int size=PyList_Size(pyLi);
+ mcIdType size=PyList_Size(pyLi);
arr.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(PyTuple_Check(o))
{
- int sz2=PyTuple_Size(o);
+ mcIdType sz2=PyTuple_Size(o);
if(sz2!=2)
throw INTERP_KERNEL::Exception(msg);
PyObject *o_0=PyTuple_GetItem(o,0);
PyObject *o_1=PyTuple_GetItem(o,1);
if(!PyInt_Check(o_1))
throw INTERP_KERNEL::Exception(msg);
- arr[i].first=(int)PyInt_AS_LONG(o_0);
- arr[i].second=(int)PyInt_AS_LONG(o_1);
+ arr[i].first=(mcIdType)PyInt_AS_LONG(o_0);
+ arr[i].second=(mcIdType)PyInt_AS_LONG(o_1);
}
else
throw INTERP_KERNEL::Exception(msg);
}
else if(PyTuple_Check(pyLi))
{
- int size=PyTuple_Size(pyLi);
+ mcIdType size=PyTuple_Size(pyLi);
arr.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(PyTuple_Check(o))
{
- int sz2=PyTuple_Size(o);
+ mcIdType sz2=PyTuple_Size(o);
if(sz2!=2)
throw INTERP_KERNEL::Exception(msg);
PyObject *o_0=PyTuple_GetItem(o,0);
PyObject *o_1=PyTuple_GetItem(o,1);
if(!PyInt_Check(o_1))
throw INTERP_KERNEL::Exception(msg);
- arr[i].first=(int)PyInt_AS_LONG(o_0);
- arr[i].second=(int)PyInt_AS_LONG(o_1);
+ arr[i].first=(mcIdType)PyInt_AS_LONG(o_0);
+ arr[i].second=(mcIdType)PyInt_AS_LONG(o_1);
}
else
throw INTERP_KERNEL::Exception(msg);
const char msg[]="convertPyToVectorPairStringInt : list must contain tuples of 2 integers only or tuple must contain tuples of 1 string and 1 integer only !";
if(PyList_Check(pyLi))
{
- int size=PyList_Size(pyLi);
+ mcIdType size=PyList_Size(pyLi);
arr.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(PyTuple_Check(o))
{
- int sz2=PyTuple_Size(o);
+ mcIdType sz2=PyTuple_Size(o);
if(sz2!=2)
throw INTERP_KERNEL::Exception(msg);
PyObject *o_0=PyTuple_GetItem(o,0);
arr[i].first=convertPyObjectToStr(o_0,msg);
if(!PyInt_Check(o_1))
throw INTERP_KERNEL::Exception(msg);
- arr[i].second=(int)PyInt_AS_LONG(o_1);
+ arr[i].second=(mcIdType)PyInt_AS_LONG(o_1);
}
else
throw INTERP_KERNEL::Exception(msg);
}
else if(PyTuple_Check(pyLi))
{
- int size=PyTuple_Size(pyLi);
+ mcIdType size=PyTuple_Size(pyLi);
arr.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(PyTuple_Check(o))
{
- int sz2=PyTuple_Size(o);
+ mcIdType sz2=PyTuple_Size(o);
if(sz2!=2)
throw INTERP_KERNEL::Exception(msg);
PyObject *o_0=PyTuple_GetItem(o,0);
arr[i].first=convertPyObjectToStr(o_0,msg);
if(!PyInt_Check(o_1))
throw INTERP_KERNEL::Exception(msg);
- arr[i].second=(int)PyInt_AS_LONG(o_1);
+ arr[i].second=(mcIdType)PyInt_AS_LONG(o_1);
}
else
throw INTERP_KERNEL::Exception(msg);
throw INTERP_KERNEL::Exception(msg);
}
-static void convertPyToNewIntArr3(PyObject *pyLi, std::vector<int>& arr)
+template<class T>
+static void convertPyToNewIntArr3(PyObject *pyLi, std::vector<T>& arr)
{
if(PyList_Check(pyLi))
{
- int size=PyList_Size(pyLi);
+ std::size_t size=PyList_Size(pyLi);
arr.resize(size);
- for(int i=0;i<size;i++)
+ for(std::size_t i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(PyInt_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ T val=(T)PyInt_AS_LONG(o);
arr[i]=val;
}
else
}
else if(PyTuple_Check(pyLi))
{
- int size=PyTuple_Size(pyLi);
+ std::size_t size=PyTuple_Size(pyLi);
arr.resize(size);
- for(int i=0;i<size;i++)
+ for(std::size_t i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(PyInt_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ T val=(T)PyInt_AS_LONG(o);
arr[i]=val;
}
else
}
}
-static void convertPyToNewIntArr4(PyObject *pyLi, int recurseLev, int nbOfSubPart, std::vector<int>& arr)
+static void convertPyToNewIntArr4(PyObject *pyLi, mcIdType recurseLev, mcIdType nbOfSubPart, std::vector<mcIdType>& arr)
{
if(recurseLev<0)
throw INTERP_KERNEL::Exception("convertPyToNewIntArr4 : invalid list of integers level of recursion !");
arr.clear();
if(PyList_Check(pyLi))
{
- int size=PyList_Size(pyLi);
- for(int i=0;i<size;i++)
+ mcIdType size=PyList_Size(pyLi);
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(PyInt_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ mcIdType val=(mcIdType)PyInt_AS_LONG(o);
arr.push_back(val);
}
else
{
- std::vector<int> arr2;
+ std::vector<mcIdType> arr2;
convertPyToNewIntArr4(o,recurseLev-1,nbOfSubPart,arr2);
- if(nbOfSubPart>=1 && nbOfSubPart!=(int)arr2.size())
+ if(nbOfSubPart>=1 && nbOfSubPart!=(mcIdType)arr2.size())
{
std::ostringstream oss; oss << "convertPyToNewIntArr4 : input list at lev " << recurseLev << " invalid nb of subpart elts expected " << nbOfSubPart << " having " << arr2.size() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
else if(PyTuple_Check(pyLi))
{
- int size=PyTuple_Size(pyLi);
- for(int i=0;i<size;i++)
+ mcIdType size=PyTuple_Size(pyLi);
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(PyInt_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ mcIdType val=(int)PyInt_AS_LONG(o);
arr.push_back(val);
}
else
{
- std::vector<int> arr2;
+ std::vector<mcIdType> arr2;
convertPyToNewIntArr4(o,recurseLev-1,nbOfSubPart,arr2);
- if(nbOfSubPart>=1 && nbOfSubPart!=(int)arr2.size())
+ if(nbOfSubPart>=1 && nbOfSubPart!=(mcIdType)arr2.size())
{
std::ostringstream oss; oss << "convertPyToNewIntArr4 : input list at lev " << recurseLev << " invalid nb of subpart elts expected " << nbOfSubPart << " having " << arr2.size() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
throw INTERP_KERNEL::Exception("convertPyToNewIntArr4 : not a list nor a tuple recursively !");
}
-static void checkFillArrayWithPyList(int size1, int size2, int& nbOfTuples, int& nbOfComp)
+static void checkFillArrayWithPyList(mcIdType size1, mcIdType size2, mcIdType& nbOfTuples, mcIdType& nbOfComp)
{
if(nbOfTuples==-1)
{
}
}
-static void fillArrayWithPyListInt3(PyObject *pyLi, int& nbOfElt, std::vector<int>& ret)
+template< class T >
+static void fillArrayWithPyListInt3(PyObject *pyLi, mcIdType& nbOfElt, std::vector<T>& ret)
{
static const char MSG[]="fillArrayWithPyListInt3 : It appears that the input list or tuple is composed by elts having different sizes !";
if(PyInt_Check(pyLi))
{
- long val=PyInt_AS_LONG(pyLi);
+ T val=PyInt_AS_LONG(pyLi);
if(nbOfElt==-1)
nbOfElt=1;
else
}
else if(PyList_Check(pyLi))
{
- int size=PyList_Size(pyLi);
- int tmp=0;
- for(int i=0;i<size;i++)
+ mcIdType size=PyList_Size(pyLi);
+ mcIdType tmp=0;
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
- int tmp1=-1;
+ mcIdType tmp1=-1;
fillArrayWithPyListInt3(o,tmp1,ret);
tmp+=tmp1;
}
}
else if(PyTuple_Check(pyLi))
{
- int size=PyTuple_Size(pyLi);
- int tmp=0;
- for(int i=0;i<size;i++)
+ mcIdType size=PyTuple_Size(pyLi);
+ mcIdType tmp=0;
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
- int tmp1=-1;
+ mcIdType tmp1=-1;
fillArrayWithPyListInt3(o,tmp1,ret);
tmp+=tmp1;
}
throw INTERP_KERNEL::Exception("fillArrayWithPyListInt3 : Unrecognized type ! Should be a composition of tuple,list,int !");
}
-static std::vector<int> fillArrayWithPyListInt2(PyObject *pyLi, int& nbOfTuples, int& nbOfComp)
+template< class T = mcIdType >
+static std::vector<T> fillArrayWithPyListInt2(PyObject *pyLi, mcIdType& nbOfTuples, mcIdType& nbOfComp)
{
- std::vector<int> ret;
- int size1=-1,size2=-1;
+ std::vector<T> ret;
+ mcIdType size1=-1,size2=-1;
if(PyList_Check(pyLi))
{
size1=PyList_Size(pyLi);
- for(int i=0;i<size1;i++)
+ for(mcIdType i=0;i<size1;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
fillArrayWithPyListInt3(o,size2,ret);
else if(PyTuple_Check(pyLi))
{
size1=PyTuple_Size(pyLi);
- for(int i=0;i<size1;i++)
+ for(mcIdType i=0;i<size1;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
fillArrayWithPyListInt3(o,size2,ret);
{
Py_ssize_t sz=PyList_Size(pyLi);
vec.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(!convertPyObjectToStrNT(o,vec[i]))
{
Py_ssize_t sz=PyTuple_Size(pyLi);
vec.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(!convertPyObjectToStrNT(o,vec[i]))
{
Py_ssize_t sz=PyList_Size(pyLi);
arr.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(!fillStringVector(o,arr[i]))
{
Py_ssize_t sz=PyTuple_Size(pyLi);
arr.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(!fillStringVector(o,arr[i]))
throw INTERP_KERNEL::Exception(msg);
}
-static bool fillIntVector(PyObject *pyLi, std::vector<int>& vec)
+static bool fillIntVector(PyObject *pyLi, std::vector<mcIdType>& vec)
{
if(PyList_Check(pyLi))
{
Py_ssize_t sz=PyList_Size(pyLi);
vec.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(PyInt_Check(o))
{
Py_ssize_t sz=PyTuple_Size(pyLi);
vec.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(PyInt_Check(o))
return false;
}
-static void convertPyToVectorOfVectorOfInt(PyObject *pyLi, std::vector< std::vector<int> >& arr)
+static void convertPyToVectorOfVectorOfInt(PyObject *pyLi, std::vector< std::vector<mcIdType> >& arr)
{
const char msg[]="convertPyToVectorOfVectorOfInt : expecting list of list of strings !";
if(PyList_Check(pyLi))
{
Py_ssize_t sz=PyList_Size(pyLi);
arr.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(!fillIntVector(o,arr[i]))
{
Py_ssize_t sz=PyTuple_Size(pyLi);
arr.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(!fillIntVector(o,arr[i]))
{
Py_ssize_t sz=PyList_Size(pyLi);
arr.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(PyTuple_Check(o))
{
- int sz2=PyTuple_Size(o);
+ mcIdType sz2=PyTuple_Size(o);
if(sz2!=2)
throw INTERP_KERNEL::Exception(msg);
std::pair<std::string, std::vector<std::string> > item;
{
Py_ssize_t sz=PyTuple_Size(pyLi);
arr.resize(sz);
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(PyTuple_Check(o))
{
- int sz2=PyTuple_Size(o);
+ mcIdType sz2=PyTuple_Size(o);
if(sz2!=2)
throw INTERP_KERNEL::Exception(msg);
std::pair<std::string, std::vector<std::string> > item;
}
template<class T>
-PyObject *convertDblArrToPyList(const T *ptr, int size)
+PyObject *convertDblArrToPyList(const T *ptr, mcIdType size)
{
PyObject *ret(PyList_New(size));
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
PyList_SetItem(ret,i,PyFloat_FromDouble(ptr[i]));
return ret;
}
static PyObject *convertDblArrToPyList2(const std::vector<double>& v)
{
- int size(v.size());
+ mcIdType size(v.size());
PyObject *ret(PyList_New(size));
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
PyList_SetItem(ret,i,PyFloat_FromDouble(v[i]));
return ret;
}
template<class T>
-PyObject *convertDblArrToPyListOfTuple(const T *vals, int nbOfComp, int nbOfTuples)
+PyObject *convertDblArrToPyListOfTuple(const T *vals, int nbOfComp, mcIdType nbOfTuples)
{
PyObject *ret(PyList_New(nbOfTuples));
- for(int i=0;i<nbOfTuples;i++)
+ for(mcIdType i=0;i<nbOfTuples;i++)
{
PyObject *t=PyTuple_New(nbOfComp);
- for(int j=0;j<nbOfComp;j++)
+ for(mcIdType j=0;j<nbOfComp;j++)
PyTuple_SetItem(t,j,PyFloat_FromDouble(vals[i*nbOfComp+j]));
PyList_SetItem(ret,i,t);
}
return ret;
}
-static PyObject *convertCharArrToPyListOfTuple(const char *vals, int nbOfComp, int nbOfTuples)
+static PyObject *convertCharArrToPyListOfTuple(const char *vals, int nbOfComp, mcIdType nbOfTuples)
{
PyObject *ret=PyList_New(nbOfTuples);
INTERP_KERNEL::AutoPtr<char> tmp=new char[nbOfComp+1]; tmp[nbOfComp]='\0';
- for(int i=0;i<nbOfTuples;i++)
+ for(mcIdType i=0;i<nbOfTuples;i++)
{
std::copy(vals+i*nbOfComp,vals+(i+1)*nbOfComp,(char *)tmp);
PyList_SetItem(ret,i,PyString_FromString(tmp));
return ret;
}
-static double *convertPyToNewDblArr2(PyObject *pyLi, int *size)
+static double *convertPyToNewDblArr2(PyObject *pyLi, mcIdType *size)
{
if(PyList_Check(pyLi))
{
*size=PyList_Size(pyLi);
double *tmp=(double *)malloc((*size)*sizeof(double));
- for(int i=0;i<*size;i++)
+ for(mcIdType i=0;i<*size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
if(PyFloat_Check(o))
}
else if(PyInt_Check(o))
{
- long val0=PyInt_AS_LONG(o);
+ mcIdType val0=PyInt_AS_LONG(o);
double val=val0;
tmp[i]=val;
}
{
*size=PyTuple_Size(pyLi);
double *tmp=(double *)malloc((*size)*sizeof(double));
- for(int i=0;i<*size;i++)
+ for(mcIdType i=0;i<*size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
if(PyFloat_Check(o))
}
else if(PyInt_Check(o))
{
- long val0=PyInt_AS_LONG(o);
+ mcIdType val0=PyInt_AS_LONG(o);
double val=val0;
tmp[i]=val;
}
throw INTERP_KERNEL::Exception("convertPyToNewDblArr2 : not a list");
}
-static void fillArrayWithPyListDbl3(PyObject *pyLi, int& nbOfElt, std::vector<double>& ret)
+static void fillArrayWithPyListDbl3(PyObject *pyLi, mcIdType& nbOfElt, std::vector<double>& ret)
{
static const char MSG[]="fillArrayWithPyListDbl3 : It appears that the input list or tuple is composed by elts having different sizes !";
if(PyFloat_Check(pyLi))
}
else if(PyInt_Check(pyLi))
{
- long val0=PyInt_AS_LONG(pyLi);
+ mcIdType val0=PyInt_AS_LONG(pyLi);
double val=val0;
if(nbOfElt==-1)
nbOfElt=1;
}
else if(PyList_Check(pyLi))
{
- int size=PyList_Size(pyLi);
- int tmp=0;
- for(int i=0;i<size;i++)
+ mcIdType size=PyList_Size(pyLi);
+ mcIdType tmp=0;
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
- int tmp1=-1;
+ mcIdType tmp1=-1;
fillArrayWithPyListDbl3(o,tmp1,ret);
tmp+=tmp1;
}
}
else if(PyTuple_Check(pyLi))
{
- int size=PyTuple_Size(pyLi);
- int tmp=0;
- for(int i=0;i<size;i++)
+ mcIdType size=PyTuple_Size(pyLi);
+ mcIdType tmp=0;
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
- int tmp1=-1;
+ mcIdType tmp1=-1;
fillArrayWithPyListDbl3(o,tmp1,ret);
tmp+=tmp1;
}
throw INTERP_KERNEL::Exception("fillArrayWithPyListDbl3 : Unrecognized type ! Should be a composition of tuple,list,int and float !");
}
-static std::vector<double> fillArrayWithPyListDbl2(PyObject *pyLi, int& nbOfTuples, int& nbOfComp)
+static std::vector<double> fillArrayWithPyListDbl2(PyObject *pyLi, mcIdType& nbOfTuples, mcIdType& nbOfComp)
{
std::vector<double> ret;
- int size1=-1,size2=-1;
+ mcIdType size1=-1,size2=-1;
if(PyList_Check(pyLi))
{
size1=PyList_Size(pyLi);
- for(int i=0;i<size1;i++)
+ for(mcIdType i=0;i<size1;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
fillArrayWithPyListDbl3(o,size2,ret);
else if(PyTuple_Check(pyLi))
{
size1=PyTuple_Size(pyLi);
- for(int i=0;i<size1;i++)
+ for(mcIdType i=0;i<size1;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
fillArrayWithPyListDbl3(o,size2,ret);
void *argp=0;
if(PyList_Check(pyLi))
{
- int size=PyList_Size(pyLi);
+ mcIdType size=PyList_Size(pyLi);
ret.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *obj=PyList_GetItem(pyLi,i);
int status=SWIG_ConvertPtr(obj,&argp,ty,0|0);
}
else if(PyTuple_Check(pyLi))
{
- int size=PyTuple_Size(pyLi);
+ mcIdType size=PyTuple_Size(pyLi);
ret.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *obj=PyTuple_GetItem(pyLi,i);
int status=SWIG_ConvertPtr(obj,&argp,ty,0|0);
* if python int -> cpp int sw=1
* if python list[int] -> cpp vector<int> sw=2
* if python tuple[int] -> cpp vector<int> sw=2
- * if python DataArrayInt -> cpp DataArrayInt sw=3
- * if python DataArrayIntTuple -> cpp DataArrayIntTuple sw=4
+ * if python DataArrayIdType -> cpp DataArrayIdType sw=3
+ * if python DataArrayIntTuple -> cpp DataArrayIdTypeTuple sw=4
*
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
*/
-static void convertIntStarLikePyObjToCpp(PyObject *value, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, MEDCoupling::DataArrayInt *& daIntTyypp, MEDCoupling::DataArrayIntTuple *&daIntTuple)
+template< class T, class ARRAY >
+static void convertIntStarLikePyObjToCpp(PyObject *value, mcIdType& sw, T& iTyypp, std::vector<T>& stdvecTyypp, ARRAY *& daIntTyypp, typename MEDCoupling::Traits< T >::ArrayTuple *&daIntTuple)
{
sw=-1;
if(PyInt_Check(value))
{
- iTyypp=(int)PyInt_AS_LONG(value);
+ iTyypp=(T)PyInt_AS_LONG(value);
sw=1;
return;
}
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
return;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTITraits< typename ARRAY::Type >::TI,0|0);
if(SWIG_IsOK(status))
{
- daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+ daIntTyypp=reinterpret_cast< ARRAY * >(argp);
sw=3;
return;
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTITraits<T>::TI_TUPLE,0|0);
if(SWIG_IsOK(status))
{
- daIntTuple=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
+ daIntTuple=reinterpret_cast< typename MEDCoupling::Traits< T >::ArrayTuple * >(argp);
sw=4;
return ;
}
- throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayInt, DataArrayIntTuple");
+ throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayIdType, DataArrayIdTypeTuple");
}
/*!
* if python int -> cpp int sw=1
* if python list[int] -> cpp vector<int> sw=2
* if python tuple[int] -> cpp vector<int> sw=2
- * if python DataArrayInt -> cpp DataArrayInt sw=3
- * if python DataArrayIntTuple -> cpp DataArrayIntTuple sw=4
+ * if python DataArrayIdType -> cpp DataArrayIdType sw=3
+ * if python DataArrayIdTypeTuple -> cpp DataArrayIdTypeTuple sw=4
*
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
*/
-static const int *convertIntStarLikePyObjToCppIntStar(PyObject *value, int& sw, int& sz, int& iTyypp, std::vector<int>& stdvecTyypp)
+template< class T >
+static const T *convertIntStarLikePyObjToCppIntStar(PyObject *value, mcIdType& sw, mcIdType& sz, T& iTyypp, std::vector<T>& stdvecTyypp)
{
sw=-1;
if(PyInt_Check(value))
{
- iTyypp=(int)PyInt_AS_LONG(value);
+ iTyypp=(T)PyInt_AS_LONG(value);
sw=1; sz=1;
return &iTyypp;
}
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
return &stdvecTyypp[0];
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTITraits<T>::TI,0|0);
if(SWIG_IsOK(status))
{
- MEDCoupling::DataArrayInt *daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+ typedef typename MEDCoupling::Traits< T >::ArrayType ARRAY;
+ ARRAY *daIntTyypp=reinterpret_cast< ARRAY * >(argp);
if(daIntTyypp)
{
sw=3; sz=daIntTyypp->getNbOfElems();
return 0;
}
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTITraits<T>::TI_TUPLE,0|0);
if(SWIG_IsOK(status))
{
- MEDCoupling::DataArrayIntTuple *daIntTuple=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
+ typedef typename MEDCoupling::Traits< T >::ArrayTuple ARRAYTUPLE;
+ ARRAYTUPLE *daIntTuple=reinterpret_cast< ARRAYTUPLE * >(argp);
sw=4; sz=daIntTuple->getNumberOfCompo();
return daIntTuple->getConstPointer();
}
- throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayInt, DataArrayIntTuple");
+ throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayIdType, DataArrayIdTypeTuple");
}
/*!
* if python tuple[int] -> cpp vector<double> sw=2
* if python DataArrayDouble -> cpp DataArrayDouble sw=3
*
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
*/
template<class T>
-void considerPyObjAsATStarLikeObject(PyObject *value, int& sw, T& iTyypp, std::vector<T>& stdvecTyypp, typename MEDCoupling::Traits<T>::ArrayType *& daIntTyypp, swig_type_info *ti)
+void considerPyObjAsATStarLikeObject(PyObject *value, mcIdType& sw, T& iTyypp, std::vector<T>& stdvecTyypp, typename MEDCoupling::Traits<T>::ArrayType *& daIntTyypp, swig_type_info *ti)
{
sw=-1;
if(PyFloat_Check(value))
}
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
* if python tuple[int] -> cpp vector<double> sw=2
* if python DataArrayDoubleTuple -> cpp DataArrayDoubleTuple sw=3
*
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
*/
-static void convertDoubleStarLikePyObjToCpp(PyObject *value, int& sw, double& iTyypp, std::vector<double>& stdvecTyypp, MEDCoupling::DataArrayDoubleTuple *& daIntTyypp)
+static void convertDoubleStarLikePyObjToCpp(PyObject *value, mcIdType& sw, double& iTyypp, std::vector<double>& stdvecTyypp, MEDCoupling::DataArrayDoubleTuple *& daIntTyypp)
{
sw=-1;
if(PyFloat_Check(value))
}
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
}
template<class T>
-void convertFPStarLikePyObjToCpp_2(PyObject *value, int& sw, T& val, typename MEDCoupling::Traits<T>::ArrayType *&d, typename MEDCoupling::Traits<T>::ArrayTuple *&e, std::vector<T>& f, swig_type_info *ti_da, swig_type_info *ti_tuple)
+void convertFPStarLikePyObjToCpp_2(PyObject *value, mcIdType& sw, T& val, typename MEDCoupling::Traits<T>::ArrayType *&d, typename MEDCoupling::Traits<T>::ArrayTuple *&e, std::vector<T>& f, swig_type_info *ti_da, swig_type_info *ti_tuple)
{
sw=-1;
if(PyFloat_Check(value))
}
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
f.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
f.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
* if value list[int,double] -> cpp std::vector<double> sw=4
* if value tuple[int,double] -> cpp std::vector<double> sw=4
*/
-static void convertDoubleStarLikePyObjToCpp_2(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f)
+static void convertDoubleStarLikePyObjToCpp_2(PyObject *value, mcIdType& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f)
{
convertFPStarLikePyObjToCpp_2<double>(value,sw,val,d,e,f,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple);
}
* if value list[int,double] -> cpp std::vector<double> sw=4
* if value tuple[int,double] -> cpp std::vector<double> sw=4
*/
-static void convertFloatStarLikePyObjToCpp_2(PyObject *value, int& sw, float& val, MEDCoupling::DataArrayFloat *&d, MEDCoupling::DataArrayFloatTuple *&e, std::vector<float>& f)
+static void convertFloatStarLikePyObjToCpp_2(PyObject *value, mcIdType& sw, float& val, MEDCoupling::DataArrayFloat *&d, MEDCoupling::DataArrayFloatTuple *&e, std::vector<float>& f)
{
convertFPStarLikePyObjToCpp_2<float>(value,sw,val,d,e,f,SWIGTYPE_p_MEDCoupling__DataArrayFloat,SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple);
}
* if python list[int] -> cpp vector<int> sw=2
* if python tuple[int] -> cpp vector<int> sw=2
* if python slicp -> cpp pair sw=3 (begin,end,step)
- * if python DataArrayInt -> cpp DataArrayInt sw=4 . The returned pointer cannot be the null pointer ! If null an exception is thrown.
+ * if python DataArrayIdType -> cpp DataArrayIdType sw=4 . The returned pointer cannot be the null pointer ! If null an exception is thrown.
*
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
*/
-static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayInt *& daIntTyypp)
+template<class T, class ARRAY>
+static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, mcIdType nbelem, mcIdType& sw, T& iTyypp, std::vector<T>& stdvecTyypp, std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& p, ARRAY *& daIntTyypp)
{
- const char *msg="5 types accepted : integer, tuple of integer, list of integer, slice, DataArrayInt, DataArrayIntTuple";
+ const char *msg="5 types accepted : integer, tuple of integer, list of integer, slice, DataArrayIdType, DataArrayIdTypeTuple";
sw=-1;
if(PyInt_Check(value))
{
- iTyypp=(int)PyInt_AS_LONG(value);
+ iTyypp=(mcIdType)PyInt_AS_LONG(value);
sw=1;
return;
}
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ stdvecTyypp[i]=(mcIdType)PyInt_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ stdvecTyypp[i]=(mcIdType)PyInt_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
return ;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTITraits< typename ARRAY::Type >::TI,0|0);
if(SWIG_IsOK(status))
{
- daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
+ daIntTyypp=reinterpret_cast< ARRAY * >(argp);
if(!daIntTyypp)
{
std::ostringstream oss; oss << msg << " Instance in null !";
sw=4;
return ;
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTITraits< typename ARRAY::Type >::TI_TUPLE,0|0);
if(SWIG_IsOK(status))
{
- MEDCoupling::DataArrayIntTuple *tmp=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
+ typedef typename MEDCoupling::Traits< typename ARRAY::Type >::ArrayTuple ARRAYTUPLE;
+ ARRAYTUPLE *tmp=reinterpret_cast< ARRAYTUPLE * >(argp);
if(!tmp)
{
std::ostringstream oss; oss << msg << " Instance in null !";
/*!
* Idem than convertIntStarOrSliceLikePyObjToCpp
*/
-static void convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayInt *& daIntTyypp)
+template<class T, class ARRAY>
+static void convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(PyObject *value, mcIdType nbelem, mcIdType& sw, T& iTyypp, std::vector<T>& stdvecTyypp, std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& p, ARRAY *& daIntTyypp)
{
convertIntStarOrSliceLikePyObjToCpp(value,nbelem,sw,iTyypp,stdvecTyypp,p,daIntTyypp);
if(sw==1)
* if python tuple[int] -> cpp vector<int> sw=2
* if python list[int] -> cpp vector<int> sw=2
* if python slice -> cpp pair sw=3
- * if python DataArrayIntTuple -> cpp DataArrayIntTuple sw=4 . WARNING The returned pointer can be the null pointer !
+ * if python DataArrayIdTypeTuple -> cpp DataArrayIdTypeTuple sw=4 . WARNING The returned pointer can be the null pointer !
*/
-static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayIntTuple *& daIntTyypp)
+template< class TUPLE_T >
+static void convertObjToPossibleCpp22(PyObject *value, mcIdType nbelem, mcIdType& sw, mcIdType& iTyypp, std::vector<mcIdType>& stdvecTyypp, std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& p, typename MEDCoupling::Traits< TUPLE_T >::ArrayTuple *& daIntTyypp)
{
sw=-1;
if(PyInt_Check(value))
{
- iTyypp=(int)PyInt_AS_LONG(value);
+ iTyypp=(mcIdType)PyInt_AS_LONG(value);
sw=1;
return;
}
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ stdvecTyypp[i]=(mcIdType)PyInt_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
stdvecTyypp.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ stdvecTyypp[i]=(mcIdType)PyInt_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
return ;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTITraits<TUPLE_T>::TI_TUPLE,0|0);
if(!SWIG_IsOK(status))
- throw INTERP_KERNEL::Exception("4 types accepted : integer, tuple of integer, list of integer, slice, DataArrayIntTuple");
- daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
+ throw INTERP_KERNEL::Exception("4 types accepted : integer, tuple of integer, list of integer, slice, DataArrayIdTypeTuple");
+ daIntTyypp=reinterpret_cast< typename MEDCoupling::Traits< TUPLE_T >::ArrayTuple * >(argp);
sw=4;
}
* if python not null pointer of DataArrayChar -> cpp DataArrayChar sw=4
* switch between (int,string,vector<string>,DataArrayChar)
*/
-static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::string& sType, std::vector<std::string>& vsType, MEDCoupling::DataArrayChar *& dacType)
+static void convertObjToPossibleCpp6(PyObject *value, mcIdType& sw, char& cTyp, std::string& sType, std::vector<std::string>& vsType, MEDCoupling::DataArrayChar *& dacType)
{
const char *msg="4 types accepted : string, list or tuple of strings having same size, not null DataArrayChar instance.";
sw=-1;
#endif
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
vsType.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
try
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
vsType.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
try
* if value list[int] -> vt sw=2
* if value tuple[int] -> vt sw=2
* if value slice -> pt sw=3
- * if value DataArrayInt -> dt sw=4
+ * if value DataArrayIdType -> dt sw=4
* if value tuple [int,int] -> cpp it,ip sw=5
* if value tuple [list[int],int] -> cpp vt,ip sw=6
* if value tuple [tuple[int],int] -> cpp vt,ip sw=6
* if value tuple [slice,slice] -> cpp pt,pc sw=15
* if value tuple [DaI,slice] -> cpp dt,pc sw=16
*
- * switch between (int,vector<int>,DataArrayInt)
+ * switch between (int,vector<int>,DataArrayIdType)
*/
-static void convertObjToPossibleCpp3(PyObject *value, int nbTuple, int nbCompo, int& sw, int& it, int& ic, std::vector<int>& vt, std::vector<int>& vc,
- std::pair<int, std::pair<int,int> >& pt, std::pair<int, std::pair<int,int> >& pc,
- MEDCoupling::DataArrayInt *&dt, MEDCoupling::DataArrayInt *&dc)
+template<class TC>
+static void convertObjToPossibleCpp3(PyObject *value, mcIdType nbTuple, int nbCompo, mcIdType& sw, mcIdType& it, TC& ic, std::vector<mcIdType>& vt, std::vector<TC>& vc,
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& pt, std::pair<mcIdType, std::pair<mcIdType,mcIdType> >& pc,
+ MEDCoupling::DataArrayIdType *&dt, MEDCoupling::DataArrayIdType *&dc)
{
if(!PyTuple_Check(value))
{
}
else
{
- int sz=PyTuple_Size(value);
+ mcIdType sz=PyTuple_Size(value);
if(sz!=2)
throw INTERP_KERNEL::Exception("Unexpected nb of slice element : 1 or 2 expected !\n1st is for tuple selection, 2nd for component selection !");
PyObject *ob0=PyTuple_GetItem(value,0);
- int sw1,sw2;
+ mcIdType sw1,sw2;
convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(ob0,nbTuple,sw1,it,vt,pt,dt);
PyObject *ob1=PyTuple_GetItem(value,1);
convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(ob1,nbCompo,sw2,ic,vc,pc,dc);
* if value list[int,double] -> cpp std::vector<double> sw=4
* if value tuple[int,double] -> cpp std::vector<double> sw=4
*/
-static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
- const char *msg, int nbTuplesExpected, int nbCompExpected, bool throwIfNullPt)
+static const double *convertObjToPossibleCpp5_Safe(PyObject *value, mcIdType& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
+ const char *msg, mcIdType nbTuplesExpected, int nbCompExpected, bool throwIfNullPt)
{
sw=-1;
if(PyFloat_Check(value))
{
try
{
- int tmp1=nbTuplesExpected,tmp2=nbCompExpected;
+ mcIdType tmp1=nbTuplesExpected,tmp2=nbCompExpected;
std::vector<double> ret=fillArrayWithPyListDbl2(value,tmp1,tmp2);
sw=4;
f=ret;
{
if(d->getNumberOfTuples()==nbTuplesExpected)
{
- if(d->getNumberOfComponents()==nbCompExpected)
+ if(ToIdType(d->getNumberOfComponents())==nbCompExpected)
{
return d->getConstPointer();
}
{
e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp);
sw=3;
- if(e->getNumberOfCompo()==nbCompExpected)
+ if(ToIdType(e->getNumberOfCompo())==nbCompExpected)
{
if(nbTuplesExpected==1)
return e->getConstPointer();
* if value list[int,double] -> cpp std::vector<double> sw=4
* if value tuple[int,double] -> cpp std::vector<double> sw=4
*/
-static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
- const char *msg, int nbCompExpected, bool throwIfNullPt, int& nbTuples)
+static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, mcIdType& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
+ const char *msg, int nbCompExpected, bool throwIfNullPt, mcIdType& nbTuples)
{
sw=-1;
if(PyFloat_Check(value))
}
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
f.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
f.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
sw=2;
if(d)
{
- if(d->getNumberOfComponents()==nbCompExpected)
+ if(ToIdType(d->getNumberOfComponents())==nbCompExpected)
{
nbTuples=d->getNumberOfTuples();
return d->getConstPointer();
sw=3;
if(e)
{
- if(e->getNumberOfCompo()==nbCompExpected)
+ if(ToIdType(e->getNumberOfCompo())==nbCompExpected)
{
nbTuples=1;
return e->getConstPointer();
* if value list[int,double] -> cpp std::vector<double> sw=4
* if value tuple[int,double] -> cpp std::vector<double> sw=4
*/
-static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int& sw, double& val, std::vector<double>& f,
- const char *msg, bool throwIfNullPt, int& nbTuples)
+static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, mcIdType& sw, double& val, std::vector<double>& f,
+ const char *msg, bool throwIfNullPt, mcIdType& nbTuples)
{
MEDCoupling::DataArrayDouble *d=0;
MEDCoupling::DataArrayDoubleTuple *e=0;
}
if(PyTuple_Check(value))
{
- int size=PyTuple_Size(value);
+ mcIdType size=PyTuple_Size(value);
f.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
}
if(PyList_Check(value))
{
- int size=PyList_Size(value);
+ mcIdType size=PyList_Size(value);
f.resize(size);
- for(int i=0;i<size;i++)
+ for(mcIdType i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
if(!SWIG_IsOK(status))
{
- status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayInt32,0|0);
if(!SWIG_IsOK(status))
{
- status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,0|0);
+ status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayInt64,0|0);
if(!SWIG_IsOK(status))
{
- status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayByte,0|0);
- std::ostringstream oss; oss << msg << " ! Accepted instances are DataArrayDouble, DataArrayInt, DataArrayAsciiChar, DataArrayByte !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
+ status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,0|0);
+ if(!SWIG_IsOK(status))
+ {
+ status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayByte,0|0);
+ std::ostringstream oss; oss << msg << " ! Accepted instances are DataArrayDouble, DataArrayIdType, DataArrayAsciiChar, DataArrayByte !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
}
}
}
{
if(PyInt_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
if(elt2)
{
if(PyInt_Check(elt2))
{//DataArrayDouble.New([1.,3.,4.,5.],2,2)
- int nbOfCompo=PyInt_AS_LONG(elt2);
+ mcIdType nbOfCompo=PyInt_AS_LONG(elt2);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
else
{//DataArrayDouble.New([1.,3.,4.],3)
MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
- int tmpp1(-1);
+ mcIdType tmpp1(-1);
std::vector<double> tmp(fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1));
ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
else
{// DataArrayDouble.New([1.,3.,4.])
MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
- int tmpp1(-1),tmpp2(-1);
+ mcIdType tmpp1(-1),tmpp2(-1);
std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
else if(PyInt_Check(elt0))
{
- int nbOfTuples1(PyInt_AS_LONG(elt0));
+ mcIdType nbOfTuples1(PyInt_AS_LONG(elt0));
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
if(nbOfTuples)
{
if(PyInt_Check(nbOfTuples))
{//DataArrayDouble.New(5,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+ mcIdType nbOfCompo=PyInt_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
{
self->checkAllocated();
const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
- int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
- int sw1,sw2;
+ mcIdType nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
+ mcIdType sw1,sw2;
T i1;
std::vector<T> v1;
typename MEDCoupling::Traits<T>::ArrayType *d1=0;
considerPyObjAsATStarLikeObject<T>(value,sw1,i1,v1,d1,ti);
- int it1,ic1;
- std::vector<int> vt1,vc1;
- std::pair<int, std::pair<int,int> > pt1,pc1;
- MEDCoupling::DataArrayInt *dt1=0,*dc1=0;
+ mcIdType it1,ic1;
+ std::vector<mcIdType> vt1;
+ std::vector<mcIdType> vc1;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > pt1,pc1;
+ MEDCoupling::DataArrayIdType *dt1=0,*dc1=0;
convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > tmp;
switch(sw2)
const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
self->checkAllocated();
- int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
- int it1,ic1;
- std::vector<int> vt1,vc1;
- std::pair<int, std::pair<int,int> > pt1,pc1;
- MEDCoupling::DataArrayInt *dt1=0,*dc1=0;
- int sw;
+ mcIdType nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
+ mcIdType it1;
+ std::size_t ic1;
+ std::vector<mcIdType> vt1;
+ std::vector<std::size_t> vc1;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > pt1,pc1;
+ MEDCoupling::DataArrayIdType *dt1=0,*dc1=0;
+ mcIdType sw;
convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
MEDCoupling::MCAuto<typename MEDCoupling::Traits<T>::ArrayType > ret;
switch(sw)
case 6:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
- std::vector<int> v2(1,ic1);
+ std::vector<std::size_t> v2(1,ic1);
return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
}
case 7:
{
ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
- std::vector<int> v2(1,ic1);
+ std::vector<std::size_t> v2(1,ic1);
return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
}
case 8:
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
- std::vector<int> v2(1,ic1);
+ std::vector<std::size_t> v2(1,ic1);
return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
}
case 9:
{
ret=self->selectByTupleIdSafe(&it1,&it1+1);
int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
- std::vector<int> v2(nbOfComp);
- for(int i=0;i<nbOfComp;i++)
+ std::vector<std::size_t> v2(nbOfComp);
+ for(mcIdType i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
}
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
- std::vector<int> v2(nbOfComp);
+ std::vector<std::size_t> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
{
ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
- std::vector<int> v2(nbOfComp);
+ std::vector<std::size_t> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
- std::vector<int> v2(nbOfComp);
+ std::vector<std::size_t> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),ti, SWIG_POINTER_OWN | 0 );
#endif
}
-void convertCSR_MCDataToVectMapIntDouble(const MEDCoupling::DataArrayInt *indptrPtr, const MEDCoupling::DataArrayInt *indicesPtr, const MEDCoupling::DataArrayDouble *dataPtr, std::vector<std::map<int,double> >& mCpp)
+void convertCSR_MCDataToVectMapIntDouble(const MEDCoupling::DataArrayIdType *indptrPtr, const MEDCoupling::DataArrayIdType *indicesPtr, const MEDCoupling::DataArrayDouble *dataPtr, std::vector<std::map<mcIdType,double> >& mCpp)
{
auto nbOfRows(indptrPtr->getNumberOfTuples()-1);
if(nbOfRows<0)
}
}
-void convertToVectMapIntDouble(PyObject *pyobj, std::vector<std::map<int,double> >& mCpp)
+void convertToVectMapIntDouble(PyObject *pyobj, std::vector<std::map<mcIdType,double> >& mCpp)
{
if(!PyList_Check(pyobj))
throw INTERP_KERNEL::Exception("convertToVectMapIntDouble : input is not a python list !");
}
PyObject *key, *value;
Py_ssize_t pos(0);
- std::map<int,double>& mapCpp(mCpp[i]);
+ std::map<mcIdType,double>& mapCpp(mCpp[i]);
while(PyDict_Next(elt,&pos,&key,&value))
{
if(!PyInt_Check(key))
std::ostringstream oss; oss << "convertToVectMapIntDouble : at pos # " << i << " of pylist the dict contains at pos " << pos << " the value not mappable to pyfloat !";
throw INTERP_KERNEL::Exception(oss.str());
}
- mapCpp[(int)PyInt_AS_LONG(key)]=PyFloat_AS_DOUBLE(value);
+ mapCpp[(mcIdType)PyInt_AS_LONG(key)]=PyFloat_AS_DOUBLE(value);
}
}
}
typename MEDCoupling::Traits<T>::ArrayType *a;
typename MEDCoupling::Traits<T>::ArrayTuple *aa;
std::vector<T> bb;
- int sw;
+ mcIdType sw;
convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,ti_da,ti_tuple);
switch(sw)
{
}
case 4:
{
- MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
self->multiplyEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
typename MEDCoupling::Traits<T>::ArrayType *a;
typename MEDCoupling::Traits<T>::ArrayTuple *aa;
std::vector<T> bb;
- int sw;
+ mcIdType sw;
convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,ti_da,ti_tuple);
switch(sw)
{
}
case 4:
{
- MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
self->divideEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
typename MEDCoupling::Traits<T>::ArrayType *a;
typename MEDCoupling::Traits<T>::ArrayTuple *aa;
std::vector<T> bb;
- int sw;
+ mcIdType sw;
convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,ti_da,ti_tuple);
switch(sw)
{
}
case 4:
{
- MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
self->addEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
typename MEDCoupling::Traits<T>::ArrayType *a;
typename MEDCoupling::Traits<T>::ArrayTuple *aa;
std::vector<T> bb;
- int sw;
+ mcIdType sw;
convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,ti_da,ti_tuple);
switch(sw)
{
}
case 4:
{
- MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
self->substractEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
-template<class T>
-struct SWIGTITraits
-{ };
-
-template<>
-struct SWIGTITraits<double>
-{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
-
-template<>
-struct SWIGTITraits<float>
-{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
-
-template<>
-struct SWIGTITraits<int>
-{ static swig_type_info *TI; static swig_type_info *TI_TUPLE; };
-
-swig_type_info *SWIGTITraits<double>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayDouble is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<float>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<int>::TI=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<double>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayDouble is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<float>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
-swig_type_info *SWIGTITraits<int>::TI_TUPLE=NULL;//unfortunately SWIGTYPE_p_MEDCoupling__DataArrayFloat is null when called here ! Postpone initialization at inlined initializeMe()
-
#ifdef WITH_NUMPY
PyTypeObject *NPYTraits<double>::NPYFunc=&PyCallBackDataArrayDouble_RefType;
typename MEDCoupling::Traits<T>::ArrayType *a;
typename MEDCoupling::Traits<T>::ArrayTuple *aa;
std::vector<T> bb;
- int sw;
+ mcIdType sw;
convertFPStarLikePyObjToCpp_2<T>(obj,sw,val,a,aa,bb,SWIGTITraits<T>::TI,SWIGTITraits<T>::TI_TUPLE);
switch(sw)
{
}
case 4:
{
- typename MEDCoupling::MCAuto<typename MEDCoupling::Traits<T>::ArrayType> aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ typename MEDCoupling::MCAuto<typename MEDCoupling::Traits<T>::ArrayType> aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,bb.size());
return MEDCoupling::Traits<T>::ArrayType::Multiply(self,aaa);
}
default:
virtual const char *getRepr() const;
virtual int getNumberOfTuples(const MEDCouplingMesh *mesh) const;
virtual int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
- virtual DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
+ virtual DataArrayIdType *getOffsetArr(const MEDCouplingMesh *mesh) const;
virtual DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
virtual void checkCompatibilityWithNature(NatureOfField nat) const;
virtual double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const;
{
virtual MEDCouplingFieldDiscretization *clonePart(PyObject *li)
{
- int sz=0,sw=-1,val1=-1;
- std::vector<int> val2;
- const int *inp=convertIntStarLikePyObjToCppIntStar(li,sw,sz,val1,val2);
+ mcIdType sz=0,sw=-1,val1=-1;
+ std::vector<mcIdType> val2;
+ const mcIdType *inp=convertIntStarLikePyObjToCppIntStar(li,sw,sz,val1,val2);
return self->clonePart(inp,inp+sz);
}
- virtual PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const
+ virtual PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds, mcIdType& beginOut, mcIdType& endOut, mcIdType& stepOut, DataArrayIdType *&di) const
{
- DataArrayInt *ret1=0;
- int bb,ee,ss;
+ DataArrayIdType *ret1=0;
+ mcIdType bb,ee,ss;
MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,beginCellIds,endCellIds,stepCellIds,bb,ee,ss,ret1);
PyObject *res=PyTuple_New(2);
PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
if(ret1)
- PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
+ PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
else
{
PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
return res;
}
- virtual int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
+ virtual mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
{
- std::vector<int> inp0;
+ std::vector<mcIdType> inp0;
convertPyToNewIntArr4(code,1,3,inp0);
- std::vector<const DataArrayInt *> inp1;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
+ std::vector<const DataArrayIdType *> inp1;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
}
virtual PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const
{
- std::vector<int> vVal; int iVal=-1;
- int sz=-1,sw=0;
- const int *tupleIdsBg=convertIntStarLikePyObjToCppIntStar(tupleIds,sw,sz,iVal,vVal);
+ std::vector<mcIdType> vVal; mcIdType iVal=-1;
+ mcIdType sz=-1,sw=0;
+ const mcIdType *tupleIdsBg=convertIntStarLikePyObjToCppIntStar(tupleIds,sw,sz,iVal,vVal);
if(sw==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
- DataArrayInt *ret0=0,*ret1=0;
+ DataArrayIdType *ret0=0,*ret1=0;
self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
PyObject *pyRet=PyTuple_New(2);
- PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return pyRet;
}
return convertDblArrToPyList<double>(tmp,sz);
}
- virtual PyObject *getCellIdsHavingGaussLocalization(int locId) const
+ virtual PyObject *getCellIdsHavingGaussLocalization(mcIdType locId) const
{
- std::vector<int> tmp;
+ std::vector<mcIdType> tmp;
self->getCellIdsHavingGaussLocalization(locId,tmp);
- DataArrayInt *ret=DataArrayInt::New();
- ret->alloc((int)tmp.size(),1);
+ DataArrayIdType *ret=DataArrayIdType::New();
+ ret->alloc(tmp.size(),1);
std::copy(tmp.begin(),tmp.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
virtual void setGaussLocalizationOnCells(const MEDCouplingMesh *m, PyObject *li, const std::vector<double>& refCoo,
const std::vector<double>& gsCoo, const std::vector<double>& wg)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- self->setGaussLocalizationOnCells(m,tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ self->setGaussLocalizationOnCells(m,tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
da2->checkAllocated();
self->setGaussLocalizationOnCells(m,da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
}
virtual PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
{
- std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
+ std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
return convertIntArrToPyList3(ret);
}
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
if(!mesh)
throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDiscretization::getValueOn : no underlying mesh !");
int spaceDim=mesh->getSpaceDimension();
return convertDblArrToPyList<double>(res,spaceDim);
}
- virtual PyObject *getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k) const
+ virtual PyObject *getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, mcIdType i, mcIdType j, mcIdType k) const
{
if(!arr)
throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::getValueOnPos : input array is null !");
int sz(arr->getNumberOfComponents());
- INTERP_KERNEL::AutoPtr<double> res=new double[sz];
- self->getValueOnPos(arr,mesh,i,j,k,res);
- return convertDblArrToPyList<double>(res,sz);
- }
+ INTERP_KERNEL::AutoPtr<double> res=new double[sz];
+ self->getValueOnPos(arr,mesh,i,j,k,res);
+ return convertDblArrToPyList<double>(res,sz);
+ }
virtual DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, PyObject *loc) const
{
if(!mesh)
throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDiscretization::getValueOnMulti : null input mesh !");
//
- int sw,nbPts;
+ mcIdType sw,nbPts;
double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
const double *inp=convertObjToPossibleCpp5_Safe2(loc,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
mesh->getSpaceDimension(),true,nbPts);
virtual void renumberCells(PyObject *li, bool check=true)
{
- int sw,sz(-1);
- int v0; std::vector<int> v1;
- const int *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
+ mcIdType sw,sz(-1);
+ mcIdType v0; std::vector<mcIdType> v1;
+ const mcIdType *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
self->renumberCells(ids,check);
}
std::vector<DataArray *> input1;
convertFromPyObjVectorOfObj<MEDCoupling::DataArray *>(arrays,SWIGTYPE_p_MEDCoupling__DataArray,"DataArray",input1);
//
- int sw,sz(-1);
- int v0; std::vector<int> v1;
- const int *old2NewBg(convertIntStarLikePyObjToCppIntStar(old2New,sw,sz,v0,v1));
+ mcIdType sw,sz(-1);
+ mcIdType v0; std::vector<mcIdType> v1;
+ const mcIdType *old2NewBg(convertIntStarLikePyObjToCppIntStar(old2New,sw,sz,v0,v1));
//
self->renumberArraysForCell(mesh,input1,old2NewBg,check);
}
- virtual DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, PyObject *cellIds) const
+ virtual DataArrayIdType *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, PyObject *cellIds) const
{
- int sw,sz(-1);
- int v0; std::vector<int> v1;
- const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
+ mcIdType sw,sz(-1);
+ mcIdType v0; std::vector<mcIdType> v1;
+ const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
return self->computeTupleIdsToSelectFromCellIds(mesh,cellIdsBg,cellIdsBg+sz);
}
virtual PyObject *buildSubMeshData(const MEDCouplingMesh *mesh, PyObject *ids)
{
- int sw,sz(-1);
- int v0; std::vector<int> v1;
- const int *idsBg(convertIntStarLikePyObjToCppIntStar(ids,sw,sz,v0,v1));
- DataArrayInt *di(0);
+ mcIdType sw,sz(-1);
+ mcIdType v0; std::vector<mcIdType> v1;
+ const mcIdType *idsBg(convertIntStarLikePyObjToCppIntStar(ids,sw,sz,v0,v1));
+ DataArrayIdType *di(0);
MEDCouplingMesh *ret0=self->buildSubMeshData(mesh,idsBg,idsBg+sz,di);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(di),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(di),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
- virtual void renumberValuesOnNodes(double epsOnVals, PyObject *old2New, int newNbOfNodes, DataArrayDouble *arr) const
+ virtual void renumberValuesOnNodes(double epsOnVals, PyObject *old2New, mcIdType newNbOfNodes, DataArrayDouble *arr) const
{
- int sw,sz(-1);
- int v0; std::vector<int> v1;
- const int *old2NewBg(convertIntStarLikePyObjToCppIntStar(old2New,sw,sz,v0,v1));
+ mcIdType sw,sz(-1);
+ mcIdType v0; std::vector<mcIdType> v1;
+ const mcIdType *old2NewBg(convertIntStarLikePyObjToCppIntStar(old2New,sw,sz,v0,v1));
self->renumberValuesOnNodes(epsOnVals,old2NewBg,newNbOfNodes,arr);
}
- virtual void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, PyObject *old2New, int newSz, DataArrayDouble *arr) const
+ virtual void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, PyObject *old2New, mcIdType newSz, DataArrayDouble *arr) const
{
- int sw,sz(-1);
- int v0; std::vector<int> v1;
- const int *old2NewBg(convertIntStarLikePyObjToCppIntStar(old2New,sw,sz,v0,v1));
+ mcIdType sw,sz(-1);
+ mcIdType v0; std::vector<mcIdType> v1;
+ const mcIdType *old2NewBg(convertIntStarLikePyObjToCppIntStar(old2New,sw,sz,v0,v1));
self->renumberValuesOnCells(epsOnVals,mesh,old2NewBg,newSz,arr);
}
- virtual void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, PyObject *new2old, int newSz, DataArrayDouble *arr) const
+ virtual void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, PyObject *new2old, mcIdType newSz, DataArrayDouble *arr) const
{
- int sw,sz(-1);
- int v0; std::vector<int> v1;
- const int *new2oldBg(convertIntStarLikePyObjToCppIntStar(new2old,sw,sz,v0,v1));
+ mcIdType sw,sz(-1);
+ mcIdType v0; std::vector<mcIdType> v1;
+ const mcIdType *new2oldBg(convertIntStarLikePyObjToCppIntStar(new2old,sw,sz,v0,v1));
self->renumberValuesOnCellsR(mesh,new2oldBg,newSz,arr);
}
}
class MEDCouplingFieldDiscretizationPerCell : public MEDCouplingFieldDiscretization
{
public:
- void setArrayOfDiscIds(const DataArrayInt *adids);
+ void setArrayOfDiscIds(const DataArrayIdType *adids);
void checkNoOrphanCells() const;
%extend
{
PyObject *getArrayOfDiscIds() const
{
- DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
+ DataArrayIdType *ret=const_cast<DataArrayIdType *>(self->getArrayOfDiscIds());
if(ret)
ret->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
PyObject *splitIntoSingleGaussDicrPerCellType() const
{
- std::vector<int> ret1;
- std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
+ std::vector<mcIdType> ret1;
+ std::vector<DataArrayIdType *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
std::size_t sz=ret0.size();
PyObject *pyRet=PyTuple_New(2);
- PyObject *pyRet0=PyList_New((int)sz);
- PyObject *pyRet1=PyList_New((int)sz);
+ PyObject *pyRet0=PyList_New((mcIdType)sz);
+ PyObject *pyRet1=PyList_New((mcIdType)sz);
for(std::size_t i=0;i<sz;i++)
{
- PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
}
PyTuple_SetItem(pyRet,0,pyRet0);
class MEDCouplingFieldDiscretizationKriging : public MEDCouplingFieldDiscretizationOnNodes
{
public:
- static DataArrayDouble *PerformDriftOfVec(const DataArrayDouble *arr, int isDrift);
+ static DataArrayDouble *PerformDriftOfVec(const DataArrayDouble *arr, mcIdType isDrift);
%extend
{
PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
{
- int ret1;
+ mcIdType ret1;
DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyObject *computeInverseMatrix(const MEDCouplingMesh *mesh) const
{
- int ret1(-1),ret2(-1);
+ mcIdType ret1(-1),ret2(-1);
DataArrayDouble *ret0=self->computeInverseMatrix(mesh,ret1,ret2);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyObject *computeMatrix(const MEDCouplingMesh *mesh) const
{
- int ret1(-1),ret2(-1);
+ mcIdType ret1(-1),ret2(-1);
DataArrayDouble *ret0=self->computeMatrix(mesh,ret1,ret2);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
{
if(!mesh)
throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretizationKriging::computeEvaluationMatrixOnGivenPts : input mesh is empty !");
- int sw,nbPts;
+ mcIdType sw,nbPts;
double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDiscretizationKriging::computeEvaluationMatrixOnGivenPts",
mesh->getSpaceDimension(),true,nbPts);
//
- int ret1(-1);
+ mcIdType ret1(-1);
DataArrayDouble *ret0=self->computeEvaluationMatrixOnGivenPts(mesh,inp,nbPts,ret1);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyObject *performDrift(const DataArrayDouble *matr, const DataArrayDouble *arr) const
{
- int ret1(-1);
+ mcIdType ret1(-1);
DataArrayDouble *ret0(self->performDrift(matr,arr,ret1));
PyObject *res(PyTuple_New(2));
PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
static PyObject *PerformDriftRect(const DataArrayDouble *matr, const DataArrayDouble *arr)
{
- int ret1(-1);
+ mcIdType ret1(-1);
DataArrayDouble *ret0(MEDCouplingFieldDiscretizationKriging::PerformDriftRect(matr,arr,ret1));
PyObject *res(PyTuple_New(2));
PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
DataArrayDouble.__ifloordiv__=MEDCouplingDataArrayDoubleIdiv
DataArrayDouble.__rfloordiv__=DataArrayDouble.__rdiv__
-DataArrayInt.__reduce__=MEDCouplingDataArrayIntReduce
-DataArrayInt.__iadd__=MEDCouplingDataArrayIntIadd
-DataArrayInt.__isub__=MEDCouplingDataArrayIntIsub
-DataArrayInt.__imul__=MEDCouplingDataArrayIntImul
-DataArrayInt.__idiv__=MEDCouplingDataArrayIntIdiv
-DataArrayInt.__imod__=MEDCouplingDataArrayIntImod
-DataArrayInt.__ipow__=MEDCouplingDataArrayIntIpow
-DataArrayInt.__truediv__=DataArrayInt.__div__
-DataArrayInt.__itruediv__=MEDCouplingDataArrayIntIdiv
-DataArrayInt.__rtruediv__=DataArrayInt.__rdiv__
-DataArrayInt.__floordiv__=DataArrayInt.__div__
-DataArrayInt.__ifloordiv__=MEDCouplingDataArrayIntIdiv
-DataArrayInt.__rfloordiv__=DataArrayInt.__rdiv__
+DataArrayInt32.__reduce__=MEDCouplingDataArrayIntReduce
+DataArrayInt32.__iadd__=MEDCouplingDataArrayIntIadd
+DataArrayInt32.__isub__=MEDCouplingDataArrayIntIsub
+DataArrayInt32.__imul__=MEDCouplingDataArrayIntImul
+DataArrayInt32.__idiv__=MEDCouplingDataArrayIntIdiv
+DataArrayInt32.__imod__=MEDCouplingDataArrayIntImod
+DataArrayInt32.__ipow__=MEDCouplingDataArrayIntIpow
+DataArrayInt32.__truediv__=DataArrayInt.__div__
+DataArrayInt32.__itruediv__=MEDCouplingDataArrayIntIdiv
+DataArrayInt32.__rtruediv__=DataArrayInt.__rdiv__
+DataArrayInt32.__floordiv__=DataArrayInt.__div__
+DataArrayInt32.__ifloordiv__=MEDCouplingDataArrayIntIdiv
+DataArrayInt32.__rfloordiv__=DataArrayInt.__rdiv__
+
+DataArrayInt64.__reduce__=MEDCouplingDataArrayIntReduce
+DataArrayInt64.__iadd__=MEDCouplingDataArrayIntIadd
+DataArrayInt64.__isub__=MEDCouplingDataArrayIntIsub
+DataArrayInt64.__imul__=MEDCouplingDataArrayIntImul
+DataArrayInt64.__idiv__=MEDCouplingDataArrayIntIdiv
+DataArrayInt64.__imod__=MEDCouplingDataArrayIntImod
+DataArrayInt64.__ipow__=MEDCouplingDataArrayIntIpow
+DataArrayInt64.__truediv__=DataArrayInt.__div__
+DataArrayInt64.__itruediv__=MEDCouplingDataArrayIntIdiv
+DataArrayInt64.__rtruediv__=DataArrayInt.__rdiv__
+DataArrayInt64.__floordiv__=DataArrayInt.__div__
+DataArrayInt64.__ifloordiv__=MEDCouplingDataArrayIntIdiv
+DataArrayInt64.__rfloordiv__=DataArrayInt.__rdiv__
DataArrayByte.__reduce__=MEDCouplingDataArrayByteReduce
MEDCouplingFieldTemplate.__reduce__=MEDCouplingFieldTemplateReduce
-MEDCouplingFieldInt.__reduce__=MEDCouplingFieldIntReduce
+MEDCouplingFieldInt32.__reduce__=MEDCouplingFieldIntReduce
+MEDCouplingFieldInt64.__reduce__=MEDCouplingFieldIntReduce
MEDCouplingFieldFloat.__reduce__=MEDCouplingFieldFloatReduce
DataArrayDoubleTuple.__itruediv__=MEDCouplingDataArrayDoubleTupleIdiv
DataArrayDoubleTuple.__ifloordiv__=MEDCouplingDataArrayDoubleTupleIdiv
-DataArrayIntTuple.__iadd__=MEDCouplingDataArrayIntTupleIadd
-DataArrayIntTuple.__isub__=MEDCouplingDataArrayIntTupleIsub
-DataArrayIntTuple.__imul__=MEDCouplingDataArrayIntTupleImul
-DataArrayIntTuple.__idiv__=MEDCouplingDataArrayIntTupleIdiv
-DataArrayIntTuple.__itruediv__=MEDCouplingDataArrayIntTupleIdiv
-DataArrayIntTuple.__ifloordiv__=MEDCouplingDataArrayIntTupleIdiv
-DataArrayIntTuple.__imod__=MEDCouplingDataArrayIntTupleImod
+DataArrayInt32Tuple.__iadd__=MEDCouplingDataArrayIntTupleIadd
+DataArrayInt32Tuple.__isub__=MEDCouplingDataArrayIntTupleIsub
+DataArrayInt32Tuple.__imul__=MEDCouplingDataArrayIntTupleImul
+DataArrayInt32Tuple.__idiv__=MEDCouplingDataArrayIntTupleIdiv
+DataArrayInt32Tuple.__itruediv__=MEDCouplingDataArrayIntTupleIdiv
+DataArrayInt32Tuple.__ifloordiv__=MEDCouplingDataArrayIntTupleIdiv
+DataArrayInt32Tuple.__imod__=MEDCouplingDataArrayIntTupleImod
+
+DataArrayInt64Tuple.__iadd__=MEDCouplingDataArrayIntTupleIadd
+DataArrayInt64Tuple.__isub__=MEDCouplingDataArrayIntTupleIsub
+DataArrayInt64Tuple.__imul__=MEDCouplingDataArrayIntTupleImul
+DataArrayInt64Tuple.__idiv__=MEDCouplingDataArrayIntTupleIdiv
+DataArrayInt64Tuple.__itruediv__=MEDCouplingDataArrayIntTupleIdiv
+DataArrayInt64Tuple.__ifloordiv__=MEDCouplingDataArrayIntTupleIdiv
+DataArrayInt64Tuple.__imod__=MEDCouplingDataArrayIntTupleImod
DenseMatrix.__iadd__=MEDCouplingDenseMatrixIadd
DenseMatrix.__isub__=MEDCouplingDenseMatrixIsub
MEDCouplingMappedExtrudedMesh.__reduce__=MEDCouplingMappedExtrudedMeshReduce
DataArrayAsciiCharIterator.__next__ = DataArrayAsciiCharIterator.next
-DataArrayIntIterator.__next__ = DataArrayIntIterator.next
+DataArrayInt32Iterator.__next__ = DataArrayInt32Iterator.next
+DataArrayInt64Iterator.__next__ = DataArrayInt64Iterator.next
DataArrayDoubleIterator.__next__ = DataArrayDoubleIterator.next
MEDCouplingUMeshCellIterator.__next__ = MEDCouplingUMeshCellIterator.next
MEDCouplingUMeshCellByTypeIterator.__next__ = MEDCouplingUMeshCellByTypeIterator.next
+
del INTERPKERNELExceptionReduce
-del MEDCouplingDataArrayDoubleReduce
-del MEDCouplingDataArrayFloatReduce
-del MEDCouplingDataArrayIntReduce
-del MEDCouplingDataArrayByteReduce
-del MEDCouplingUMeshReduce
+del MEDCoupling1DGTUMeshReduce
+del MEDCoupling1SGTUMeshReduce
del MEDCouplingCMeshReduce
-del MEDCouplingIMeshReduce
-del MEDCouplingMappedExtrudedMeshReduce
del MEDCouplingCurveLinearMeshReduce
-del MEDCoupling1SGTUMeshReduce
-del MEDCoupling1DGTUMeshReduce
-del MEDCouplingFieldDoubleReduce
-del MEDCouplingFieldFloatReduce
-del MEDCouplingFieldIntReduce
-del MEDCouplingFieldTemplateReduce
+del MEDCouplingDataArrayByteReduce
del MEDCouplingDataArrayDoubleIadd
-del MEDCouplingDataArrayDoubleIsub
del MEDCouplingDataArrayDoubleImul
-del MEDCouplingDataArrayDoubleIdiv
-del MEDCouplingFieldDoubleIadd
-del MEDCouplingFieldDoubleIsub
-del MEDCouplingFieldDoubleImul
-del MEDCouplingFieldDoubleIdiv
-del MEDCouplingFieldDoubleIpow
-del MEDCouplingDataArrayIntIadd
-del MEDCouplingDataArrayIntIsub
-del MEDCouplingDataArrayIntImul
-del MEDCouplingDataArrayIntIdiv
-del MEDCouplingDataArrayIntImod
-del MEDCouplingDataArrayFloatIadd
-del MEDCouplingDataArrayFloatIsub
-del MEDCouplingDataArrayFloatImul
-del MEDCouplingDataArrayFloatIdiv
+del MEDCouplingDataArrayDoubleIpow
+del MEDCouplingDataArrayDoubleIsub
+del MEDCouplingDataArrayDoubleReduce
del MEDCouplingDataArrayDoubleTupleIadd
-del MEDCouplingDataArrayDoubleTupleIsub
del MEDCouplingDataArrayDoubleTupleImul
-del MEDCouplingDataArrayDoubleTupleIdiv
+del MEDCouplingDataArrayDoubleTupleIsub
+del MEDCouplingDataArrayFloatIadd
+del MEDCouplingDataArrayFloatImul
+del MEDCouplingDataArrayFloatIsub
+del MEDCouplingDataArrayFloatReduce
+del MEDCouplingDataArrayIntIadd
+del MEDCouplingDataArrayIntIadd
+del MEDCouplingDataArrayIntImod
+del MEDCouplingDataArrayIntImul
+del MEDCouplingDataArrayIntIpow
+del MEDCouplingDataArrayIntIsub
+del MEDCouplingDataArrayIntReduce
del MEDCouplingDataArrayIntTupleIadd
-del MEDCouplingDataArrayIntTupleIsub
-del MEDCouplingDataArrayIntTupleImul
del MEDCouplingDataArrayIntTupleIdiv
del MEDCouplingDataArrayIntTupleImod
+del MEDCouplingDataArrayIntTupleImul
+del MEDCouplingDataArrayIntTupleIsub
del MEDCouplingDenseMatrixIadd
del MEDCouplingDenseMatrixIsub
+del MEDCouplingFieldDoubleIadd
+del MEDCouplingFieldDoubleImul
+del MEDCouplingFieldDoubleIpow
+del MEDCouplingFieldDoubleIsub
+del MEDCouplingFieldDoubleReduce
+del MEDCouplingFieldFloatReduce
+del MEDCouplingFieldIntReduce
+del MEDCouplingFieldTemplateReduce
+del MEDCouplingIMeshReduce
+del MEDCouplingMappedExtrudedMeshReduce
+del MEDCouplingUMeshReduce
%}
$result=convertDataArrayChar($1,$owner);
}
-%typemap(out) MCAuto<MEDCoupling::DataArrayInt>
+%typemap(out) MCAuto<MEDCoupling::DataArrayInt32>
{
- $result=SWIG_NewPointerObj(SWIG_as_voidptr($1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN|0);
+ $result=SWIG_NewPointerObj(SWIG_as_voidptr($1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt32,SWIG_POINTER_OWN|0);
+}
+
+%typemap(out) MCAuto<MEDCoupling::DataArrayInt64>
+{
+ $result=SWIG_NewPointerObj(SWIG_as_voidptr($1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt64,SWIG_POINTER_OWN|0);
}
%typemap(out) MCAuto<MEDCoupling::DataArrayDouble>
%newobject MEDCoupling::DataArrayFloat::__iter__;
%newobject MEDCoupling::DataArrayFloat::Meld;
%newobject MEDCoupling::DataArrayFloat::__rmul__;
-%newobject MEDCoupling::DataArrayInt::New;
-%newobject MEDCoupling::DataArrayInt::__iter__;
-%newobject MEDCoupling::DataArrayInt::performCopyOrIncrRef;
-%newobject MEDCoupling::DataArrayInt::subArray;
-%newobject MEDCoupling::DataArrayInt::changeNbOfComponents;
-%newobject MEDCoupling::DataArrayInt::accumulatePerChunck;
-%newobject MEDCoupling::DataArrayInt::checkAndPreparePermutation;
-%newobject MEDCoupling::DataArrayInt::transformWithIndArrR;
-%newobject MEDCoupling::DataArrayInt::renumber;
-%newobject MEDCoupling::DataArrayInt::renumberR;
-%newobject MEDCoupling::DataArrayInt::renumberAndReduce;
-%newobject MEDCoupling::DataArrayInt::invertArrayO2N2N2O;
-%newobject MEDCoupling::DataArrayInt::invertArrayN2O2O2N;
-%newobject MEDCoupling::DataArrayInt::invertArrayO2N2N2OBis;
-%newobject MEDCoupling::DataArrayInt::findIdsEqual;
-%newobject MEDCoupling::DataArrayInt::findIdsNotEqual;
-%newobject MEDCoupling::DataArrayInt::findIdsEqualList;
-%newobject MEDCoupling::DataArrayInt::findIdsNotEqualList;
-%newobject MEDCoupling::DataArrayInt::findIdsEqualTuple;
-%newobject MEDCoupling::DataArrayInt::findIdForEach;
-%newobject MEDCoupling::DataArrayInt::sumPerTuple;
-%newobject MEDCoupling::DataArrayInt::negate;
-%newobject MEDCoupling::DataArrayInt::computeAbs;
-%newobject MEDCoupling::DataArrayInt::findIdsInRange;
-%newobject MEDCoupling::DataArrayInt::findIdsNotInRange;
-%newobject MEDCoupling::DataArrayInt::findIdsStrictlyNegative;
-%newobject MEDCoupling::DataArrayInt::Aggregate;
-%newobject MEDCoupling::DataArrayInt::AggregateIndexes;
-%newobject MEDCoupling::DataArrayInt::Meld;
-%newobject MEDCoupling::DataArrayInt::Add;
-%newobject MEDCoupling::DataArrayInt::Substract;
-%newobject MEDCoupling::DataArrayInt::Multiply;
-%newobject MEDCoupling::DataArrayInt::Divide;
-%newobject MEDCoupling::DataArrayInt::Pow;
-%newobject MEDCoupling::DataArrayInt::BuildUnion;
-%newobject MEDCoupling::DataArrayInt::BuildIntersection;
-%newobject MEDCoupling::DataArrayInt::Range;
-%newobject MEDCoupling::DataArrayInt::indicesOfSubPart;
-%newobject MEDCoupling::DataArrayInt::fromNoInterlace;
-%newobject MEDCoupling::DataArrayInt::toNoInterlace;
-%newobject MEDCoupling::DataArrayInt::buildComplement;
-%newobject MEDCoupling::DataArrayInt::buildUnion;
-%newobject MEDCoupling::DataArrayInt::buildSubstraction;
-%newobject MEDCoupling::DataArrayInt::buildSubstractionOptimized;
-%newobject MEDCoupling::DataArrayInt::buildIntersection;
-%newobject MEDCoupling::DataArrayInt::buildUnique;
-%newobject MEDCoupling::DataArrayInt::buildUniqueNotSorted;
-%newobject MEDCoupling::DataArrayInt::deltaShiftIndex;
-%newobject MEDCoupling::DataArrayInt::buildExplicitArrByRanges;
-%newobject MEDCoupling::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
-%newobject MEDCoupling::DataArrayInt::findRangeIdForEachTuple;
-%newobject MEDCoupling::DataArrayInt::findIdInRangeForEachTuple;
-%newobject MEDCoupling::DataArrayInt::duplicateEachTupleNTimes;
-%newobject MEDCoupling::DataArrayInt::buildPermutationArr;
-%newobject MEDCoupling::DataArrayInt::buildPermArrPerLevel;
-%newobject MEDCoupling::DataArrayInt::getDifferentValues;
-%newobject MEDCoupling::DataArrayInt::FindPermutationFromFirstToSecond;
-%newobject MEDCoupling::DataArrayInt::CheckAndPreparePermutation;
-%newobject MEDCoupling::DataArrayInt::__neg__;
-%newobject MEDCoupling::DataArrayInt::__add__;
-%newobject MEDCoupling::DataArrayInt::__radd__;
-%newobject MEDCoupling::DataArrayInt::__sub__;
-%newobject MEDCoupling::DataArrayInt::__rsub__;
-%newobject MEDCoupling::DataArrayInt::__mul__;
-%newobject MEDCoupling::DataArrayInt::__rmul__;
-%newobject MEDCoupling::DataArrayInt::__div__;
-%newobject MEDCoupling::DataArrayInt::__rdiv__;
-%newobject MEDCoupling::DataArrayInt::__mod__;
-%newobject MEDCoupling::DataArrayInt::__rmod__;
-%newobject MEDCoupling::DataArrayInt::__pow__;
-%newobject MEDCoupling::DataArrayInt::__rpow__;
-%newobject MEDCoupling::DataArrayIntTuple::buildDAInt;
+%newobject MEDCoupling::DataArrayInt32::New;
+%newobject MEDCoupling::DataArrayInt32::__iter__;
+%newobject MEDCoupling::DataArrayInt32::performCopyOrIncrRef;
+%newobject MEDCoupling::DataArrayInt32::subArray;
+%newobject MEDCoupling::DataArrayInt32::changeNbOfComponents;
+%newobject MEDCoupling::DataArrayInt32::accumulatePerChunck;
+%newobject MEDCoupling::DataArrayInt32::checkAndPreparePermutation;
+%newobject MEDCoupling::DataArrayInt32::transformWithIndArrR;
+%newobject MEDCoupling::DataArrayInt32::renumber;
+%newobject MEDCoupling::DataArrayInt32::renumberR;
+%newobject MEDCoupling::DataArrayInt32::renumberAndReduce;
+%newobject MEDCoupling::DataArrayInt32::invertArrayO2N2N2O;
+%newobject MEDCoupling::DataArrayInt32::invertArrayN2O2O2N;
+%newobject MEDCoupling::DataArrayInt32::invertArrayO2N2N2OBis;
+%newobject MEDCoupling::DataArrayInt32::findIdsEqual;
+%newobject MEDCoupling::DataArrayInt32::findIdsNotEqual;
+%newobject MEDCoupling::DataArrayInt32::findIdsEqualList;
+%newobject MEDCoupling::DataArrayInt32::findIdsNotEqualList;
+%newobject MEDCoupling::DataArrayInt32::findIdsEqualTuple;
+%newobject MEDCoupling::DataArrayInt32::findIdForEach;
+%newobject MEDCoupling::DataArrayInt32::sumPerTuple;
+%newobject MEDCoupling::DataArrayInt32::negate;
+%newobject MEDCoupling::DataArrayInt32::computeAbs;
+%newobject MEDCoupling::DataArrayInt32::findIdsInRange;
+%newobject MEDCoupling::DataArrayInt32::findIdsNotInRange;
+%newobject MEDCoupling::DataArrayInt32::findIdsStrictlyNegative;
+%newobject MEDCoupling::DataArrayInt32::Aggregate;
+%newobject MEDCoupling::DataArrayInt32::AggregateIndexes;
+%newobject MEDCoupling::DataArrayInt32::Meld;
+%newobject MEDCoupling::DataArrayInt32::Add;
+%newobject MEDCoupling::DataArrayInt32::Substract;
+%newobject MEDCoupling::DataArrayInt32::Multiply;
+%newobject MEDCoupling::DataArrayInt32::Divide;
+%newobject MEDCoupling::DataArrayInt32::Pow;
+%newobject MEDCoupling::DataArrayInt32::BuildUnion;
+%newobject MEDCoupling::DataArrayInt32::BuildIntersection;
+%newobject MEDCoupling::DataArrayInt32::Range;
+%newobject MEDCoupling::DataArrayInt32::indicesOfSubPart;
+%newobject MEDCoupling::DataArrayInt32::fromNoInterlace;
+%newobject MEDCoupling::DataArrayInt32::toNoInterlace;
+%newobject MEDCoupling::DataArrayInt32::buildComplement;
+%newobject MEDCoupling::DataArrayInt32::buildUnion;
+%newobject MEDCoupling::DataArrayInt32::buildSubstraction;
+%newobject MEDCoupling::DataArrayInt32::buildSubstractionOptimized;
+%newobject MEDCoupling::DataArrayInt32::buildIntersection;
+%newobject MEDCoupling::DataArrayInt32::buildUnique;
+%newobject MEDCoupling::DataArrayInt32::buildUniqueNotSorted;
+%newobject MEDCoupling::DataArrayInt32::deltaShiftIndex;
+%newobject MEDCoupling::DataArrayInt32::buildExplicitArrByRanges;
+%newobject MEDCoupling::DataArrayInt32::buildExplicitArrOfSliceOnScaledArr;
+%newobject MEDCoupling::DataArrayInt32::findRangeIdForEachTuple;
+%newobject MEDCoupling::DataArrayInt32::findIdInRangeForEachTuple;
+%newobject MEDCoupling::DataArrayInt32::duplicateEachTupleNTimes;
+%newobject MEDCoupling::DataArrayInt32::buildPermutationArr;
+%newobject MEDCoupling::DataArrayInt32::buildPermArrPerLevel;
+%newobject MEDCoupling::DataArrayInt32::getDifferentValues;
+%newobject MEDCoupling::DataArrayInt32::FindPermutationFromFirstToSecond;
+%newobject MEDCoupling::DataArrayInt32::CheckAndPreparePermutation;
+%newobject MEDCoupling::DataArrayInt32::__neg__;
+%newobject MEDCoupling::DataArrayInt32::__add__;
+%newobject MEDCoupling::DataArrayInt32::__radd__;
+%newobject MEDCoupling::DataArrayInt32::__sub__;
+%newobject MEDCoupling::DataArrayInt32::__rsub__;
+%newobject MEDCoupling::DataArrayInt32::__mul__;
+%newobject MEDCoupling::DataArrayInt32::__rmul__;
+%newobject MEDCoupling::DataArrayInt32::__div__;
+%newobject MEDCoupling::DataArrayInt32::__rdiv__;
+%newobject MEDCoupling::DataArrayInt32::__mod__;
+%newobject MEDCoupling::DataArrayInt32::__rmod__;
+%newobject MEDCoupling::DataArrayInt32::__pow__;
+%newobject MEDCoupling::DataArrayInt32::__rpow__;
+%newobject MEDCoupling::DataArrayInt32Tuple::buildDAInt;
+%newobject MEDCoupling::DataArrayInt64::New;
+%newobject MEDCoupling::DataArrayInt64::__iter__;
+%newobject MEDCoupling::DataArrayInt64::performCopyOrIncrRef;
+%newobject MEDCoupling::DataArrayInt64::subArray;
+%newobject MEDCoupling::DataArrayInt64::changeNbOfComponents;
+%newobject MEDCoupling::DataArrayInt64::accumulatePerChunck;
+%newobject MEDCoupling::DataArrayInt64::checkAndPreparePermutation;
+%newobject MEDCoupling::DataArrayInt64::transformWithIndArrR;
+%newobject MEDCoupling::DataArrayInt64::renumber;
+%newobject MEDCoupling::DataArrayInt64::renumberR;
+%newobject MEDCoupling::DataArrayInt64::renumberAndReduce;
+%newobject MEDCoupling::DataArrayInt64::invertArrayO2N2N2O;
+%newobject MEDCoupling::DataArrayInt64::invertArrayN2O2O2N;
+%newobject MEDCoupling::DataArrayInt64::invertArrayO2N2N2OBis;
+%newobject MEDCoupling::DataArrayInt64::findIdsEqual;
+%newobject MEDCoupling::DataArrayInt64::findIdsNotEqual;
+%newobject MEDCoupling::DataArrayInt64::findIdsEqualList;
+%newobject MEDCoupling::DataArrayInt64::findIdsNotEqualList;
+%newobject MEDCoupling::DataArrayInt64::findIdsEqualTuple;
+%newobject MEDCoupling::DataArrayInt64::findIdForEach;
+%newobject MEDCoupling::DataArrayInt64::sumPerTuple;
+%newobject MEDCoupling::DataArrayInt64::negate;
+%newobject MEDCoupling::DataArrayInt64::computeAbs;
+%newobject MEDCoupling::DataArrayInt64::findIdsInRange;
+%newobject MEDCoupling::DataArrayInt64::findIdsNotInRange;
+%newobject MEDCoupling::DataArrayInt64::findIdsStrictlyNegative;
+%newobject MEDCoupling::DataArrayInt64::Aggregate;
+%newobject MEDCoupling::DataArrayInt64::AggregateIndexes;
+%newobject MEDCoupling::DataArrayInt64::Meld;
+%newobject MEDCoupling::DataArrayInt64::Add;
+%newobject MEDCoupling::DataArrayInt64::Substract;
+%newobject MEDCoupling::DataArrayInt64::Multiply;
+%newobject MEDCoupling::DataArrayInt64::Divide;
+%newobject MEDCoupling::DataArrayInt64::Pow;
+%newobject MEDCoupling::DataArrayInt64::BuildUnion;
+%newobject MEDCoupling::DataArrayInt64::BuildIntersection;
+%newobject MEDCoupling::DataArrayInt64::Range;
+%newobject MEDCoupling::DataArrayInt64::indicesOfSubPart;
+%newobject MEDCoupling::DataArrayInt64::fromNoInterlace;
+%newobject MEDCoupling::DataArrayInt64::toNoInterlace;
+%newobject MEDCoupling::DataArrayInt64::buildComplement;
+%newobject MEDCoupling::DataArrayInt64::buildUnion;
+%newobject MEDCoupling::DataArrayInt64::buildSubstraction;
+%newobject MEDCoupling::DataArrayInt64::buildSubstractionOptimized;
+%newobject MEDCoupling::DataArrayInt64::buildIntersection;
+%newobject MEDCoupling::DataArrayInt64::buildUnique;
+%newobject MEDCoupling::DataArrayInt64::buildUniqueNotSorted;
+%newobject MEDCoupling::DataArrayInt64::deltaShiftIndex;
+%newobject MEDCoupling::DataArrayInt64::buildExplicitArrByRanges;
+%newobject MEDCoupling::DataArrayInt64::buildExplicitArrOfSliceOnScaledArr;
+%newobject MEDCoupling::DataArrayInt64::findRangeIdForEachTuple;
+%newobject MEDCoupling::DataArrayInt64::findIdInRangeForEachTuple;
+%newobject MEDCoupling::DataArrayInt64::duplicateEachTupleNTimes;
+%newobject MEDCoupling::DataArrayInt64::buildPermutationArr;
+%newobject MEDCoupling::DataArrayInt64::buildPermArrPerLevel;
+%newobject MEDCoupling::DataArrayInt64::getDifferentValues;
+%newobject MEDCoupling::DataArrayInt64::FindPermutationFromFirstToSecond;
+%newobject MEDCoupling::DataArrayInt64::CheckAndPreparePermutation;
+%newobject MEDCoupling::DataArrayInt64::__neg__;
+%newobject MEDCoupling::DataArrayInt64::__add__;
+%newobject MEDCoupling::DataArrayInt64::__radd__;
+%newobject MEDCoupling::DataArrayInt64::__sub__;
+%newobject MEDCoupling::DataArrayInt64::__rsub__;
+%newobject MEDCoupling::DataArrayInt64::__mul__;
+%newobject MEDCoupling::DataArrayInt64::__rmul__;
+%newobject MEDCoupling::DataArrayInt64::__div__;
+%newobject MEDCoupling::DataArrayInt64::__rdiv__;
+%newobject MEDCoupling::DataArrayInt64::__mod__;
+%newobject MEDCoupling::DataArrayInt64::__rmod__;
+%newobject MEDCoupling::DataArrayInt64::__pow__;
+%newobject MEDCoupling::DataArrayInt64::__rpow__;
+%newobject MEDCoupling::DataArrayInt64Tuple::buildDAInt;
%newobject MEDCoupling::DataArrayChar::convertToIntArr;
%newobject MEDCoupling::DataArrayChar::renumber;
%newobject MEDCoupling::DataArrayChar::renumberR;
%feature("unref") DataArray "$this->decrRef();"
%feature("unref") DataArrayDouble "$this->decrRef();"
-%feature("unref") DataArrayInt "$this->decrRef();"
+%feature("unref") DataArrayInt32 "$this->decrRef();"
+%feature("unref") DataArrayInt64 "$this->decrRef();"
%feature("unref") DataArrayChar "$this->decrRef();"
%feature("unref") DataArrayAsciiChar "$this->decrRef();"
%feature("unref") DataArrayByte "$this->decrRef();"
AX_SPHER = 5
} MEDCouplingAxisType;
- class DataArrayInt;
+ class DataArrayInt32;
+ class DataArrayInt64;
class MapII : public RefCountObject, public TimeLabel
{
{
public:
static PartDefinition *New(int start, int stop, int step);
- static PartDefinition *New(DataArrayInt *listOfIds);
- virtual DataArrayInt *toDAI() const;
+ static PartDefinition *New(DataArrayIdType *listOfIds);
+ virtual DataArrayIdType *toDAI() const;
virtual int getNumberOfElems() const;
virtual std::string getRepr() const;
virtual PartDefinition *composeWith(const PartDefinition *other) const;
class DataArrayPartDefinition : public PartDefinition
{
public:
- static DataArrayPartDefinition *New(DataArrayInt *listOfIds);
+ static DataArrayPartDefinition *New(DataArrayIdType *listOfIds);
%extend
{
- DataArrayPartDefinition(DataArrayInt *listOfIds)
+ DataArrayPartDefinition(DataArrayIdType *listOfIds)
{
return DataArrayPartDefinition::New(listOfIds);
}
int getEffectiveStop() const;
%extend
{
- SlicePartDefinition(int start, int stop, int step)
+ SlicePartDefinition(mcIdType start, mcIdType stop, mcIdType step)
{
return SlicePartDefinition::New(start,stop,step);
}
PyObject *getSlice() const
{
- int a,b,c;
+ mcIdType a,b,c;
self->getSlice(a,b,c);
return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
}
public:
void setName(const std::string& name);
void copyStringInfoFrom(const DataArray& other);
- void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds);
- void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other);
+ void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<std::size_t>& compoIds);
+ void copyPartOfStringInfoFrom2(const std::vector<std::size_t>& compoIds, const DataArray& other);
bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const;
bool areInfoEquals(const DataArray& other) const;
std::string cppRepr(const std::string& varName) const;
PyObject *getInfoOnComponents() const
{
const std::vector<std::string>& comps=self->getInfoOnComponents();
- PyObject *ret=PyList_New((int)comps.size());
- for(int i=0;i<(int)comps.size();i++)
+ PyObject *ret=PyList_New((mcIdType)comps.size());
+ for(std::size_t i=0;i<comps.size();i++)
PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
return ret;
}
void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li)
{
- std::vector<int> tmp;
+ std::vector<std::size_t> tmp;
convertPyToNewIntArr3(li,tmp);
self->copyPartOfStringInfoFrom(other,tmp);
}
void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other)
{
- std::vector<int> tmp;
+ std::vector<std::size_t> tmp;
convertPyToNewIntArr3(li,tmp);
self->copyPartOfStringInfoFrom2(tmp,other);
}
virtual void renumberInPlace(PyObject *li)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
da2->checkAllocated();
- int size=self->getNumberOfTuples();
+ mcIdType size=self->getNumberOfTuples();
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
virtual void renumberInPlaceR(PyObject *li)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
da2->checkAllocated();
- int size=self->getNumberOfTuples();
+ mcIdType size=self->getNumberOfTuples();
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
}
//tuplesSelec in PyObject * because DataArrayInt is not already existing !
- virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec)
+ virtual void setContigPartOfSelectedValues(mcIdType tupleIdStart, PyObject *aBase, PyObject *tuplesSelec)
{
static const char msg[]="DataArray::setContigPartOfSelectedValuesSlice : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValuesSlice : 3rd parameter \"aBase\" should be of type DataArray");
DataArray *tuplesSelecPtr=CheckAndRetrieveDataArrayInstance(tuplesSelec,msg);
- DataArrayInt *tuplesSelecPtr2=0;
+ DataArrayIdType *tuplesSelecPtr2=0;
if(tuplesSelecPtr)
{
- tuplesSelecPtr2=dynamic_cast<DataArrayInt *>(tuplesSelecPtr);
+ tuplesSelecPtr2=dynamic_cast<DataArrayIdType *>(tuplesSelecPtr);
if(!tuplesSelecPtr2)
throw INTERP_KERNEL::Exception(msg);
}
self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
}
- virtual void setContigPartOfSelectedValuesSlice(int tupleIdStart, PyObject *aBase, int bg, int end2, int step)
+ virtual void setContigPartOfSelectedValuesSlice(mcIdType tupleIdStart, PyObject *aBase, mcIdType bg, mcIdType end2, mcIdType step)
{
DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValuesSlice : 2nd parameter \"aBase\" should be of type DataArray");
self->setContigPartOfSelectedValuesSlice(tupleIdStart,a,bg,end2,step);
virtual DataArray *selectByTupleRanges(PyObject *li) const
{
- std::vector<std::pair<int,int> > ranges;
+ std::vector<std::pair<mcIdType,mcIdType> > ranges;
convertPyToVectorPairInt(li,ranges);
return self->selectByTupleRanges(ranges);
}
virtual DataArray *selectByTupleId(PyObject *li) const
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
return self->selectByTupleId(tmp,tmp+size);
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
da2->checkAllocated();
virtual DataArray *selectByTupleIdSafe(PyObject *li) const
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
return self->selectByTupleIdSafe(tmp,tmp+size);
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
da2->checkAllocated();
virtual PyObject *keepSelectedComponents(PyObject *li) const
{
- std::vector<int> tmp;
+ std::vector<std::size_t> tmp;
convertPyToNewIntArr3(li,tmp);
DataArray *ret=self->keepSelectedComponents(tmp);
return convertDataArray(ret,SWIG_POINTER_OWN | 0 );
}
- static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices)
+ static PyObject *GetSlice(PyObject *slic, mcIdType sliceId, mcIdType nbOfSlices)
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
Py_ssize_t strt=2,stp=2,step=2;
GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetSlice (wrap) : the input slice is invalid !");
- int a,b;
+ mcIdType a,b;
DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
}
- PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const
+ PyObject *getSlice(PyObject *slic, mcIdType sliceId, mcIdType nbOfSlices) const
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
Py_ssize_t strt=2,stp=2,step=2;
GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getSlice (wrap) : the input slice is invalid !");
- int a,b;
+ mcIdType a,b;
DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
}
- static int GetNumberOfItemGivenBES(PyObject *slic)
+ static mcIdType GetNumberOfItemGivenBES(PyObject *slic)
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
}
- static int GetNumberOfItemGivenBESRelative(PyObject *slic)
+ static mcIdType GetNumberOfItemGivenBESRelative(PyObject *slic)
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
return DataArray::Aggregate(tmp);
}
- int getNumberOfItemGivenBES(PyObject *slic) const
+ mcIdType getNumberOfItemGivenBES(PyObject *slic) const
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
}
- int getNumberOfItemGivenBESRelative(PyObject *slic)
+ mcIdType getNumberOfItemGivenBESRelative(PyObject *slic)
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
const std::vector<std::string> &a1(self->getInfoOnComponents());
PyTuple_SetItem(ret,0,PyString_FromString(a0.c_str()));
//
- int sz(a1.size());
+ mcIdType sz(a1.size());
PyObject *ret1(PyList_New(sz));
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
PyList_SetItem(ret1,i,PyString_FromString(a1[i].c_str()));
PyTuple_SetItem(ret,1,ret1);
//
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 !";
if(!PyTuple_Check(inp))
throw INTERP_KERNEL::Exception("DataArrayDouble.__setstate__ : invalid input ! Invalid overwrite of __getstate__ ?");
- int sz(PyTuple_Size(inp));
+ mcIdType sz(PyTuple_Size(inp));
if(sz!=2)
throw INTERP_KERNEL::Exception("DataArrayDouble.__setstate__ : invalid tuple in input ! Should be of size 2 ! Invalid overwrite of __getstate__ ?");
PyObject *a0(PyTuple_GetItem(inp,0));
return self->reprNotTooLong();
}
- int __len__() const
+ mcIdType __len__() const
{
if(self->isAllocated())
{
PyObject *getValuesAsTuple() const
{
const float *vals(self->begin());
- int nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
+ mcIdType nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
return convertDblArrToPyListOfTuple<float>(vals,nbOfComp,nbOfTuples);
}
class DataArrayFloatTuple
{
public:
- int getNumberOfCompo() const;
- DataArrayFloat *buildDAFloat(int nbOfTuples, int nbOfCompo) const;
+ std::size_t getNumberOfCompo() const;
+ DataArrayFloat *buildDAFloat(mcIdType nbOfTuples, mcIdType nbOfCompo) const;
%extend
{
std::string __str__() const
}
};
- class DataArrayInt;
class DataArrayDoubleIterator;
class DataArrayDouble : public DataArray
void meldWith(const DataArrayDouble *other);
DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const;
DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const;
- DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const;
- DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const;
+ DataArrayIdType *findClosestTupleId(const DataArrayDouble *other) const;
+ DataArrayIdType *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const;
void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
- void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec);
+ void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayIdType *tuplesSelec);
double getIJ(int tupleId, int compoId) const;
double front() const;
double back() const;
DataArrayDouble *applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const;
void applyFuncFast32(const std::string& func);
void applyFuncFast64(const std::string& func);
- DataArrayInt *findIdsInRange(double vmin, double vmax) const;
- DataArrayInt *findIdsNotInRange(double vmin, double vmax) const;
- DataArrayInt *findIdsStrictlyNegative() const;
+ DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
+ DataArrayIdType *findIdsNotInRange(double vmin, double vmax) const;
+ DataArrayIdType *findIdsStrictlyNegative() const;
static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2);
static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2);
static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2);
void divideEqual(const DataArrayDouble *other);
static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2);
void powEqual(const DataArrayDouble *other);
- MCAuto<DataArrayInt> findIdsGreaterOrEqualTo(double val) const;
- MCAuto<DataArrayInt> findIdsGreaterThan(double val) const;
- MCAuto<DataArrayInt> findIdsLowerOrEqualTo(double val) const;
- MCAuto<DataArrayInt> findIdsLowerThan(double val) const;
- MCAuto<DataArrayInt> convertToIntArr() const;
+ MCAuto<DataArrayIdType> findIdsGreaterOrEqualTo(double val) const;
+ MCAuto<DataArrayIdType> findIdsGreaterThan(double val) const;
+ MCAuto<DataArrayIdType> findIdsLowerOrEqualTo(double val) const;
+ MCAuto<DataArrayIdType> findIdsLowerThan(double val) const;
+ MCAuto<DataArrayIdType> convertToIntArr() const;
MCAuto<DataArrayDouble> selectPartDef(const PartDefinition* pd) const;
MCAuto<DataArrayDouble> cumSum() const;
MCAuto<DataArrayFloat> convertToFloatArr() const;
{
double val;
std::vector<double> bb;
- int sw,nbTuples=-1;
+ mcIdType sw; mcIdType nbTuples=-1;
const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
self->pushBackValsSilent(tmp,tmp+nbTuples);
{
if(PyInt_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
if(nbOfComp && nbOfComp != Py_None)
{
if(PyInt_Check(nbOfComp))
{//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
}
else
{//DataArrayDouble.setValues([1.,3.,4.],3)
- int tmpp1=-1;
+ mcIdType tmpp1=-1;
std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
}
}
else
{// DataArrayDouble.setValues([1.,3.,4.])
- int tmpp1=-1,tmpp2=-1;
+ mcIdType tmpp1=-1,tmpp2=-1;
std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
}
PyObject *getValuesAsTuple() const
{
const double *vals(self->begin());
- int nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
+ mcIdType nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
return convertDblArrToPyListOfTuple<double>(vals,nbOfComp,nbOfTuples);
}
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const double *seg2Ptr(convertObjToPossibleCpp5_Safe(seg2,sw,val,a,aa,bb,msg,2,2,true));
const double *tri3Ptr(convertObjToPossibleCpp5_Safe(tri3,sw,val2,a2,aa2,bb2,msg,3,2,true));
//
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
MCAuto<DataArrayDouble> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
static PyObject *GiveBaseForPlane(PyObject *normalVector)
{
const char msg[]="Python wrap of DataArrayDouble::GiveBaseForPlane : ";
- double val,val2;
- DataArrayDouble *a,*a2;
- DataArrayDoubleTuple *aa,*aa2;
+ double val;
+ DataArrayDouble *a;
+ DataArrayDoubleTuple *aa;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val,a,aa,bb,msg,1,3,true));
double res[9];
DataArrayDouble::GiveBaseForPlane(vectorPtr,res);
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> bb,bb2;
- int sw;
+ mcIdType sw;
const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
return self->fromCartToCylGiven(coords,centerPtr,vectorPtr);
DataArrayDouble *renumber(PyObject *li)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
da2->checkAllocated();
- int size=self->getNumberOfTuples();
+ mcIdType size=self->getNumberOfTuples();
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
DataArrayDouble *renumberR(PyObject *li)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
da2->checkAllocated();
- int size=self->getNumberOfTuples();
+ mcIdType size=self->getNumberOfTuples();
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
}
}
- DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple)
+ DataArrayDouble *renumberAndReduce(PyObject *li, mcIdType newNbOfTuple)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
}
else
{
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
if(!da2)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
da2->checkAllocated();
- int size=self->getNumberOfTuples();
+ mcIdType size=self->getNumberOfTuples();
if(size!=self->getNumberOfTuples())
{
throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
PyObject *minimalDistanceTo(const DataArrayDouble *other) const
{
- int thisTupleId,otherTupleId;
+ mcIdType thisTupleId,otherTupleId;
double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
PyObject *getMaxValue() const
{
- int tmp;
+ mcIdType tmp;
double r1=self->getMaxValue(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
PyObject *getMaxValue2() const
{
- DataArrayInt *tmp;
+ DataArrayIdType *tmp;
double r1=self->getMaxValue2(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *getMinValue() const
{
- int tmp;
+ mcIdType tmp;
double r1=self->getMinValue(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
PyObject *getMinValue2() const
{
- DataArrayInt *tmp;
+ DataArrayIdType *tmp;
double r1=self->getMinValue2(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *getMinMaxPerComponent() const
{
- int nbOfCompo(self->getNumberOfComponents());
+ std::size_t nbOfCompo(self->getNumberOfComponents());
INTERP_KERNEL::AutoPtr<double> tmp(new double[2*nbOfCompo]);
self->getMinMaxPerComponent(tmp);
PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,nbOfCompo);
PyObject *normMaxPerComponent() const
{
- int nbOfCompo(self->getNumberOfComponents());
+ std::size_t nbOfCompo(self->getNumberOfComponents());
INTERP_KERNEL::AutoPtr<double> tmp(new double[nbOfCompo]);
self->normMaxPerComponent(tmp);
return convertDblArrToPyList<double>(tmp,nbOfCompo);
PyObject *accumulate() const
{
- int sz=self->getNumberOfComponents();
+ std::size_t sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
self->accumulate(tmp);
return convertDblArrToPyList<double>(tmp,sz);
DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const
{
- int sw,sz,val;
- std::vector<int> val2;
- const int *bg=convertIntStarLikePyObjToCppIntStar(indexArr,sw,sz,val,val2);
+ mcIdType sw, sz,val;
+ std::vector<mcIdType> val2;
+ const mcIdType *bg=convertIntStarLikePyObjToCppIntStar(indexArr,sw,sz,val,val2);
return self->accumulatePerChunck(bg,bg+sz);
}
- PyObject *findCommonTuples(double prec, int limitNodeId=-1) const
+ PyObject *findCommonTuples(double prec, mcIdType limitNodeId=-1) const
{
- DataArrayInt *comm, *commIndex;
+ DataArrayIdType *comm, *commIndex;
self->findCommonTuples(prec,limitNodeId,comm,commIndex);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return res;
}
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
- int tupleId=-1,nbOfCompo=self->getNumberOfComponents();
+ mcIdType sw;
+ mcIdType tupleId=-1,nbOfCompo=self->getNumberOfComponents();
const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
//
double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
void setSelectedComponents(const DataArrayDouble *a, PyObject *li)
{
- std::vector<int> tmp;
+ std::vector<std::size_t> tmp;
convertPyToNewIntArr3(li,tmp);
self->setSelectedComponents(a,tmp);
}
return res;
}
- PyObject *getTuple(int tupleId)
+ PyObject *getTuple(mcIdType tupleId)
{
- int sz=self->getNumberOfComponents();
+ std::size_t sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
self->getTuple(tupleId,tmp);
return convertDblArrToPyList<double>(tmp,sz);
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
- int nbComp=self->getNumberOfComponents(),nbTuples=-1;
+ mcIdType sw;
+ mcIdType nbComp=self->getNumberOfComponents(),nbTuples=-1;
const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
MCAuto<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,DeallocType::CPP_DEALLOC,nbTuples,nbComp);
- DataArrayInt *c=0,*cI=0;
+ DataArrayIdType *c=0,*cI=0;
self->computeTupleIdsNearTuples(inpu,eps,c,cI);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const
{
- DataArrayInt *ret1=0;
+ DataArrayIdType *ret1=0;
bool ret0=self->areIncludedInMe(other,prec,ret1);
PyObject *ret=PyTuple_New(2);
PyObject *ret0Py=ret0?Py_True:Py_False;
Py_XINCREF(ret0Py);
PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
//
#ifndef WITHOUT_AUTOFIELD
void *argp;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
return DataArrayDouble::Add(self,aaa);
}
default:
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
//
#ifndef WITHOUT_AUTOFIELD
void *argp;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
return DataArrayDouble::Substract(aaa,self);
}
default:
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
//
#ifndef WITHOUT_AUTOFIELD
void *argp;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
//
#ifndef WITHOUT_AUTOFIELD
void *argp;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
return DataArrayDouble::Divide(aaa,self);
}
default:
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
return DataArrayDouble::Pow(self,aaa);
}
default:
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
return DataArrayDouble::Pow(aaa,self);
}
default:
DataArrayDouble *a;
DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
self->powEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
{
- DataArrayInt *c=0,*cI=0;
+ DataArrayIdType *c=0,*cI=0;
//
self->computeTupleIdsNearTuples(other,eps,c,cI);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *maxPerTupleWithCompoId() const
{
- DataArrayInt *ret1=0;
+ DataArrayIdType *ret1=0;
DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
}
class DataArrayDoubleTuple
{
public:
- int getNumberOfCompo() const;
+ std::size_t getNumberOfCompo() const;
DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const;
%extend
{
PyObject *__getitem__(PyObject *obj)
{
const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
const double *pt=self->getConstPointer();
- int nbc=self->getNumberOfCompo();
+ mcIdType nbc=self->getNumberOfCompo();
convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
case 2:
{
PyObject *t=PyTuple_New(multiVal.size());
- for(int j=0;j<(int)multiVal.size();j++)
+ for(std::size_t j=0;j<multiVal.size();j++)
{
- int cid=multiVal[j];
+ mcIdType cid=multiVal[j];
if(cid>=nbc)
{
std::ostringstream oss;
}
case 3:
{
- int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
+ mcIdType sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
PyObject *t=PyTuple_New(sz);
- for(int j=0;j<sz;j++)
+ for(mcIdType j=0;j<sz;j++)
PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
return t;
}
{
const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
- int sw1,sw2;
+ mcIdType sw1,sw2;
double singleValV;
std::vector<double> multiValV;
MEDCoupling::DataArrayDoubleTuple *daIntTyyppV=0;
- int nbc=self->getNumberOfCompo();
+ mcIdType nbc=self->getNumberOfCompo();
convertDoubleStarLikePyObjToCpp(value,sw1,singleValV,multiValV,daIntTyyppV);
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
double *pt=self->getPointer();
convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
switch(sw2)
{
case 1:
{
- for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
+ for(std::vector<mcIdType>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
{
if(*it>=nbc)
{
oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- for(int i=0;i<(int)multiVal.size();i++)
+ for(std::size_t i=0;i<multiVal.size();i++)
{
- int pos=multiVal[i];
+ mcIdType pos=multiVal[i];
if(pos>=nbc)
{
std::ostringstream oss;
case 3:
{
const double *ptV=daIntTyyppV->getConstPointer();
- if(nbc>daIntTyyppV->getNumberOfCompo())
+ if(nbc>(mcIdType)daIntTyyppV->getNumberOfCompo())
{
std::ostringstream oss;
oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
}
case 3:
{
- int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
+ mcIdType sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
switch(sw1)
{
case 1:
{
- for(int j=0;j<sz;j++)
+ for(mcIdType j=0;j<sz;j++)
pt[slic.first+j*slic.second.second]=singleValV;
return self;
}
case 2:
{
- if(sz!=(int)multiValV.size())
+ if(sz!=(mcIdType)multiValV.size())
{
std::ostringstream oss;
oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- for(int j=0;j<sz;j++)
+ for(mcIdType j=0;j<sz;j++)
pt[slic.first+j*slic.second.second]=multiValV[j];
return self;
}
case 3:
{
const double *ptV=daIntTyyppV->getConstPointer();
- if(sz>daIntTyyppV->getNumberOfCompo())
+ if(sz>(mcIdType)daIntTyyppV->getNumberOfCompo())
{
std::ostringstream oss;
oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- for(int j=0;j<sz;j++)
+ for(mcIdType j=0;j<sz;j++)
pt[slic.first+j*slic.second.second]=ptV[j];
return self;
}
}
};
- class DataArrayIntIterator;
-
- class DataArrayInt : public DataArray
+ class DataArrayChar : public DataArray
{
public:
- static DataArrayInt *New();
- int intValue() const;
+ virtual DataArrayChar *buildEmptySpecializedDAChar() const;
int getHashCode() const;
bool empty() const;
- void aggregate(const DataArrayInt *other);
- DataArrayInt *performCopyOrIncrRef(bool deepCopy) const;
- void deepCopyFrom(const DataArrayInt& other);
+ void deepCopyFrom(const DataArrayChar& other);
void reserve(std::size_t nbOfElems);
- void pushBackSilent(int val);
- int popBackSilent();
+ void pushBackSilent(char val);
+ char popBackSilent();
void pack() const;
void allocIfNecessary(int nbOfTuple, int nbOfCompo);
- bool isEqual(const DataArrayInt& other) const;
- bool isEqualWithoutConsideringStr(const DataArrayInt& other) const;
- bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const;
- DataArrayInt *buildPermutationArr(const DataArrayInt& other) const;
- DataArrayInt *sumPerTuple() const;
- void sort(bool asc=true);
+ bool isEqual(const DataArrayChar& other) const;
+ bool isEqualWithoutConsideringStr(const DataArrayChar& other) const;
void reverse();
- void checkMonotonic(bool increasing) const;
- bool isMonotonic(bool increasing) const;
- void checkStrictlyMonotonic(bool increasing) const;
- bool isStrictlyMonotonic(bool increasing) const;
void fillWithZero();
- void fillWithValue(int val);
- void iota(int init=0);
+ void fillWithValue(char val);
std::string repr() const;
std::string reprZip() const;
- std::string reprNotTooLong() const;
- DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const;
- DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const;
- DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const;
- MCAuto< MapII > invertArrayN2O2O2NOptimized() const;
- MCAuto< MapII > giveN2OOptimized() const;
- DataArrayInt *indicesOfSubPart(const DataArrayInt& partOfThis) const;
- DataArrayInt *fromNoInterlace() const;
- DataArrayInt *toNoInterlace() const;
- DataArrayInt *selectByTupleIdSafeSlice(int bg, int end, int step) const;
- DataArrayInt *checkAndPreparePermutation() const;
- DataArrayInt *buildPermArrPerLevel() const;
- bool isIota(int sizeExpected) const;
- bool isUniform(int val) const;
- int checkUniformAndGuess() const;
- bool hasUniqueValues() const;
- DataArrayInt *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
- void transpose();
- DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const;
- void meldWith(const DataArrayInt *other);
- void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
- void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
- void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec);
- void getTuple(int tupleId, int *res) const;
- int getIJ(int tupleId, int compoId) const;
- int getIJSafe(int tupleId, int compoId) const;
- int front() const;
- int back() const;
- void setIJ(int tupleId, int compoId, int newVal);
- void setIJSilent(int tupleId, int compoId, int newVal);
- int *getPointer();
- const int *getConstPointer() const;
- DataArrayIntIterator *iterator();
- const int *begin() const;
- const int *end() const;
- DataArrayInt *findIdsEqual(int val) const;
- DataArrayInt *findIdsNotEqual(int val) const;
- int changeValue(int oldValue, int newValue);
- int findIdFirstEqualTuple(const std::vector<int>& tupl) const;
- int findIdFirstEqual(int value) const;
- int findIdFirstEqual(const std::vector<int>& vals) const;
- int findIdSequence(const std::vector<int>& vals) const;
- bool presenceOfTuple(const std::vector<int>& tupl) const;
- bool presenceOfValue(int value) const;
- bool presenceOfValue(const std::vector<int>& vals) const;
- int count(int value) const;
- int accumulate(int compId) const;
- int getMaxValueInArray() const;
- int getMaxAbsValueInArray() const;
- int getMinValueInArray() const;
- void abs();
- DataArrayInt *computeAbs() const;
- void applyLin(int a, int b, int compoId);
- void applyLin(int a, int b);
- void applyInv(int numerator);
- DataArrayInt *negate() const;
- void applyDivideBy(int val);
- void applyModulus(int val);
- void applyRModulus(int val);
- void applyPow(int val);
- void applyRPow(int val);
- DataArrayInt *findIdsInRange(int vmin, int vmax) const;
- DataArrayInt *findIdsNotInRange(int vmin, int vmax) const;
- DataArrayInt *findIdsStrictlyNegative() const;
- bool checkAllIdsInRange(int vmin, int vmax) const;
- static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2);
- static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2);
- static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups);
- static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr);
- static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr);
- static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2);
- DataArrayInt *buildComplement(int nbOfElement) const;
- DataArrayInt *buildSubstraction(const DataArrayInt *other) const;
- DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const;
- DataArrayInt *buildUnion(const DataArrayInt *other) const;
- DataArrayInt *buildIntersection(const DataArrayInt *other) const;
- DataArrayInt *buildUnique() const;
- DataArrayInt *buildUniqueNotSorted() const;
- DataArrayInt *deltaShiftIndex() const;
- void computeOffsets();
- void computeOffsetsFull();
- DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const;
- DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const;
- DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const;
- void sortEachPairToMakeALinkedList();
- DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const;
- DataArrayInt *getDifferentValues() const;
- static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2);
- void addEqual(const DataArrayInt *other);
- static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2);
- void substractEqual(const DataArrayInt *other);
- static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2);
- void multiplyEqual(const DataArrayInt *other);
- static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2);
- void divideEqual(const DataArrayInt *other);
- static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2);
- void modulusEqual(const DataArrayInt *other);
- static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2);
- void powEqual(const DataArrayInt *other);
- MCAuto<DataArrayInt> fromLinkedListOfPairToList() const;
- MCAuto<DataArrayInt> findIdsGreaterOrEqualTo(int val) const;
- MCAuto<DataArrayInt> findIdsGreaterThan(int val) const;
- MCAuto<DataArrayInt> findIdsLowerOrEqualTo(int val) const;
- MCAuto<DataArrayInt> findIdsLowerThan(int val) const;
- MCAuto<DataArrayInt> selectPartDef(const PartDefinition* pd) const;
- MCAuto<DataArrayDouble> convertToDblArr() const;
- MCAuto<DataArrayFloat> convertToFloatArr() const;
+ DataArrayIdType *convertToIntArr() const;
+ DataArrayChar *renumber(const mcIdType *old2New) const;
+ DataArrayChar *renumberR(const mcIdType *new2Old) const;
+ DataArrayChar *renumberAndReduce(const mcIdType *old2NewBg, mcIdType newNbOfTuple) const;
+ bool isUniform(char val) const;
+ void sort(bool asc=true);
+ DataArrayChar *subArray(mcIdType tupleIdBg, mcIdType tupleIdEnd=-1) const;
+ DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const;
+ void meldWith(const DataArrayChar *other);
+ void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayIdType *tuplesSelec);
+ char front() const;
+ char back() const;
+ void setIJ(mcIdType tupleId, int compoId, char newVal);
+ void setIJSilent(mcIdType tupleId, int compoId, char newVal);
+ char *getPointer();
+ DataArrayIdType *findIdsEqual(char val) const;
+ DataArrayIdType *findIdsNotEqual(char val) const;
+ int findIdFirstEqualTuple(const std::vector<char>& tupl) const;
+ bool presenceOfTuple(const std::vector<char>& tupl) const;
+ char getMaxValue(mcIdType& tupleId) const;
+ char getMaxValueInArray() const;
+ char getMinValue(mcIdType& tupleId) const;
+ char getMinValueInArray() const;
+ DataArrayIdType *findIdsInRange(char vmin, char vmax) const;
+ static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2);
+ static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2);
+ %extend
+ {
+ mcIdType __len__() const
+ {
+ if(self->isAllocated())
+ {
+ return self->getNumberOfTuples();
+ }
+ else
+ {
+ throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
+ }
+ }
+
+ PyObject *isEqualIfNotWhy(const DataArrayChar& other) const
+ {
+ std::string ret1;
+ bool ret0=self->isEqualIfNotWhy(other,ret1);
+ PyObject *ret=PyTuple_New(2);
+ PyObject *ret0Py=ret0?Py_True:Py_False;
+ Py_XINCREF(ret0Py);
+ PyTuple_SetItem(ret,0,ret0Py);
+ PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
+ return ret;
+ }
+
+ DataArrayChar *renumber(PyObject *li)
+ {
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumber(tmp);
+ }
+ else
+ {
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
+ if(!da2)
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
+ da2->checkAllocated();
+ mcIdType size=self->getNumberOfTuples();
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumber(da2->getConstPointer());
+ }
+ }
+
+ DataArrayChar *renumberR(PyObject *li)
+ {
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumberR(tmp);
+ }
+ else
+ {
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
+ if(!da2)
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
+ da2->checkAllocated();
+ mcIdType size=self->getNumberOfTuples();
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumberR(da2->getConstPointer());
+ }
+ }
+
+ DataArrayChar *renumberAndReduce(PyObject *li, mcIdType newNbOfTuple)
+ {
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ mcIdType size;
+ INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumberAndReduce(tmp,newNbOfTuple);
+ }
+ else
+ {
+ DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
+ if(!da2)
+ throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
+ da2->checkAllocated();
+ mcIdType size=self->getNumberOfTuples();
+ if(size!=self->getNumberOfTuples())
+ {
+ throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
+ }
+ return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
+ }
+ }
+
+ static DataArrayChar *Aggregate(PyObject *dachs)
+ {
+ std::vector<const MEDCoupling::DataArrayChar *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
+ return DataArrayChar::Aggregate(tmp);
+ }
+
+ static DataArrayChar *Meld(PyObject *dachs)
+ {
+ std::vector<const MEDCoupling::DataArrayChar *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
+ return DataArrayChar::Meld(tmp);
+ }
+ }
+ };
+
+ class DataArrayByteIterator;
+
+ class DataArrayByte : public DataArrayChar
+ {
public:
- static DataArrayInt *Range(int begin, int end, int step);
+ static DataArrayByte *New();
+ DataArrayByteIterator *iterator();
+ DataArrayByte *performCopyOrIncrRef(bool deepCopy) const;
+ char byteValue() const;
%extend
{
- DataArrayInt()
+ DataArrayByte()
{
- return DataArrayInt::New();
+ return DataArrayByte::New();
}
- static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
+ static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
- 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)";
- std::string msg(msgBase);
-#ifdef WITH_NUMPY
- msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
-#endif
- msg+=" !";
+ 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) !";
if(PyList_Check(elt0) || PyTuple_Check(elt0))
{
if(nbOfTuples)
{
if(PyInt_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
- throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
+ throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
if(nbOfComp)
{
if(PyInt_Check(nbOfComp))
- {//DataArrayInt.New([1,3,4,5],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ {//DataArrayByte.New([1,3,4,5],2,2)
+ mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
if(nbOfCompo<0)
- throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
- MCAuto<DataArrayInt> ret=DataArrayInt::New();
- std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
+ throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
+ std::vector<mcIdType> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
else
- throw INTERP_KERNEL::Exception(msg.c_str());
+ throw INTERP_KERNEL::Exception(msg);
}
else
- {//DataArrayInt.New([1,3,4],3)
- MCAuto<DataArrayInt> ret=DataArrayInt::New();
- int tmpp1=-1;
- std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
+ {//DataArrayByte.New([1,3,4],3)
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
+ mcIdType tmpp1=-1;
+ std::vector<mcIdType> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
}
else
- throw INTERP_KERNEL::Exception(msg.c_str());
+ throw INTERP_KERNEL::Exception(msg);
}
else
- {// DataArrayInt.New([1,3,4])
- MCAuto<DataArrayInt> ret=DataArrayInt::New();
- int tmpp1=-1,tmpp2=-1;
- std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
+ {// DataArrayByte.New([1,3,4])
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
+ mcIdType tmpp1=-1,tmpp2=-1;
+ std::vector<mcIdType> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
}
else if(PyInt_Check(elt0))
{
- int nbOfTuples1=PyInt_AS_LONG(elt0);
+ mcIdType nbOfTuples1=PyInt_AS_LONG(elt0);
if(nbOfTuples1<0)
- throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
+ throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
if(nbOfTuples)
{
if(!nbOfComp)
{
if(PyInt_Check(nbOfTuples))
- {//DataArrayInt.New(5,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+ {//DataArrayByte.New(5,2)
+ mcIdType nbOfCompo=PyInt_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
- throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
- MCAuto<DataArrayInt> ret=DataArrayInt::New();
+ throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
ret->alloc(nbOfTuples1,nbOfCompo);
return ret.retn();
}
else
- throw INTERP_KERNEL::Exception(msg.c_str());
+ throw INTERP_KERNEL::Exception(msg);
}
else
- throw INTERP_KERNEL::Exception(msg.c_str());
+ throw INTERP_KERNEL::Exception(msg);
}
else
- {//DataArrayInt.New(5)
- MCAuto<DataArrayInt> ret=DataArrayInt::New();
+ {//DataArrayByte.New(5)
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
ret->alloc(nbOfTuples1,1);
return ret.retn();
}
}
#ifdef WITH_NUMPY
else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
- {//DataArrayInt.New(numpyArray)
- return BuildNewInstance<DataArrayInt,int>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
+ {//DataArrayDouble.New(numpyArray)
+ return BuildNewInstance<DataArrayByte,char>(elt0,NPY_INT8,&PyCallBackDataArrayChar_RefType,"INT8");
}
#endif
else
- throw INTERP_KERNEL::Exception(msg.c_str());
- throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
+ throw INTERP_KERNEL::Exception(msg);
}
- DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
+ DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
- return MEDCoupling_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
+ return MEDCoupling_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
}
-
- std::string __str__() const
+
+ std::string __repr__() const
{
- return self->reprNotTooLong();
+ std::ostringstream oss;
+ self->reprQuickOverview(oss);
+ return oss.str();
}
-
- int __len__() const
+
+ int __int__() const
{
- if(self->isAllocated())
- {
- return self->getNumberOfTuples();
- }
- else
- {
- throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
- }
+ return (int) self->byteValue();
}
- int __int__() const
+ DataArrayByteIterator *__iter__()
{
- return self->intValue();
+ return self->iterator();
}
- DataArrayIntIterator *__iter__()
+ mcIdType getIJ(mcIdType tupleId, mcIdType compoId) const
{
- return self->iterator();
+ return (mcIdType)self->getIJ(tupleId,compoId);
}
-
- PyObject *accumulate() const
+
+ mcIdType getIJSafe(mcIdType tupleId, mcIdType compoId) const
{
- int sz=self->getNumberOfComponents();
- INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
- self->accumulate(tmp);
- return convertIntArrToPyList(tmp,sz);
+ return (mcIdType)self->getIJSafe(tupleId,compoId);
}
- DataArrayInt *accumulatePerChunck(PyObject *indexArr) const
+ std::string __str__() const
{
- int sw,sz,val;
- std::vector<int> val2;
- const int *bg=convertIntStarLikePyObjToCppIntStar(indexArr,sw,sz,val,val2);
- return self->accumulatePerChunck(bg,bg+sz);
+ return self->repr();
+ }
+
+ PyObject *toStrList() const
+ {
+ const char *vals=self->getConstPointer();
+ mcIdType nbOfComp=self->getNumberOfComponents();
+ mcIdType nbOfTuples=self->getNumberOfTuples();
+ return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
+ }
+
+ bool presenceOfTuple(PyObject *tupl) const
+ {
+ mcIdType sz=-1,sw=-1;
+ mcIdType ival=-1; std::vector<mcIdType> ivval;
+ const mcIdType *pt=convertIntStarLikePyObjToCppIntStar(tupl,sw,sz,ival,ivval);
+ std::vector<char> vals(sz);
+ std::copy(pt,pt+sz,vals.begin());
+ return self->presenceOfTuple(vals);
}
- DataArrayInt *findIdsEqualTuple(PyObject *inputTuple) const
+ bool presenceOfValue(PyObject *vals) const
{
- int sw,sz,val;
- std::vector<int> val2;
- const int *bg(convertIntStarLikePyObjToCppIntStar(inputTuple,sw,sz,val,val2));
- return self->findIdsEqualTuple(bg,bg+sz);
+ mcIdType sz=-1,sw=-1;
+ mcIdType ival=-1; std::vector<mcIdType> ivval;
+ const mcIdType *pt=convertIntStarLikePyObjToCppIntStar(vals,sw,sz,ival,ivval);
+ std::vector<char> vals2(sz);
+ std::copy(pt,pt+sz,vals2.begin());
+ return self->presenceOfValue(vals2);
}
- DataArrayInt *findIdForEach(PyObject *vals) const
+ mcIdType findIdFirstEqual(PyObject *vals) const
{
- int sw,sz,val;
- std::vector<int> val2;
- const int *bg(convertIntStarLikePyObjToCppIntStar(vals,sw,sz,val,val2));
- MCAuto<DataArrayInt> ret(self->findIdForEach(bg,bg+sz));
- return ret.retn();
+ mcIdType sz=-1,sw=-1;
+ mcIdType ival=-1; std::vector<mcIdType> ivval;
+ const mcIdType *pt=convertIntStarLikePyObjToCppIntStar(vals,sw,sz,ival,ivval);
+ std::vector<char> vals2(sz);
+ std::copy(pt,pt+sz,vals2.begin());
+ return self->findIdFirstEqual(vals2);
}
- PyObject *splitInBalancedSlices(int nbOfSlices) const
+ mcIdType findIdFirstEqualTuple(PyObject *tupl) const
{
- std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
- PyObject *ret=PyList_New(slcs.size());
- for(std::size_t i=0;i<slcs.size();i++)
- PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
- return ret;
+ mcIdType sz=-1,sw=-1;
+ mcIdType ival=-1; std::vector<mcIdType> ivval;
+ const mcIdType *pt=convertIntStarLikePyObjToCppIntStar(tupl,sw,sz,ival,ivval);
+ std::vector<char> vals(sz);
+ std::copy(pt,pt+sz,vals.begin());
+ return self->findIdFirstEqualTuple(vals);
}
- DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const
+ mcIdType findIdSequence(PyObject *strOrListOfInt) const
{
- if(!PySlice_Check(slic))
- throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
- Py_ssize_t strt=2,stp=2,step=2;
- GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
- if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
- 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 !");
- return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
+ mcIdType sz=-1,sw=-1;
+ mcIdType ival=-1; std::vector<mcIdType> ivval;
+ const mcIdType *pt=convertIntStarLikePyObjToCppIntStar(strOrListOfInt,sw,sz,ival,ivval);
+ std::vector<char> vals(sz);
+ std::copy(pt,pt+sz,vals.begin());
+ return self->findIdSequence(vals);
}
- PyObject *getMinMaxValues() const
+ PyObject *getTuple(mcIdType tupleId)
{
- int a,b;
- self->getMinMaxValues(a,b);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(a));
- PyTuple_SetItem(ret,1,PyInt_FromLong(b));
+ mcIdType sz=self->getNumberOfComponents();
+ INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
+ self->getTuple(tupleId,tmp);
+ PyObject *ret=PyTuple_New(sz);
+ for(mcIdType i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((mcIdType)tmp[i]));
return ret;
}
-
- static PyObject *ConvertIndexArrayToO2N(int nbOfOldTuples, PyObject *arr, PyObject *arrI)
- {
- int newNbOfTuples=-1;
- int szArr,szArrI,sw,iTypppArr,iTypppArrI;
- std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
- const int *arrPtr=convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
- const int *arrIPtr=convertIntStarLikePyObjToCppIntStar(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
- DataArrayInt *ret0=MEDCoupling::DataArrayInt::ConvertIndexArrayToO2N(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
+
+ PyObject *getMaxValue() const
+ {
+ mcIdType tmp;
+ mcIdType r1=(mcIdType)self->getMaxValue(tmp);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
- PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
+ PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
+ PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
return ret;
}
- static DataArrayInt *CheckAndPreparePermutation(PyObject *arr)
+ PyObject *getMinValue() const
{
- MCAuto<DataArrayInt> ret(DataArrayInt::New());
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *arrPtr(convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
- int *pt(MEDCoupling::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
- ret->useArray(pt,true,MEDCoupling::DeallocType::C_DEALLOC,szArr,1);
- return ret.retn();
- }
-
- void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
- {
- 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 !";
- if(PyList_Check(li) || PyTuple_Check(li))
- {
- if(nbOfTuples && nbOfTuples != Py_None)
- {
- if(PyInt_Check(nbOfTuples))
- {
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
- if(nbOfTuples1<0)
- throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
- if(nbOfComp && nbOfComp != Py_None)
- {
- if(PyInt_Check(nbOfComp))
- {//DataArrayInt.setValues([1,3,4,5],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
- if(nbOfCompo<0)
- throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
- std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
- self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
- }
- else
- throw INTERP_KERNEL::Exception(msg);
- }
- else
- {//DataArrayInt.setValues([1,3,4],3)
- int tmpp1=-1;
- std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
- self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
- }
- }
- else
- throw INTERP_KERNEL::Exception(msg);
- }
- else
- {// DataArrayInt.setValues([1,3,4])
- int tmpp1=-1,tmpp2=-1;
- std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
- self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
- }
- }
- else
- throw INTERP_KERNEL::Exception(msg);
- }
-
- PyObject *getValues() const
- {
- const int *vals=self->getConstPointer();
- return convertIntArrToPyList(vals,self->getNbOfElems());
- }
-
-#ifdef WITH_NUMPY
- PyObject *toNumPyArray() // not const. It is not a bug !
- {
- return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
- }
-#endif
-
- PyObject *isEqualIfNotWhy(const DataArrayInt& other) const
- {
- std::string ret1;
- bool ret0=self->isEqualIfNotWhy(other,ret1);
- PyObject *ret=PyTuple_New(2);
- PyObject *ret0Py=ret0?Py_True:Py_False;
- Py_XINCREF(ret0Py);
- PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
- return ret;
- }
-
- PyObject *getValuesAsTuple() const
- {
- const int *vals=self->getConstPointer();
- int nbOfComp=self->getNumberOfComponents();
- int nbOfTuples=self->getNumberOfTuples();
- return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
- }
-
- static PyObject *MakePartition(PyObject *gps, int newNb)
- {
- std::vector<const DataArrayInt *> groups;
- std::vector< std::vector<int> > fidsOfGroups;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(gps,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",groups);
- MEDCoupling::DataArrayInt *ret0=MEDCoupling::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
- PyObject *ret = PyList_New(2);
- PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- int sz=fidsOfGroups.size();
- PyObject *ret1 = PyList_New(sz);
- for(int i=0;i<sz;i++)
- PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
- PyList_SetItem(ret,1,ret1);
- return ret;
- }
-
- void transformWithIndArr(PyObject *li)
- {
- void *da=0;
- int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 ));
- if (!SWIG_IsOK(res1))
- {
- int res2(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 | 0 ));
- if(SWIG_IsOK(res2))
- {
- MapII *m=reinterpret_cast<MapII *>(da);
- self->transformWithIndArr(*m);
- }
- else
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- self->transformWithIndArr(tmp,tmp+size);
- }
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
- }
- }
-
- DataArrayInt *findIdsEqualList(PyObject *obj)
- {
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- convertIntStarOrSliceLikePyObjToCpp(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- return self->findIdsEqualList(&singleVal,&singleVal+1);
- case 2:
- return self->findIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
- case 4:
- return self->findIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
- default:
- throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- }
-
- DataArrayInt *findIdsNotEqualList(PyObject *obj)
- {
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- convertIntStarOrSliceLikePyObjToCpp(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- return self->findIdsNotEqualList(&singleVal,&singleVal+1);
- case 2:
- return self->findIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
- case 4:
- return self->findIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
- default:
- throw INTERP_KERNEL::Exception("DataArrayInt::findIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- }
-
- PyObject *splitByValueRange(PyObject *li) const
- {
- DataArrayInt *ret0=0,*ret1=0,*ret2=0;
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- self->splitByValueRange(da2->begin(),da2->end(),ret0,ret1,ret2);
- }
- PyObject *ret = PyList_New(3);
- PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- DataArrayInt *transformWithIndArrR(PyObject *li) const
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- return self->transformWithIndArrR(tmp,tmp+size);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
- }
- }
-
- DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumberAndReduce(tmp,newNbOfTuple);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- int size=self->getNumberOfTuples();
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
- }
- }
-
- DataArrayInt *renumber(PyObject *li)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumber(tmp);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- int size=self->getNumberOfTuples();
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumber(da2->getConstPointer());
- }
- }
-
- DataArrayInt *renumberR(PyObject *li)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumberR(tmp);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- int size=self->getNumberOfTuples();
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumberR(da2->getConstPointer());
- }
- }
-
- void setSelectedComponents(const DataArrayInt *a, PyObject *li)
- {
- std::vector<int> tmp;
- convertPyToNewIntArr3(li,tmp);
- self->setSelectedComponents(a,tmp);
- }
-
- PyObject *explodeComponents() const
- {
- std::vector< MCAuto<DataArrayInt> > retCpp(self->explodeComponents());
- std::size_t sz(retCpp.size());
- PyObject *res(PyList_New(sz));
- for(std::size_t i=0;i<sz;i++)
- PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i].retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return res;
- }
-
- PyObject *getTuple(int tupleId)
- {
- int sz=self->getNumberOfComponents();
- INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
- self->getTuple(tupleId,tmp);
- return convertIntArrToPyList(tmp,sz);
- }
-
- PyObject *changeSurjectiveFormat(int targetNb) const
- {
- DataArrayInt *arr=0;
- DataArrayInt *arrI=0;
- self->changeSurjectiveFormat(targetNb,arr,arrI);
- PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
- PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
- return res;
- }
-
- static DataArrayInt *Meld(PyObject *li)
- {
- std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
- return DataArrayInt::Meld(tmp);
- }
-
- static DataArrayInt *Aggregate(PyObject *li)
- {
- std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
- return DataArrayInt::Aggregate(tmp);
- }
-
- static DataArrayInt *AggregateIndexes(PyObject *li)
- {
- std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
- return DataArrayInt::AggregateIndexes(tmp);
- }
-
- static DataArrayInt *BuildUnion(PyObject *li)
- {
- std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
- return DataArrayInt::BuildUnion(tmp);
- }
-
- static DataArrayInt *BuildIntersection(PyObject *li)
- {
- std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
- return DataArrayInt::BuildIntersection(tmp);
- }
-
- PyObject *getMaxValue() const
- {
- int tmp;
- int r1=self->getMaxValue(tmp);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
- return ret;
- }
-
- PyObject *getMaxAbsValue(std::size_t& tupleId) const
- {
- std::size_t tmp;
- int r1=self->getMaxAbsValue(tmp);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
- return ret;
- }
-
- PyObject *getMinValue() const
- {
- int tmp;
- int r1=self->getMinValue(tmp);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
- return ret;
- }
-
- int index(PyObject *obj) const
- {
- int nbOfCompo=self->getNumberOfComponents();
- switch(nbOfCompo)
- {
- case 1:
- {
- if(PyInt_Check(obj))
- {
- int val=(int)PyInt_AS_LONG(obj);
- return self->findIdFirstEqual(val);
- }
- else
- throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
- }
- default:
- {
- std::vector<int> arr;
- convertPyToNewIntArr3(obj,arr);
- return self->findIdFirstEqualTuple(arr);
- }
- }
- }
-
- bool __contains__(PyObject *obj) const
- {
- int nbOfCompo=self->getNumberOfComponents();
- switch(nbOfCompo)
- {
- case 0:
- return false;
- case 1:
- {
- if(PyInt_Check(obj))
- {
- int val=(int)PyInt_AS_LONG(obj);
- return self->presenceOfValue(val);
- }
- else
- throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
- }
- default:
- {
- std::vector<int> arr;
- convertPyToNewIntArr3(obj,arr);
- return self->presenceOfTuple(arr);
- }
- }
- }
-
- PyObject *__getitem__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
- const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
- self->checkAllocated();
- int nbOfTuples=self->getNumberOfTuples();
- int nbOfComponents=self->getNumberOfComponents();
- int it1,ic1;
- std::vector<int> vt1,vc1;
- std::pair<int, std::pair<int,int> > pt1,pc1;
- DataArrayInt *dt1=0,*dc1=0;
- int sw;
- convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
- MCAuto<DataArrayInt> ret;
- switch(sw)
- {
- case 1:
- {
- if(nbOfComponents==1)
- return PyInt_FromLong(self->getIJSafe(it1,0));
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 2:
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- case 3:
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- case 4:
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- case 5:
- return PyInt_FromLong(self->getIJSafe(it1,ic1));
- case 6:
- {
- ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
- std::vector<int> v2(1,ic1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 7:
- {
- ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
- std::vector<int> v2(1,ic1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 8:
- {
- ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
- std::vector<int> v2(1,ic1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 9:
- {
- ret=self->selectByTupleIdSafe(&it1,&it1+1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 10:
- {
- ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 11:
- {
- ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 12:
- {
- ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 13:
- {
- ret=self->selectByTupleIdSafe(&it1,&it1+1);
- int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
- std::vector<int> v2(nbOfComp);
- for(int i=0;i<nbOfComp;i++)
- v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 14:
- {
- ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
- int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
- std::vector<int> v2(nbOfComp);
- for(int i=0;i<nbOfComp;i++)
- v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 15:
- {
- ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
- int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
- std::vector<int> v2(nbOfComp);
- for(int i=0;i<nbOfComp;i++)
- v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- case 16:
- {
- ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
- int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
- std::vector<int> v2(nbOfComp);
- for(int i=0;i<nbOfComp;i++)
- v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__setitem__(PyObject *obj, PyObject *value)
- {
- self->checkAllocated();
- const char msg[]="Unexpected situation in __setitem__ !";
- int nbOfTuples=self->getNumberOfTuples();
- int nbOfComponents=self->getNumberOfComponents();
- int sw1,sw2;
- int i1;
- std::vector<int> v1;
- DataArrayInt *d1=0;
- DataArrayIntTuple *dd1=0;
- convertIntStarLikePyObjToCpp(value,sw1,i1,v1,d1,dd1);
- int it1,ic1;
- std::vector<int> vt1,vc1;
- std::pair<int, std::pair<int,int> > pt1,pc1;
- DataArrayInt *dt1=0,*dc1=0;
- convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
- MCAuto<DataArrayInt> tmp;
- switch(sw2)
- {
- case 1:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
- return self;
- case 3:
- self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 2:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
- return self;
- case 3:
- self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 3:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
- return self;
- case 3:
- self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 4:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
- return self;
- case 3:
- self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 5:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
- return self;
- case 3:
- self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 6:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
- return self;
- case 3:
- self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 7:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
- return self;
- case 3:
- self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 8:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
- return self;
- case 3:
- self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 9:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
- return self;
- case 3:
- self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 10:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
- return self;
- case 3:
- self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 11:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
- return self;
- case 3:
- self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 12:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
- return self;
- case 3:
- self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 13:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
- return self;
- case 3:
- self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 14:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
- return self;
- case 3:
- self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 15:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
- return self;
- case 3:
- self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- case 16:
- {
- switch(sw1)
- {
- case 1:
- self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
- return self;
- case 2:
- tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
- self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
- return self;
- case 3:
- self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
- return self;
- case 4:
- tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
- self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
- return self;
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- break;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- return self;
- }
-
- DataArrayInt *__neg__() const
- {
- return self->negate();
- }
-
- DataArrayInt *__add__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __add__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyLin(1,val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Add(self,aaaa);
- }
- case 3:
- {
- return DataArrayInt::Add(self,a);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Add(self,aaaa);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__radd__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __radd__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyLin(1,val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Add(self,aaaa);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Add(self,aaaa);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
- {
- const char msg[]="Unexpected situation in __iadd__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- self->applyLin(1,val);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 2:
- {
- MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- self->addEqual(bb);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 3:
- {
- self->addEqual(a);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- self->addEqual(aaaa);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__sub__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __sub__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyLin(1,-val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Substract(self,aaaa);
- }
- case 3:
- {
- return DataArrayInt::Substract(self,a);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Substract(self,aaaa);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__rsub__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __rsub__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyLin(-1,val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Substract(aaaa,self);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Substract(aaaa,self);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
- {
- const char msg[]="Unexpected situation in __isub__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- self->applyLin(1,-val);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 2:
- {
- MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- self->substractEqual(bb);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 3:
- {
- self->substractEqual(a);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- self->substractEqual(aaaa);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__mul__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __mul__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyLin(val,0);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Multiply(self,aaaa);
- }
- case 3:
- {
- return DataArrayInt::Multiply(self,a);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Multiply(self,aaaa);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__rmul__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __rmul__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyLin(val,0);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Multiply(self,aaaa);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Multiply(self,aaaa);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
- {
- const char msg[]="Unexpected situation in __imul__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- self->applyLin(val,0);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 2:
- {
- MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- self->multiplyEqual(bb);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 3:
- {
- self->multiplyEqual(a);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- self->multiplyEqual(aaaa);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__div__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __div__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyDivideBy(val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Divide(self,aaaa);
- }
- case 3:
- {
- return DataArrayInt::Divide(self,a);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Divide(self,aaaa);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__rdiv__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __rdiv__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyInv(val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Divide(aaaa,self);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Divide(aaaa,self);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
- {
- const char msg[]="Unexpected situation in __idiv__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- self->applyDivideBy(val);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 2:
- {
- MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- self->divideEqual(bb);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 3:
- {
- self->divideEqual(a);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- self->divideEqual(aaaa);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__mod__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __mod__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyModulus(val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Modulus(self,aaaa);
- }
- case 3:
- {
- return DataArrayInt::Modulus(self,a);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Modulus(self,aaaa);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__rmod__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __rmod__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyRModulus(val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Modulus(aaaa,self);
- }
- case 3:
- {
- return DataArrayInt::Modulus(a,self);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Modulus(aaaa,self);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- PyObject *___imod___(PyObject *trueSelf, PyObject *obj)
- {
- const char msg[]="Unexpected situation in __imod__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- self->applyModulus(val);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 3:
- {
- self->modulusEqual(a);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- self->modulusEqual(aaaa);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__pow__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __pow__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyPow(val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Pow(self,aaaa);
- }
- case 3:
- {
- return DataArrayInt::Pow(self,a);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Pow(self,aaaa);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- DataArrayInt *__rpow__(PyObject *obj)
- {
- const char msg[]="Unexpected situation in __rpow__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- MCAuto<DataArrayInt> ret=self->deepCopy();
- ret->applyRPow(val);
- return ret.retn();
- }
- case 2:
- {
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
- return DataArrayInt::Pow(aaaa,self);
- }
- case 3:
- {
- return DataArrayInt::Pow(a,self);
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- return DataArrayInt::Pow(aaaa,self);
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
- {
- const char msg[]="Unexpected situation in __ipow__ !";
- int val;
- DataArrayInt *a;
- std::vector<int> aa;
- DataArrayIntTuple *aaa;
- int sw;
- convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa);
- switch(sw)
- {
- case 1:
- {
- self->applyPow(val);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 3:
- {
- self->powEqual(a);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- case 4:
- {
- MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
- self->powEqual(aaaa);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
-
- std::string __repr__() const
- {
- std::ostringstream oss;
- self->reprQuickOverview(oss);
- return oss.str();
- }
-
- void pushBackValsSilent(PyObject *li)
- {
- int szArr,sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
- self->pushBackValsSilent(tmp,tmp+szArr);
- }
-
- PyObject *partitionByDifferentValues() const
- {
- std::vector<int> ret1;
- std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
- std::size_t sz=ret0.size();
- PyObject *pyRet=PyTuple_New(2);
- PyObject *pyRet0=PyList_New((int)sz);
- PyObject *pyRet1=PyList_New((int)sz);
- for(std::size_t i=0;i<sz;i++)
- {
- PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
- }
- PyTuple_SetItem(pyRet,0,pyRet0);
- PyTuple_SetItem(pyRet,1,pyRet1);
- return pyRet;
- }
-
- PyObject *findIdsRangesInListOfIds(const DataArrayInt *listOfIds) const
- {
- DataArrayInt *ret0=0,*ret1=0;
- self->findIdsRangesInListOfIds(listOfIds,ret0,ret1);
- PyObject *pyRet=PyTuple_New(2);
- PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return pyRet;
- }
-
- PyObject *isRange() const
- {
- int a(0),b(0),c(0);
- bool ret(self->isRange(a,b,c));
- PyObject *pyRet=PyTuple_New(2);
- PyObject *ret0Py=ret?Py_True:Py_False,*ret1Py(0);
- Py_XINCREF(ret0Py);
- PyTuple_SetItem(pyRet,0,ret0Py);
- if(ret)
- ret1Py=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
- else
- {
- ret1Py=Py_None;
- Py_XINCREF(ret1Py);
- }
- PyTuple_SetItem(pyRet,1,ret1Py);
- return pyRet;
- }
-
- static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
- {
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- if(!arrIndx)
- throw INTERP_KERNEL::Exception("DataArrayInt::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
- convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- return DataArrayInt::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
- case 2:
- return DataArrayInt::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
- case 4:
- return DataArrayInt::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
- default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- }
-
- static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *arrOut=0,*arrIndexOut=0;
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- if(!arrIndxIn)
- throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
- convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- {
- DataArrayInt::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
- break;
- }
- case 2:
- {
- DataArrayInt::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
- break;
- }
- case 4:
- {
- DataArrayInt::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
- break;
- }
- default:
- throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *arrOut=0,*arrIndexOut=0;
- DataArrayInt::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
- {
- if(!PySlice_Check(slic))
- throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
- Py_ssize_t strt=2,stp=2,step=2;
- if(!arrIndxIn)
- throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
- arrIndxIn->checkAllocated();
- if(arrIndxIn->getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
- GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
- DataArrayInt *arrOut=0,*arrIndexOut=0;
- DataArrayInt::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- static PyObject *SetPartOfIndexedArrays(PyObject *li,
- const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *arrOut=0,*arrIndexOut=0;
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- if(!arrIndxIn)
- throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArrays : null pointer as arrIndex !");
- convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- {
- DataArrayInt::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
- break;
- }
- case 2:
- {
- DataArrayInt::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
- break;
- }
- case 4:
- {
- DataArrayInt::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
- break;
- }
- default:
- throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
- {
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- if(!arrIndxIn)
- throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
- convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- {
- DataArrayInt::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
- break;
- }
- case 2:
- {
- DataArrayInt::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
- break;
- }
- case 4:
- {
- DataArrayInt::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
- break;
- }
- default:
- throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- }
-
- } // end extent
- };
-
- class DataArrayIntTuple;
-
- class DataArrayIntIterator
- {
- public:
- DataArrayIntIterator(DataArrayInt *da);
- ~DataArrayIntIterator();
- %extend
- {
- PyObject *next()
- {
- DataArrayIntTuple *ret=self->nextt();
- if(ret)
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
- else
- {
- PyErr_SetString(PyExc_StopIteration,"No more data.");
- return 0;
- }
- }
- }
- };
-
- class DataArrayIntTuple
- {
- public:
- int getNumberOfCompo() const;
- DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const;
- %extend
- {
- std::string __str__() const
- {
- return self->repr();
- }
-
- int __int__() const
- {
- return self->intValue();
- }
-
- DataArrayInt *buildDAInt()
- {
- return self->buildDAInt(1,self->getNumberOfCompo());
- }
-
- PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
- {
- MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- MEDCoupling_DataArrayInt____iadd___(ret,0,obj);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
-
- PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
- {
- MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- MEDCoupling_DataArrayInt____isub___(ret,0,obj);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
-
- PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
- {
- MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- MEDCoupling_DataArrayInt____imul___(ret,0,obj);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
- PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
- {
- MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- MEDCoupling_DataArrayInt____idiv___(ret,0,obj);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
-
- PyObject *___imod___(PyObject *trueSelf, PyObject *obj)
- {
- MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- MEDCoupling_DataArrayInt____imod___(ret,0,obj);
- Py_XINCREF(trueSelf);
- return trueSelf;
- }
-
- PyObject *__len__()
- {
- return PyInt_FromLong(self->getNumberOfCompo());
- }
-
- PyObject *__getitem__(PyObject *obj)
- {
- const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- const int *pt=self->getConstPointer();
- int nbc=self->getNumberOfCompo();
- convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- {
- if(singleVal>=nbc)
- {
- std::ostringstream oss;
- oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
- PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
- return 0;
- }
- if(singleVal>=0)
- return PyInt_FromLong(pt[singleVal]);
- else
- {
- if(nbc+singleVal>0)
- return PyInt_FromLong(pt[nbc+singleVal]);
- else
- {
- std::ostringstream oss;
- oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- }
- }
- case 2:
- {
- PyObject *t=PyTuple_New(multiVal.size());
- for(int j=0;j<(int)multiVal.size();j++)
- {
- int cid=multiVal[j];
- if(cid>=nbc)
- {
- std::ostringstream oss;
- oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
- }
- return t;
- }
- case 3:
- {
- int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
- PyObject *t=PyTuple_New(sz);
- for(int j=0;j<sz;j++)
- PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
- return t;
- }
- default:
- throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
- }
- }
-
- DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value)
- {
- const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
- const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
- int sw1,sw2;
- int singleValV;
- std::vector<int> multiValV;
- std::pair<int, std::pair<int,int> > slicV;
- MEDCoupling::DataArrayIntTuple *daIntTyyppV=0;
- int nbc=self->getNumberOfCompo();
- convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- int *pt=self->getPointer();
- convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
- switch(sw2)
- {
- case 1:
- {
- if(singleVal>=nbc)
- {
- std::ostringstream oss;
- oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- switch(sw1)
- {
- case 1:
- {
- pt[singleVal]=singleValV;
- return self;
- }
- case 2:
- {
- if(multiValV.size()!=1)
- {
- std::ostringstream oss;
- oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- pt[singleVal]=multiValV[0];
- return self;
- }
- case 4:
- {
- pt[singleVal]=daIntTyyppV->getConstPointer()[0];
- return self;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
- case 2:
- {
- switch(sw1)
- {
- case 1:
- {
- for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
- {
- if(*it>=nbc)
- {
- std::ostringstream oss;
- oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- pt[*it]=singleValV;
- }
- return self;
- }
- case 2:
- {
- if(multiVal.size()!=multiValV.size())
- {
- std::ostringstream oss;
- oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- for(int i=0;i<(int)multiVal.size();i++)
- {
- int pos=multiVal[i];
- if(pos>=nbc)
- {
- std::ostringstream oss;
- oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- pt[multiVal[i]]=multiValV[i];
- }
- return self;
- }
- case 4:
- {
- const int *ptV=daIntTyyppV->getConstPointer();
- if(nbc>daIntTyyppV->getNumberOfCompo())
- {
- std::ostringstream oss;
- oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- std::copy(ptV,ptV+nbc,pt);
- return self;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
- case 3:
- {
- int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
- switch(sw1)
- {
- case 1:
- {
- for(int j=0;j<sz;j++)
- pt[slic.first+j*slic.second.second]=singleValV;
- return self;
- }
- case 2:
- {
- if(sz!=(int)multiValV.size())
- {
- std::ostringstream oss;
- oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- for(int j=0;j<sz;j++)
- pt[slic.first+j*slic.second.second]=multiValV[j];
- return self;
- }
- case 4:
- {
- const int *ptV=daIntTyyppV->getConstPointer();
- if(sz>daIntTyyppV->getNumberOfCompo())
- {
- std::ostringstream oss;
- oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- for(int j=0;j<sz;j++)
- pt[slic.first+j*slic.second.second]=ptV[j];
- return self;
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
- default:
- throw INTERP_KERNEL::Exception(msg);
- }
- }
- }
- };
-
- class DataArrayChar : public DataArray
- {
- public:
- virtual DataArrayChar *buildEmptySpecializedDAChar() const;
- int getHashCode() const;
- bool empty() const;
- void deepCopyFrom(const DataArrayChar& other);
- void reserve(std::size_t nbOfElems);
- void pushBackSilent(char val);
- char popBackSilent();
- void pack() const;
- void allocIfNecessary(int nbOfTuple, int nbOfCompo);
- bool isEqual(const DataArrayChar& other) const;
- bool isEqualWithoutConsideringStr(const DataArrayChar& other) const;
- void reverse();
- void fillWithZero();
- void fillWithValue(char val);
- std::string repr() const;
- std::string reprZip() const;
- DataArrayInt *convertToIntArr() const;
- DataArrayChar *renumber(const int *old2New) const;
- DataArrayChar *renumberR(const int *new2Old) const;
- DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const;
- bool isUniform(char val) const;
- void sort(bool asc=true);
- DataArrayChar *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
- DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const;
- void meldWith(const DataArrayChar *other);
- void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayInt *tuplesSelec);
- char front() const;
- char back() const;
- void setIJ(int tupleId, int compoId, char newVal);
- void setIJSilent(int tupleId, int compoId, char newVal);
- char *getPointer();
- DataArrayInt *findIdsEqual(char val) const;
- DataArrayInt *findIdsNotEqual(char val) const;
- int findIdFirstEqualTuple(const std::vector<char>& tupl) const;
- bool presenceOfTuple(const std::vector<char>& tupl) const;
- char getMaxValue(int& tupleId) const;
- char getMaxValueInArray() const;
- char getMinValue(int& tupleId) const;
- char getMinValueInArray() const;
- DataArrayInt *findIdsInRange(char vmin, char vmax) const;
- static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2);
- static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2);
- %extend
- {
- int __len__() const
- {
- if(self->isAllocated())
- {
- return self->getNumberOfTuples();
- }
- else
- {
- throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
- }
- }
-
- PyObject *isEqualIfNotWhy(const DataArrayChar& other) const
- {
- std::string ret1;
- bool ret0=self->isEqualIfNotWhy(other,ret1);
- PyObject *ret=PyTuple_New(2);
- PyObject *ret0Py=ret0?Py_True:Py_False;
- Py_XINCREF(ret0Py);
- PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
- return ret;
- }
-
- DataArrayChar *renumber(PyObject *li)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumber(tmp);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- int size=self->getNumberOfTuples();
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumber(da2->getConstPointer());
- }
- }
-
- DataArrayChar *renumberR(PyObject *li)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumberR(tmp);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- int size=self->getNumberOfTuples();
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumberR(da2->getConstPointer());
- }
- }
-
- DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumberAndReduce(tmp,newNbOfTuple);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- int size=self->getNumberOfTuples();
- if(size!=self->getNumberOfTuples())
- {
- throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
- }
- return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
- }
- }
-
- static DataArrayChar *Aggregate(PyObject *dachs)
- {
- std::vector<const MEDCoupling::DataArrayChar *> tmp;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
- return DataArrayChar::Aggregate(tmp);
- }
-
- static DataArrayChar *Meld(PyObject *dachs)
- {
- std::vector<const MEDCoupling::DataArrayChar *> tmp;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
- return DataArrayChar::Meld(tmp);
- }
- }
- };
-
- class DataArrayByteIterator;
-
- class DataArrayByte : public DataArrayChar
- {
- public:
- static DataArrayByte *New();
- DataArrayByteIterator *iterator();
- DataArrayByte *performCopyOrIncrRef(bool deepCopy) const;
- char byteValue() const;
- %extend
- {
- DataArrayByte()
- {
- return DataArrayByte::New();
- }
-
- static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
- {
- 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) !";
- if(PyList_Check(elt0) || PyTuple_Check(elt0))
- {
- if(nbOfTuples)
- {
- if(PyInt_Check(nbOfTuples))
- {
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
- if(nbOfTuples1<0)
- throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
- if(nbOfComp)
- {
- if(PyInt_Check(nbOfComp))
- {//DataArrayByte.New([1,3,4,5],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
- if(nbOfCompo<0)
- throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
- MCAuto<DataArrayByte> ret=DataArrayByte::New();
- std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
- ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
- return ret.retn();
- }
- else
- throw INTERP_KERNEL::Exception(msg);
- }
- else
- {//DataArrayByte.New([1,3,4],3)
- MCAuto<DataArrayByte> ret=DataArrayByte::New();
- int tmpp1=-1;
- std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
- ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
- return ret.retn();
- }
- }
- else
- throw INTERP_KERNEL::Exception(msg);
- }
- else
- {// DataArrayByte.New([1,3,4])
- MCAuto<DataArrayByte> ret=DataArrayByte::New();
- int tmpp1=-1,tmpp2=-1;
- std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
- ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
- return ret.retn();
- }
- }
- else if(PyInt_Check(elt0))
- {
- int nbOfTuples1=PyInt_AS_LONG(elt0);
- if(nbOfTuples1<0)
- throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
- if(nbOfTuples)
- {
- if(!nbOfComp)
- {
- if(PyInt_Check(nbOfTuples))
- {//DataArrayByte.New(5,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
- if(nbOfCompo<0)
- throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
- MCAuto<DataArrayByte> ret=DataArrayByte::New();
- ret->alloc(nbOfTuples1,nbOfCompo);
- return ret.retn();
- }
- else
- throw INTERP_KERNEL::Exception(msg);
- }
- else
- throw INTERP_KERNEL::Exception(msg);
- }
- else
- {//DataArrayByte.New(5)
- MCAuto<DataArrayByte> ret=DataArrayByte::New();
- ret->alloc(nbOfTuples1,1);
- return ret.retn();
- }
- }
-#ifdef WITH_NUMPY
- else if(PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
- {//DataArrayDouble.New(numpyArray)
- return BuildNewInstance<DataArrayByte,char>(elt0,NPY_INT8,&PyCallBackDataArrayChar_RefType,"INT8");
- }
-#endif
- else
- throw INTERP_KERNEL::Exception(msg);
- }
-
- DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
- {
- return MEDCoupling_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
- }
-
- std::string __repr__() const
- {
- std::ostringstream oss;
- self->reprQuickOverview(oss);
- return oss.str();
- }
-
- int __int__() const
- {
- return (int) self->byteValue();
- }
-
- DataArrayByteIterator *__iter__()
- {
- return self->iterator();
- }
-
- int getIJ(int tupleId, int compoId) const
- {
- return (int)self->getIJ(tupleId,compoId);
- }
-
- int getIJSafe(int tupleId, int compoId) const
- {
- return (int)self->getIJSafe(tupleId,compoId);
- }
-
- std::string __str__() const
- {
- return self->repr();
- }
-
- PyObject *toStrList() const
- {
- const char *vals=self->getConstPointer();
- int nbOfComp=self->getNumberOfComponents();
- int nbOfTuples=self->getNumberOfTuples();
- return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
- }
-
- bool presenceOfTuple(PyObject *tupl) const
- {
- int sz=-1,sw=-1;
- int ival=-1; std::vector<int> ivval;
- const int *pt=convertIntStarLikePyObjToCppIntStar(tupl,sw,sz,ival,ivval);
- std::vector<char> vals(sz);
- std::copy(pt,pt+sz,vals.begin());
- return self->presenceOfTuple(vals);
- }
-
- bool presenceOfValue(PyObject *vals) const
- {
- int sz=-1,sw=-1;
- int ival=-1; std::vector<int> ivval;
- const int *pt=convertIntStarLikePyObjToCppIntStar(vals,sw,sz,ival,ivval);
- std::vector<char> vals2(sz);
- std::copy(pt,pt+sz,vals2.begin());
- return self->presenceOfValue(vals2);
- }
-
- int findIdFirstEqual(PyObject *vals) const
- {
- int sz=-1,sw=-1;
- int ival=-1; std::vector<int> ivval;
- const int *pt=convertIntStarLikePyObjToCppIntStar(vals,sw,sz,ival,ivval);
- std::vector<char> vals2(sz);
- std::copy(pt,pt+sz,vals2.begin());
- return self->findIdFirstEqual(vals2);
- }
-
- int findIdFirstEqualTuple(PyObject *tupl) const
- {
- int sz=-1,sw=-1;
- int ival=-1; std::vector<int> ivval;
- const int *pt=convertIntStarLikePyObjToCppIntStar(tupl,sw,sz,ival,ivval);
- std::vector<char> vals(sz);
- std::copy(pt,pt+sz,vals.begin());
- return self->findIdFirstEqualTuple(vals);
- }
-
- int findIdSequence(PyObject *strOrListOfInt) const
- {
- int sz=-1,sw=-1;
- int ival=-1; std::vector<int> ivval;
- const int *pt=convertIntStarLikePyObjToCppIntStar(strOrListOfInt,sw,sz,ival,ivval);
- std::vector<char> vals(sz);
- std::copy(pt,pt+sz,vals.begin());
- return self->findIdSequence(vals);
- }
-
- PyObject *getTuple(int tupleId)
- {
- int sz=self->getNumberOfComponents();
- INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
- self->getTuple(tupleId,tmp);
- PyObject *ret=PyTuple_New(sz);
- for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
- return ret;
- }
-
- PyObject *getMaxValue() const
- {
- int tmp;
- int r1=(int)self->getMaxValue(tmp);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
- return ret;
- }
-
- PyObject *getMinValue() const
- {
- int tmp;
- int r1=(int)self->getMinValue(tmp);
+ mcIdType tmp;
+ mcIdType r1=(mcIdType)self->getMinValue(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
return ret;
}
- int index(PyObject *obj) const
+ mcIdType index(PyObject *obj) const
{
- int nbOfCompo=self->getNumberOfComponents();
+ mcIdType nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
{
case 1:
{
if(PyInt_Check(obj))
{
- int val=(int)PyInt_AS_LONG(obj);
+ mcIdType val=(mcIdType)PyInt_AS_LONG(obj);
return self->findIdFirstEqual(val);
}
else
bool __contains__(PyObject *obj) const
{
- int nbOfCompo=self->getNumberOfComponents();
+ mcIdType nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
{
case 0:
{
if(PyInt_Check(obj))
{
- int val=(int)PyInt_AS_LONG(obj);
+ mcIdType val=(mcIdType)PyInt_AS_LONG(obj);
return self->presenceOfValue(val);
}
else
{
self->checkAllocated();
const char msg[]="Unexpected situation in __setitem__ !";
- int nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
- int sw1,sw2;
- int i1;
- std::vector<int> v1;
- DataArrayInt *d1=0;
- DataArrayIntTuple *dd1=0;
+ mcIdType nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
+ mcIdType sw1,sw2;
+ mcIdType i1;
+ std::vector<mcIdType> v1;
+ DataArrayIdType *d1=0;
+ DataArrayIdTypeTuple *dd1=0;
convertIntStarLikePyObjToCpp(value,sw1,i1,v1,d1,dd1);
- int it1,ic1;
- std::vector<int> vt1,vc1;
- std::pair<int, std::pair<int,int> > pt1,pc1;
- DataArrayInt *dt1=0,*dc1=0;
+ mcIdType it1,ic1;
+ std::vector<mcIdType> vt1,vc1;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > pt1,pc1;
+ DataArrayIdType *dt1=0,*dc1=0;
convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
- MCAuto<DataArrayInt> tmp;
+ MCAuto<DataArrayIdType> tmp;
switch(sw2)
{
case 1:
{
public:
std::string repr() const;
- DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const;
+ DataArrayByte *buildDAByte(mcIdType nbOfTuples, mcIdType nbOfCompo) const;
%extend
{
std::string __str__() const
{
if(PyInt_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
if(nbOfComp)
{
if(PyInt_Check(nbOfComp))
{//DataArrayAsciiChar.New([1,3,4,5],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
- std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
+ std::vector<mcIdType> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
else
{//DataArrayAsciiChar.New([1,3,4],3)
MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
- int tmpp1=-1;
- std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
+ mcIdType tmpp1=-1;
+ std::vector<mcIdType> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
{
// DataArrayAsciiChar.New([1,3,4])
MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
- int tmpp1=-1,tmpp2=-1;
- std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
+ mcIdType tmpp1=-1,tmpp2=-1;
+ std::vector<mcIdType> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
}
else if(PyInt_Check(elt0))
{
- int nbOfTuples1=PyInt_AS_LONG(elt0);
+ mcIdType nbOfTuples1=PyInt_AS_LONG(elt0);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
if(nbOfTuples)
{
if(PyInt_Check(nbOfTuples))
{//DataArrayAsciiChar.New(5,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+ mcIdType nbOfCompo=PyInt_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
return self->iterator();
}
- std::string getIJ(int tupleId, int compoId) const
+ std::string getIJ(mcIdType tupleId, mcIdType compoId) const
{
char tmp[2]; tmp[1]='\0';
tmp[0]=self->getIJ(tupleId,compoId);
return std::string(tmp);
}
- std::string getIJSafe(int tupleId, int compoId) const
+ std::string getIJSafe(mcIdType tupleId, mcIdType compoId) const
{
char tmp[2]; tmp[1]='\0';
tmp[0]=self->getIJSafe(tupleId,compoId);
PyObject *toStrList() const
{
const char *vals=self->getConstPointer();
- int nbOfComp=self->getNumberOfComponents();
- int nbOfTuples=self->getNumberOfTuples();
+ mcIdType nbOfComp=self->getNumberOfComponents();
+ mcIdType nbOfTuples=self->getNumberOfTuples();
return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
}
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
}
- int findIdFirstEqual(PyObject *vals) const
+ mcIdType findIdFirstEqual(PyObject *vals) const
{
if(PyString_Check(vals))
{
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqual : only strings in input supported !");
}
- int findIdFirstEqualTuple(PyObject *tupl) const
+ mcIdType findIdFirstEqualTuple(PyObject *tupl) const
{
if(PyString_Check(tupl))
{
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqualTuple : only strings in input supported !");
}
- int findIdSequence(PyObject *strOrListOfInt) const
+ mcIdType findIdSequence(PyObject *strOrListOfInt) const
{
if(PyString_Check(strOrListOfInt))
{
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
}
- PyObject *getTuple(int tupleId) const
+ PyObject *getTuple(mcIdType tupleId) const
{
- int sz=self->getNumberOfComponents();
+ mcIdType sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
self->getTuple(tupleId,tmp);
return PyString_FromString(tmp);
PyObject *getMaxValue() const
{
- int tmp;
+ mcIdType tmp;
char tmp2[2]; tmp2[1]='\0';
tmp2[0]=self->getMaxValue(tmp);
PyObject *ret=PyTuple_New(2);
PyObject *getMinValue() const
{
- int tmp;
+ mcIdType tmp;
char tmp2[2]; tmp2[1]='\0';
tmp2[0]=self->getMinValue(tmp);
PyObject *ret=PyTuple_New(2);
return ret;
}
- int index(PyObject *obj) const
+ mcIdType index(PyObject *obj) const
{
- int nbOfCompo=self->getNumberOfComponents();
+ mcIdType nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
{
case 1:
bool __contains__(PyObject *obj) const
{
- int nbOfCompo=self->getNumberOfComponents();
+ mcIdType nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
{
case 0:
PyObject *__getitem__(PyObject *obj) const
{
- int sw,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- std::pair<int, std::pair<int,int> > sTyyppArr;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
+ mcIdType sw,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > sTyyppArr;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
switch(sw)
{
case 4:
return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
default:
- throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
+ throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayIdType and slice in input !");
}
}
DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value)
{
- 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.";
- int sw1,iTypppArr;
- std::vector<int> stdvecTyyppArr;
- std::pair<int, std::pair<int,int> > sTyyppArr;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- int nbOfCompo=self->getNumberOfComponents();
- int nbOfTuples=self->getNumberOfTuples();
+ static const char msg[]="DataArrayAsciiChar::__setitem__ : supporting int, list of int, tuple of int, DataArrayIdType and slice in input, and 4 types accepted in value : string, list or tuple of strings having same size, not null DataArrayChar instance.";
+ mcIdType sw1,iTypppArr;
+ std::vector<mcIdType> stdvecTyyppArr;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > sTyyppArr;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
+ mcIdType nbOfCompo=self->getNumberOfComponents();
+ mcIdType nbOfTuples=self->getNumberOfTuples();
convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
- int sw2;
+ mcIdType sw2;
char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
switch(sw1)
}
}
case 4:
- {//DataArrayInt
+ {//DataArrayIdType
switch(sw2)
{
{//value char
class DataArrayAsciiCharTuple
{
public:
- int getNumberOfCompo() const;
- DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const;
+ std::size_t getNumberOfCompo() const;
+ DataArrayAsciiChar *buildDAAsciiChar(mcIdType nbOfTuples, mcIdType nbOfCompo) const;
%extend
{
std::string __str__() const
};
}
+%include "DataArrayInt.i"
+
%pythoncode %{
def MEDCouplingStdReduceFunct(cls,params):
a,b=params
def MEDCouplingDataArrayIntReduce(self):
if not MEDCouplingHasNumPyBindings():
- raise InterpKernelException("PyWrap of DataArrayInt.__reduce__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !")
- return MEDCouplingStdReduceFunct,(DataArrayInt,((self.toNumPyArray(),),(self.__getstate__()),))
+ raise InterpKernelException("PyWrap of DataArrayIdType.__reduce__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !")
+ return MEDCouplingStdReduceFunct,(DataArrayIdType,((self.toNumPyArray(),),(self.__getstate__()),))
def MEDCouplingDataArrayByteReduce(self):
if not MEDCouplingHasNumPyBindings():
if not MEDCouplingHasNumPyBindings():
raise InterpKernelException("PyWrap of DataArrayFloat.__reduce__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !")
return MEDCouplingStdReduceFunct,(DataArrayFloat,((self.toNumPyArray(),),(self.__getstate__()),))
+
+if MEDCouplingUse64BitIDs():
+ DataArrayInt=DataArrayInt64
+else:
+ DataArrayInt=DataArrayInt32
+pass
+
%}
return false;
#endif
}
+
+ bool MEDCouplingUse64BitIDs()
+ {
+#ifndef MEDCOUPLING_USE_64BIT_IDS
+ return false;
+#else
+ return true;
+#endif
+ }
std::string MEDCouplingCompletionScript()
{
{
PyObject *getCrudeMatrix() const
{
- const std::vector<std::map<int,double> >& m=self->getCrudeMatrix();
+ const std::vector<std::map<mcIdType,double> >& m=self->getCrudeMatrix();
std::size_t sz=m.size();
PyObject *ret=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
{
- const std::map<int,double>& row=m[i];
+ const std::map<mcIdType,double>& row=m[i];
PyObject *ret0=PyDict_New();
- for(std::map<int,double>::const_iterator it=row.begin();it!=row.end();it++)
+ for(std::map<mcIdType,double>::const_iterator it=row.begin();it!=row.end();it++)
PyDict_SetItem(ret0,PyInt_FromLong((*it).first),PyFloat_FromDouble((*it).second));
PyList_SetItem(ret,i,ret0);
}
#endif
void setCrudeMatrix(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method, PyObject *m)
{
- std::vector<std::map<int,double> > mCpp;
+ std::vector<std::map<mcIdType,double> > mCpp;
if(isCSRMatrix(m))
{
#if defined(WITH_NUMPY) && defined(WITH_SCIPY)
PyObject *indptr(PyObject_GetAttrString(m,"indptr"));
PyObject *indices(PyObject_GetAttrString(m,"indices"));
PyObject *data(PyObject_GetAttrString(m,"data"));
- MCAuto<DataArrayInt> indptrPtr(MEDCoupling_DataArrayInt_New__SWIG_1(indptr,NULL,NULL));
- MCAuto<DataArrayInt> indicesPtr(MEDCoupling_DataArrayInt_New__SWIG_1(indices,NULL,NULL));
+ MCAuto<DataArrayIdType> indptrPtr, indicesPtr;
+#if defined(MEDCOUPLING_USE_64BIT_IDS)
+ indptrPtr = MEDCoupling_DataArrayInt64_New__SWIG_1(indptr,NULL,NULL);
+ indicesPtr = MEDCoupling_DataArrayInt64_New__SWIG_1(indices,NULL,NULL);
+#else
+ indptrPtr = MEDCoupling_DataArrayInt32_New__SWIG_1(indptr,NULL,NULL);
+ indicesPtr = MEDCoupling_DataArrayInt32_New__SWIG_1(indices,NULL,NULL);
+#endif
MCAuto<DataArrayDouble> dataPtr(MEDCoupling_DataArrayDouble_New__SWIG_1(data,NULL,NULL));
convertCSR_MCDataToVectMapIntDouble(indptrPtr,indicesPtr,dataPtr,mCpp);
Py_XDECREF(data); Py_XDECREF(indptr); Py_XDECREF(indices);
void setCrudeMatrixEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target, PyObject *m)
{
- std::vector<std::map<int,double> > mCpp;
+ std::vector<std::map<mcIdType,double> > mCpp;
convertToVectMapIntDouble(m,mCpp);
self->setCrudeMatrixEx(src,target,mCpp);
}
MEDCoupling::DataArrayDouble *a;
MEDCoupling::DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
MEDCoupling::DataArrayDouble *a;
MEDCoupling::DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
MEDCoupling::DataArrayDouble *a;
MEDCoupling::DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
MEDCoupling::DataArrayDouble *a;
MEDCoupling::DataArrayDoubleTuple *aa;
std::vector<double> bb;
- int sw;
+ mcIdType sw;
convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
switch(sw)
{
template<class T>
typename MEDCoupling::Traits<T>::FieldType *fieldT_buildSubPart(const MEDCoupling::MEDCouplingFieldT<T> *self, PyObject *li)
{
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
+ mcIdType sw;
+ mcIdType singleVal;
+ std::vector<mcIdType> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
const MEDCoupling::MEDCouplingMesh *mesh=self->getMesh();
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
- int nbc=mesh->getNumberOfCells();
+ mcIdType nbc=mesh->getNumberOfCells();
convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
{
if(nbc+singleVal>0)
{
- int tmp=nbc+singleVal;
+ mcIdType tmp=nbc+singleVal;
return self->buildSubPart(&tmp,&tmp+1);
}
else
return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
}
default:
- throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
}
}
template<class T>
typename MEDCoupling::Traits<T>::FieldType *fieldT__getitem__(const MEDCoupling::MEDCouplingFieldT<T> *self, PyObject *li)
{
- const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call Available API are : \n-myField[dataArrayInt]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[dataArrayInt,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
+ const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call Available API are : \n-myField[DataArrayIdType]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[DataArrayIdType,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
if(PyTuple_Check(li))
{
Py_ssize_t sz=PyTuple_Size(li);
if(sz!=2)
throw INTERP_KERNEL::Exception(msg);
PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
+ mcIdType sw;
+ std::size_t singleVal;
+ std::vector<std::size_t> multiVal;
+ std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
+ MEDCoupling::DataArrayIdType *daIntTyypp=0;
if(!self->getArray())
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
try
{
case 1:
{
- std::vector<int> v2(1,singleVal);
+ std::vector<std::size_t> v2(1,singleVal);
MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aarr(ret0Arr->keepSelectedComponents(v2));
ret0->setArray(aarr);
return ret0.retn();
}
case 3:
{
- int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !"));
- std::vector<int> v2(nbOfComp);
- for(int i=0;i<nbOfComp;i++)
+ mcIdType nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !"));
+ std::vector<std::size_t> v2(nbOfComp);
+ for(mcIdType i=0;i<nbOfComp;i++)
v2[i]=slic.first+i*slic.second.second;
MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aarr(ret0Arr->keepSelectedComponents(v2));
ret0->setArray(aarr);
PyObject *field_getTinySerializationInformation(const FIELDT *self)
{
std::vector<double> a0;
- std::vector<int> a1;
+ std::vector<mcIdType> a1;
std::vector<std::string> a2;
self->getTinySerializationDbleInformation(a0);
self->getTinySerializationIntInformation(a1);
PyObject *ret(PyTuple_New(3));
PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
- int sz(a2.size());
+ mcIdType sz(a2.size());
PyObject *ret2(PyList_New(sz));
{
- for(int i=0;i<sz;i++)
+ for(mcIdType i=0;i<sz;i++)
PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
}
PyTuple_SetItem(ret,2,ret2);
template<class T>
PyObject *field_serialize(const typename MEDCoupling::Traits<T>::FieldType *self)
{
- MEDCoupling::DataArrayInt *ret0(0);
+ MEDCoupling::DataArrayIdType *ret0(0);
std::vector<typename MEDCoupling::Traits<T>::ArrayType *> ret1;
self->serialize(ret0,ret1);
if(ret0)
ret0->incrRef();
std::size_t sz(ret1.size());
PyObject *ret(PyTuple_New(2));
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyObject *ret1Py(PyList_New(sz));
for(std::size_t i=0;i<sz;i++)
{
static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
if(!PyTuple_Check(inp))
throw INTERP_KERNEL::Exception(MSG);
- int sz(PyTuple_Size(inp));
+ mcIdType sz(PyTuple_Size(inp));
if(sz!=3)
throw INTERP_KERNEL::Exception(MSG);
// mesh
PyObject *elt0(PyTuple_GetItem(inp,0));
PyObject *elt1(PyTuple_GetItem(inp,1));
std::vector<double> a0;
- std::vector<int> a1;
+ std::vector<mcIdType> a1;
std::vector<std::string> a2;
- MEDCoupling::DataArrayInt *b0(0);
+ MEDCoupling::DataArrayIdType *b0(0);
std::vector<typename MEDCoupling::Traits<T>::ArrayType *>b1;
{
if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
throw INTERP_KERNEL::Exception(MSG);
PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
- int tmp(-1);
+ mcIdType tmp(-1);
fillArrayWithPyListDbl3(a0py,tmp,a0);
convertPyToNewIntArr3(a1py,a1);
fillStringVector(a2py,a2);
throw INTERP_KERNEL::Exception(MSG);
PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
void *argp(0);
- int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
+ int status(SWIG_ConvertPtr(b0py,&argp,SWIGTITraits<mcIdType>::TI,0|0));
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception(MSG);
- b0=reinterpret_cast<MEDCoupling::DataArrayInt *>(argp);
+ b0=reinterpret_cast<MEDCoupling::DataArrayIdType *>(argp);
convertFromPyObjVectorOfObj<typename MEDCoupling::Traits<T>::ArrayType *>(b1py,SWIGTITraits<T>::TI,MEDCoupling::Traits<T>::ArrayTypeName,b1);
}
self->checkForUnserialization(a1,b0,b1);
self->finishUnserialization(a1,a0,a2);
}
-PyObject *Mesh_getCellsContainingPointsLike(PyObject *p, double eps, const MEDCoupling::MEDCouplingMesh *self, std::function<void(const double *,int,double,MEDCoupling::MCAuto<MEDCoupling::DataArrayInt>&,MEDCoupling::MCAuto<MEDCoupling::DataArrayInt>&)> func)
+PyObject *Mesh_getCellsContainingPointsLike(PyObject *p, double eps, const MEDCoupling::MEDCouplingMesh *self, std::function<void(const double *,mcIdType,double,MEDCoupling::MCAuto<MEDCoupling::DataArrayIdType>&,MEDCoupling::MCAuto<MEDCoupling::DataArrayIdType>&)> func)
{
- MEDCoupling::MCAuto<MEDCoupling::DataArrayInt> elts,eltsIndex;
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayIdType> elts,eltsIndex;
int spaceDim=self->getSpaceDimension();
void *da=0;
int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
if (!SWIG_IsOK(res1))
{
- int size;
+ mcIdType size;
INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
- int nbOfPoints=size/spaceDim;
+ mcIdType nbOfPoints=size/spaceDim;
if(size%spaceDim!=0)
{
throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
if(!da2)
throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
da2->checkAllocated();
- int size=da2->getNumberOfTuples();
- int nbOfCompo=da2->getNumberOfComponents();
+ mcIdType size=da2->getNumberOfTuples();
+ mcIdType nbOfCompo=da2->getNumberOfComponents();
if(nbOfCompo!=spaceDim)
{
throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
func(da2->getConstPointer(),size,eps,elts,eltsIndex);
}
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}