From: eap Date: Fri, 29 Nov 2019 17:17:39 +0000 (+0300) Subject: LOT3: SWIG DataArrayInt64. Create MEDCouplingBasicsTest7.py X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Feap%2FLOT3;p=tools%2Fmedcoupling.git LOT3: SWIG DataArrayInt64. Create MEDCouplingBasicsTest7.py --- diff --git a/src/MEDCoupling_Swig/DataArrayInt.i b/src/MEDCoupling_Swig/DataArrayInt.i index 15497e69e..e33fc70a7 100644 --- a/src/MEDCoupling_Swig/DataArrayInt.i +++ b/src/MEDCoupling_Swig/DataArrayInt.i @@ -20,30 +20,32 @@ %include "MEDCouplingMemArray.i" -namespace MEDCoupling -{ - class DataArrayInt32Iterator; +%define ARRAYDEF( ARRAY, INT ) - class DataArrayInt32 : public DataArray - { +// namespace MEDCoupling +// { +// class ARRAY ## Iterator; + +// class ARRAY : public DataArray -- #ifdef doesn't work inside +// { public: - static DataArrayInt32 *New(); - int intValue() const; - int getHashCode() const; + static ARRAY *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 aggregate(const ARRAY *other); + ARRAY *performCopyOrIncrRef(bool deepCopy) const; + void deepCopyFrom(const ARRAY& other); void reserve(std::size_t nbOfElems); - void pushBackSilent(int val); - int popBackSilent(); + 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 allocIfNecessary(INT nbOfTuple, INT nbOfCompo); + bool isEqual(const ARRAY& other) const; + bool isEqualWithoutConsideringStr(const ARRAY& other) const; + bool isEqualWithoutConsideringStrAndOrder(const ARRAY& other) const; + ARRAY *buildPermutationArr(const ARRAY& other) const; + ARRAY *sumPerTuple() const; void sort(bool asc=true); void reverse(); void checkMonotonic(bool increasing) const; @@ -51,135 +53,131 @@ namespace MEDCoupling void checkStrictlyMonotonic(bool increasing) const; bool isStrictlyMonotonic(bool increasing) const; void fillWithZero(); - void fillWithValue(int val); - void iota(int init=0); + 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; + ARRAY *invertArrayO2N2N2O(INT newNbOfElem) const; + ARRAY *invertArrayN2O2O2N(INT oldNbOfElem) const; + ARRAY *invertArrayO2N2N2OBis(INT newNbOfElem) const; + ARRAY *indicesOfSubPart(const ARRAY& partOfThis) const; + ARRAY *fromNoInterlace() const; + ARRAY *toNoInterlace() const; + ARRAY *selectByTupleIdSafeSlice(INT bg, INT end, INT step) const; + ARRAY *checkAndPreparePermutation() const; + ARRAY *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; + ARRAY *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& tupl) const; - int findIdFirstEqual(int value) const; - int findIdFirstEqual(const std::vector& vals) const; - int findIdSequence(const std::vector& vals) const; - bool presenceOfTuple(const std::vector& tupl) const; - bool presenceOfValue(int value) const; - bool presenceOfValue(const std::vector& vals) const; - int count(int value) const; - int accumulate(int compId) const; - int getMaxValueInArray() const; - int getMaxAbsValueInArray() const; - int getMinValueInArray() const; + ARRAY *changeNbOfComponents(INT newNbOfComp, INT dftValue) const; + void meldWith(const ARRAY *other); + void setPartOfValues1(const ARRAY *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 ARRAY *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; + ARRAY ## Iterator *iterator(); + const INT *begin() const; + const INT *end() const; + ARRAY *findIdsEqual(INT val) const; + ARRAY *findIdsNotEqual(INT val) const; + INT changeValue(INT oldValue, INT newValue); + INT findIdFirstEqualTuple(const std::vector& tupl) const; + INT findIdFirstEqual(INT value) const; + INT findIdFirstEqual(const std::vector& vals) const; + INT findIdSequence(const std::vector& vals) const; + bool presenceOfTuple(const std::vector& tupl) const; + bool presenceOfValue(INT value) const; + bool presenceOfValue(const std::vector& 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& groups, mcIdType newNb, std::vector< std::vector >& fidsOfGroups); - static DataArrayInt32 *BuildUnion(const std::vector& arr); - static DataArrayInt32 *BuildIntersection(const std::vector& 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; + ARRAY *computeAbs() const; + void applyLin(INT a, INT b, INT compoId); + void applyLin(INT a, INT b); + void applyInv(INT numerator); + ARRAY *negate() const; + void applyDivideBy(INT val); + void applyModulus(INT val); + void applyRModulus(INT val); + void applyPow(INT val); + void applyRPow(INT val); + ARRAY *findIdsInRange(INT vmin, INT vmax) const; + ARRAY *findIdsNotInRange(INT vmin, INT vmax) const; + ARRAY *findIdsStrictlyNegative() const; + bool checkAllIdsInRange(INT vmin, INT vmax) const; + static ARRAY *Aggregate(const ARRAY *a1, const ARRAY *a2, INT offsetA2); + static ARRAY *Meld(const ARRAY *a1, const ARRAY *a2); + static DataArrayIdType *MakePartition(const std::vector& groups, mcIdType newNb, std::vector< std::vector >& fidsOfGroups); + static ARRAY *BuildUnion(const std::vector& arr); + static ARRAY *BuildIntersection(const std::vector& arr); + static ARRAY *FindPermutationFromFirstToSecond(const ARRAY *ids1, const ARRAY *ids2); + ARRAY *buildComplement(INT nbOfElement) const; + ARRAY *buildSubstraction(const ARRAY *other) const; + ARRAY *buildSubstractionOptimized(const ARRAY *other) const; + ARRAY *buildUnion(const ARRAY *other) const; + ARRAY *buildIntersection(const ARRAY *other) const; + ARRAY *buildUnique() const; + ARRAY *buildUniqueNotSorted() const; + ARRAY *deltaShiftIndex() const; void computeOffsets(); void computeOffsetsFull(); - DataArrayInt32 *buildExplicitArrByRanges(const DataArrayInt32 *offsets) const; - DataArrayInt32 *findRangeIdForEachTuple(const DataArrayInt32 *ranges) const; - DataArrayInt32 *findIdInRangeForEachTuple(const DataArrayInt32 *ranges) const; + ARRAY *buildExplicitArrByRanges(const ARRAY *offsets) const; + ARRAY *findRangeIdForEachTuple(const ARRAY *ranges) const; + ARRAY *findIdInRangeForEachTuple(const ARRAY *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 fromLinkedListOfPairToList() const; - MCAuto findIdsGreaterOrEqualTo(int val) const; - MCAuto findIdsGreaterThan(int val) const; - MCAuto findIdsLowerOrEqualTo(int val) const; - MCAuto findIdsLowerThan(int val) const; - MCAuto selectPartDef(const PartDefinition* pd) const; + ARRAY *duplicateEachTupleNTimes(INT nbTimes) const; + ARRAY *getDifferentValues() const; + static ARRAY *Add(const ARRAY *a1, const ARRAY *a2); + void addEqual(const ARRAY *other); + static ARRAY *Substract(const ARRAY *a1, const ARRAY *a2); + void substractEqual(const ARRAY *other); + static ARRAY *Multiply(const ARRAY *a1, const ARRAY *a2); + void multiplyEqual(const ARRAY *other); + static ARRAY *Divide(const ARRAY *a1, const ARRAY *a2); + void divideEqual(const ARRAY *other); + static ARRAY *Modulus(const ARRAY *a1, const ARRAY *a2); + void modulusEqual(const ARRAY *other); + static ARRAY *Pow(const ARRAY *a1, const ARRAY *a2); + void powEqual(const ARRAY *other); + MCAuto fromLinkedListOfPairToList() const; + MCAuto findIdsGreaterOrEqualTo(INT val) const; + MCAuto findIdsGreaterThan(INT val) const; + MCAuto findIdsLowerOrEqualTo(INT val) const; + MCAuto findIdsLowerThan(INT val) const; + MCAuto selectPartDef(const PartDefinition* pd) const; MCAuto convertToDblArr() const; MCAuto convertToFloatArr() const; public: - static DataArrayInt32 *Range(int begin, int end, int step); + static ARRAY *Range(INT begin, INT end, INT step); %extend { - DataArrayInt32() + ARRAY() { - return DataArrayInt32::New(); + return ARRAY::New(); } - static DataArrayInt32 *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) + static ARRAY *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)"; + const char *msgBase="MEDCoupling::ARRAY::New : Available API are : \n-ARRAY.New()\n-ARRAY.New([1,3,4])\n-ARRAY.New([1,3,4],3)\n-ARRAY.New([1,3,4,5],2,2)\n-ARRAY.New([1,3,4,5,7,8],3,2)\n-ARRAY.New([(1,3),(4,5),(7,8)])\n-ARRAY.New(5)\n-ARRAY.New(5,2)"; std::string msg(msgBase); -#ifdef WITH_NUMPY - msg+="\n-DataArrayInt32.New(numpy array with dtype=int32)"; -#endif + if ( MEDCouplingHasNumPyBindings() ) + msg+="\n-ARRAY.New(numpy array with dtype=int32)"; + msg+=" !"; if(PyList_Check(elt0) || PyTuple_Check(elt0)) { @@ -189,16 +187,16 @@ namespace MEDCoupling { mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples); if(nbOfTuples1<0) - throw INTERP_KERNEL::Exception("DataArrayInt32::New : should be a positive set of allocated memory !"); + throw INTERP_KERNEL::Exception("ARRAY::New : should be a positive set of allocated memory !"); if(nbOfComp) { if(PyInt_Check(nbOfComp)) - {//DataArrayInt32.New([1,3,4,5],2,2) + {//ARRAY.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 ret=DataArrayInt32::New(); - std::vector tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo); + throw INTERP_KERNEL::Exception("ARRAY::New : should be a positive number of components !"); + MCAuto ret=ARRAY::New(); + std::vector tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo); ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer()); return ret.retn(); } @@ -206,10 +204,10 @@ namespace MEDCoupling throw INTERP_KERNEL::Exception(msg.c_str()); } else - {//DataArrayInt32.New([1,3,4],3) - MCAuto ret=DataArrayInt32::New(); + {//ARRAY.New([1,3,4],3) + MCAuto ret=ARRAY::New(); mcIdType tmpp1=-1; - std::vector tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1); + std::vector tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1); ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer()); return ret.retn(); } @@ -218,29 +216,29 @@ namespace MEDCoupling throw INTERP_KERNEL::Exception(msg.c_str()); } else - {// DataArrayInt32.New([1,3,4]) - MCAuto ret=DataArrayInt32::New(); + {// ARRAY.New([1,3,4]) + MCAuto ret=ARRAY::New(); mcIdType tmpp1=-1,tmpp2=-1; - std::vector tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2); + std::vector 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); + INT nbOfTuples1=PyInt_AS_LONG(elt0); if(nbOfTuples1<0) - throw INTERP_KERNEL::Exception("DataArrayInt32::New : should be a positive set of allocated memory !"); + throw INTERP_KERNEL::Exception("ARRAY::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); + {//ARRAY.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 ret=DataArrayInt32::New(); + throw INTERP_KERNEL::Exception("ARRAY::New : should be a positive number of components !"); + MCAuto ret=ARRAY::New(); ret->alloc(nbOfTuples1,nbOfCompo); return ret.retn(); } @@ -251,26 +249,24 @@ namespace MEDCoupling throw INTERP_KERNEL::Exception(msg.c_str()); } else - {//DataArrayInt32.New(5) - MCAuto ret=DataArrayInt32::New(); + {//ARRAY.New(5) + MCAuto ret=ARRAY::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(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32"); + else if(MEDCouplingHasNumPyBindings() && PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL) + {//ARRAY.New(numpyArray) + return BuildNewInstance(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) + ARRAY(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) { - return MEDCoupling_DataArrayInt32_New__SWIG_1(elt0,nbOfTuples,nbOfComp); + return MEDCoupling_ ## ARRAY ## _New__SWIG_1(elt0,nbOfTuples,nbOfComp); } std::string __str__() const @@ -278,7 +274,7 @@ namespace MEDCoupling return self->reprNotTooLong(); } - int __len__() const + INT __len__() const { if(self->isAllocated()) { @@ -286,16 +282,16 @@ namespace MEDCoupling } else { - throw INTERP_KERNEL::Exception("DataArrayInt32::__len__ : Instance is NOT allocated !"); + throw INTERP_KERNEL::Exception("ARRAY::__len__ : Instance is NOT allocated !"); } } - int __int__() const + INT __int__() const { return self->intValue(); } - DataArrayInt32Iterator *__iter__() + ARRAY ## Iterator *__iter__() { return self->iterator(); } @@ -303,12 +299,12 @@ namespace MEDCoupling PyObject *accumulate() const { mcIdType sz=self->getNumberOfComponents(); - INTERP_KERNEL::AutoPtr tmp=new int[sz]; - self->accumulate((int *)tmp); - return convertIntArrToPyList((const int *)tmp,sz); + INTERP_KERNEL::AutoPtr tmp=new INT[sz]; + self->accumulate((INT *)tmp); + return convertIntArrToPyList((const INT *)tmp,sz); } - DataArrayInt32 *accumulatePerChunck(PyObject *indexArr) const + ARRAY *accumulatePerChunck(PyObject *indexArr) const { mcIdType sw,sz,val; std::vector val2; @@ -319,18 +315,18 @@ namespace MEDCoupling DataArrayIdType *findIdsEqualTuple(PyObject *inputTuple) const { mcIdType sw,sz; - int val; - std::vector val2; - const int *bg(convertIntStarLikePyObjToCppIntStar(inputTuple,sw,sz,val,val2)); + INT val; + std::vector 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 val2; - const int *bg(convertIntStarLikePyObjToCppIntStar(vals,sw,sz,val,val2)); + INT val; + std::vector val2; + const INT *bg(convertIntStarLikePyObjToCppIntStar(vals,sw,sz,val,val2)); MCAuto ret(self->findIdForEach(bg,bg+sz)); return ret.retn(); } @@ -344,20 +340,20 @@ namespace MEDCoupling return ret; } - DataArrayInt32 *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const + ARRAY *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const { if(!PySlice_Check(slic)) - throw INTERP_KERNEL::Exception("DataArrayInt32::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !"); + throw INTERP_KERNEL::Exception("ARRAY::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::max() || stp==std::numeric_limits::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 !"); + GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"ARRAY::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !"); + if(strt==std::numeric_limits::max() || stp==std::numeric_limits::max()) + throw INTERP_KERNEL::Exception("ARRAY::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; + INT a,b; self->getMinMaxValues(a,b); PyObject *ret=PyTuple_New(2); PyTuple_SetItem(ret,0,PyInt_FromLong(a)); @@ -369,12 +365,12 @@ namespace MEDCoupling { mcIdType newNbOfTuples=-1; mcIdType szArr,szArrI,sw,iTypppArrI; - int iTypppArr; - std::vector stdvecTyyppArr; + INT iTypppArr; + std::vector stdvecTyyppArr; std::vector stdvecTyyppArrI; - const int *arrPtr=convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr); + 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); + DataArrayIdType *ret0=MEDCoupling::ARRAY::ConvertIndexArrayToO2N(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples); PyObject *ret=PyTuple_New(2); PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTITraits::TI,SWIG_POINTER_OWN | 0)); PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples)); @@ -385,17 +381,17 @@ namespace MEDCoupling { MCAuto ret(DataArrayIdType::New()); mcIdType szArr,sw; - int iTypppArr; - std::vector stdvecTyyppArr; - const int *arrPtr(convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr)); - mcIdType *pt(MEDCoupling::DataArrayInt32::CheckAndPreparePermutation(arrPtr,arrPtr+szArr)); + INT iTypppArr; + std::vector stdvecTyyppArr; + const INT *arrPtr(convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr)); + mcIdType *pt(MEDCoupling::ARRAY::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 !"; + const char *msg="MEDCoupling::ARRAY::setValues : Available API are : \n-ARRAY.setValues([1,3,4])\n-ARRAY.setValues([1,3,4],3)\n-ARRAY.setValues([1,3,4,5],2,2)\n-ARRAY.New(5)\n !"; if(PyList_Check(li) || PyTuple_Check(li)) { if(nbOfTuples && nbOfTuples != Py_None) @@ -404,24 +400,24 @@ namespace MEDCoupling { mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples); if(nbOfTuples1<0) - throw INTERP_KERNEL::Exception("DataArrayInt32::setValue : should be a positive set of allocated memory !"); + throw INTERP_KERNEL::Exception("ARRAY::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) + {//ARRAY.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 tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo); + throw INTERP_KERNEL::Exception("ARRAY::setValue : should be a positive number of components !"); + std::vector tmp=fillArrayWithPyListInt2(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) + {//ARRAY.setValues([1,3,4],3) mcIdType tmpp1=-1; - std::vector tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1); + std::vector tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1); self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer()); } } @@ -429,9 +425,9 @@ namespace MEDCoupling throw INTERP_KERNEL::Exception(msg); } else - {// DataArrayInt32.setValues([1,3,4]) + {// ARRAY.setValues([1,3,4]) mcIdType tmpp1=-1,tmpp2=-1; - std::vector tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2); + std::vector tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2); self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer()); } } @@ -441,18 +437,11 @@ namespace MEDCoupling PyObject *getValues() const { - const int *vals=self->getConstPointer(); + const INT *vals=self->getConstPointer(); return convertIntArrToPyList(vals,self->getNbOfElems()); } -#ifdef WITH_NUMPY - PyObject *toNumPyArray() // not const. It is not a bug ! - { - return ToNumPyArray(self,NPY_INT32,"DataArrayInt32"); - } -#endif - - PyObject *isEqualIfNotWhy(const DataArrayInt32& other) const + PyObject *isEqualIfNotWhy(const ARRAY& other) const { std::string ret1; bool ret0=self->isEqualIfNotWhy(other,ret1); @@ -466,7 +455,7 @@ namespace MEDCoupling PyObject *getValuesAsTuple() const { - const int *vals=self->getConstPointer(); + const INT *vals=self->getConstPointer(); mcIdType nbOfComp=self->getNumberOfComponents(); mcIdType nbOfTuples=self->getNumberOfTuples(); return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples); @@ -474,10 +463,10 @@ namespace MEDCoupling static PyObject *MakePartition(PyObject *gps, mcIdType newNb) { - std::vector groups; + std::vector groups; std::vector< std::vector > fidsOfGroups; - convertFromPyObjVectorOfObj(gps,SWIGTITraits::TI,"DataArrayInt32",groups); - DataArrayIdType *ret0=MEDCoupling::DataArrayInt32::MakePartition(groups,newNb,fidsOfGroups); + convertFromPyObjVectorOfObj(gps,SWIGTITraits::TI,"ARRAY",groups); + DataArrayIdType *ret0=MEDCoupling::ARRAY::MakePartition(groups,newNb,fidsOfGroups); PyObject *ret = PyList_New(2); PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); mcIdType sz=fidsOfGroups.size(); @@ -488,40 +477,13 @@ namespace MEDCoupling return ret; } -#ifndef MEDCOUPLING_USE_64BIT_IDS - void transformWithIndArr(PyObject *li) - { - void *da=0; - int res1(SWIG_ConvertPtr(li,&da,SWIGTITraits::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(da); - self->transformWithIndArr(*m); - } - else - { - mcIdType size; - INTERP_KERNEL::AutoPtr tmp=convertPyToNewIntArr2(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 multiVal; + INT singleVal; + std::vector multiVal; std::pair > slic; - DataArrayInt32 *daIntTyypp=0; + ARRAY *daIntTyypp=0; convertIntStarOrSliceLikePyObjToCpp(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp); switch(sw) { @@ -532,17 +494,17 @@ namespace MEDCoupling 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 !"); + throw INTERP_KERNEL::Exception("ARRAY::findIdsEqualList : unrecognized type entered, expected list of int, tuple of int or ARRAY !"); } } DataArrayIdType *findIdsNotEqualList(PyObject *obj) { mcIdType sw; - int singleVal; - std::vector multiVal; + INT singleVal; + std::vector multiVal; std::pair > slic; - DataArrayInt32 *daIntTyypp=0; + ARRAY *daIntTyypp=0; convertIntStarOrSliceLikePyObjToCpp(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp); switch(sw) { @@ -553,26 +515,26 @@ namespace MEDCoupling 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 !"); + throw INTERP_KERNEL::Exception("ARRAY::findIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or ARRAY !"); } } PyObject *splitByValueRange(PyObject *li) const { - DataArrayInt32 *ret0=0,*ret1=0,*ret2=0; + ARRAY *ret0=0,*ret1=0,*ret2=0; void *da=0; int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits::TI, 0 | 0 ); if (!SWIG_IsOK(res1)) { mcIdType size; - INTERP_KERNEL::AutoPtr tmp=convertPyToNewIntArr2(li,&size); - self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2); + INTERP_KERNEL::AutoPtr tmp=convertPyToNewIntArr2(li,&size); + self->splitByValueRange(tmp,(INT *)tmp+size,ret0,ret1,ret2); } else { - DataArrayInt32 *da2=reinterpret_cast< DataArrayInt32 * >(da); + ARRAY *da2=reinterpret_cast< ARRAY * >(da); if(!da2) - throw INTERP_KERNEL::Exception("Not null DataArrayInt32 instance expected !"); + throw INTERP_KERNEL::Exception("Not null ARRAY instance expected !"); da2->checkAllocated(); self->splitByValueRange(da2->begin(),da2->end(),ret0,ret1,ret2); } @@ -590,17 +552,17 @@ namespace MEDCoupling if (!SWIG_IsOK(res1)) { mcIdType size; - INTERP_KERNEL::AutoPtr tmp=convertPyToNewIntArr2(li,&size); + INTERP_KERNEL::AutoPtr tmp=convertPyToNewIntArr2(li,&size); return self->transformWithIndArrR(tmp,tmp+size); } else { - DataArrayInt32 *da2=reinterpret_cast< DataArrayInt32 * >(da); + ARRAY *da2=reinterpret_cast< ARRAY * >(da); return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems()); } } - DataArrayInt32 *renumberAndReduce(PyObject *li, mcIdType newNbOfTuple) + ARRAY *renumberAndReduce(PyObject *li, mcIdType newNbOfTuple) { void *da=0; int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits::TI, 0 | 0 ); @@ -629,7 +591,7 @@ namespace MEDCoupling } } - DataArrayInt32 *renumber(PyObject *li) + ARRAY *renumber(PyObject *li) { void *da=0; int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits::TI, 0 | 0 ); @@ -658,7 +620,7 @@ namespace MEDCoupling } } - DataArrayInt32 *renumberR(PyObject *li) + ARRAY *renumberR(PyObject *li) { void *da=0; int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits::TI, 0 | 0 ); @@ -687,7 +649,7 @@ namespace MEDCoupling } } - void setSelectedComponents(const DataArrayInt32 *a, PyObject *li) + void setSelectedComponents(const ARRAY *a, PyObject *li) { std::vector tmp; convertPyToNewIntArr3(li,tmp); @@ -696,7 +658,7 @@ namespace MEDCoupling PyObject *explodeComponents() const { - std::vector< MCAuto > retCpp(self->explodeComponents()); + std::vector< MCAuto > retCpp(self->explodeComponents()); std::size_t sz(retCpp.size()); PyObject *res(PyList_New(sz)); for(std::size_t i=0;igetNumberOfComponents(); - INTERP_KERNEL::AutoPtr tmp=new int[sz]; + INTERP_KERNEL::AutoPtr tmp=new INT[sz]; self->getTuple(tupleId,tmp); - return convertIntArrToPyList((const int*)tmp,sz); + return convertIntArrToPyList((const INT*)tmp,sz); } - PyObject *changeSurjectiveFormat(int targetNb) const + PyObject *changeSurjectiveFormat(INT targetNb) const { DataArrayIdType *arr=0; DataArrayIdType *arrI=0; @@ -723,45 +685,45 @@ namespace MEDCoupling return res; } - static DataArrayInt32 *Meld(PyObject *li) + static ARRAY *Meld(PyObject *li) { - std::vector tmp; - convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"DataArrayInt32",tmp); - return DataArrayInt32::Meld(tmp); + std::vector tmp; + convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"ARRAY",tmp); + return ARRAY::Meld(tmp); } - static DataArrayInt32 *Aggregate(PyObject *li) + static ARRAY *Aggregate(PyObject *li) { - std::vector tmp; - convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"DataArrayInt32",tmp); - return DataArrayInt32::Aggregate(tmp); + std::vector tmp; + convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"ARRAY",tmp); + return ARRAY::Aggregate(tmp); } - static DataArrayInt32 *AggregateIndexes(PyObject *li) + static ARRAY *AggregateIndexes(PyObject *li) { - std::vector tmp; - convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"DataArrayInt32",tmp); - return DataArrayInt32::AggregateIndexes(tmp); + std::vector tmp; + convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"ARRAY",tmp); + return ARRAY::AggregateIndexes(tmp); } - static DataArrayInt32 *BuildUnion(PyObject *li) + static ARRAY *BuildUnion(PyObject *li) { - std::vector tmp; - convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"DataArrayInt32",tmp); - return DataArrayInt32::BuildUnion(tmp); + std::vector tmp; + convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"ARRAY",tmp); + return ARRAY::BuildUnion(tmp); } - static DataArrayInt32 *BuildIntersection(PyObject *li) + static ARRAY *BuildIntersection(PyObject *li) { - std::vector tmp; - convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"DataArrayInt32",tmp); - return DataArrayInt32::BuildIntersection(tmp); + std::vector tmp; + convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"ARRAY",tmp); + return ARRAY::BuildIntersection(tmp); } PyObject *getMaxValue() const { mcIdType tmp; - int r1=self->getMaxValue(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)); @@ -771,7 +733,7 @@ namespace MEDCoupling PyObject *getMaxAbsValue(std::size_t& tupleId) const { std::size_t tmp; - int r1=self->getMaxAbsValue(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)); @@ -781,7 +743,7 @@ namespace MEDCoupling PyObject *getMinValue() const { mcIdType tmp; - int r1=self->getMinValue(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)); @@ -797,15 +759,15 @@ namespace MEDCoupling { if(PyInt_Check(obj)) { - int val=(int)PyInt_AS_LONG(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 !"); + throw INTERP_KERNEL::Exception("ARRAY::index : 'this' contains one component and trying to find an element which is not an integer !"); } default: { - std::vector arr; + std::vector arr; convertPyToNewIntArr3(obj,arr); return self->findIdFirstEqualTuple(arr); } @@ -823,15 +785,15 @@ namespace MEDCoupling { if(PyInt_Check(obj)) { - int val=(int)PyInt_AS_LONG(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 !"); + throw INTERP_KERNEL::Exception("ARRAY::__contains__ : 'this' contains one component and trying to find an element which is not an integer !"); } default: { - std::vector arr; + std::vector arr; convertPyToNewIntArr3(obj,arr); return self->presenceOfTuple(arr); } @@ -840,8 +802,8 @@ namespace MEDCoupling 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) !"; + const char msg[]="Unexpected situation in ARRAY::__getitem__ !"; + const char msg2[]="ARRAY::__getitem__ : Mismatch of slice values in 2nd parameter (components) !"; self->checkAllocated(); mcIdType nbOfTuples=self->getNumberOfTuples(); mcIdType nbOfComponents=self->getNumberOfComponents(); @@ -853,7 +815,7 @@ namespace MEDCoupling DataArrayIdType *dt1=0,*dc1=0; mcIdType sw; convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1); - MCAuto ret; + MCAuto ret; switch(sw) { case 1: @@ -913,7 +875,7 @@ namespace MEDCoupling ret=self->selectByTupleIdSafe(&it1,&it1+1); mcIdType nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2); std::vector v2(nbOfComp); - for(int i=0;ikeepSelectedComponents(v2)),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 ); } @@ -922,7 +884,7 @@ namespace MEDCoupling ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size()); mcIdType nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2); std::vector v2(nbOfComp); - for(int i=0;ikeepSelectedComponents(v2)),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 ); } @@ -940,7 +902,7 @@ namespace MEDCoupling ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems()); mcIdType nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2); std::vector v2(nbOfComp); - for(int i=0;ikeepSelectedComponents(v2)),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 ); } @@ -949,24 +911,24 @@ namespace MEDCoupling } } - DataArrayInt32 *__setitem__(PyObject *obj, PyObject *value) + ARRAY *__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 v1; - DataArrayInt32 *d1=0; - DataArrayInt32Tuple *dd1=0; + INT i1; + std::vector v1; + ARRAY *d1=0; + ARRAY ## Tuple *dd1=0; convertIntStarLikePyObjToCpp(value,sw1,i1,v1,d1,dd1); mcIdType it1,ic1; std::vector vt1,vc1; std::pair > pt1,pc1; DataArrayIdType *dt1=0,*dc1=0; convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1); - MCAuto tmp; + MCAuto tmp; switch(sw2) { case 1: @@ -977,7 +939,7 @@ namespace MEDCoupling self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1001,7 +963,7 @@ namespace MEDCoupling self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1025,7 +987,7 @@ namespace MEDCoupling self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1049,7 +1011,7 @@ namespace MEDCoupling self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1073,7 +1035,7 @@ namespace MEDCoupling self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1097,7 +1059,7 @@ namespace MEDCoupling self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1121,7 +1083,7 @@ namespace MEDCoupling self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1145,7 +1107,7 @@ namespace MEDCoupling self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1169,7 +1131,7 @@ namespace MEDCoupling self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size()); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1193,7 +1155,7 @@ namespace MEDCoupling self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size()); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1217,7 +1179,7 @@ namespace MEDCoupling 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=ARRAY::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; @@ -1241,7 +1203,7 @@ namespace MEDCoupling self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size()); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1265,7 +1227,7 @@ namespace MEDCoupling self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second); return self; case 2: - tmp=DataArrayInt32::New(); + tmp=ARRAY::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; @@ -1289,7 +1251,7 @@ namespace MEDCoupling 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=ARRAY::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; @@ -1313,7 +1275,7 @@ namespace MEDCoupling 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=ARRAY::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; @@ -1337,7 +1299,7 @@ namespace MEDCoupling 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=ARRAY::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; @@ -1359,73 +1321,73 @@ namespace MEDCoupling return self; } - DataArrayInt32 *__neg__() const + ARRAY *__neg__() const { return self->negate(); } - DataArrayInt32 *__add__(PyObject *obj) + ARRAY *__add__(PyObject *obj) { const char msg[]="Unexpected situation in __add__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayIntTuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyLin(1,val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Add(self,aaaa); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Add(self,aaaa); } case 3: { - return DataArrayInt32::Add(self,a); + return ARRAY::Add(self,a); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Add(self,aaaa); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Add(self,aaaa); } default: throw INTERP_KERNEL::Exception(msg); } } - DataArrayInt32 *__radd__(PyObject *obj) + ARRAY *__radd__(PyObject *obj) { const char msg[]="Unexpected situation in __radd__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayIntTuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyLin(1,val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Add(self,aaaa); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Add(self,aaaa); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Add(self,aaaa); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Add(self,aaaa); } default: throw INTERP_KERNEL::Exception(msg); @@ -1435,10 +1397,10 @@ namespace MEDCoupling PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) { const char msg[]="Unexpected situation in __iadd__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) @@ -1451,7 +1413,7 @@ namespace MEDCoupling } case 2: { - MCAuto bb=DataArrayInt32::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + MCAuto bb=ARRAY::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); self->addEqual(bb); Py_XINCREF(trueSelf); return trueSelf; @@ -1464,7 +1426,7 @@ namespace MEDCoupling } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); self->addEqual(aaaa); Py_XINCREF(trueSelf); return trueSelf; @@ -1474,68 +1436,68 @@ namespace MEDCoupling } } - DataArrayInt32 *__sub__(PyObject *obj) + ARRAY *__sub__(PyObject *obj) { const char msg[]="Unexpected situation in __sub__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyLin(1,-val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Substract(self,aaaa); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Substract(self,aaaa); } case 3: { - return DataArrayInt32::Substract(self,a); + return ARRAY::Substract(self,a); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Substract(self,aaaa); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Substract(self,aaaa); } default: throw INTERP_KERNEL::Exception(msg); } } - DataArrayInt32 *__rsub__(PyObject *obj) + ARRAY *__rsub__(PyObject *obj) { const char msg[]="Unexpected situation in __rsub__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyLin(-1,val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Substract(aaaa,self); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Substract(aaaa,self); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Substract(aaaa,self); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Substract(aaaa,self); } default: throw INTERP_KERNEL::Exception(msg); @@ -1545,10 +1507,10 @@ namespace MEDCoupling PyObject *___isub___(PyObject *trueSelf, PyObject *obj) { const char msg[]="Unexpected situation in __isub__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) @@ -1561,7 +1523,7 @@ namespace MEDCoupling } case 2: { - MCAuto bb=DataArrayInt32::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + MCAuto bb=ARRAY::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); self->substractEqual(bb); Py_XINCREF(trueSelf); return trueSelf; @@ -1574,7 +1536,7 @@ namespace MEDCoupling } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); self->substractEqual(aaaa); Py_XINCREF(trueSelf); return trueSelf; @@ -1584,68 +1546,68 @@ namespace MEDCoupling } } - DataArrayInt32 *__mul__(PyObject *obj) + ARRAY *__mul__(PyObject *obj) { const char msg[]="Unexpected situation in __mul__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyLin(val,0); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Multiply(self,aaaa); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Multiply(self,aaaa); } case 3: { - return DataArrayInt32::Multiply(self,a); + return ARRAY::Multiply(self,a); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Multiply(self,aaaa); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Multiply(self,aaaa); } default: throw INTERP_KERNEL::Exception(msg); } } - DataArrayInt32 *__rmul__(PyObject *obj) + ARRAY *__rmul__(PyObject *obj) { const char msg[]="Unexpected situation in __rmul__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyLin(val,0); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Multiply(self,aaaa); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Multiply(self,aaaa); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Multiply(self,aaaa); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Multiply(self,aaaa); } default: throw INTERP_KERNEL::Exception(msg); @@ -1655,10 +1617,10 @@ namespace MEDCoupling PyObject *___imul___(PyObject *trueSelf, PyObject *obj) { const char msg[]="Unexpected situation in __imul__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) @@ -1671,7 +1633,7 @@ namespace MEDCoupling } case 2: { - MCAuto bb=DataArrayInt32::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + MCAuto bb=ARRAY::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); self->multiplyEqual(bb); Py_XINCREF(trueSelf); return trueSelf; @@ -1684,7 +1646,7 @@ namespace MEDCoupling } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); self->multiplyEqual(aaaa); Py_XINCREF(trueSelf); return trueSelf; @@ -1694,68 +1656,68 @@ namespace MEDCoupling } } - DataArrayInt32 *__div__(PyObject *obj) + ARRAY *__div__(PyObject *obj) { const char msg[]="Unexpected situation in __div__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyDivideBy(val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Divide(self,aaaa); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Divide(self,aaaa); } case 3: { - return DataArrayInt32::Divide(self,a); + return ARRAY::Divide(self,a); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Divide(self,aaaa); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Divide(self,aaaa); } default: throw INTERP_KERNEL::Exception(msg); } } - DataArrayInt32 *__rdiv__(PyObject *obj) + ARRAY *__rdiv__(PyObject *obj) { const char msg[]="Unexpected situation in __rdiv__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyInv(val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Divide(aaaa,self); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Divide(aaaa,self); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Divide(aaaa,self); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Divide(aaaa,self); } default: throw INTERP_KERNEL::Exception(msg); @@ -1765,10 +1727,10 @@ namespace MEDCoupling PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) { const char msg[]="Unexpected situation in __idiv__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) @@ -1781,7 +1743,7 @@ namespace MEDCoupling } case 2: { - MCAuto bb=DataArrayInt32::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + MCAuto bb=ARRAY::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); self->divideEqual(bb); Py_XINCREF(trueSelf); return trueSelf; @@ -1794,7 +1756,7 @@ namespace MEDCoupling } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); self->divideEqual(aaaa); Py_XINCREF(trueSelf); return trueSelf; @@ -1804,72 +1766,72 @@ namespace MEDCoupling } } - DataArrayInt32 *__mod__(PyObject *obj) + ARRAY *__mod__(PyObject *obj) { const char msg[]="Unexpected situation in __mod__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyModulus(val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Modulus(self,aaaa); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Modulus(self,aaaa); } case 3: { - return DataArrayInt32::Modulus(self,a); + return ARRAY::Modulus(self,a); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Modulus(self,aaaa); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Modulus(self,aaaa); } default: throw INTERP_KERNEL::Exception(msg); } } - DataArrayInt32 *__rmod__(PyObject *obj) + ARRAY *__rmod__(PyObject *obj) { const char msg[]="Unexpected situation in __rmod__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyRModulus(val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Modulus(aaaa,self); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Modulus(aaaa,self); } case 3: { - return DataArrayInt32::Modulus(a,self); + return ARRAY::Modulus(a,self); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Modulus(aaaa,self); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Modulus(aaaa,self); } default: throw INTERP_KERNEL::Exception(msg); @@ -1879,10 +1841,10 @@ namespace MEDCoupling PyObject *___imod___(PyObject *trueSelf, PyObject *obj) { const char msg[]="Unexpected situation in __imod__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) @@ -1901,7 +1863,7 @@ namespace MEDCoupling } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); self->modulusEqual(aaaa); Py_XINCREF(trueSelf); return trueSelf; @@ -1911,72 +1873,72 @@ namespace MEDCoupling } } - DataArrayInt32 *__pow__(PyObject *obj) + ARRAY *__pow__(PyObject *obj) { const char msg[]="Unexpected situation in __pow__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyPow(val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Pow(self,aaaa); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Pow(self,aaaa); } case 3: { - return DataArrayInt32::Pow(self,a); + return ARRAY::Pow(self,a); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Pow(self,aaaa); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Pow(self,aaaa); } default: throw INTERP_KERNEL::Exception(msg); } } - DataArrayInt32 *__rpow__(PyObject *obj) + ARRAY *__rpow__(PyObject *obj) { const char msg[]="Unexpected situation in __rpow__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) { case 1: { - MCAuto ret=self->deepCopy(); + MCAuto ret=self->deepCopy(); ret->applyRPow(val); return ret.retn(); } case 2: { - MCAuto aaaa=DataArrayInt32::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); - return DataArrayInt32::Pow(aaaa,self); + MCAuto aaaa=ARRAY::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,aa.size()); + return ARRAY::Pow(aaaa,self); } case 3: { - return DataArrayInt32::Pow(a,self); + return ARRAY::Pow(a,self); } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); - return DataArrayInt32::Pow(aaaa,self); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + return ARRAY::Pow(aaaa,self); } default: throw INTERP_KERNEL::Exception(msg); @@ -1986,10 +1948,10 @@ namespace MEDCoupling PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) { const char msg[]="Unexpected situation in __ipow__ !"; - int val; - DataArrayInt32 *a; - std::vector aa; - DataArrayInt32Tuple *aaa; + INT val; + ARRAY *a; + std::vector aa; + ARRAY ## Tuple *aaa; mcIdType sw; convertIntStarLikePyObjToCpp(obj,sw,val,aa,a,aaa); switch(sw) @@ -2008,7 +1970,7 @@ namespace MEDCoupling } case 4: { - MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); + MCAuto aaaa=aaa->buildDAInt(1,self->getNumberOfComponents()); self->powEqual(aaaa); Py_XINCREF(trueSelf); return trueSelf; @@ -2028,20 +1990,20 @@ namespace MEDCoupling void pushBackValsSilent(PyObject *li) { mcIdType szArr,sw; - int iTypppArr; - std::vector stdvecTyyppArr; - const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr); + INT iTypppArr; + std::vector stdvecTyyppArr; + const INT *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr); self->pushBackValsSilent(tmp,tmp+szArr); } PyObject *partitionByDifferentValues() const { - std::vector ret1; + std::vector ret1; std::vector 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); + PyObject *pyRet0=PyList_New((INT)sz); + PyObject *pyRet1=PyList_New((INT)sz); for(std::size_t i=0;i::TI, SWIG_POINTER_OWN | 0 )); @@ -2052,20 +2014,20 @@ namespace MEDCoupling return pyRet; } - PyObject *findIdsRangesInListOfIds(const DataArrayInt32 *listOfIds) const + PyObject *findIdsRangesInListOfIds(const ARRAY *listOfIds) const { DataArrayIdType *ret0=0; - DataArrayInt32 *ret1=0; + ARRAY *ret1=0; self->findIdsRangesInListOfIds(listOfIds,ret0,ret1); PyObject *pyRet=PyTuple_New(2); PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); return pyRet; } PyObject *isRange() const { - int a(0),b(0),c(0); + 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); @@ -2082,32 +2044,32 @@ namespace MEDCoupling return pyRet; } - static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt32 *arr, DataArrayIdType *arrIndx, mcIdType offsetForRemoval=0) throw(INTERP_KERNEL::Exception) + static bool RemoveIdsFromIndexedArrays(PyObject *li, ARRAY *arr, DataArrayIdType *arrIndx, mcIdType offsetForRemoval=0) throw(INTERP_KERNEL::Exception) { mcIdType sw; - int singleVal; - std::vector multiVal; + INT singleVal; + std::vector multiVal; std::pair > slic; - MEDCoupling::DataArrayInt32 *daIntTyypp=0; + MEDCoupling::ARRAY *daIntTyypp=0; if(!arrIndx) - throw INTERP_KERNEL::Exception("DataArrayInt32::RemoveIdsFromIndexedArrays : null pointer as arrIndex !"); + throw INTERP_KERNEL::Exception("ARRAY::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); + return ARRAY::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval); case 2: - return DataArrayInt32::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval); + return ARRAY::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval); case 4: - return DataArrayInt32::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval); + return ARRAY::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 !"); + throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or ARRAY !"); } } - static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn) throw(INTERP_KERNEL::Exception) + static PyObject *ExtractFromIndexedArrays(PyObject *li, const ARRAY *arrIn, const DataArrayIdType *arrIndxIn) throw(INTERP_KERNEL::Exception) { - DataArrayInt32 *arrOut=0; + ARRAY *arrOut=0; DataArrayIdType *arrIndexOut=0; mcIdType sw; mcIdType singleVal; @@ -2115,27 +2077,27 @@ namespace MEDCoupling std::pair > slic; MEDCoupling::DataArrayIdType *daIntTyypp=0; if(!arrIndxIn) - throw INTERP_KERNEL::Exception("DataArrayInt32::ExtractFromIndexedArrays : null pointer as arrIndxIn !"); + throw INTERP_KERNEL::Exception("ARRAY::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); + ARRAY::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut); break; } case 2: { - DataArrayInt32::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut); + ARRAY::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut); break; } case 4: { - DataArrayInt32::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut); + ARRAY::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 !"); + throw INTERP_KERNEL::Exception("ARRAY::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or ARRAY !"); } PyObject *ret=PyTuple_New(2); PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); @@ -2143,18 +2105,18 @@ namespace MEDCoupling return ret; } - static PyObject *ExtractFromIndexedArraysSlice(mcIdType strt, mcIdType stp, mcIdType step, const DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn) throw(INTERP_KERNEL::Exception) + static PyObject *ExtractFromIndexedArraysSlice(mcIdType strt, mcIdType stp, mcIdType step, const ARRAY *arrIn, const DataArrayIdType *arrIndxIn) throw(INTERP_KERNEL::Exception) { - DataArrayInt32 *arrOut=0; + ARRAY *arrOut=0; DataArrayIdType *arrIndexOut=0; - DataArrayInt32::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut); + ARRAY::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut); PyObject *ret=PyTuple_New(2); PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); return ret; } - static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn) throw(INTERP_KERNEL::Exception) + static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const ARRAY *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 !"); @@ -2165,9 +2127,9 @@ namespace MEDCoupling 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; + ARRAY *arrOut=0; DataArrayIdType *arrIndexOut=0; - DataArrayInt32::ExtractFromIndexedArraysSlice(ToIdType(strt),ToIdType(stp),ToIdType(step),arrIn,arrIndxIn,arrOut,arrIndexOut); + ARRAY::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::TI, SWIG_POINTER_OWN | 0 )); PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); @@ -2175,10 +2137,10 @@ namespace MEDCoupling } static PyObject *SetPartOfIndexedArrays(PyObject *li, - const DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn, - const DataArrayInt32 *srcArr, const DataArrayIdType *srcArrIndex) throw(INTERP_KERNEL::Exception) + const ARRAY *arrIn, const DataArrayIdType *arrIndxIn, + const ARRAY *srcArr, const DataArrayIdType *srcArrIndex) throw(INTERP_KERNEL::Exception) { - DataArrayInt32 *arrOut=0; + ARRAY *arrOut=0; DataArrayIdType *arrIndexOut=0; mcIdType sw; mcIdType singleVal; @@ -2186,27 +2148,27 @@ namespace MEDCoupling std::pair > slic; MEDCoupling::DataArrayIdType *daIntTyypp=0; if(!arrIndxIn) - throw INTERP_KERNEL::Exception("DataArrayInt32::SetPartOfIndexedArrays : null pointer as arrIndex !"); + throw INTERP_KERNEL::Exception("ARRAY::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); + ARRAY::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); + ARRAY::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); + ARRAY::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 !"); + throw INTERP_KERNEL::Exception("ARRAY::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or ARRAY !"); } PyObject *ret=PyTuple_New(2); PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); @@ -2214,8 +2176,8 @@ namespace MEDCoupling return ret; } - static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt32 *arrIn, const DataArrayIdType *arrIndxIn, - const DataArrayInt32 *srcArr, const DataArrayIdType *srcArrIndex) throw(INTERP_KERNEL::Exception) + static void SetPartOfIndexedArraysSameIdx(PyObject *li, ARRAY *arrIn, const DataArrayIdType *arrIndxIn, + const ARRAY *srcArr, const DataArrayIdType *srcArrIndex) throw(INTERP_KERNEL::Exception) { mcIdType sw; mcIdType singleVal; @@ -2223,47 +2185,47 @@ namespace MEDCoupling std::pair > slic; MEDCoupling::DataArrayIdType *daIntTyypp=0; if(!arrIndxIn) - throw INTERP_KERNEL::Exception("DataArrayInt32::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !"); + throw INTERP_KERNEL::Exception("ARRAY::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); + ARRAY::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex); break; } case 2: { - DataArrayInt32::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex); + ARRAY::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex); break; } case 4: { - DataArrayInt32::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex); + ARRAY::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 !"); + throw INTERP_KERNEL::Exception("ARRAY::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or ARRAY !"); } } } // end extent }; - class DataArrayInt32Tuple; + class ARRAY ## Tuple; - class DataArrayInt32Iterator + class ARRAY ## Iterator { public: - DataArrayInt32Iterator(DataArrayInt32 *da); - ~DataArrayInt32Iterator(); + ARRAY ## Iterator(ARRAY *da); + ~ARRAY ## Iterator(); %extend { PyObject *next() { - DataArrayInt32Tuple *ret=self->nextt(); + ARRAY ## Tuple *ret=self->nextt(); if(ret) - return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt32Tuple,SWIG_POINTER_OWN | 0); + return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__ ## ARRAY ## Tuple,SWIG_POINTER_OWN | 0); else { PyErr_SetString(PyExc_StopIteration,"No more data."); @@ -2273,11 +2235,11 @@ namespace MEDCoupling } }; - class DataArrayInt32Tuple + class ARRAY ## Tuple { public: std::size_t getNumberOfCompo() const; - DataArrayInt32 *buildDAInt(int nbOfTuples, int nbOfCompo) const; + ARRAY *buildDAInt(INT nbOfTuples, INT nbOfCompo) const; %extend { std::string __str__() const @@ -2285,51 +2247,51 @@ namespace MEDCoupling return self->repr(); } - int __int__() const + INT __int__() const { return self->intValue(); } - DataArrayInt32 *buildDAInt() + ARRAY *buildDAInt() { return self->buildDAInt(1,self->getNumberOfCompo()); } PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) { - MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); - MEDCoupling_DataArrayInt32____iadd___(ret,0,obj); + MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); + MEDCoupling_ ## ARRAY ## ____iadd___(ret,0,obj); Py_XINCREF(trueSelf); return trueSelf; } PyObject *___isub___(PyObject *trueSelf, PyObject *obj) { - MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); - MEDCoupling_DataArrayInt32____isub___(ret,0,obj); + MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); + MEDCoupling_ ## ARRAY ## ____isub___(ret,0,obj); Py_XINCREF(trueSelf); return trueSelf; } PyObject *___imul___(PyObject *trueSelf, PyObject *obj) { - MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); - MEDCoupling_DataArrayInt32____imul___(ret,0,obj); + MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); + MEDCoupling_ ## ARRAY ## ____imul___(ret,0,obj); Py_XINCREF(trueSelf); return trueSelf; } PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) { - MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); - MEDCoupling_DataArrayInt32____idiv___(ret,0,obj); + MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); + MEDCoupling_ ## ARRAY ## ____idiv___(ret,0,obj); Py_XINCREF(trueSelf); return trueSelf; } PyObject *___imod___(PyObject *trueSelf, PyObject *obj) { - MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); - MEDCoupling_DataArrayInt32____imod___(ret,0,obj); + MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); + MEDCoupling_ ## ARRAY ## ____imod___(ret,0,obj); Py_XINCREF(trueSelf); return trueSelf; } @@ -2341,14 +2303,14 @@ namespace MEDCoupling PyObject *__getitem__(PyObject *obj) { - const char msg2[]="DataArrayInt32Tuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !"; + const char msg2[]="ARRAY ## Tuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !"; mcIdType sw; mcIdType singleVal; std::vector multiVal; std::pair > slic; MEDCoupling::DataArrayIdType *daIntTyypp=0; - const int *pt=self->getConstPointer(); - int nbc=self->getNumberOfCompo(); + const INT *pt=self->getConstPointer(); + INT nbc=self->getNumberOfCompo(); convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp); switch(sw) { @@ -2378,9 +2340,9 @@ namespace MEDCoupling case 2: { PyObject *t=PyTuple_New(multiVal.size()); - for(int j=0;j<(int)multiVal.size();j++) + for(INT j=0;j<(INT)multiVal.size();j++) { - int cid=multiVal[j]; + INT cid=multiVal[j]; if(cid>=nbc) { std::ostringstream oss; @@ -2393,18 +2355,18 @@ namespace MEDCoupling } case 3: { - int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2); + INT sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2); PyObject *t=PyTuple_New(sz); - for(int j=0;j multiValV; std::pair > slicV; - MEDCoupling::DataArrayInt32Tuple *daIntTyyppV=0; - int nbc=self->getNumberOfCompo(); - convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV); - int singleVal; - std::vector multiVal; + MEDCoupling::ARRAY ## Tuple *daIntTyyppV=0; + INT nbc=self->getNumberOfCompo(); + convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV); + INT singleVal; + std::vector multiVal; std::pair > slic; - MEDCoupling::DataArrayInt32 *daIntTyypp=0; - int *pt=self->getPointer(); + MEDCoupling::ARRAY *daIntTyypp=0; + INT *pt=self->getPointer(); convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp); switch(sw2) { @@ -2464,7 +2426,7 @@ namespace MEDCoupling { case 1: { - for(std::vector::const_iterator it=multiVal.begin();it!=multiVal.end();it++) + for(std::vector::const_iterator it=multiVal.begin();it!=multiVal.end();it++) { if(*it>=nbc) { @@ -2484,9 +2446,9 @@ namespace MEDCoupling 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(INT i=0;i<(INT)multiVal.size();i++) { - int pos=multiVal[i]; + INT pos=multiVal[i]; if(pos>=nbc) { std::ostringstream oss; @@ -2499,8 +2461,8 @@ namespace MEDCoupling } case 4: { - const int *ptV=daIntTyyppV->getConstPointer(); - if(nbc>(int)daIntTyyppV->getNumberOfCompo()) + const INT *ptV=daIntTyyppV->getConstPointer(); + if(nbc>(INT)daIntTyyppV->getNumberOfCompo()) { std::ostringstream oss; oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !"; @@ -2515,37 +2477,37 @@ namespace MEDCoupling } case 3: { - int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2); + INT sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2); switch(sw1) { case 1: { - for(int j=0;jgetConstPointer(); - if(sz>(int)daIntTyyppV->getNumberOfCompo()) + 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::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(da); + self->transformWithIndArr(*m); + } + else + { + mcIdType size; + INTERP_KERNEL::AutoPtr tmp=convertPyToNewIntArr2(li,&size); + self->transformWithIndArr(tmp,tmp+size); + } + } + else + { + ARRAY *da2=reinterpret_cast< ARRAY * >(da); + self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems()); + } +} +%enddef + namespace MEDCoupling { - class DataArrayInt64 : public DataArray + class DataArrayInt32Iterator; + + class DataArrayInt32 : 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); + ARRAYDEF( DataArrayInt32, Int32 ) + }; + %extend DataArrayInt32 { #ifdef WITH_NUMPY - msg+="\n-DataArrayInt64.New(numpy array with dtype=int64)"; + PyObject *toNumPyArray() // not const. It is not a bug ! + { + return ToNumPyArray(self,NPY_INT32,"DataArrayInt32"); + } #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 ret=DataArrayInt64::New(); - std::vector 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()); - } - else - {//DataArrayInt64.New([1,3,4],3) - MCAuto ret=DataArrayInt64::New(); - mcIdType tmpp1=-1; - std::vector 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()); - } - else - {// DataArrayInt64.New([1,3,4]) - MCAuto ret=DataArrayInt64::New(); - mcIdType tmpp1=-1,tmpp2=-1; - std::vector 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("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 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 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(elt0,NPY_INT64,&PyCallBackDataArrayInt_RefType,"INT64"); - } +#ifndef MEDCOUPLING_USE_64BIT_IDS + MCAuto< MapII > invertArrayN2O2O2NOptimized() + { + return self->invertArrayN2O2O2NOptimized(); + } + MCAuto< MapII > giveN2OOptimized() + { + return self->giveN2OOptimized(); + } + TRANSFORMWITHINDARR( DataArrayInt32, Int32 ) #endif - else - throw INTERP_KERNEL::Exception(msg.c_str()); - throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy - } + }; + + class DataArrayInt64Iterator; + class DataArrayInt64 : public DataArray + { + ARRAYDEF( DataArrayInt64, Int64 ) + }; + %extend DataArrayInt64 { #ifdef WITH_NUMPY - PyObject *toNumPyArray() // not const. It is not a bug ! - { - return ToNumPyArray(self,NPY_INT64,"DataArrayInt64"); - } + PyObject *toNumPyArray() // not const. It is not a bug ! + { + return ToNumPyArray(self,NPY_INT64,"DataArrayInt64"); + } #endif +#ifdef MEDCOUPLING_USE_64BIT_IDS + MCAuto< MapII > invertArrayN2O2O2NOptimized() + { + return self->invertArrayN2O2O2NOptimized(); } - }; - - class DataArrayInt64Tuple; - - class DataArrayInt64Iterator - { - public: - DataArrayInt64Iterator(DataArrayInt64 *da); - ~DataArrayInt64Iterator(); - %extend + MCAuto< MapII > giveN2OOptimized() { - 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; - } - } + return self->giveN2OOptimized(); } - }; - - 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 ret=self->buildDAInt(1,self->getNumberOfCompo()); - // MEDCoupling_DataArrayInt64____iadd___(ret,0,obj); - // Py_XINCREF(trueSelf); - // return trueSelf; - // } - - // PyObject *___isub___(PyObject *trueSelf, PyObject *obj) - // { - // MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); - // MEDCoupling_DataArrayInt64____isub___(ret,0,obj); - // Py_XINCREF(trueSelf); - // return trueSelf; - // } - - // PyObject *___imul___(PyObject *trueSelf, PyObject *obj) - // { - // MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); - // MEDCoupling_DataArrayInt64____imul___(ret,0,obj); - // Py_XINCREF(trueSelf); - // return trueSelf; - // } - // PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) - // { - // MCAuto ret=self->buildDAInt(1,self->getNumberOfCompo()); - // MEDCoupling_DataArrayInt64____idiv___(ret,0,obj); - // Py_XINCREF(trueSelf); - // return trueSelf; - // } - - // PyObject *___imod___(PyObject *trueSelf, PyObject *obj) - // { - // MCAuto 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 multiVal; - // std::pair > 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 multiValV; - // std::pair > slicV; - // MEDCoupling::DataArrayInt64Tuple *daIntTyyppV=0; - // int nbc=self->getNumberOfCompo(); - // convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV); - // int singleVal; - // std::vector multiVal; - // std::pair > 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::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;jgetConstPointer(); - // 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