From: rnv Date: Mon, 13 Jan 2020 12:41:21 +0000 (+0300) Subject: Fix compilation on Windows with VS 2017 after implementation 64 bit ids in MEDCOUPLING. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e5928fc386edb432f6b880fb4349c72579d1e7f5;p=tools%2Fmedcoupling.git Fix compilation on Windows with VS 2017 after implementation 64 bit ids in MEDCOUPLING. --- diff --git a/src/INTERP_KERNEL/Bases/InterpKernelHashFun.hxx b/src/INTERP_KERNEL/Bases/InterpKernelHashFun.hxx index 5ed88c718..4f5f33159 100644 --- a/src/INTERP_KERNEL/Bases/InterpKernelHashFun.hxx +++ b/src/INTERP_KERNEL/Bases/InterpKernelHashFun.hxx @@ -148,6 +148,18 @@ namespace INTERP_KERNEL { std::size_t operator()(unsigned long __x) const { return __x; } }; + + template<> + struct hash + { + std::size_t operator()(long long __x) const { return __x; } + }; + + template<> + struct hash + { + std::size_t operator()(unsigned long long __x) const { return __x; } + }; } #endif diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 488c15a89..309f3a376 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -42,23 +42,23 @@ typedef double (*MYFUNCPTR)(double); using namespace MEDCoupling; -template class MEDCoupling::MemArray; -template class MEDCoupling::MemArray; -template class MEDCoupling::DataArrayTemplate; -template class MEDCoupling::DataArrayTemplate; -template class MEDCoupling::DataArrayTemplateClassic; -template class MEDCoupling::DataArrayTemplateClassic; -template class MEDCoupling::DataArrayTemplateClassic; -template class MEDCoupling::DataArrayTemplateFP; -template class MEDCoupling::DataArrayIterator; -template class MEDCoupling::DataArrayIterator; -template class MEDCoupling::DataArrayDiscrete; -template class MEDCoupling::DataArrayDiscreteSigned; -template class MEDCoupling::DataArrayDiscrete; -template class MEDCoupling::DataArrayDiscreteSigned; -template class MEDCoupling::DataArrayTuple; -template class MEDCoupling::DataArrayTuple; -template class MEDCoupling::DataArrayTuple; +template class MEDCOUPLING_EXPORT MEDCoupling::MemArray; +template class MEDCOUPLING_EXPORT MEDCoupling::MemArray; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTemplate; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTemplate; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTemplateClassic; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTemplateClassic; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTemplateClassic; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTemplateFP; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayIterator; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayIterator; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayDiscrete; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayDiscreteSigned; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayDiscrete; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayDiscreteSigned; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTuple; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTuple; +template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTuple; template void DataArrayDouble::findCommonTuplesAlg(const double *bbox, mcIdType nbNodes, mcIdType limitNodeId, double prec, DataArrayIdType *c, DataArrayIdType *cI) const diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index 549f3ca9b..66323346a 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -51,14 +51,14 @@ namespace MEDCoupling class MEDCouplingPointer { public: - MEDCOUPLING_EXPORT MEDCouplingPointer():_internal(0),_external(0) { } - MEDCOUPLING_EXPORT void null() { _internal=0; _external=0; } - MEDCOUPLING_EXPORT bool isNull() const { return _internal==0 && _external==0; } - MEDCOUPLING_EXPORT void setInternal(T *pointer); - MEDCOUPLING_EXPORT void setExternal(const T *pointer); - MEDCOUPLING_EXPORT const T *getConstPointer() const { if(_internal) return _internal; else return _external; } - MEDCOUPLING_EXPORT const T *getConstPointerLoc(std::size_t offset) const { if(_internal) return _internal+offset; else return _external+offset; } - MEDCOUPLING_EXPORT T *getPointer() { if(_internal) return _internal; if(_external) throw INTERP_KERNEL::Exception("Trying to write on an external pointer."); else return 0; } + MEDCouplingPointer():_internal(0),_external(0) { } + void null() { _internal=0; _external=0; } + bool isNull() const { return _internal==0 && _external==0; } + void setInternal(T *pointer); + void setExternal(const T *pointer); + const T *getConstPointer() const { if(_internal) return _internal; else return _external; } + const T *getConstPointerLoc(std::size_t offset) const { if(_internal) return _internal+offset; else return _external+offset; } + T *getPointer() { if(_internal) return _internal; if(_external) throw INTERP_KERNEL::Exception("Trying to write on an external pointer."); else return 0; } private: T *_internal; const T *_external; @@ -70,49 +70,49 @@ namespace MEDCoupling public: typedef void (*Deallocator)(void *,void *); public: - MEDCOUPLING_EXPORT MemArray():_nb_of_elem(0),_nb_of_elem_alloc(0),_ownership(false),_dealloc(0),_param_for_deallocator(0) { } - MEDCOUPLING_EXPORT MemArray(const MemArray& other); - MEDCOUPLING_EXPORT bool isNull() const { return _pointer.isNull(); } - MEDCOUPLING_EXPORT const T *getConstPointerLoc(std::size_t offset) const { return _pointer.getConstPointerLoc(offset); } - MEDCOUPLING_EXPORT const T *getConstPointer() const { return _pointer.getConstPointer(); } - MEDCOUPLING_EXPORT std::size_t getNbOfElem() const { return _nb_of_elem; } - MEDCOUPLING_EXPORT std::size_t getNbOfElemAllocated() const { return _nb_of_elem_alloc; } - MEDCOUPLING_EXPORT T *getPointer() { return _pointer.getPointer(); } - MEDCOUPLING_EXPORT MemArray &operator=(const MemArray& other); - MEDCOUPLING_EXPORT T operator[](std::size_t id) const { return _pointer.getConstPointer()[id]; } - MEDCOUPLING_EXPORT T& operator[](std::size_t id) { return _pointer.getPointer()[id]; } - MEDCOUPLING_EXPORT bool isEqual(const MemArray& other, T prec, std::string& reason) const; - MEDCOUPLING_EXPORT void repr(mcIdType sl, std::ostream& stream) const; - MEDCOUPLING_EXPORT bool reprHeader(mcIdType sl, std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprZip(mcIdType sl, std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprNotTooLong(mcIdType sl, std::ostream& stream) const; - MEDCOUPLING_EXPORT void fillWithValue(const T& val); - MEDCOUPLING_EXPORT T *fromNoInterlace(std::size_t nbOfComp) const; - MEDCOUPLING_EXPORT T *toNoInterlace(std::size_t nbOfComp) const; - MEDCOUPLING_EXPORT void sort(bool asc); - MEDCOUPLING_EXPORT void reverse(std::size_t nbOfComp); - MEDCOUPLING_EXPORT void alloc(std::size_t nbOfElements); - MEDCOUPLING_EXPORT void reserve(std::size_t newNbOfElements); - MEDCOUPLING_EXPORT void reAlloc(std::size_t newNbOfElements); - MEDCOUPLING_EXPORT void useArray(const T *array, bool ownership, DeallocType type, std::size_t nbOfElem); - MEDCOUPLING_EXPORT void useExternalArrayWithRWAccess(const T *array, std::size_t nbOfElem); - MEDCOUPLING_EXPORT void writeOnPlace(std::size_t id, T element0, const T *others, std::size_t sizeOfOthers); + MemArray():_nb_of_elem(0),_nb_of_elem_alloc(0),_ownership(false),_dealloc(0),_param_for_deallocator(0) { } + MemArray(const MemArray& other); + bool isNull() const { return _pointer.isNull(); } + const T *getConstPointerLoc(std::size_t offset) const { return _pointer.getConstPointerLoc(offset); } + const T *getConstPointer() const { return _pointer.getConstPointer(); } + std::size_t getNbOfElem() const { return _nb_of_elem; } + std::size_t getNbOfElemAllocated() const { return _nb_of_elem_alloc; } + T *getPointer() { return _pointer.getPointer(); } + MemArray &operator=(const MemArray& other); + T operator[](std::size_t id) const { return _pointer.getConstPointer()[id]; } + T& operator[](std::size_t id) { return _pointer.getPointer()[id]; } + bool isEqual(const MemArray& other, T prec, std::string& reason) const; + void repr(mcIdType sl, std::ostream& stream) const; + bool reprHeader(mcIdType sl, std::ostream& stream) const; + void reprZip(mcIdType sl, std::ostream& stream) const; + void reprNotTooLong(mcIdType sl, std::ostream& stream) const; + void fillWithValue(const T& val); + T *fromNoInterlace(std::size_t nbOfComp) const; + T *toNoInterlace(std::size_t nbOfComp) const; + void sort(bool asc); + void reverse(std::size_t nbOfComp); + void alloc(std::size_t nbOfElements); + void reserve(std::size_t newNbOfElements); + void reAlloc(std::size_t newNbOfElements); + void useArray(const T *array, bool ownership, DeallocType type, std::size_t nbOfElem); + void useExternalArrayWithRWAccess(const T *array, std::size_t nbOfElem); + void writeOnPlace(std::size_t id, T element0, const T *others, std::size_t sizeOfOthers); template void insertAtTheEnd(InputIterator first, InputIterator last); - MEDCOUPLING_EXPORT void pushBack(T elem); - MEDCOUPLING_EXPORT T popBack(); - MEDCOUPLING_EXPORT void pack() const; - MEDCOUPLING_EXPORT bool isDeallocatorCalled() const { return _ownership; } - MEDCOUPLING_EXPORT Deallocator getDeallocator() const { return _dealloc; } - MEDCOUPLING_EXPORT void setSpecificDeallocator(Deallocator dealloc) { _dealloc=dealloc; } - MEDCOUPLING_EXPORT void setParameterForDeallocator(void *param) { _param_for_deallocator=param; } - MEDCOUPLING_EXPORT void *getParameterForDeallocator() const { return _param_for_deallocator; } - MEDCOUPLING_EXPORT void destroy(); - MEDCOUPLING_EXPORT ~MemArray() { destroy(); } + void pushBack(T elem); + T popBack(); + void pack() const; + bool isDeallocatorCalled() const { return _ownership; } + Deallocator getDeallocator() const { return _dealloc; } + void setSpecificDeallocator(Deallocator dealloc) { _dealloc=dealloc; } + void setParameterForDeallocator(void *param) { _param_for_deallocator=param; } + void *getParameterForDeallocator() const { return _param_for_deallocator; } + void destroy(); + ~MemArray() { destroy(); } public: - MEDCOUPLING_EXPORT static void CPPDeallocator(void *pt, void *param); - MEDCOUPLING_EXPORT static void CDeallocator(void *pt, void *param); - MEDCOUPLING_EXPORT static void COffsetDeallocator(void *pt, void *param); + static void CPPDeallocator(void *pt, void *param); + static void CDeallocator(void *pt, void *param); + static void COffsetDeallocator(void *pt, void *param); private: static void DestroyPointer(T *pt, Deallocator dealloc, void *param); static Deallocator BuildFromType(DeallocType type); @@ -128,92 +128,92 @@ namespace MEDCoupling template class DataArrayTools { public: - MEDCOUPLING_EXPORT static void GetSlice(T start, T stop, T step, mcIdType sliceId, mcIdType nbOfSlices, T& startSlice, T& stopSlice); - MEDCOUPLING_EXPORT static mcIdType GetNumberOfItemGivenBES(T begin, T end, T step, const std::string& msg); - MEDCOUPLING_EXPORT static mcIdType GetNumberOfItemGivenBESRelative(T begin, T end, T step, const std::string& msg); - MEDCOUPLING_EXPORT static mcIdType GetPosOfItemGivenBESRelativeNoThrow(T value, T begin, T end, T step); + static void GetSlice(T start, T stop, T step, mcIdType sliceId, mcIdType nbOfSlices, T& startSlice, T& stopSlice); + static mcIdType GetNumberOfItemGivenBES(T begin, T end, T step, const std::string& msg); + static mcIdType GetNumberOfItemGivenBESRelative(T begin, T end, T step, const std::string& msg); + static mcIdType GetPosOfItemGivenBESRelativeNoThrow(T value, T begin, T end, T step); }; class DataArrayByte; - class DataArray : public RefCountObject, public TimeLabel + class MEDCOUPLING_EXPORT DataArray : public RefCountObject, public TimeLabel { public: - MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDCOUPLING_EXPORT std::vector getDirectChildrenWithNull() const; - MEDCOUPLING_EXPORT void setName(const std::string& name); - MEDCOUPLING_EXPORT void copyStringInfoFrom(const DataArray& other); - MEDCOUPLING_EXPORT void copyPartOfStringInfoFrom(const DataArray& other, const std::vector& compoIds); - MEDCOUPLING_EXPORT void copyPartOfStringInfoFrom2(const std::vector& compoIds, const DataArray& other); - MEDCOUPLING_EXPORT bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const; - MEDCOUPLING_EXPORT bool areInfoEquals(const DataArray& other) const; - MEDCOUPLING_EXPORT std::string cppRepr(const std::string& varName) const; - MEDCOUPLING_EXPORT std::string getName() const { return _name; } - MEDCOUPLING_EXPORT const std::vector &getInfoOnComponents() const { return _info_on_compo; } - MEDCOUPLING_EXPORT std::vector &getInfoOnComponents() { return _info_on_compo; } - MEDCOUPLING_EXPORT void setInfoOnComponents(const std::vector& info); - MEDCOUPLING_EXPORT void setInfoAndChangeNbOfCompo(const std::vector& info); - MEDCOUPLING_EXPORT std::vector getVarsOnComponent() const; - MEDCOUPLING_EXPORT std::vector getUnitsOnComponent() const; - MEDCOUPLING_EXPORT std::string getInfoOnComponent(std::size_t i) const; - MEDCOUPLING_EXPORT std::string getVarOnComponent(std::size_t i) const; - MEDCOUPLING_EXPORT std::string getUnitOnComponent(std::size_t i) const; - MEDCOUPLING_EXPORT void setInfoOnComponent(std::size_t i, const std::string& info); - MEDCOUPLING_EXPORT std::size_t getNumberOfComponents() const { return _info_on_compo.size(); } - MEDCOUPLING_EXPORT void setPartOfValuesBase3(const DataArray *aBase, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true); - MEDCOUPLING_EXPORT virtual void *getVoidStarPointer() = 0; - MEDCOUPLING_EXPORT virtual DataArray *deepCopy() const = 0; - MEDCOUPLING_EXPORT virtual DataArray *buildNewEmptyInstance() const = 0; - MEDCOUPLING_EXPORT virtual bool isAllocated() const = 0; - MEDCOUPLING_EXPORT virtual void checkAllocated() const = 0; - MEDCOUPLING_EXPORT virtual void desallocate() = 0; - MEDCOUPLING_EXPORT virtual mcIdType getNumberOfTuples() const = 0; - MEDCOUPLING_EXPORT virtual mcIdType getNbOfElems() const = 0; - MEDCOUPLING_EXPORT virtual std::size_t getNbOfElemAllocated() const = 0; - MEDCOUPLING_EXPORT virtual void alloc(std::size_t nbOfTuple, std::size_t nbOfCompo=1) = 0; - MEDCOUPLING_EXPORT virtual void reAlloc(std::size_t newNbOfTuple) = 0; - MEDCOUPLING_EXPORT virtual void renumberInPlace(const mcIdType *old2New) = 0; - MEDCOUPLING_EXPORT virtual void renumberInPlaceR(const mcIdType *new2Old) = 0; - MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValues(mcIdType tupleIdStart, const DataArray *aBase, const DataArrayIdType *tuplesSelec) = 0; - MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValuesSlice(mcIdType tupleIdStart, const DataArray *aBase, mcIdType bg, mcIdType end2, mcIdType step) = 0; - MEDCOUPLING_EXPORT virtual DataArray *selectByTupleRanges(const std::vector >& ranges) const = 0; - MEDCOUPLING_EXPORT virtual DataArray *keepSelectedComponents(const std::vector& compoIds) const = 0; - MEDCOUPLING_EXPORT virtual DataArray *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const = 0; - MEDCOUPLING_EXPORT virtual DataArray *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const = 0; - MEDCOUPLING_EXPORT virtual DataArray *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const = 0; - MEDCOUPLING_EXPORT virtual void rearrange(std::size_t newNbOfCompo) = 0; - MEDCOUPLING_EXPORT virtual void circularPermutation(mcIdType nbOfShift=1) = 0; - MEDCOUPLING_EXPORT virtual void circularPermutationPerTuple(mcIdType nbOfShift=1) = 0; - MEDCOUPLING_EXPORT virtual void reversePerTuple() = 0; - MEDCOUPLING_EXPORT void checkNbOfTuples(mcIdType nbOfTuples, const std::string& msg) const; - MEDCOUPLING_EXPORT void checkNbOfComps(std::size_t nbOfCompo, const std::string& msg) const; - MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const; - MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(mcIdType nbOfTuples, std::size_t nbOfCompo, const std::string& msg) const; - MEDCOUPLING_EXPORT void checkNbOfElems(mcIdType nbOfElems, const std::string& msg) const; - MEDCOUPLING_EXPORT static void GetSlice(mcIdType start, mcIdType stop, mcIdType step, mcIdType sliceId, mcIdType nbOfSlices, mcIdType& startSlice, mcIdType& stopSlice); - MEDCOUPLING_EXPORT static mcIdType GetNumberOfItemGivenBES(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg); - MEDCOUPLING_EXPORT static mcIdType GetNumberOfItemGivenBESRelative(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg); - MEDCOUPLING_EXPORT static mcIdType GetPosOfItemGivenBESRelativeNoThrow(mcIdType value, mcIdType begin, mcIdType end, mcIdType step); - MEDCOUPLING_EXPORT static std::string GetVarNameFromInfo(const std::string& info); - MEDCOUPLING_EXPORT static std::string GetUnitFromInfo(const std::string& info); - MEDCOUPLING_EXPORT static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit); - MEDCOUPLING_EXPORT static std::string GetAxisTypeRepr(MEDCouplingAxisType at); - MEDCOUPLING_EXPORT static DataArray *Aggregate(const std::vector& arrs); - MEDCOUPLING_EXPORT virtual void reprStream(std::ostream& stream) const = 0; - MEDCOUPLING_EXPORT virtual void reprZipStream(std::ostream& stream) const = 0; - MEDCOUPLING_EXPORT virtual void reprWithoutNameStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT virtual void reprZipWithoutNameStream(std::ostream& stream) const = 0; - MEDCOUPLING_EXPORT virtual void reprCppStream(const std::string& varName, std::ostream& stream) const = 0; - MEDCOUPLING_EXPORT virtual void reprQuickOverview(std::ostream& stream) const = 0; - MEDCOUPLING_EXPORT virtual void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const = 0; + std::size_t getHeapMemorySizeWithoutChildren() const; + std::vector getDirectChildrenWithNull() const; + void setName(const std::string& name); + void copyStringInfoFrom(const DataArray& other); + void copyPartOfStringInfoFrom(const DataArray& other, const std::vector& compoIds); + void copyPartOfStringInfoFrom2(const std::vector& compoIds, const DataArray& other); + bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const; + bool areInfoEquals(const DataArray& other) const; + std::string cppRepr(const std::string& varName) const; + std::string getName() const { return _name; } + const std::vector &getInfoOnComponents() const { return _info_on_compo; } + std::vector &getInfoOnComponents() { return _info_on_compo; } + void setInfoOnComponents(const std::vector& info); + void setInfoAndChangeNbOfCompo(const std::vector& info); + std::vector getVarsOnComponent() const; + std::vector getUnitsOnComponent() const; + std::string getInfoOnComponent(std::size_t i) const; + std::string getVarOnComponent(std::size_t i) const; + std::string getUnitOnComponent(std::size_t i) const; + void setInfoOnComponent(std::size_t i, const std::string& info); + std::size_t getNumberOfComponents() const { return _info_on_compo.size(); } + void setPartOfValuesBase3(const DataArray *aBase, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true); + virtual void *getVoidStarPointer() = 0; + virtual DataArray *deepCopy() const = 0; + virtual DataArray *buildNewEmptyInstance() const = 0; + virtual bool isAllocated() const = 0; + virtual void checkAllocated() const = 0; + virtual void desallocate() = 0; + virtual mcIdType getNumberOfTuples() const = 0; + virtual mcIdType getNbOfElems() const = 0; + virtual std::size_t getNbOfElemAllocated() const = 0; + virtual void alloc(std::size_t nbOfTuple, std::size_t nbOfCompo=1) = 0; + virtual void reAlloc(std::size_t newNbOfTuple) = 0; + virtual void renumberInPlace(const mcIdType *old2New) = 0; + virtual void renumberInPlaceR(const mcIdType *new2Old) = 0; + virtual void setContigPartOfSelectedValues(mcIdType tupleIdStart, const DataArray *aBase, const DataArrayIdType *tuplesSelec) = 0; + virtual void setContigPartOfSelectedValuesSlice(mcIdType tupleIdStart, const DataArray *aBase, mcIdType bg, mcIdType end2, mcIdType step) = 0; + virtual DataArray *selectByTupleRanges(const std::vector >& ranges) const = 0; + virtual DataArray *keepSelectedComponents(const std::vector& compoIds) const = 0; + virtual DataArray *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const = 0; + virtual DataArray *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const = 0; + virtual DataArray *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const = 0; + virtual void rearrange(std::size_t newNbOfCompo) = 0; + virtual void circularPermutation(mcIdType nbOfShift=1) = 0; + virtual void circularPermutationPerTuple(mcIdType nbOfShift=1) = 0; + virtual void reversePerTuple() = 0; + void checkNbOfTuples(mcIdType nbOfTuples, const std::string& msg) const; + void checkNbOfComps(std::size_t nbOfCompo, const std::string& msg) const; + void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const; + void checkNbOfTuplesAndComp(mcIdType nbOfTuples, std::size_t nbOfCompo, const std::string& msg) const; + void checkNbOfElems(mcIdType nbOfElems, const std::string& msg) const; + static void GetSlice(mcIdType start, mcIdType stop, mcIdType step, mcIdType sliceId, mcIdType nbOfSlices, mcIdType& startSlice, mcIdType& stopSlice); + static mcIdType GetNumberOfItemGivenBES(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg); + static mcIdType GetNumberOfItemGivenBESRelative(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg); + static mcIdType GetPosOfItemGivenBESRelativeNoThrow(mcIdType value, mcIdType begin, mcIdType end, mcIdType step); + static std::string GetVarNameFromInfo(const std::string& info); + static std::string GetUnitFromInfo(const std::string& info); + static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit); + static std::string GetAxisTypeRepr(MEDCouplingAxisType at); + static DataArray *Aggregate(const std::vector& arrs); + virtual void reprStream(std::ostream& stream) const = 0; + virtual void reprZipStream(std::ostream& stream) const = 0; + virtual void reprWithoutNameStream(std::ostream& stream) const; + virtual void reprZipWithoutNameStream(std::ostream& stream) const = 0; + virtual void reprCppStream(const std::string& varName, std::ostream& stream) const = 0; + virtual void reprQuickOverview(std::ostream& stream) const = 0; + virtual void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const = 0; protected: DataArray() { } ~DataArray() { } protected: - MEDCOUPLING_EXPORT static void CheckValueInRange(mcIdType ref, mcIdType value, const std::string& msg); - MEDCOUPLING_EXPORT static void CheckValueInRangeEx(mcIdType value, mcIdType start, mcIdType end, const std::string& msg); - MEDCOUPLING_EXPORT static void CheckClosingParInRange(mcIdType ref, mcIdType value, const std::string& msg); - MEDCOUPLING_EXPORT static mcIdType EffectiveCircPerm(mcIdType nbOfShift, mcIdType nbOfTuples); + static void CheckValueInRange(mcIdType ref, mcIdType value, const std::string& msg); + static void CheckValueInRangeEx(mcIdType value, mcIdType start, mcIdType end, const std::string& msg); + static void CheckClosingParInRange(mcIdType ref, mcIdType value, const std::string& msg); + static mcIdType EffectiveCircPerm(mcIdType nbOfShift, mcIdType nbOfTuples); protected: std::string _name; std::vector _info_on_compo; @@ -228,85 +228,85 @@ namespace MEDCoupling public: typedef T Type; public: - MEDCOUPLING_EXPORT static MCAuto< typename Traits::ArrayTypeCh > NewFromStdVector(const typename std::vector& v); - MEDCOUPLING_EXPORT std::vector< MCAuto< typename Traits::ArrayTypeCh > > explodeComponents() const; + static MCAuto< typename Traits::ArrayTypeCh > NewFromStdVector(const typename std::vector& v); + std::vector< MCAuto< typename Traits::ArrayTypeCh > > explodeComponents() const; // std::size_t getHeapMemorySizeWithoutChildren() const; - MEDCOUPLING_EXPORT void updateTime() const { } + void updateTime() const { } // - MEDCOUPLING_EXPORT mcIdType getNumberOfTuples() const { return ToIdType(_info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents()); } - MEDCOUPLING_EXPORT mcIdType getNbOfElems() const { return ToIdType(_mem.getNbOfElem()); } - MEDCOUPLING_EXPORT bool empty() const; - MEDCOUPLING_EXPORT void *getVoidStarPointer() { return getPointer(); } - MEDCOUPLING_EXPORT const T *getConstPointer() const { return _mem.getConstPointer(); } - MEDCOUPLING_EXPORT const T *begin() const { return getConstPointer(); } - MEDCOUPLING_EXPORT const T *end() const { return getConstPointer()+getNbOfElems(); } - MEDCOUPLING_EXPORT T *rwBegin() { return getPointer(); } - MEDCOUPLING_EXPORT T *rwEnd() { return getPointer()+getNbOfElems(); } - MEDCOUPLING_EXPORT void alloc(std::size_t nbOfTuple, std::size_t nbOfCompo=1); - MEDCOUPLING_EXPORT void useArray(const T *array, bool ownership, DeallocType type, std::size_t nbOfTuple, std::size_t nbOfCompo); - MEDCOUPLING_EXPORT void useExternalArrayWithRWAccess(const T *array, std::size_t nbOfTuple, std::size_t nbOfCompo); - MEDCOUPLING_EXPORT T getIJSafe(std::size_t tupleId, std::size_t compoId) const; - MEDCOUPLING_EXPORT T getIJ(std::size_t tupleId, std::size_t compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; } - MEDCOUPLING_EXPORT void setIJ(std::size_t tupleId, std::size_t compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); } - MEDCOUPLING_EXPORT void setIJSilent(std::size_t tupleId, std::size_t compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; } - MEDCOUPLING_EXPORT T *getPointer() { return _mem.getPointer(); declareAsNew(); } - MEDCOUPLING_EXPORT void pack() const; - MEDCOUPLING_EXPORT bool isAllocated() const override; - MEDCOUPLING_EXPORT void checkAllocated() const; - MEDCOUPLING_EXPORT void desallocate(); - MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems); - MEDCOUPLING_EXPORT void rearrange(std::size_t newNbOfCompo); - MEDCOUPLING_EXPORT void transpose(); - MEDCOUPLING_EXPORT void pushBackSilent(T val); - MEDCOUPLING_EXPORT void pushBackValsSilent(const T *valsBg, const T *valsEnd); - MEDCOUPLING_EXPORT T popBackSilent(); - MEDCOUPLING_EXPORT T front() const; - MEDCOUPLING_EXPORT T back() const; - MEDCOUPLING_EXPORT std::size_t getNbOfElemAllocated() const { return _mem.getNbOfElemAllocated(); } - MEDCOUPLING_EXPORT void allocIfNecessary(std::size_t nbOfTuple, std::size_t nbOfCompo); - MEDCOUPLING_EXPORT void deepCopyFrom(const DataArrayTemplate& other); - MEDCOUPLING_EXPORT void reverse(); - MEDCOUPLING_EXPORT void fillWithValue(T val); - MEDCOUPLING_EXPORT void reAlloc(std::size_t newNbOfTuple); - MEDCOUPLING_EXPORT void renumberInPlace(const mcIdType *old2New); - MEDCOUPLING_EXPORT void renumberInPlaceR(const mcIdType *new2Old); - MEDCOUPLING_EXPORT void sort(bool asc=true); - MEDCOUPLING_EXPORT typename Traits::ArrayType *renumber(const mcIdType *old2New) const; - MEDCOUPLING_EXPORT typename Traits::ArrayType *renumberR(const mcIdType *new2Old) const; - MEDCOUPLING_EXPORT typename Traits::ArrayType *renumberAndReduce(const mcIdType *old2New, mcIdType newNbOfTuple) const; - MEDCOUPLING_EXPORT typename Traits::ArrayType *changeNbOfComponents(std::size_t newNbOfComp, T dftValue) const; - MEDCOUPLING_EXPORT typename Traits::ArrayType *subArray(mcIdType tupleIdBg, mcIdType tupleIdEnd=-1) const; - MEDCOUPLING_EXPORT MCAuto::ArrayTypeCh> selectPartDef(const PartDefinition* pd) const; - MEDCOUPLING_EXPORT void circularPermutation(mcIdType nbOfShift=1); - MEDCOUPLING_EXPORT void circularPermutationPerTuple(mcIdType nbOfShift=1); - MEDCOUPLING_EXPORT void reversePerTuple(); - MEDCOUPLING_EXPORT void setPartOfValues1(const typename Traits::ArrayType *a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true); - MEDCOUPLING_EXPORT void setPartOfValuesSimple1(T a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp); - MEDCOUPLING_EXPORT void setPartOfValues2(const typename Traits::ArrayType *a, const mcIdType *bgTuples, const mcIdType *endTuples, const mcIdType *bgComp, const mcIdType *endComp, bool strictCompoCompare=true); - MEDCOUPLING_EXPORT void setPartOfValuesSimple2(T a, const mcIdType *bgTuples, const mcIdType *endTuples, const mcIdType *bgComp, const mcIdType *endComp); - MEDCOUPLING_EXPORT void setPartOfValues3(const typename Traits::ArrayType *a, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true); - MEDCOUPLING_EXPORT void setPartOfValuesSimple3(T a, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp); - MEDCOUPLING_EXPORT void setPartOfValues4(const typename Traits::ArrayType *a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, const mcIdType *bgComp, const mcIdType *endComp, bool strictCompoCompare=true); - MEDCOUPLING_EXPORT void setPartOfValuesSimple4(T a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, const mcIdType *bgComp, const mcIdType *endComp); - MEDCOUPLING_EXPORT void setPartOfValuesAdv(const typename Traits::ArrayType *a, const DataArrayIdType *tuplesSelec); - MEDCOUPLING_EXPORT void setContigPartOfSelectedValues(mcIdType tupleIdStart, const DataArray *aBase, const DataArrayIdType *tuplesSelec); - MEDCOUPLING_EXPORT void setContigPartOfSelectedValuesSlice(mcIdType tupleIdStart, const DataArray *aBase, mcIdType bg, mcIdType end2, mcIdType step); - MEDCOUPLING_EXPORT T getMaxValue(mcIdType& tupleId) const; - MEDCOUPLING_EXPORT T getMaxValueInArray() const; - MEDCOUPLING_EXPORT T getMaxAbsValue(std::size_t& tupleId) const; - MEDCOUPLING_EXPORT T getMaxAbsValueInArray() const; - MEDCOUPLING_EXPORT T getMinValue(mcIdType& tupleId) const; - MEDCOUPLING_EXPORT T getMinValueInArray() const; - MEDCOUPLING_EXPORT void getTuple(mcIdType tupleId, T *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } + mcIdType getNumberOfTuples() const { return ToIdType(_info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents()); } + mcIdType getNbOfElems() const { return ToIdType(_mem.getNbOfElem()); } + bool empty() const; + void *getVoidStarPointer() { return getPointer(); } + const T *getConstPointer() const { return _mem.getConstPointer(); } + const T *begin() const { return getConstPointer(); } + const T *end() const { return getConstPointer()+getNbOfElems(); } + T *rwBegin() { return getPointer(); } + T *rwEnd() { return getPointer()+getNbOfElems(); } + void alloc(std::size_t nbOfTuple, std::size_t nbOfCompo=1); + void useArray(const T *array, bool ownership, DeallocType type, std::size_t nbOfTuple, std::size_t nbOfCompo); + void useExternalArrayWithRWAccess(const T *array, std::size_t nbOfTuple, std::size_t nbOfCompo); + T getIJSafe(std::size_t tupleId, std::size_t compoId) const; + T getIJ(std::size_t tupleId, std::size_t compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; } + void setIJ(std::size_t tupleId, std::size_t compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); } + void setIJSilent(std::size_t tupleId, std::size_t compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; } + T *getPointer() { return _mem.getPointer(); declareAsNew(); } + void pack() const; + bool isAllocated() const override; + void checkAllocated() const; + void desallocate(); + void reserve(std::size_t nbOfElems); + void rearrange(std::size_t newNbOfCompo); + void transpose(); + void pushBackSilent(T val); + void pushBackValsSilent(const T *valsBg, const T *valsEnd); + T popBackSilent(); + T front() const; + T back() const; + std::size_t getNbOfElemAllocated() const { return _mem.getNbOfElemAllocated(); } + void allocIfNecessary(std::size_t nbOfTuple, std::size_t nbOfCompo); + void deepCopyFrom(const DataArrayTemplate& other); + void reverse(); + void fillWithValue(T val); + void reAlloc(std::size_t newNbOfTuple); + void renumberInPlace(const mcIdType *old2New); + void renumberInPlaceR(const mcIdType *new2Old); + void sort(bool asc=true); + typename Traits::ArrayType *renumber(const mcIdType *old2New) const; + typename Traits::ArrayType *renumberR(const mcIdType *new2Old) const; + typename Traits::ArrayType *renumberAndReduce(const mcIdType *old2New, mcIdType newNbOfTuple) const; + typename Traits::ArrayType *changeNbOfComponents(std::size_t newNbOfComp, T dftValue) const; + typename Traits::ArrayType *subArray(mcIdType tupleIdBg, mcIdType tupleIdEnd=-1) const; + MCAuto::ArrayTypeCh> selectPartDef(const PartDefinition* pd) const; + void circularPermutation(mcIdType nbOfShift=1); + void circularPermutationPerTuple(mcIdType nbOfShift=1); + void reversePerTuple(); + void setPartOfValues1(const typename Traits::ArrayType *a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true); + void setPartOfValuesSimple1(T a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp); + void setPartOfValues2(const typename Traits::ArrayType *a, const mcIdType *bgTuples, const mcIdType *endTuples, const mcIdType *bgComp, const mcIdType *endComp, bool strictCompoCompare=true); + void setPartOfValuesSimple2(T a, const mcIdType *bgTuples, const mcIdType *endTuples, const mcIdType *bgComp, const mcIdType *endComp); + void setPartOfValues3(const typename Traits::ArrayType *a, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true); + void setPartOfValuesSimple3(T a, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp); + void setPartOfValues4(const typename Traits::ArrayType *a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, const mcIdType *bgComp, const mcIdType *endComp, bool strictCompoCompare=true); + void setPartOfValuesSimple4(T a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, const mcIdType *bgComp, const mcIdType *endComp); + void setPartOfValuesAdv(const typename Traits::ArrayType *a, const DataArrayIdType *tuplesSelec); + void setContigPartOfSelectedValues(mcIdType tupleIdStart, const DataArray *aBase, const DataArrayIdType *tuplesSelec); + void setContigPartOfSelectedValuesSlice(mcIdType tupleIdStart, const DataArray *aBase, mcIdType bg, mcIdType end2, mcIdType step); + T getMaxValue(mcIdType& tupleId) const; + T getMaxValueInArray() const; + T getMaxAbsValue(std::size_t& tupleId) const; + T getMaxAbsValueInArray() const; + T getMinValue(mcIdType& tupleId) const; + T getMinValueInArray() const; + void getTuple(mcIdType tupleId, T *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } template void insertAtTheEnd(InputIterator first, InputIterator last); - MEDCOUPLING_EXPORT static void SetArrayIn(typename Traits::ArrayType *newArray, typename Traits::ArrayType* &arrayToSet); - MEDCOUPLING_EXPORT void writeOnPlace(std::size_t id, T element0, const T *others, mcIdType sizeOfOthers) { _mem.writeOnPlace(id,element0,others,sizeOfOthers); } - MEDCOUPLING_EXPORT void fillWithZero(); + static void SetArrayIn(typename Traits::ArrayType *newArray, typename Traits::ArrayType* &arrayToSet); + void writeOnPlace(std::size_t id, T element0, const T *others, mcIdType sizeOfOthers) { _mem.writeOnPlace(id,element0,others,sizeOfOthers); } + void fillWithZero(); public: - MEDCOUPLING_EXPORT MemArray& accessToMemArray() { return _mem; } - MEDCOUPLING_EXPORT const MemArray& accessToMemArray() const { return _mem; } + MemArray& accessToMemArray() { return _mem; } + const MemArray& accessToMemArray() const { return _mem; } protected: typename Traits::ArrayType *mySelectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const; typename Traits::ArrayType *mySelectByTupleId(const DataArrayIdType& di) const; @@ -322,46 +322,46 @@ namespace MEDCoupling class DataArrayTemplateClassic : public DataArrayTemplate { public: - MEDCOUPLING_EXPORT MCAuto convertToDblArr() const; - MEDCOUPLING_EXPORT MCAuto convertToIntArr() const; - MEDCOUPLING_EXPORT MCAuto convertToFloatArr() const; - MEDCOUPLING_EXPORT void applyLin(T a, T b, std::size_t compoId); - MEDCOUPLING_EXPORT void applyLin(T a, T b); - MEDCOUPLING_EXPORT typename Traits::ArrayType *negate() const; - MEDCOUPLING_EXPORT void addEqual(const typename Traits::ArrayType *other); - MEDCOUPLING_EXPORT void substractEqual(const typename Traits::ArrayType *other); - MEDCOUPLING_EXPORT void multiplyEqual(const typename Traits::ArrayType *other); - MEDCOUPLING_EXPORT void divideEqual(const typename Traits::ArrayType *other); - MEDCOUPLING_EXPORT static typename Traits::ArrayType *Substract(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); - MEDCOUPLING_EXPORT static typename Traits::ArrayType *Divide(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); - MEDCOUPLING_EXPORT static typename Traits::ArrayType *Add(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); - MEDCOUPLING_EXPORT static typename Traits::ArrayType *Multiply(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); - MEDCOUPLING_EXPORT static typename Traits::ArrayType *Meld(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); - MEDCOUPLING_EXPORT static typename Traits::ArrayType *Meld(const std::vector::ArrayType *>& arr); - MEDCOUPLING_EXPORT MCAuto findIdsGreaterOrEqualTo(T val) const; - MEDCOUPLING_EXPORT MCAuto findIdsGreaterThan(T val) const; - MEDCOUPLING_EXPORT MCAuto findIdsLowerOrEqualTo(T val) const; - MEDCOUPLING_EXPORT MCAuto findIdsLowerThan(T val) const; - MEDCOUPLING_EXPORT DataArrayIdType *findIdsStrictlyNegative() const; - MEDCOUPLING_EXPORT typename Traits::ArrayType *fromNoInterlace() const; - MEDCOUPLING_EXPORT typename Traits::ArrayType *toNoInterlace() const; - MEDCOUPLING_EXPORT void meldWith(const typename Traits::ArrayType *other); - MEDCOUPLING_EXPORT typename Traits::ArrayType *duplicateEachTupleNTimes(mcIdType nbTimes) const; - MEDCOUPLING_EXPORT void aggregate(const typename Traits::ArrayType *other); - MEDCOUPLING_EXPORT void abs(); - MEDCOUPLING_EXPORT typename Traits::ArrayType *computeAbs() const; - MEDCOUPLING_EXPORT typename Traits::ArrayType *performCopyOrIncrRef(bool dCpy) const; - MEDCOUPLING_EXPORT typename Traits::ArrayType *sumPerTuple() const; - MEDCOUPLING_EXPORT void iota(T init=(T)0); - MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprNotTooLongStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprNotTooLongWithoutNameStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT std::string reprZip() const; - MEDCOUPLING_EXPORT std::string reprNotTooLong() const; + MCAuto convertToDblArr() const; + MCAuto convertToIntArr() const; + MCAuto convertToFloatArr() const; + void applyLin(T a, T b, std::size_t compoId); + void applyLin(T a, T b); + typename Traits::ArrayType *negate() const; + void addEqual(const typename Traits::ArrayType *other); + void substractEqual(const typename Traits::ArrayType *other); + void multiplyEqual(const typename Traits::ArrayType *other); + void divideEqual(const typename Traits::ArrayType *other); + static typename Traits::ArrayType *Substract(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); + static typename Traits::ArrayType *Divide(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); + static typename Traits::ArrayType *Add(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); + static typename Traits::ArrayType *Multiply(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); + static typename Traits::ArrayType *Meld(const typename Traits::ArrayType *a1, const typename Traits::ArrayType *a2); + static typename Traits::ArrayType *Meld(const std::vector::ArrayType *>& arr); + MCAuto findIdsGreaterOrEqualTo(T val) const; + MCAuto findIdsGreaterThan(T val) const; + MCAuto findIdsLowerOrEqualTo(T val) const; + MCAuto findIdsLowerThan(T val) const; + DataArrayIdType *findIdsStrictlyNegative() const; + typename Traits::ArrayType *fromNoInterlace() const; + typename Traits::ArrayType *toNoInterlace() const; + void meldWith(const typename Traits::ArrayType *other); + typename Traits::ArrayType *duplicateEachTupleNTimes(mcIdType nbTimes) const; + void aggregate(const typename Traits::ArrayType *other); + void abs(); + typename Traits::ArrayType *computeAbs() const; + typename Traits::ArrayType *performCopyOrIncrRef(bool dCpy) const; + typename Traits::ArrayType *sumPerTuple() const; + void iota(T init=(T)0); + void reprStream(std::ostream& stream) const; + void reprZipStream(std::ostream& stream) const; + void reprNotTooLongStream(std::ostream& stream) const; + void reprWithoutNameStream(std::ostream& stream) const; + void reprZipWithoutNameStream(std::ostream& stream) const; + void reprNotTooLongWithoutNameStream(std::ostream& stream) const; + std::string repr() const; + std::string reprZip() const; + std::string reprNotTooLong() const; template MCAuto< typename Traits::ArrayType > convertToOtherTypeOfArr() const; protected: @@ -377,34 +377,34 @@ namespace MEDCoupling class DataArrayTemplateFP : public DataArrayTemplateClassic { public: - MEDCOUPLING_EXPORT bool isUniform(T val, T eps) const; + bool isUniform(T val, T eps) const; }; } namespace MEDCoupling { class DataArrayFloatIterator; - class DataArrayFloat : public DataArrayTemplateFP + class MEDCOUPLING_EXPORT DataArrayFloat : public DataArrayTemplateFP { public: - MEDCOUPLING_EXPORT static DataArrayFloat *New(); + static DataArrayFloat *New(); public:// abstract method overload - MEDCOUPLING_EXPORT DataArrayFloat *deepCopy() const; - MEDCOUPLING_EXPORT DataArrayFloat *buildNewEmptyInstance() const { return DataArrayFloat::New(); } - MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplateFP::mySelectByTupleRanges(ranges); } - MEDCOUPLING_EXPORT DataArrayFloat *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplateFP::myKeepSelectedComponents(compoIds); } - MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return DataArrayTemplateFP::mySelectByTupleIdSafeSlice(bg,end2,step); } - MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; + DataArrayFloat *deepCopy() const; + DataArrayFloat *buildNewEmptyInstance() const { return DataArrayFloat::New(); } + DataArrayFloat *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplateFP::mySelectByTupleRanges(ranges); } + DataArrayFloat *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplateFP::myKeepSelectedComponents(compoIds); } + DataArrayFloat *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } + DataArrayFloat *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + DataArrayFloat *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return DataArrayTemplateFP::mySelectByTupleIdSafeSlice(bg,end2,step); } + void reprCppStream(const std::string& varName, std::ostream& stream) const; + void reprQuickOverview(std::ostream& stream) const; + void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; public:// non abstract but essential - MEDCOUPLING_EXPORT bool isEqual(const DataArrayFloat& other, float prec) const; - MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayFloat& other, float prec, std::string& reason) const; - MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayFloat& other, float prec) const; + bool isEqual(const DataArrayFloat& other, float prec) const; + bool isEqualIfNotWhy(const DataArrayFloat& other, float prec, std::string& reason) const; + bool isEqualWithoutConsideringStr(const DataArrayFloat& other, float prec) const; public: - MEDCOUPLING_EXPORT DataArrayFloatIterator *iterator(); + DataArrayFloatIterator *iterator(); private: ~DataArrayFloat() { } DataArrayFloat() { } @@ -414,109 +414,109 @@ namespace MEDCoupling namespace MEDCoupling { class DataArrayDoubleIterator; - class DataArrayDouble : public DataArrayTemplateFP + class MEDCOUPLING_EXPORT DataArrayDouble : public DataArrayTemplateFP { public: - MEDCOUPLING_EXPORT static DataArrayDouble *New(); - MEDCOUPLING_EXPORT double doubleValue() const; - MEDCOUPLING_EXPORT DataArrayDouble *deepCopy() const; - MEDCOUPLING_EXPORT DataArrayDouble *buildNewEmptyInstance() const { return DataArrayDouble::New(); } - MEDCOUPLING_EXPORT void checkMonotonic(bool increasing, double eps) const; - MEDCOUPLING_EXPORT bool isMonotonic(bool increasing, double eps) const; - MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, mcIdType indent, const std::string& nameInFile, DataArrayByte *byteArr) const; - MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; - MEDCOUPLING_EXPORT bool isEqual(const DataArrayDouble& other, double prec) const; - MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayDouble& other, double prec, std::string& reason) const; - MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const; - MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); } - MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayDouble *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplateFP::myKeepSelectedComponents(compoIds); } - MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return DataArrayTemplateFP::mySelectByTupleIdSafeSlice(bg,end2,step); } - MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplateFP::mySelectByTupleRanges(ranges); } - MEDCOUPLING_EXPORT bool areIncludedInMe(const DataArrayDouble *other, double prec, DataArrayIdType *&tupleIds) const; - MEDCOUPLING_EXPORT void findCommonTuples(double prec, mcIdType limitTupleId, DataArrayIdType *&comm, DataArrayIdType *&commIndex) const; - MEDCOUPLING_EXPORT double minimalDistanceTo(const DataArrayDouble *other, mcIdType& thisTupleId, mcIdType& otherTupleId) const; - MEDCOUPLING_EXPORT DataArrayDouble *getDifferentValues(double prec, mcIdType limitTupleId=-1) const; - MEDCOUPLING_EXPORT DataArrayIdType *findClosestTupleId(const DataArrayDouble *other) const; - MEDCOUPLING_EXPORT DataArrayIdType *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const; - MEDCOUPLING_EXPORT void setSelectedComponents(const DataArrayDouble *a, const std::vector& compoIds); - MEDCOUPLING_EXPORT DataArrayDoubleIterator *iterator(); - MEDCOUPLING_EXPORT void checkNoNullValues() const; - MEDCOUPLING_EXPORT void getMinMaxPerComponent(double *bounds) const; - MEDCOUPLING_EXPORT DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const; - MEDCOUPLING_EXPORT void computeTupleIdsNearTuples(const DataArrayDouble *other, double eps, DataArrayIdType *& c, DataArrayIdType *& cI) const; - MEDCOUPLING_EXPORT void recenterForMaxPrecision(double eps); - MEDCOUPLING_EXPORT double getMaxValue2(DataArrayIdType*& tupleIds) const; - MEDCOUPLING_EXPORT double getMinValue2(DataArrayIdType*& tupleIds) const; - MEDCOUPLING_EXPORT mcIdType count(double value, double eps) const; - MEDCOUPLING_EXPORT double getAverageValue() const; - MEDCOUPLING_EXPORT double norm2() const; - MEDCOUPLING_EXPORT double normMax() const; - MEDCOUPLING_EXPORT void normMaxPerComponent(double * res) const; - MEDCOUPLING_EXPORT double normMin() const; - MEDCOUPLING_EXPORT void accumulate(double *res) const; - MEDCOUPLING_EXPORT double accumulate(std::size_t compId) const; - MEDCOUPLING_EXPORT DataArrayDouble *accumulatePerChunck(const mcIdType *bgOfIndex, const mcIdType *endOfIndex) const; - MEDCOUPLING_EXPORT MCAuto cumSum() const; - MEDCOUPLING_EXPORT double distanceToTuple(const double *tupleBg, const double *tupleEnd, mcIdType& tupleId) const; - MEDCOUPLING_EXPORT DataArrayDouble *fromPolarToCart() const; - MEDCOUPLING_EXPORT DataArrayDouble *fromCylToCart() const; - MEDCOUPLING_EXPORT DataArrayDouble *fromSpherToCart() const; - MEDCOUPLING_EXPORT DataArrayDouble *cartesianize(MEDCouplingAxisType atOfThis) const; - MEDCOUPLING_EXPORT DataArrayDouble *fromCartToPolar() const; - MEDCOUPLING_EXPORT DataArrayDouble *fromCartToCyl() const; - MEDCOUPLING_EXPORT DataArrayDouble *fromCartToSpher() const; - MEDCOUPLING_EXPORT DataArrayDouble *fromCartToCylGiven(const DataArrayDouble *coords, const double center[3], const double vect[3]) const; - MEDCOUPLING_EXPORT DataArrayDouble *doublyContractedProduct() const; - MEDCOUPLING_EXPORT DataArrayDouble *determinant() const; - MEDCOUPLING_EXPORT DataArrayDouble *eigenValues() const; - MEDCOUPLING_EXPORT DataArrayDouble *eigenVectors() const; - MEDCOUPLING_EXPORT DataArrayDouble *inverse() const; - MEDCOUPLING_EXPORT DataArrayDouble *trace() const; - MEDCOUPLING_EXPORT DataArrayDouble *deviator() const; - MEDCOUPLING_EXPORT DataArrayDouble *magnitude() const; - MEDCOUPLING_EXPORT DataArrayDouble *maxPerTuple() const; - MEDCOUPLING_EXPORT DataArrayDouble *maxPerTupleWithCompoId(DataArrayIdType* &compoIdOfMaxPerTuple) const; - MEDCOUPLING_EXPORT DataArrayDouble *buildEuclidianDistanceDenseMatrix() const; - MEDCOUPLING_EXPORT DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const; - MEDCOUPLING_EXPORT void asArcOfCircle(double center[2], double& radius, double& ang) const; - MEDCOUPLING_EXPORT void sortPerTuple(bool asc); - MEDCOUPLING_EXPORT void applyInv(double numerator); - MEDCOUPLING_EXPORT void applyPow(double val); - MEDCOUPLING_EXPORT void applyRPow(double val); - MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(std::size_t nbOfComp, FunctionToEvaluate func) const; - MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(std::size_t nbOfComp, const std::string& func, bool isSafe=true) const; - MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const; - MEDCOUPLING_EXPORT void applyFuncOnThis(const std::string& func, bool isSafe=true); - MEDCOUPLING_EXPORT DataArrayDouble *applyFuncCompo(std::size_t nbOfComp, const std::string& func, bool isSafe=true) const; - MEDCOUPLING_EXPORT DataArrayDouble *applyFuncNamedCompo(std::size_t nbOfComp, const std::vector& varsOrder, const std::string& func, bool isSafe=true) const; - MEDCOUPLING_EXPORT void applyFuncFast32(const std::string& func); - MEDCOUPLING_EXPORT void applyFuncFast64(const std::string& func); - MEDCOUPLING_EXPORT MCAuto symmetry3DPlane(const double point[3], const double normalVector[3]) const; - MEDCOUPLING_EXPORT DataArrayIdType *findIdsInRange(double vmin, double vmax) const; - MEDCOUPLING_EXPORT DataArrayIdType *findIdsNotInRange(double vmin, double vmax) const; - MEDCOUPLING_EXPORT static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2); - MEDCOUPLING_EXPORT static DataArrayDouble *Aggregate(const std::vector& arr); - MEDCOUPLING_EXPORT static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2); - MEDCOUPLING_EXPORT static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2); - MEDCOUPLING_EXPORT static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2); - MEDCOUPLING_EXPORT static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2); - MEDCOUPLING_EXPORT static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2); - MEDCOUPLING_EXPORT void powEqual(const DataArrayDouble *other); - MEDCOUPLING_EXPORT std::vector toVectorOfBool(double eps) const; - MEDCOUPLING_EXPORT static void Rotate2DAlg(const double *center, double angle, mcIdType nbNodes, const double *coordsIn, double *coordsOut); - MEDCOUPLING_EXPORT static void Rotate3DAlg(const double *center, const double *vect, double angle, mcIdType nbNodes, const double *coordsIn, double *coordsOut); - MEDCOUPLING_EXPORT static void Symmetry3DPlane(const double point[3], const double normalVector[3], mcIdType nbNodes, const double *coordsIn, double *coordsOut); - MEDCOUPLING_EXPORT static void GiveBaseForPlane(const double normalVector[3], double baseOfPlane[9]); - MEDCOUPLING_EXPORT static void ComputeIntegralOfSeg2IntoTri3(const double seg2[4], const double tri3[6], double coeffs[3], double& length); + static DataArrayDouble *New(); + double doubleValue() const; + DataArrayDouble *deepCopy() const; + DataArrayDouble *buildNewEmptyInstance() const { return DataArrayDouble::New(); } + void checkMonotonic(bool increasing, double eps) const; + bool isMonotonic(bool increasing, double eps) const; + void writeVTK(std::ostream& ofs, mcIdType indent, const std::string& nameInFile, DataArrayByte *byteArr) const; + void reprCppStream(const std::string& varName, std::ostream& stream) const; + void reprQuickOverview(std::ostream& stream) const; + void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; + bool isEqual(const DataArrayDouble& other, double prec) const; + bool isEqualIfNotWhy(const DataArrayDouble& other, double prec, std::string& reason) const; + bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const; + DataArrayDouble *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } + DataArrayDouble *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); } + DataArrayDouble *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + DataArrayDouble *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplateFP::myKeepSelectedComponents(compoIds); } + DataArrayDouble *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return DataArrayTemplateFP::mySelectByTupleIdSafeSlice(bg,end2,step); } + DataArrayDouble *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplateFP::mySelectByTupleRanges(ranges); } + bool areIncludedInMe(const DataArrayDouble *other, double prec, DataArrayIdType *&tupleIds) const; + void findCommonTuples(double prec, mcIdType limitTupleId, DataArrayIdType *&comm, DataArrayIdType *&commIndex) const; + double minimalDistanceTo(const DataArrayDouble *other, mcIdType& thisTupleId, mcIdType& otherTupleId) const; + DataArrayDouble *getDifferentValues(double prec, mcIdType limitTupleId=-1) const; + DataArrayIdType *findClosestTupleId(const DataArrayDouble *other) const; + DataArrayIdType *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const; + void setSelectedComponents(const DataArrayDouble *a, const std::vector& compoIds); + DataArrayDoubleIterator *iterator(); + void checkNoNullValues() const; + void getMinMaxPerComponent(double *bounds) const; + DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const; + void computeTupleIdsNearTuples(const DataArrayDouble *other, double eps, DataArrayIdType *& c, DataArrayIdType *& cI) const; + void recenterForMaxPrecision(double eps); + double getMaxValue2(DataArrayIdType*& tupleIds) const; + double getMinValue2(DataArrayIdType*& tupleIds) const; + mcIdType count(double value, double eps) const; + double getAverageValue() const; + double norm2() const; + double normMax() const; + void normMaxPerComponent(double * res) const; + double normMin() const; + void accumulate(double *res) const; + double accumulate(std::size_t compId) const; + DataArrayDouble *accumulatePerChunck(const mcIdType *bgOfIndex, const mcIdType *endOfIndex) const; + MCAuto cumSum() const; + double distanceToTuple(const double *tupleBg, const double *tupleEnd, mcIdType& tupleId) const; + DataArrayDouble *fromPolarToCart() const; + DataArrayDouble *fromCylToCart() const; + DataArrayDouble *fromSpherToCart() const; + DataArrayDouble *cartesianize(MEDCouplingAxisType atOfThis) const; + DataArrayDouble *fromCartToPolar() const; + DataArrayDouble *fromCartToCyl() const; + DataArrayDouble *fromCartToSpher() const; + DataArrayDouble *fromCartToCylGiven(const DataArrayDouble *coords, const double center[3], const double vect[3]) const; + DataArrayDouble *doublyContractedProduct() const; + DataArrayDouble *determinant() const; + DataArrayDouble *eigenValues() const; + DataArrayDouble *eigenVectors() const; + DataArrayDouble *inverse() const; + DataArrayDouble *trace() const; + DataArrayDouble *deviator() const; + DataArrayDouble *magnitude() const; + DataArrayDouble *maxPerTuple() const; + DataArrayDouble *maxPerTupleWithCompoId(DataArrayIdType* &compoIdOfMaxPerTuple) const; + DataArrayDouble *buildEuclidianDistanceDenseMatrix() const; + DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const; + void asArcOfCircle(double center[2], double& radius, double& ang) const; + void sortPerTuple(bool asc); + void applyInv(double numerator); + void applyPow(double val); + void applyRPow(double val); + DataArrayDouble *applyFunc(std::size_t nbOfComp, FunctionToEvaluate func) const; + DataArrayDouble *applyFunc(std::size_t nbOfComp, const std::string& func, bool isSafe=true) const; + DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const; + void applyFuncOnThis(const std::string& func, bool isSafe=true); + DataArrayDouble *applyFuncCompo(std::size_t nbOfComp, const std::string& func, bool isSafe=true) const; + DataArrayDouble *applyFuncNamedCompo(std::size_t nbOfComp, const std::vector& varsOrder, const std::string& func, bool isSafe=true) const; + void applyFuncFast32(const std::string& func); + void applyFuncFast64(const std::string& func); + MCAuto symmetry3DPlane(const double point[3], const double normalVector[3]) const; + DataArrayIdType *findIdsInRange(double vmin, double vmax) const; + DataArrayIdType *findIdsNotInRange(double vmin, double vmax) const; + static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2); + static DataArrayDouble *Aggregate(const std::vector& arr); + static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2); + static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2); + static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2); + static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2); + static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2); + void powEqual(const DataArrayDouble *other); + std::vector toVectorOfBool(double eps) const; + static void Rotate2DAlg(const double *center, double angle, mcIdType nbNodes, const double *coordsIn, double *coordsOut); + static void Rotate3DAlg(const double *center, const double *vect, double angle, mcIdType nbNodes, const double *coordsIn, double *coordsOut); + static void Symmetry3DPlane(const double point[3], const double normalVector[3], mcIdType nbNodes, const double *coordsIn, double *coordsOut); + static void GiveBaseForPlane(const double normalVector[3], double baseOfPlane[9]); + static void ComputeIntegralOfSeg2IntoTri3(const double seg2[4], const double tri3[6], double coeffs[3], double& length); public: - MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector& tinyInfo) const; - MEDCOUPLING_EXPORT void getTinySerializationStrInformation(std::vector& tinyInfo) const; - MEDCOUPLING_EXPORT bool resizeForUnserialization(const std::vector& tinyInfoI); - MEDCOUPLING_EXPORT void finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoS); + void getTinySerializationIntInformation(std::vector& tinyInfo) const; + void getTinySerializationStrInformation(std::vector& tinyInfo) const; + bool resizeForUnserialization(const std::vector& tinyInfoI); + void finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoS); public: template void findCommonTuplesAlg(const double *bbox, mcIdType nbNodes, mcIdType limitNodeId, double prec, DataArrayIdType *c, DataArrayIdType *cI) const; @@ -539,140 +539,140 @@ namespace MEDCoupling public: typedef typename Traits::ArrayType DataArrayType; public: - MEDCOUPLING_EXPORT static DataArrayType *New(); - MEDCOUPLING_EXPORT T intValue() const; - MEDCOUPLING_EXPORT bool isEqual(const DataArrayDiscrete& other) const; - MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayDiscrete& other, std::string& reason) const; - MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayDiscrete& other) const; - MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStrAndOrder(const typename Traits::ArrayType& other) const; - MEDCOUPLING_EXPORT void switchOnTupleEqualTo(T val, std::vector& vec) const; - MEDCOUPLING_EXPORT void switchOnTupleNotEqualTo(T val, std::vector& vec) const; - MEDCOUPLING_EXPORT DataArrayIdType *buildPermutationArr(const DataArrayDiscrete& other) const; - MEDCOUPLING_EXPORT DataArrayIdType *indicesOfSubPart(const DataArrayDiscrete& partOfThis) const; - MEDCOUPLING_EXPORT void checkMonotonic(bool increasing) const; - MEDCOUPLING_EXPORT bool isMonotonic(bool increasing) const; - MEDCOUPLING_EXPORT void checkStrictlyMonotonic(bool increasing) const; - MEDCOUPLING_EXPORT bool isStrictlyMonotonic(bool increasing) const; - MEDCOUPLING_EXPORT mcIdType getHashCode() const; - MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; - MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, mcIdType indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const; - MEDCOUPLING_EXPORT void transformWithIndArr(const T *indArrBg, const T *indArrEnd); - MEDCOUPLING_EXPORT void transformWithIndArr(const MapKeyVal& m); - MEDCOUPLING_EXPORT DataArrayIdType *findIdsEqual(T val) const; - MEDCOUPLING_EXPORT DataArrayIdType *transformWithIndArrR(const T *indArr2Bg, const T *indArrEnd) const; - MEDCOUPLING_EXPORT void splitByValueRange(const T *arrBg, const T *arrEnd, + static DataArrayType *New(); + T intValue() const; + bool isEqual(const DataArrayDiscrete& other) const; + bool isEqualIfNotWhy(const DataArrayDiscrete& other, std::string& reason) const; + bool isEqualWithoutConsideringStr(const DataArrayDiscrete& other) const; + bool isEqualWithoutConsideringStrAndOrder(const typename Traits::ArrayType& other) const; + void switchOnTupleEqualTo(T val, std::vector& vec) const; + void switchOnTupleNotEqualTo(T val, std::vector& vec) const; + DataArrayIdType *buildPermutationArr(const DataArrayDiscrete& other) const; + DataArrayIdType *indicesOfSubPart(const DataArrayDiscrete& partOfThis) const; + void checkMonotonic(bool increasing) const; + bool isMonotonic(bool increasing) const; + void checkStrictlyMonotonic(bool increasing) const; + bool isStrictlyMonotonic(bool increasing) const; + mcIdType getHashCode() const; + void reprCppStream(const std::string& varName, std::ostream& stream) const; + void reprQuickOverview(std::ostream& stream) const; + void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; + void writeVTK(std::ostream& ofs, mcIdType indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const; + void transformWithIndArr(const T *indArrBg, const T *indArrEnd); + void transformWithIndArr(const MapKeyVal& m); + DataArrayIdType *findIdsEqual(T val) const; + DataArrayIdType *transformWithIndArrR(const T *indArr2Bg, const T *indArrEnd) const; + void splitByValueRange(const T *arrBg, const T *arrEnd, DataArrayType *& castArr, DataArrayType *& rankInsideCast, DataArrayType *& castsPresent) const; - MEDCOUPLING_EXPORT bool isRange(T& strt, T& sttoopp, T& stteepp) const; - MEDCOUPLING_EXPORT DataArrayIdType *invertArrayO2N2N2O(mcIdType newNbOfElem) const; - MEDCOUPLING_EXPORT DataArrayIdType *invertArrayN2O2O2N(mcIdType oldNbOfElem) const; - MEDCOUPLING_EXPORT DataArrayIdType *invertArrayO2N2N2OBis(mcIdType newNbOfElem) const; - MEDCOUPLING_EXPORT MCAuto< MapKeyVal > invertArrayN2O2O2NOptimized() const; - MEDCOUPLING_EXPORT MCAuto< MapKeyVal > giveN2OOptimized() const; - MEDCOUPLING_EXPORT MCAuto findIdForEach(const T *valsBg, const T *valsEnd) const; - MEDCOUPLING_EXPORT DataArrayIdType *checkAndPreparePermutation() const; - MEDCOUPLING_EXPORT void changeSurjectiveFormat(T targetNb, DataArrayIdType *&arr, DataArrayIdType *&arrI) const; - MEDCOUPLING_EXPORT DataArrayIdType *buildPermArrPerLevel() const; - MEDCOUPLING_EXPORT bool isIota(mcIdType sizeExpected) const; - MEDCOUPLING_EXPORT bool isUniform(T val) const; - MEDCOUPLING_EXPORT T checkUniformAndGuess() const; - MEDCOUPLING_EXPORT bool hasUniqueValues() const; - MEDCOUPLING_EXPORT void setSelectedComponents(const DataArrayType *a, const std::vector& compoIds); - MEDCOUPLING_EXPORT DataArrayIdType *findIdsNotEqual(T val) const; - MEDCOUPLING_EXPORT DataArrayIdType *findIdsEqualTuple(const T *tupleBg, const T *tupleEnd) const; - MEDCOUPLING_EXPORT DataArrayIdType *findIdsEqualList(const T *valsBg, const T *valsEnd) const; - MEDCOUPLING_EXPORT DataArrayIdType *findIdsNotEqualList(const T *valsBg, const T *valsEnd) const; - MEDCOUPLING_EXPORT mcIdType findIdFirstEqual(T value) const; - MEDCOUPLING_EXPORT mcIdType findIdFirstEqual(const std::vector& vals) const; - MEDCOUPLING_EXPORT mcIdType findIdFirstEqualTuple(const std::vector& tupl) const; - MEDCOUPLING_EXPORT mcIdType findIdSequence(const std::vector& vals) const; - MEDCOUPLING_EXPORT mcIdType changeValue(T oldValue, T newValue); - MEDCOUPLING_EXPORT mcIdType count(T value) const; - MEDCOUPLING_EXPORT bool presenceOfTuple(const std::vector& tupl) const; - MEDCOUPLING_EXPORT bool presenceOfValue(T value) const; - MEDCOUPLING_EXPORT bool presenceOfValue(const std::vector& vals) const; - MEDCOUPLING_EXPORT void accumulate(T *res) const; - MEDCOUPLING_EXPORT T accumulate(std::size_t compId) const; - MEDCOUPLING_EXPORT DataArrayType *accumulatePerChunck(const mcIdType *bgOfIndex, const mcIdType *endOfIndex) const; - MEDCOUPLING_EXPORT void getMinMaxValues(T& minValue, T& maxValue) const; - MEDCOUPLING_EXPORT void applyInv(T numerator); - MEDCOUPLING_EXPORT void applyDivideBy(T val); - MEDCOUPLING_EXPORT void applyModulus(T val); - MEDCOUPLING_EXPORT void applyRModulus(T val); - MEDCOUPLING_EXPORT void applyPow(T val); - MEDCOUPLING_EXPORT void applyRPow(T val); - MEDCOUPLING_EXPORT DataArrayIdType *findIdsInRange(T vmin, T vmax) const; - MEDCOUPLING_EXPORT DataArrayIdType *findIdsNotInRange(T vmin, T vmax) const; - MEDCOUPLING_EXPORT bool checkAllIdsInRange(T vmin, T vmax) const; - MEDCOUPLING_EXPORT static DataArrayType *Aggregate(const DataArrayType *a1, const DataArrayType *a2, T offsetA2); - MEDCOUPLING_EXPORT static DataArrayType *Aggregate(const std::vector& arr); - MEDCOUPLING_EXPORT static DataArrayType *AggregateIndexes(const std::vector& arrs); - MEDCOUPLING_EXPORT static DataArrayType *BuildUnion(const std::vector& arr); - MEDCOUPLING_EXPORT static DataArrayType *BuildIntersection(const std::vector& arr); - MEDCOUPLING_EXPORT static void PutIntoToSkylineFrmt(const std::vector< std::vector >& v, DataArrayType *& data, DataArrayIdType *& dataIndex); - MEDCOUPLING_EXPORT DataArrayIdType *buildComplement(mcIdType nbOfElement) const; - MEDCOUPLING_EXPORT DataArrayType *buildSubstraction(const DataArrayType *other) const; - MEDCOUPLING_EXPORT DataArrayType *buildSubstractionOptimized(const DataArrayType *other) const; - MEDCOUPLING_EXPORT DataArrayType *buildUnion(const DataArrayType *other) const; - MEDCOUPLING_EXPORT DataArrayType *buildIntersection(const DataArrayType *other) const; - MEDCOUPLING_EXPORT DataArrayType *buildUnique() const; - MEDCOUPLING_EXPORT DataArrayType *buildUniqueNotSorted() const; - MEDCOUPLING_EXPORT DataArrayType *deltaShiftIndex() const; - MEDCOUPLING_EXPORT void computeOffsets(); - MEDCOUPLING_EXPORT void computeOffsetsFull(); - MEDCOUPLING_EXPORT void findIdsRangesInListOfIds(const DataArrayType *listOfIds, DataArrayIdType *& rangeIdsFetched, DataArrayType *& idsInInputListThatFetch) const; - MEDCOUPLING_EXPORT DataArrayType *buildExplicitArrByRanges(const DataArrayType *offsets) const; - MEDCOUPLING_EXPORT DataArrayType *buildExplicitArrOfSliceOnScaledArr(T begin, T stop, T step) const; - MEDCOUPLING_EXPORT DataArrayIdType *findRangeIdForEachTuple(const DataArrayType *ranges) const; - MEDCOUPLING_EXPORT DataArrayType *findIdInRangeForEachTuple(const DataArrayType *ranges) const; - MEDCOUPLING_EXPORT void sortEachPairToMakeALinkedList(); - MEDCOUPLING_EXPORT MCAuto fromLinkedListOfPairToList() const; - MEDCOUPLING_EXPORT DataArrayType *getDifferentValues() const; - MEDCOUPLING_EXPORT std::vector partitionByDifferentValues(std::vector& differentIds) const; - MEDCOUPLING_EXPORT std::vector< std::pair > splitInBalancedSlices(mcIdType nbOfSlices) const; - MEDCOUPLING_EXPORT static DataArrayType *Modulus(const DataArrayType *a1, const DataArrayType *a2); - MEDCOUPLING_EXPORT void modulusEqual(const DataArrayType *other); - MEDCOUPLING_EXPORT static DataArrayType *Pow(const DataArrayType *a1, const DataArrayType *a2); - MEDCOUPLING_EXPORT void powEqual(const DataArrayType *other); - //MEDCOUPLING_EXPORT MemArray& accessToMemArray() { return _mem; } - //MEDCOUPLING_EXPORT const MemArray& accessToMemArray() const { return _mem; } + bool isRange(T& strt, T& sttoopp, T& stteepp) const; + DataArrayIdType *invertArrayO2N2N2O(mcIdType newNbOfElem) const; + DataArrayIdType *invertArrayN2O2O2N(mcIdType oldNbOfElem) const; + DataArrayIdType *invertArrayO2N2N2OBis(mcIdType newNbOfElem) const; + MCAuto< MapKeyVal > invertArrayN2O2O2NOptimized() const; + MCAuto< MapKeyVal > giveN2OOptimized() const; + MCAuto findIdForEach(const T *valsBg, const T *valsEnd) const; + DataArrayIdType *checkAndPreparePermutation() const; + void changeSurjectiveFormat(T targetNb, DataArrayIdType *&arr, DataArrayIdType *&arrI) const; + DataArrayIdType *buildPermArrPerLevel() const; + bool isIota(mcIdType sizeExpected) const; + bool isUniform(T val) const; + T checkUniformAndGuess() const; + bool hasUniqueValues() const; + void setSelectedComponents(const DataArrayType *a, const std::vector& compoIds); + DataArrayIdType *findIdsNotEqual(T val) const; + DataArrayIdType *findIdsEqualTuple(const T *tupleBg, const T *tupleEnd) const; + DataArrayIdType *findIdsEqualList(const T *valsBg, const T *valsEnd) const; + DataArrayIdType *findIdsNotEqualList(const T *valsBg, const T *valsEnd) const; + mcIdType findIdFirstEqual(T value) const; + mcIdType findIdFirstEqual(const std::vector& vals) const; + mcIdType findIdFirstEqualTuple(const std::vector& tupl) const; + mcIdType findIdSequence(const std::vector& vals) const; + mcIdType changeValue(T oldValue, T newValue); + mcIdType count(T value) const; + bool presenceOfTuple(const std::vector& tupl) const; + bool presenceOfValue(T value) const; + bool presenceOfValue(const std::vector& vals) const; + void accumulate(T *res) const; + T accumulate(std::size_t compId) const; + DataArrayType *accumulatePerChunck(const mcIdType *bgOfIndex, const mcIdType *endOfIndex) const; + void getMinMaxValues(T& minValue, T& maxValue) const; + void applyInv(T numerator); + void applyDivideBy(T val); + void applyModulus(T val); + void applyRModulus(T val); + void applyPow(T val); + void applyRPow(T val); + DataArrayIdType *findIdsInRange(T vmin, T vmax) const; + DataArrayIdType *findIdsNotInRange(T vmin, T vmax) const; + bool checkAllIdsInRange(T vmin, T vmax) const; + static DataArrayType *Aggregate(const DataArrayType *a1, const DataArrayType *a2, T offsetA2); + static DataArrayType *Aggregate(const std::vector& arr); + static DataArrayType *AggregateIndexes(const std::vector& arrs); + static DataArrayType *BuildUnion(const std::vector& arr); + static DataArrayType *BuildIntersection(const std::vector& arr); + static void PutIntoToSkylineFrmt(const std::vector< std::vector >& v, DataArrayType *& data, DataArrayIdType *& dataIndex); + DataArrayIdType *buildComplement(mcIdType nbOfElement) const; + DataArrayType *buildSubstraction(const DataArrayType *other) const; + DataArrayType *buildSubstractionOptimized(const DataArrayType *other) const; + DataArrayType *buildUnion(const DataArrayType *other) const; + DataArrayType *buildIntersection(const DataArrayType *other) const; + DataArrayType *buildUnique() const; + DataArrayType *buildUniqueNotSorted() const; + DataArrayType *deltaShiftIndex() const; + void computeOffsets(); + void computeOffsetsFull(); + void findIdsRangesInListOfIds(const DataArrayType *listOfIds, DataArrayIdType *& rangeIdsFetched, DataArrayType *& idsInInputListThatFetch) const; + DataArrayType *buildExplicitArrByRanges(const DataArrayType *offsets) const; + DataArrayType *buildExplicitArrOfSliceOnScaledArr(T begin, T stop, T step) const; + DataArrayIdType *findRangeIdForEachTuple(const DataArrayType *ranges) const; + DataArrayType *findIdInRangeForEachTuple(const DataArrayType *ranges) const; + void sortEachPairToMakeALinkedList(); + MCAuto fromLinkedListOfPairToList() const; + DataArrayType *getDifferentValues() const; + std::vector partitionByDifferentValues(std::vector& differentIds) const; + std::vector< std::pair > splitInBalancedSlices(mcIdType nbOfSlices) const; + static DataArrayType *Modulus(const DataArrayType *a1, const DataArrayType *a2); + void modulusEqual(const DataArrayType *other); + static DataArrayType *Pow(const DataArrayType *a1, const DataArrayType *a2); + void powEqual(const DataArrayType *other); + //MemArray& accessToMemArray() { return _mem; } + //const MemArray& accessToMemArray() const { return _mem; } public: - MEDCOUPLING_EXPORT static DataArrayIdType *FindPermutationFromFirstToSecond(const DataArrayType *ids1, const DataArrayType *ids2); - MEDCOUPLING_EXPORT static mcIdType *CheckAndPreparePermutation(const T *start, const T *end); - MEDCOUPLING_EXPORT static DataArrayType *BuildListOfSwitchedOn(const std::vector& v); - MEDCOUPLING_EXPORT static DataArrayType *BuildListOfSwitchedOff(const std::vector& v); - MEDCOUPLING_EXPORT static DataArrayIdType *ConvertIndexArrayToO2N(mcIdType nbOfOldTuples, const mcIdType *arr, const mcIdType *arrIBg, const mcIdType *arrIEnd, mcIdType &newNbOfTuples); - MEDCOUPLING_EXPORT static DataArrayIdType *MakePartition(const std::vector& groups, mcIdType newNb, std::vector< std::vector >& fidsOfGroups); + static DataArrayIdType *FindPermutationFromFirstToSecond(const DataArrayType *ids1, const DataArrayType *ids2); + static mcIdType *CheckAndPreparePermutation(const T *start, const T *end); + static DataArrayType *BuildListOfSwitchedOn(const std::vector& v); + static DataArrayType *BuildListOfSwitchedOff(const std::vector& v); + static DataArrayIdType *ConvertIndexArrayToO2N(mcIdType nbOfOldTuples, const mcIdType *arr, const mcIdType *arrIBg, const mcIdType *arrIEnd, mcIdType &newNbOfTuples); + static DataArrayIdType *MakePartition(const std::vector& groups, mcIdType newNb, std::vector< std::vector >& fidsOfGroups); public: - MEDCOUPLING_EXPORT static void ExtractFromIndexedArrays(const mcIdType *idsOfSelectBg, const mcIdType *idsOfSelectEnd, + static void ExtractFromIndexedArrays(const mcIdType *idsOfSelectBg, const mcIdType *idsOfSelectEnd, const DataArrayType *arrIn, const DataArrayIdType *arrIndxIn, DataArrayType* &arrOut, DataArrayIdType* &arrIndexOut); - MEDCOUPLING_EXPORT static void ExtractFromIndexedArraysSlice(mcIdType idsOfSelectStart, mcIdType idsOfSelectStop, mcIdType idsOfSelectStep, + static void ExtractFromIndexedArraysSlice(mcIdType idsOfSelectStart, mcIdType idsOfSelectStop, mcIdType idsOfSelectStep, const DataArrayType *arrIn, const DataArrayIdType *arrIndxIn, DataArrayType* &arrOut, DataArrayIdType* &arrIndexOut); - MEDCOUPLING_EXPORT static void SetPartOfIndexedArrays(const mcIdType *idsOfSelectBg, const mcIdType *idsOfSelectEnd, + static void SetPartOfIndexedArrays(const mcIdType *idsOfSelectBg, const mcIdType *idsOfSelectEnd, const DataArrayType *arrIn, const DataArrayIdType *arrIndxIn, const DataArrayType *srcArr, const DataArrayIdType *srcArrIndex, DataArrayType* &arrOut, DataArrayIdType* &arrIndexOut); - MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSlice(mcIdType start, mcIdType end, mcIdType step, + static void SetPartOfIndexedArraysSlice(mcIdType start, mcIdType end, mcIdType step, const DataArrayType *arrIn, const DataArrayIdType *arrIndxIn, const DataArrayType *srcArr, const DataArrayIdType *srcArrIndex, DataArrayType* &arrOut, DataArrayIdType* &arrIndexOut); - MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdx(const mcIdType *idsOfSelectBg, const mcIdType *idsOfSelectEnd, + static void SetPartOfIndexedArraysSameIdx(const mcIdType *idsOfSelectBg, const mcIdType *idsOfSelectEnd, DataArrayType *arrInOut, const DataArrayIdType *arrIndxIn, const DataArrayType *srcArr, const DataArrayIdType *srcArrIndex); - MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdxSlice(mcIdType start, mcIdType end, mcIdType step, + static void SetPartOfIndexedArraysSameIdxSlice(mcIdType start, mcIdType end, mcIdType step, DataArrayType *arrInOut, const DataArrayIdType *arrIndxIn, const DataArrayType *srcArr, const DataArrayIdType *srcArrIndex); - MEDCOUPLING_EXPORT static bool RemoveIdsFromIndexedArrays(const T *idsToRemoveBg, const T *idsToRemoveEnd, + static bool RemoveIdsFromIndexedArrays(const T *idsToRemoveBg, const T *idsToRemoveEnd, DataArrayType *arr, DataArrayIdType *arrIndx, mcIdType offsetForRemoval=0); - MEDCOUPLING_EXPORT static DataArrayType *Range(T begin, T end, T step); + static DataArrayType *Range(T begin, T end, T step); public: - MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector& tinyInfo) const; - MEDCOUPLING_EXPORT void getTinySerializationStrInformation(std::vector& tinyInfo) const; - MEDCOUPLING_EXPORT bool resizeForUnserialization(const std::vector& tinyInfoI); - MEDCOUPLING_EXPORT void finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoS); + void getTinySerializationIntInformation(std::vector& tinyInfo) const; + void getTinySerializationStrInformation(std::vector& tinyInfo) const; + bool resizeForUnserialization(const std::vector& tinyInfoI); + void finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoS); protected: template void switchOnTupleAlg(T val, std::vector& vec, ALG algo) const; @@ -684,48 +684,48 @@ namespace MEDCoupling class DataArrayDiscreteSigned : public DataArrayDiscrete { public: - MEDCOUPLING_EXPORT bool isFittingWith(const std::vector& v) const; + bool isFittingWith(const std::vector& v) const; protected: ~DataArrayDiscreteSigned() { } }; class DataArrayInt32Iterator; - class DataArrayInt32 : public DataArrayDiscreteSigned + class MEDCOUPLING_EXPORT DataArrayInt32 : public DataArrayDiscreteSigned { friend class DataArrayDiscrete; public: - MEDCOUPLING_EXPORT DataArrayInt32 *deepCopy() const;//ok - MEDCOUPLING_EXPORT DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }//ok + DataArrayInt32 *deepCopy() const;//ok + DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }//ok public: - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); } - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayInt32 *keepSelectedComponents(const std::vector& compoIds) const { return this->myKeepSelectedComponents(compoIds); } - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return this->mySelectByTupleIdSafeSlice(bg,end2,step); } - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleRanges(const std::vector >& ranges) const { return this->mySelectByTupleRanges(ranges); } + DataArrayInt32 *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } + DataArrayInt32 *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); } + DataArrayInt32 *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + DataArrayInt32 *keepSelectedComponents(const std::vector& compoIds) const { return this->myKeepSelectedComponents(compoIds); } + DataArrayInt32 *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return this->mySelectByTupleIdSafeSlice(bg,end2,step); } + DataArrayInt32 *selectByTupleRanges(const std::vector >& ranges) const { return this->mySelectByTupleRanges(ranges); } public: - MEDCOUPLING_EXPORT DataArrayInt32Iterator *iterator(); + DataArrayInt32Iterator *iterator(); private: ~DataArrayInt32() { } DataArrayInt32() { } }; - class DataArrayInt64 : public DataArrayDiscreteSigned + class MEDCOUPLING_EXPORT DataArrayInt64 : public DataArrayDiscreteSigned { friend class DataArrayDiscrete; public: - MEDCOUPLING_EXPORT DataArrayInt64 *deepCopy() const; - MEDCOUPLING_EXPORT DataArrayInt64 *buildNewEmptyInstance() const { return DataArrayInt64::New(); }//ok + DataArrayInt64 *deepCopy() const; + DataArrayInt64 *buildNewEmptyInstance() const { return DataArrayInt64::New(); }//ok public: - MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); } - MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayInt64 *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } - MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } - MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } + DataArrayInt64 *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } + DataArrayInt64 *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); } + DataArrayInt64 *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + DataArrayInt64 *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } + DataArrayInt64 *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } + DataArrayInt64 *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } public: - MEDCOUPLING_EXPORT DataArrayInt64Iterator *iterator(); + DataArrayInt64Iterator *iterator(); private: ~DataArrayInt64() { } DataArrayInt64() { } @@ -751,71 +751,71 @@ namespace MEDCoupling return ret; } - class DataArrayChar : public DataArrayTemplate + class MEDCOUPLING_EXPORT DataArrayChar : public DataArrayTemplate { public: - MEDCOUPLING_EXPORT virtual DataArrayChar *buildEmptySpecializedDAChar() const = 0; - MEDCOUPLING_EXPORT mcIdType getHashCode() const; - MEDCOUPLING_EXPORT bool isEqual(const DataArrayChar& other) const; - MEDCOUPLING_EXPORT virtual bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const; - MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayChar& other) const; - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT std::string reprZip() const; - MEDCOUPLING_EXPORT DataArrayInt *convertToIntArr() const; - MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); } - MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayChar *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } - MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } - MEDCOUPLING_EXPORT bool isUniform(char val) const; - MEDCOUPLING_EXPORT void meldWith(const DataArrayChar *other); - MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } - MEDCOUPLING_EXPORT DataArrayIdType *findIdsEqual(char val) const; - MEDCOUPLING_EXPORT DataArrayIdType *findIdsNotEqual(char val) const; - MEDCOUPLING_EXPORT mcIdType findIdSequence(const std::vector& vals) const; - MEDCOUPLING_EXPORT mcIdType findIdFirstEqualTuple(const std::vector& tupl) const; - MEDCOUPLING_EXPORT mcIdType findIdFirstEqual(char value) const; - MEDCOUPLING_EXPORT mcIdType findIdFirstEqual(const std::vector& vals) const; - MEDCOUPLING_EXPORT bool presenceOfTuple(const std::vector& tupl) const; - MEDCOUPLING_EXPORT bool presenceOfValue(char value) const; - MEDCOUPLING_EXPORT bool presenceOfValue(const std::vector& vals) const; - MEDCOUPLING_EXPORT DataArrayIdType *findIdsInRange(char vmin, char vmax) const; - MEDCOUPLING_EXPORT static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2); - MEDCOUPLING_EXPORT static DataArrayChar *Aggregate(const std::vector& arr); - MEDCOUPLING_EXPORT static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2); - MEDCOUPLING_EXPORT static DataArrayChar *Meld(const std::vector& arr); - MEDCOUPLING_EXPORT MemArray& accessToMemArray() { return _mem; } - MEDCOUPLING_EXPORT const MemArray& accessToMemArray() const { return _mem; } + virtual DataArrayChar *buildEmptySpecializedDAChar() const = 0; + mcIdType getHashCode() const; + bool isEqual(const DataArrayChar& other) const; + virtual bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const; + bool isEqualWithoutConsideringStr(const DataArrayChar& other) const; + std::string repr() const; + std::string reprZip() const; + DataArrayInt *convertToIntArr() const; + DataArrayChar *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); } + DataArrayChar *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); } + DataArrayChar *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + DataArrayChar *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } + DataArrayChar *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } + bool isUniform(char val) const; + void meldWith(const DataArrayChar *other); + DataArray *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } + DataArrayIdType *findIdsEqual(char val) const; + DataArrayIdType *findIdsNotEqual(char val) const; + mcIdType findIdSequence(const std::vector& vals) const; + mcIdType findIdFirstEqualTuple(const std::vector& tupl) const; + mcIdType findIdFirstEqual(char value) const; + mcIdType findIdFirstEqual(const std::vector& vals) const; + bool presenceOfTuple(const std::vector& tupl) const; + bool presenceOfValue(char value) const; + bool presenceOfValue(const std::vector& vals) const; + DataArrayIdType *findIdsInRange(char vmin, char vmax) const; + static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2); + static DataArrayChar *Aggregate(const std::vector& arr); + static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2); + static DataArrayChar *Meld(const std::vector& arr); + MemArray& accessToMemArray() { return _mem; } + const MemArray& accessToMemArray() const { return _mem; } public: - //MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector& tinyInfo) const; - //MEDCOUPLING_EXPORT void getTinySerializationStrInformation(std::vector& tinyInfo) const; - //MEDCOUPLING_EXPORT bool resizeForUnserialization(const std::vector& tinyInfoI); - //MEDCOUPLING_EXPORT void finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoS); + //void getTinySerializationIntInformation(std::vector& tinyInfo) const; + //void getTinySerializationStrInformation(std::vector& tinyInfo) const; + //bool resizeForUnserialization(const std::vector& tinyInfoI); + //void finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoS); protected: DataArrayChar() { } }; class DataArrayByteIterator; - class DataArrayByte : public DataArrayChar + class MEDCOUPLING_EXPORT DataArrayByte : public DataArrayChar { public: - MEDCOUPLING_EXPORT static DataArrayByte *New(); - MEDCOUPLING_EXPORT DataArrayChar *buildEmptySpecializedDAChar() const; - MEDCOUPLING_EXPORT DataArrayByteIterator *iterator(); - MEDCOUPLING_EXPORT DataArrayByte *deepCopy() const; - MEDCOUPLING_EXPORT DataArrayByte *performCopyOrIncrRef(bool deepCopy) const; - MEDCOUPLING_EXPORT DataArrayByte *buildNewEmptyInstance() const { return DataArrayByte::New(); } - MEDCOUPLING_EXPORT char byteValue() const; - MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; - MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const; - MEDCOUPLING_EXPORT std::vector toVectorOfBool() const; + static DataArrayByte *New(); + DataArrayChar *buildEmptySpecializedDAChar() const; + DataArrayByteIterator *iterator(); + DataArrayByte *deepCopy() const; + DataArrayByte *performCopyOrIncrRef(bool deepCopy) const; + DataArrayByte *buildNewEmptyInstance() const { return DataArrayByte::New(); } + char byteValue() const; + void reprStream(std::ostream& stream) const; + void reprZipStream(std::ostream& stream) const; + void reprWithoutNameStream(std::ostream& stream) const; + void reprZipWithoutNameStream(std::ostream& stream) const; + void reprCppStream(const std::string& varName, std::ostream& stream) const; + void reprQuickOverview(std::ostream& stream) const; + void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; + bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const; + std::vector toVectorOfBool() const; private: ~DataArrayByte() { } DataArrayByte() { } @@ -823,26 +823,26 @@ namespace MEDCoupling class DataArrayAsciiCharIterator; - class DataArrayAsciiChar : public DataArrayChar + class MEDCOUPLING_EXPORT DataArrayAsciiChar : public DataArrayChar { public: - MEDCOUPLING_EXPORT static DataArrayAsciiChar *New(); - MEDCOUPLING_EXPORT static DataArrayAsciiChar *New(const std::string& st); - MEDCOUPLING_EXPORT static DataArrayAsciiChar *New(const std::vector& vst, char defaultChar); - MEDCOUPLING_EXPORT DataArrayChar *buildEmptySpecializedDAChar() const; - MEDCOUPLING_EXPORT DataArrayAsciiCharIterator *iterator(); - MEDCOUPLING_EXPORT DataArrayAsciiChar *deepCopy() const; - MEDCOUPLING_EXPORT DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const; - MEDCOUPLING_EXPORT DataArrayAsciiChar *buildNewEmptyInstance() const { return DataArrayAsciiChar::New(); } - MEDCOUPLING_EXPORT char asciiCharValue() const; - MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; - MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const; + static DataArrayAsciiChar *New(); + static DataArrayAsciiChar *New(const std::string& st); + static DataArrayAsciiChar *New(const std::vector& vst, char defaultChar); + DataArrayChar *buildEmptySpecializedDAChar() const; + DataArrayAsciiCharIterator *iterator(); + DataArrayAsciiChar *deepCopy() const; + DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const; + DataArrayAsciiChar *buildNewEmptyInstance() const { return DataArrayAsciiChar::New(); } + char asciiCharValue() const; + void reprStream(std::ostream& stream) const; + void reprZipStream(std::ostream& stream) const; + void reprWithoutNameStream(std::ostream& stream) const; + void reprZipWithoutNameStream(std::ostream& stream) const; + void reprCppStream(const std::string& varName, std::ostream& stream) const; + void reprQuickOverview(std::ostream& stream) const; + void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; + bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const; private: ~DataArrayAsciiChar() { } DataArrayAsciiChar() { } @@ -856,7 +856,7 @@ namespace MEDCoupling public: DataArrayIterator(typename Traits::ArrayType *da); ~DataArrayIterator(); - MEDCOUPLING_EXPORT typename Traits::ArrayTuple *nextt(); + typename Traits::ArrayTuple *nextt(); private: typename Traits::ArrayType *_da; T *_pt; @@ -869,12 +869,12 @@ namespace MEDCoupling class DataArrayTuple { public: - MEDCOUPLING_EXPORT DataArrayTuple(T *pt, std::size_t nbOfComp); - //MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT std::size_t getNumberOfCompo() const { return _nb_of_compo; } - MEDCOUPLING_EXPORT const T *getConstPointer() const { return _pt; } - MEDCOUPLING_EXPORT T *getPointer() { return _pt; } - MEDCOUPLING_EXPORT typename Traits::ArrayType *buildDA(std::size_t nbOfTuples, std::size_t nbOfCompo) const; + DataArrayTuple(T *pt, std::size_t nbOfComp); + std::string repr() const; + std::size_t getNumberOfCompo() const { return _nb_of_compo; } + const T *getConstPointer() const { return _pt; } + T *getPointer() { return _pt; } + typename Traits::ArrayType *buildDA(std::size_t nbOfTuples, std::size_t nbOfCompo) const; protected: T zeValue() const; protected: @@ -884,82 +884,82 @@ namespace MEDCoupling class DataArrayDoubleTuple; - class DataArrayDoubleIterator : public DataArrayIterator + class MEDCOUPLING_EXPORT DataArrayDoubleIterator : public DataArrayIterator { public: - MEDCOUPLING_EXPORT DataArrayDoubleIterator(DataArrayDouble *da); - MEDCOUPLING_EXPORT ~DataArrayDoubleIterator() { } + DataArrayDoubleIterator(DataArrayDouble *da); + ~DataArrayDoubleIterator() { } }; - class DataArrayDoubleTuple : public DataArrayTuple + class MEDCOUPLING_EXPORT DataArrayDoubleTuple : public DataArrayTuple { public: - MEDCOUPLING_EXPORT DataArrayDoubleTuple(double *pt, std::size_t nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT double doubleValue() const; - MEDCOUPLING_EXPORT DataArrayDouble *buildDADouble(std::size_t nbOfTuples, std::size_t nbOfCompo) const; + DataArrayDoubleTuple(double *pt, std::size_t nbOfComp); + std::string repr() const; + double doubleValue() const; + DataArrayDouble *buildDADouble(std::size_t nbOfTuples, std::size_t nbOfCompo) const; }; class DataArrayFloatTuple; - class DataArrayFloatIterator : public DataArrayIterator + class MEDCOUPLING_EXPORT DataArrayFloatIterator : public DataArrayIterator { public: - MEDCOUPLING_EXPORT DataArrayFloatIterator(DataArrayFloat *da); - MEDCOUPLING_EXPORT ~DataArrayFloatIterator() { } + DataArrayFloatIterator(DataArrayFloat *da); + ~DataArrayFloatIterator() { } }; - class DataArrayFloatTuple : public DataArrayTuple + class MEDCOUPLING_EXPORT DataArrayFloatTuple : public DataArrayTuple { public: - MEDCOUPLING_EXPORT DataArrayFloatTuple(float *pt, std::size_t nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT float floatValue() const; - MEDCOUPLING_EXPORT DataArrayFloat *buildDAFloat(std::size_t nbOfTuples, std::size_t nbOfCompo) const; + DataArrayFloatTuple(float *pt, std::size_t nbOfComp); + std::string repr() const; + float floatValue() const; + DataArrayFloat *buildDAFloat(std::size_t nbOfTuples, std::size_t nbOfCompo) const; }; - class DataArrayInt32Iterator : public DataArrayIterator + class MEDCOUPLING_EXPORT DataArrayInt32Iterator : public DataArrayIterator { public: - MEDCOUPLING_EXPORT DataArrayInt32Iterator(DataArrayInt32 *da); - MEDCOUPLING_EXPORT ~DataArrayInt32Iterator() { } + DataArrayInt32Iterator(DataArrayInt32 *da); + ~DataArrayInt32Iterator() { } }; - class DataArrayInt64Iterator : public DataArrayIterator + class MEDCOUPLING_EXPORT DataArrayInt64Iterator : public DataArrayIterator { public: - MEDCOUPLING_EXPORT DataArrayInt64Iterator(DataArrayInt64 *da); - MEDCOUPLING_EXPORT ~DataArrayInt64Iterator() { } + DataArrayInt64Iterator(DataArrayInt64 *da); + ~DataArrayInt64Iterator() { } }; - class DataArrayInt32Tuple : public DataArrayTuple + class MEDCOUPLING_EXPORT DataArrayInt32Tuple : public DataArrayTuple { public: - MEDCOUPLING_EXPORT DataArrayInt32Tuple(Int32 *pt, std::size_t nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT Int32 intValue() const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildDAInt(std::size_t nbOfTuples, std::size_t nbOfCompo) const; + DataArrayInt32Tuple(Int32 *pt, std::size_t nbOfComp); + std::string repr() const; + Int32 intValue() const; + DataArrayInt32 *buildDAInt(std::size_t nbOfTuples, std::size_t nbOfCompo) const; }; - class DataArrayInt64Tuple : public DataArrayTuple + class MEDCOUPLING_EXPORT DataArrayInt64Tuple : public DataArrayTuple { public: - MEDCOUPLING_EXPORT DataArrayInt64Tuple(Int64 *pt, std::size_t nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT Int64 intValue() const; - MEDCOUPLING_EXPORT DataArrayInt64 *buildDAInt(std::size_t nbOfTuples, std::size_t nbOfCompo) const; + DataArrayInt64Tuple(Int64 *pt, std::size_t nbOfComp); + std::string repr() const; + Int64 intValue() const; + DataArrayInt64 *buildDAInt(std::size_t nbOfTuples, std::size_t nbOfCompo) const; }; typedef DataArrayInt32Tuple DataArrayIntTuple; class DataArrayAsciiCharTuple; - class DataArrayAsciiCharIterator + class MEDCOUPLING_EXPORT DataArrayAsciiCharIterator { public: - MEDCOUPLING_EXPORT DataArrayAsciiCharIterator(DataArrayAsciiChar *da); - MEDCOUPLING_EXPORT ~DataArrayAsciiCharIterator(); - MEDCOUPLING_EXPORT DataArrayAsciiCharTuple *nextt(); + DataArrayAsciiCharIterator(DataArrayAsciiChar *da); + ~DataArrayAsciiCharIterator(); + DataArrayAsciiCharTuple *nextt(); private: DataArrayAsciiChar *_da; char *_pt; @@ -968,16 +968,16 @@ namespace MEDCoupling mcIdType _nb_tuple; }; - class DataArrayAsciiCharTuple + class MEDCOUPLING_EXPORT DataArrayAsciiCharTuple { public: - MEDCOUPLING_EXPORT DataArrayAsciiCharTuple(char *pt, std::size_t nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT std::size_t getNumberOfCompo() const { return _nb_of_compo; } - MEDCOUPLING_EXPORT const char *getConstPointer() const { return _pt; } - MEDCOUPLING_EXPORT char *getPointer() { return _pt; } - MEDCOUPLING_EXPORT char asciiCharValue() const; - MEDCOUPLING_EXPORT DataArrayAsciiChar *buildDAAsciiChar(std::size_t nbOfTuples, std::size_t nbOfCompo) const; + DataArrayAsciiCharTuple(char *pt, std::size_t nbOfComp); + std::string repr() const; + std::size_t getNumberOfCompo() const { return _nb_of_compo; } + const char *getConstPointer() const { return _pt; } + char *getPointer() { return _pt; } + char asciiCharValue() const; + DataArrayAsciiChar *buildDAAsciiChar(std::size_t nbOfTuples, std::size_t nbOfCompo) const; private: char *_pt; std::size_t _nb_of_compo; @@ -985,12 +985,12 @@ namespace MEDCoupling class DataArrayByteTuple; - class DataArrayByteIterator + class MEDCOUPLING_EXPORT DataArrayByteIterator { public: - MEDCOUPLING_EXPORT DataArrayByteIterator(DataArrayByte *da); - MEDCOUPLING_EXPORT ~DataArrayByteIterator(); - MEDCOUPLING_EXPORT DataArrayByteTuple *nextt(); + DataArrayByteIterator(DataArrayByte *da); + ~DataArrayByteIterator(); + DataArrayByteTuple *nextt(); private: DataArrayByte *_da; char *_pt; @@ -999,16 +999,16 @@ namespace MEDCoupling mcIdType _nb_tuple; }; - class DataArrayByteTuple + class MEDCOUPLING_EXPORT DataArrayByteTuple { public: - MEDCOUPLING_EXPORT DataArrayByteTuple(char *pt, std::size_t nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT std::size_t getNumberOfCompo() const { return _nb_of_compo; } - MEDCOUPLING_EXPORT const char *getConstPointer() const { return _pt; } - MEDCOUPLING_EXPORT char *getPointer() { return _pt; } - MEDCOUPLING_EXPORT char byteValue() const; - MEDCOUPLING_EXPORT DataArrayByte *buildDAByte(std::size_t nbOfTuples, std::size_t nbOfCompo) const; + DataArrayByteTuple(char *pt, std::size_t nbOfComp); + std::string repr() const; + std::size_t getNumberOfCompo() const { return _nb_of_compo; } + const char *getConstPointer() const { return _pt; } + char *getPointer() { return _pt; } + char byteValue() const; + DataArrayByte *buildDAByte(std::size_t nbOfTuples, std::size_t nbOfCompo) const; private: char *_pt; std::size_t _nb_of_compo; diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.hxx b/src/MEDCoupling/MEDCouplingRefCountObject.hxx index b61aa6740..f9edf9ac4 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.hxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.hxx @@ -69,58 +69,58 @@ namespace MEDCoupling MEDCOUPLING_EXPORT const char *MEDCouplingByteOrderStr(); MEDCOUPLING_EXPORT bool IsCXX11Compiled(); - class BigMemoryObject + class MEDCOUPLING_EXPORT BigMemoryObject { public: - MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const; - MEDCOUPLING_EXPORT std::string getHeapMemorySizeStr() const; - MEDCOUPLING_EXPORT std::vector getDirectChildren() const; - MEDCOUPLING_EXPORT std::vector getAllTheProgeny() const; - MEDCOUPLING_EXPORT bool isObjectInTheProgeny(const BigMemoryObject *obj) const; - MEDCOUPLING_EXPORT static std::size_t GetHeapMemorySizeOfObjs(const std::vector& objs); - MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const = 0; - MEDCOUPLING_EXPORT virtual std::vector getDirectChildrenWithNull() const = 0; - MEDCOUPLING_EXPORT virtual ~BigMemoryObject(); + std::size_t getHeapMemorySize() const; + std::string getHeapMemorySizeStr() const; + std::vector getDirectChildren() const; + std::vector getAllTheProgeny() const; + bool isObjectInTheProgeny(const BigMemoryObject *obj) const; + static std::size_t GetHeapMemorySizeOfObjs(const std::vector& objs); + virtual std::size_t getHeapMemorySizeWithoutChildren() const = 0; + virtual std::vector getDirectChildrenWithNull() const = 0; + virtual ~BigMemoryObject(); private: static std::size_t GetHeapMemoryOfSet(std::set& s1, std::set& s2); }; - class RefCountObjectOnly + class MEDCOUPLING_EXPORT RefCountObjectOnly { protected: - MEDCOUPLING_EXPORT RefCountObjectOnly(); - MEDCOUPLING_EXPORT RefCountObjectOnly(const RefCountObjectOnly& other); + RefCountObjectOnly(); + RefCountObjectOnly(const RefCountObjectOnly& other); public: - MEDCOUPLING_EXPORT bool decrRef() const; - MEDCOUPLING_EXPORT void incrRef() const; - MEDCOUPLING_EXPORT int getRCValue() const; - MEDCOUPLING_EXPORT RefCountObjectOnly& operator=(const RefCountObjectOnly& other); + bool decrRef() const; + void incrRef() const; + int getRCValue() const; + RefCountObjectOnly& operator=(const RefCountObjectOnly& other); protected: virtual ~RefCountObjectOnly(); private: mutable std::atomic _cnt; }; - class RefCountObject : public RefCountObjectOnly, public BigMemoryObject + class MEDCOUPLING_EXPORT RefCountObject : public RefCountObjectOnly, public BigMemoryObject { protected: - MEDCOUPLING_EXPORT RefCountObject(); - MEDCOUPLING_EXPORT RefCountObject(const RefCountObject& other); - MEDCOUPLING_EXPORT virtual ~RefCountObject(); + RefCountObject(); + RefCountObject(const RefCountObject& other); + virtual ~RefCountObject(); }; - class GlobalDict + class MEDCOUPLING_EXPORT GlobalDict { public: - MEDCOUPLING_EXPORT static GlobalDict *GetInstance(); - MEDCOUPLING_EXPORT bool hasKey(const std::string& key) const; - MEDCOUPLING_EXPORT std::string value(const std::string& key) const; - MEDCOUPLING_EXPORT std::vector keys() const; - MEDCOUPLING_EXPORT void erase(const std::string& key); - MEDCOUPLING_EXPORT void clear(); - MEDCOUPLING_EXPORT void setKeyValue(const std::string& key, const std::string& val); - MEDCOUPLING_EXPORT void setKeyValueForce(const std::string& key, const std::string& val); - MEDCOUPLING_EXPORT std::string printSelf() const; + static GlobalDict *GetInstance(); + bool hasKey(const std::string& key) const; + std::string value(const std::string& key) const; + std::vector keys() const; + void erase(const std::string& key); + void clear(); + void setKeyValue(const std::string& key, const std::string& val); + void setKeyValueForce(const std::string& key, const std::string& val); + std::string printSelf() const; private: GlobalDict() { } private: diff --git a/src/MEDCoupling_Swig/CMakeLists.txt b/src/MEDCoupling_Swig/CMakeLists.txt index 38643a5ed..c6724e3e9 100644 --- a/src/MEDCoupling_Swig/CMakeLists.txt +++ b/src/MEDCoupling_Swig/CMakeLists.txt @@ -102,6 +102,9 @@ IF(WIN32) SET_PROPERTY(SOURCE MEDCoupling.i PROPERTY SWIG_MODULE_NAME MEDCouplingCompat) SET_PROPERTY(SOURCE MEDCoupling.i PROPERTY COMPILE_DEFINITIONS WIN32) SET(SWIG_MODULE_MEDCouplingCompat_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") + IF(MEDCOUPLING_USE_64BIT_IDS) + STRING(APPEND SWIG_MODULE_MEDCouplingCompat_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS") + ENDIF(MEDCOUPLING_USE_64BIT_IDS) ELSE() SET(MEDCouling_target_name MEDCoupling) ENDIF() @@ -121,6 +124,9 @@ ENDIF(WIN32) # ${PYTHON_LIBRARIES} not needed SWIG_CHECK_GENERATION(${MEDCouling_target_name}) SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON) +IF(WIN32) + SET_PROPERTY(SOURCE MEDCouplingRemapper.i PROPERTY COMPILE_DEFINITIONS WIN32) +ENDIF() IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3") SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_FLAGS "-py3") ELSE() diff --git a/src/MEDCoupling_Swig/DataArrayInt.i b/src/MEDCoupling_Swig/DataArrayInt.i index 6017f1559..087e61929 100644 --- a/src/MEDCoupling_Swig/DataArrayInt.i +++ b/src/MEDCoupling_Swig/DataArrayInt.i @@ -2555,8 +2555,11 @@ void transformWithIndArr(PyObject *li) namespace MEDCoupling { typedef int Int32; - typedef long int Int64; - +#ifdef WIN32 + typedef long long Int64; +#else + typedef long int Int64; +#endif class DataArrayInt32Iterator; diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index e6f78013b..d90474d78 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -74,9 +74,14 @@ typedef DataArrayInt32 DataArrayIdType; %template(i64vec) std::vector; #else //typedef std::int64_t mcIdType; -typedef long int mcIdType; typedef DataArrayInt64 DataArrayIdType; +#ifdef WIN32 +%template(ivec) std::vector; +typedef long long mcIdType; +#else %template(ivec) std::vector; +typedef long int mcIdType; +#endif %template(i32vec) std::vector; #endif diff --git a/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx b/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx index 3187b80eb..dc07ddd68 100644 --- a/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx +++ b/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx @@ -148,7 +148,11 @@ extern "C" { if(self->_pt_mc) { +#ifdef WIN32 + MEDCoupling::MemArray& mma=self->_pt_mc->accessToMemArray(); +#else MEDCoupling::MemArray& mma=self->_pt_mc->accessToMemArray(); +#endif mma.destroy(); } Py_XINCREF(Py_None); @@ -425,7 +429,11 @@ struct NPYTraits }; template<> +#ifdef WIN32 +struct NPYTraits +#else struct NPYTraits +#endif { static const int NPYObjectType=NPY_INT64; static PyTypeObject *NPYFunc; diff --git a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i index cc99dc9bb..5c21279f6 100644 --- a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i +++ b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i @@ -3363,8 +3363,12 @@ PyTypeObject *NPYTraits::NPYFunc=&PyCallBackDataArrayFloat_RefType; PyTypeObject *NPYTraits::NPYFunc=&PyCallBackDataArrayInt32_RefType; +#ifdef WIN32 +PyTypeObject *NPYTraits::NPYFunc=&PyCallBackDataArrayInt64_RefType; +#else PyTypeObject *NPYTraits::NPYFunc=&PyCallBackDataArrayInt64_RefType; #endif +#endif template typename MEDCoupling::Traits::ArrayType *DataArrayT__setitem__(typename MEDCoupling::Traits::ArrayType *self, PyObject *obj, PyObject *value) diff --git a/src/MEDLoader/Swig/CMakeLists.txt b/src/MEDLoader/Swig/CMakeLists.txt index 428263cd2..0bf28c398 100644 --- a/src/MEDLoader/Swig/CMakeLists.txt +++ b/src/MEDLoader/Swig/CMakeLists.txt @@ -71,6 +71,9 @@ IF(MEDCOUPLING_BUILD_DOC) swig_ready) ENDIF() +IF(WIN32) + SET_PROPERTY(SOURCE MEDLoader.i PROPERTY COMPILE_DEFINITIONS WIN32) +ENDIF() IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(MEDLoader python MEDLoader.i) diff --git a/src/PyWrapping/CMakeLists.txt b/src/PyWrapping/CMakeLists.txt index 11430ce98..3b178e8fc 100644 --- a/src/PyWrapping/CMakeLists.txt +++ b/src/PyWrapping/CMakeLists.txt @@ -24,6 +24,9 @@ INCLUDE(${SWIG_USE_FILE}) ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS}) SET_SOURCE_FILES_PROPERTIES(medcoupling.i PROPERTIES CPLUSPLUS ON) +IF(WIN32) + SET_PROPERTY(SOURCE medcoupling.i PROPERTY COMPILE_DEFINITIONS WIN32) +ENDIF() IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3") SET_SOURCE_FILES_PROPERTIES(medcoupling.i PROPERTIES SWIG_FLAGS "-py3") ELSE() diff --git a/src/RENUMBER_Swig/CMakeLists.txt b/src/RENUMBER_Swig/CMakeLists.txt index a85a1a6be..a3e2097ac 100644 --- a/src/RENUMBER_Swig/CMakeLists.txt +++ b/src/RENUMBER_Swig/CMakeLists.txt @@ -56,6 +56,9 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints ) +IF(WIN32) + SET_PROPERTY(SOURCE MEDRenumber.i PROPERTY COMPILE_DEFINITIONS WIN32) +ENDIF() IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(MEDRenumber python MEDRenumber.i) ELSE() diff --git a/src/RENUMBER_Swig/MEDRenumberCommon.i b/src/RENUMBER_Swig/MEDRenumberCommon.i index 382c1b057..ae3872dbc 100644 --- a/src/RENUMBER_Swig/MEDRenumberCommon.i +++ b/src/RENUMBER_Swig/MEDRenumberCommon.i @@ -24,9 +24,7 @@ %include "MEDCouplingCommon.i" %{ -#ifndef WIN32 #include "MEDCouplingMemArray.txx" -#endif #include "MCAuto.hxx" #include "MEDCouplingDataArrayTypemaps.i"