From 629ef91212424e91fc195aeaf411fd383c6c01bc Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 29 Aug 2018 14:46:27 +0300 Subject: [PATCH] SALOME 9.1.0 Windows version --- .../ExprEval/InterpKernelFunction.cxx | 5 + .../ExprEval/InterpKernelUnit.cxx | 5 + .../ExprEval/InterpKernelValue.cxx | 4 + .../Geometric2D/InterpKernelGeo2DEdge.cxx | 5 + .../InterpKernelGeo2DPrecision.hxx | 2 +- .../InterpKernelCellSimplify.cxx | 4 + src/INTERP_KERNEL/VectorUtils.hxx | 4 + src/MEDCoupling/MEDCoupling.hxx | 2 +- src/MEDCoupling/MEDCouplingAMRAttribute.cxx | 4 + src/MEDCoupling/MEDCouplingMemArray.hxx | 998 +++++++++--------- src/MEDCoupling/MEDCouplingPartDefinition.cxx | 4 + .../MEDCouplingUMesh_intersection.cxx | 4 +- src/MEDCoupling_Swig/CMakeLists.txt | 15 +- src/MEDCoupling_Swig/MEDCouplingCommon.i | 3 + .../MEDCouplingDataArrayTraits.hxx | 4 + src/MEDLoader/Swig/CMakeLists.txt | 10 +- src/MEDPartitioner_Swig/CMakeLists.txt | 7 +- src/ParaMEDMEM_Swig/CMakeLists.txt | 7 +- src/PyWrapping/CMakeLists.txt | 15 +- src/PyWrapping/medcoupling.i | 6 + src/RENUMBER_Swig/CMakeLists.txt | 7 +- src/RENUMBER_Swig/MEDRenumber.i | 1 + src/RENUMBER_Swig/MEDRenumberCommon.i | 4 +- 23 files changed, 604 insertions(+), 516 deletions(-) diff --git a/src/INTERP_KERNEL/ExprEval/InterpKernelFunction.cxx b/src/INTERP_KERNEL/ExprEval/InterpKernelFunction.cxx index c3ddbac46..83fe7332d 100644 --- a/src/INTERP_KERNEL/ExprEval/InterpKernelFunction.cxx +++ b/src/INTERP_KERNEL/ExprEval/InterpKernelFunction.cxx @@ -24,6 +24,11 @@ #include #include +#ifdef WIN32 +#include +#endif + + using namespace INTERP_KERNEL; const char IdentityFunction::REPR[]="Id"; diff --git a/src/INTERP_KERNEL/ExprEval/InterpKernelUnit.cxx b/src/INTERP_KERNEL/ExprEval/InterpKernelUnit.cxx index aeee8ba16..675af9990 100644 --- a/src/INTERP_KERNEL/ExprEval/InterpKernelUnit.cxx +++ b/src/INTERP_KERNEL/ExprEval/InterpKernelUnit.cxx @@ -26,6 +26,11 @@ #include #include +#ifdef WIN32 +#include +#endif + + using namespace INTERP_KERNEL; UnitDataBase UnitDataBase::_uniqueMapForExpr; diff --git a/src/INTERP_KERNEL/ExprEval/InterpKernelValue.cxx b/src/INTERP_KERNEL/ExprEval/InterpKernelValue.cxx index 833607843..223e34063 100644 --- a/src/INTERP_KERNEL/ExprEval/InterpKernelValue.cxx +++ b/src/INTERP_KERNEL/ExprEval/InterpKernelValue.cxx @@ -25,6 +25,10 @@ #include #include +#ifdef WIN32 +#include +#endif + using namespace INTERP_KERNEL; ValueDouble::ValueDouble():_data(std::numeric_limits::max()) diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx index 27a9acb99..03ae45f56 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx @@ -28,6 +28,11 @@ #include +#ifdef WIN32 +#include +#endif + + using namespace INTERP_KERNEL; MergePoints::MergePoints():_ass1Start1(0),_ass1End1(0),_ass1Start2(0),_ass1End2(0), diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DPrecision.hxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DPrecision.hxx index 00149c564..e66a0a378 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DPrecision.hxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DPrecision.hxx @@ -36,7 +36,7 @@ namespace INTERP_KERNEL * When the instance is destroyed, the previous precision is set back. * */ - class QuadraticPlanarPrecision + class INTERPKERNEL_EXPORT QuadraticPlanarPrecision { public: QuadraticPlanarPrecision(double prec); diff --git a/src/INTERP_KERNEL/InterpKernelCellSimplify.cxx b/src/INTERP_KERNEL/InterpKernelCellSimplify.cxx index 40fad8559..761c1595c 100644 --- a/src/INTERP_KERNEL/InterpKernelCellSimplify.cxx +++ b/src/INTERP_KERNEL/InterpKernelCellSimplify.cxx @@ -31,6 +31,10 @@ #include #include +#ifdef WIN32 +#include +#endif + using namespace INTERP_KERNEL; /*! diff --git a/src/INTERP_KERNEL/VectorUtils.hxx b/src/INTERP_KERNEL/VectorUtils.hxx index 7ac0582bd..b409447e8 100644 --- a/src/INTERP_KERNEL/VectorUtils.hxx +++ b/src/INTERP_KERNEL/VectorUtils.hxx @@ -26,6 +26,10 @@ #include #include +#ifdef WIN32 +#include +#endif + namespace INTERP_KERNEL { /// Precision used for tests of 3D part of INTERP_KERNEL diff --git a/src/MEDCoupling/MEDCoupling.hxx b/src/MEDCoupling/MEDCoupling.hxx index 89add71b6..5b6208fb3 100644 --- a/src/MEDCoupling/MEDCoupling.hxx +++ b/src/MEDCoupling/MEDCoupling.hxx @@ -22,7 +22,7 @@ #define _MEDCOUPLING_HXX_ #ifdef WIN32 -# if defined medcoupling_EXPORTS +# if defined(medcoupling_EXPORTS) || defined(medcouplingcpp_EXPORTS) # define MEDCOUPLING_EXPORT __declspec( dllexport ) # else # define MEDCOUPLING_EXPORT __declspec( dllimport ) diff --git a/src/MEDCoupling/MEDCouplingAMRAttribute.cxx b/src/MEDCoupling/MEDCouplingAMRAttribute.cxx index 7302fa45f..f1e508106 100644 --- a/src/MEDCoupling/MEDCouplingAMRAttribute.cxx +++ b/src/MEDCoupling/MEDCouplingAMRAttribute.cxx @@ -26,6 +26,10 @@ #include #include +#ifdef WIN32 +#include +#endif + using namespace MEDCoupling; /// @cond INTERNAL diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index edb12b566..ac38430a6 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -127,84 +127,84 @@ namespace MEDCoupling class DataArrayInt32; 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(int i) const; - MEDCOUPLING_EXPORT std::string getVarOnComponent(int i) const; - MEDCOUPLING_EXPORT std::string getUnitOnComponent(int i) const; - MEDCOUPLING_EXPORT void setInfoOnComponent(int 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 int *bgTuples, const int *endTuples, int bgComp, int endComp, int 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 std::size_t getNumberOfTuples() const = 0; - MEDCOUPLING_EXPORT virtual std::size_t 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 int *old2New) = 0; - MEDCOUPLING_EXPORT virtual void renumberInPlaceR(const int *new2Old) = 0; - MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt32 *tuplesSelec) = 0; - MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int 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 int *new2OldBg, const int *new2OldEnd) const = 0; - MEDCOUPLING_EXPORT virtual DataArray *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const = 0; - MEDCOUPLING_EXPORT virtual DataArray *selectByTupleIdSafeSlice(int bg, int end2, int step) const = 0; - MEDCOUPLING_EXPORT virtual void rearrange(int newNbOfCompo) = 0; - MEDCOUPLING_EXPORT virtual void circularPermutation(int nbOfShift=1) = 0; - MEDCOUPLING_EXPORT virtual void circularPermutationPerTuple(int nbOfShift=1) = 0; - MEDCOUPLING_EXPORT virtual void reversePerTuple() = 0; - MEDCOUPLING_EXPORT void checkNbOfTuples(int nbOfTuples, const std::string& msg) const; - MEDCOUPLING_EXPORT void checkNbOfComps(int nbOfCompo, const std::string& msg) const; - MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const; - MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const; - MEDCOUPLING_EXPORT void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const; - MEDCOUPLING_EXPORT static void GetSlice(int start, int stop, int step, int sliceId, int nbOfSlices, int& startSlice, int& stopSlice); - MEDCOUPLING_EXPORT static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg); - MEDCOUPLING_EXPORT static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg); - MEDCOUPLING_EXPORT static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int 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(int i) const; + std::string getVarOnComponent(int i) const; + std::string getUnitOnComponent(int i) const; + void setInfoOnComponent(int i, const std::string& info); + std::size_t getNumberOfComponents() const { return _info_on_compo.size(); } + void setPartOfValuesBase3(const DataArray *aBase, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int 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 std::size_t getNumberOfTuples() const = 0; + virtual std::size_t 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 int *old2New) = 0; + virtual void renumberInPlaceR(const int *new2Old) = 0; + virtual void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt32 *tuplesSelec) = 0; + virtual void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step) = 0; + virtual DataArray *selectByTupleRanges(const std::vector >& ranges) const = 0; + virtual DataArray *keepSelectedComponents(const std::vector& compoIds) const = 0; + virtual DataArray *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const = 0; + virtual DataArray *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const = 0; + virtual DataArray *selectByTupleIdSafeSlice(int bg, int end2, int step) const = 0; + virtual void rearrange(int newNbOfCompo) = 0; + virtual void circularPermutation(int nbOfShift=1) = 0; + virtual void circularPermutationPerTuple(int nbOfShift=1) = 0; + virtual void reversePerTuple() = 0; + void checkNbOfTuples(int nbOfTuples, const std::string& msg) const; + void checkNbOfComps(int nbOfCompo, const std::string& msg) const; + void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const; + void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const; + void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const; + static void GetSlice(int start, int stop, int step, int sliceId, int nbOfSlices, int& startSlice, int& stopSlice); + static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg); + static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg); + static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int 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(int ref, int value, const std::string& msg); - MEDCOUPLING_EXPORT static void CheckValueInRangeEx(int value, int start, int end, const std::string& msg); - MEDCOUPLING_EXPORT static void CheckClosingParInRange(int ref, int value, const std::string& msg); - MEDCOUPLING_EXPORT static int EffectiveCircPerm(int nbOfShift, int nbOfTuples); + static void CheckValueInRange(int ref, int value, const std::string& msg); + static void CheckValueInRangeEx(int value, int start, int end, const std::string& msg); + static void CheckClosingParInRange(int ref, int value, const std::string& msg); + static int EffectiveCircPerm(int nbOfShift, int nbOfTuples); protected: std::string _name; std::vector _info_on_compo; @@ -221,29 +221,29 @@ 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 std::size_t getNumberOfTuples() const { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); } - MEDCOUPLING_EXPORT std::size_t getNbOfElems() const { return _mem.getNbOfElem(); } + std::size_t getNumberOfTuples() const { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); } + std::size_t getNbOfElems() const { return _mem.getNbOfElem(); } 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(); } + 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, int nbOfTuple, int nbOfCompo); void useExternalArrayWithRWAccess(const T *array, int nbOfTuple, int nbOfCompo); T getIJSafe(int tupleId, int compoId) const; - MEDCOUPLING_EXPORT T getIJ(int tupleId, int compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; } - MEDCOUPLING_EXPORT void setIJ(int tupleId, int compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); } - MEDCOUPLING_EXPORT void setIJSilent(int tupleId, int compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; } - MEDCOUPLING_EXPORT T *getPointer() { return _mem.getPointer(); declareAsNew(); } + T getIJ(int tupleId, int compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; } + void setIJ(int tupleId, int compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); } + void setIJSilent(int tupleId, int compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; } + T *getPointer() { return _mem.getPointer(); declareAsNew(); } void pack() const; bool isAllocated() const; void checkAllocated() const; @@ -291,15 +291,15 @@ namespace MEDCoupling T getMaxAbsValueInArray() const; T getMinValue(int& tupleId) const; T getMinValueInArray() const; - MEDCOUPLING_EXPORT void getTuple(int tupleId, T *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } + void getTuple(int 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, int 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, int 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 int *new2OldBg, const int *new2OldEnd) const; typename Traits::ArrayType *mySelectByTupleId(const DataArrayInt32& di) const; @@ -315,44 +315,44 @@ 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, int 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 DataArrayInt32 *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(int 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 reprNotTooLong() const; + MCAuto convertToDblArr() const; + MCAuto convertToIntArr() const; + MCAuto convertToFloatArr() const; + void applyLin(T a, T b, int 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; + DataArrayInt32 *findIdsStrictlyNegative() const; + typename Traits::ArrayType *fromNoInterlace() const; + typename Traits::ArrayType *toNoInterlace() const; + void meldWith(const typename Traits::ArrayType *other); + typename Traits::ArrayType *duplicateEachTupleNTimes(int 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 reprNotTooLong() const; template MCAuto< typename Traits::ArrayType > convertToOtherTypeOfArr() const; protected: @@ -368,34 +368,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 int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleId(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleIdSafeSlice(int bg, int end2, int 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 int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleId(new2OldBg,new2OldEnd); } + DataArrayFloat *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + DataArrayFloat *selectByTupleIdSafeSlice(int bg, int end2, int 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() { } @@ -405,109 +405,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 std::string repr() const; - MEDCOUPLING_EXPORT std::string reprZip() const; - MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int 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 int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleId(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const DataArrayInt32& di) const { return DataArrayTemplateFP::mySelectByTupleId(di); } - MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayDouble *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplateFP::myKeepSelectedComponents(compoIds); } - MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafeSlice(int bg, int end2, int 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, DataArrayInt32 *&tupleIds) const; - MEDCOUPLING_EXPORT void findCommonTuples(double prec, int limitTupleId, DataArrayInt32 *&comm, DataArrayInt32 *&commIndex) const; - MEDCOUPLING_EXPORT double minimalDistanceTo(const DataArrayDouble *other, int& thisTupleId, int& otherTupleId) const; - MEDCOUPLING_EXPORT DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const; - MEDCOUPLING_EXPORT DataArrayInt32 *findClosestTupleId(const DataArrayDouble *other) const; - MEDCOUPLING_EXPORT DataArrayInt32 *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, DataArrayInt32 *& c, DataArrayInt32 *& cI) const; - MEDCOUPLING_EXPORT void recenterForMaxPrecision(double eps); - MEDCOUPLING_EXPORT double getMaxValue2(DataArrayInt32*& tupleIds) const; - MEDCOUPLING_EXPORT double getMinValue2(DataArrayInt32*& tupleIds) const; - MEDCOUPLING_EXPORT int count(double value, double eps) const; - MEDCOUPLING_EXPORT double getAverageValue() const; - MEDCOUPLING_EXPORT double norm2() const; - MEDCOUPLING_EXPORT double normMax() const; - MEDCOUPLING_EXPORT double normMin() const; - MEDCOUPLING_EXPORT void accumulate(double *res) const; - MEDCOUPLING_EXPORT double accumulate(int compId) const; - MEDCOUPLING_EXPORT DataArrayDouble *accumulatePerChunck(const int *bgOfIndex, const int *endOfIndex) const; - MEDCOUPLING_EXPORT MCAuto cumSum() const; - MEDCOUPLING_EXPORT double distanceToTuple(const double *tupleBg, const double *tupleEnd, int& 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(DataArrayInt32* &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(int nbOfComp, FunctionToEvaluate func) const; - MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(int 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(int nbOfComp, const std::string& func, bool isSafe=true) const; - MEDCOUPLING_EXPORT DataArrayDouble *applyFuncNamedCompo(int 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 DataArrayInt32 *findIdsInRange(double vmin, double vmax) const; - MEDCOUPLING_EXPORT DataArrayInt32 *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, int nbNodes, const double *coordsIn, double *coordsOut); - MEDCOUPLING_EXPORT static void Rotate3DAlg(const double *center, const double *vect, double angle, int nbNodes, const double *coordsIn, double *coordsOut); - MEDCOUPLING_EXPORT static void Symmetry3DPlane(const double point[3], const double normalVector[3], int nbNodes, const double *coordsIn, double *coordsOut); - MEDCOUPLING_EXPORT static void GiveBaseForPlane(const double normalVector[3], double baseOfPlane[9]); - 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); + 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; + std::string repr() const; + std::string reprZip() const; + void writeVTK(std::ostream& ofs, int 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 int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleId(new2OldBg,new2OldEnd); } + DataArrayDouble *selectByTupleId(const DataArrayInt32& di) const { return DataArrayTemplateFP::mySelectByTupleId(di); } + DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + DataArrayDouble *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplateFP::myKeepSelectedComponents(compoIds); } + DataArrayDouble *selectByTupleIdSafeSlice(int bg, int end2, int 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, DataArrayInt32 *&tupleIds) const; + void findCommonTuples(double prec, int limitTupleId, DataArrayInt32 *&comm, DataArrayInt32 *&commIndex) const; + double minimalDistanceTo(const DataArrayDouble *other, int& thisTupleId, int& otherTupleId) const; + DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const; + DataArrayInt32 *findClosestTupleId(const DataArrayDouble *other) const; + DataArrayInt32 *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, DataArrayInt32 *& c, DataArrayInt32 *& cI) const; + void recenterForMaxPrecision(double eps); + double getMaxValue2(DataArrayInt32*& tupleIds) const; + double getMinValue2(DataArrayInt32*& tupleIds) const; + int count(double value, double eps) const; + double getAverageValue() const; + double norm2() const; + double normMax() const; + double normMin() const; + void accumulate(double *res) const; + double accumulate(int compId) const; + DataArrayDouble *accumulatePerChunck(const int *bgOfIndex, const int *endOfIndex) const; + MCAuto cumSum() const; + double distanceToTuple(const double *tupleBg, const double *tupleEnd, int& 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(DataArrayInt32* &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(int nbOfComp, FunctionToEvaluate func) const; + DataArrayDouble *applyFunc(int 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(int nbOfComp, const std::string& func, bool isSafe=true) const; + DataArrayDouble *applyFuncNamedCompo(int 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; + DataArrayInt32 *findIdsInRange(double vmin, double vmax) const; + DataArrayInt32 *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, int nbNodes, const double *coordsIn, double *coordsOut); + static void Rotate3DAlg(const double *center, const double *vect, double angle, int nbNodes, const double *coordsIn, double *coordsOut); + static void Symmetry3DPlane(const double point[3], const double normalVector[3], int nbNodes, const double *coordsIn, double *coordsOut); + static void GiveBaseForPlane(const double normalVector[3], double baseOfPlane[9]); + public: + 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, int nbNodes, int limitNodeId, double prec, DataArrayInt32 *c, DataArrayInt32 *cI) const; @@ -525,18 +525,18 @@ namespace MEDCoupling class DataArrayDiscrete : public DataArrayTemplateClassic { public: - 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; + 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; protected: template void switchOnTupleAlg(T val, std::vector& vec, ALG algo) const; @@ -548,125 +548,125 @@ 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 { public: - MEDCOUPLING_EXPORT static DataArrayInt32 *New(); - MEDCOUPLING_EXPORT int intValue() const; - MEDCOUPLING_EXPORT int getHashCode() const; - MEDCOUPLING_EXPORT DataArrayInt32 *deepCopy() const;//ok - MEDCOUPLING_EXPORT DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }//ok - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT std::string reprZip() const; - MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& type, 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 void transformWithIndArr(const int *indArrBg, const int *indArrEnd); - MEDCOUPLING_EXPORT void transformWithIndArr(const MapKeyVal& m); - MEDCOUPLING_EXPORT DataArrayInt32 *transformWithIndArrR(const int *indArrBg, const int *indArrEnd) const; - MEDCOUPLING_EXPORT void splitByValueRange(const int *arrBg, const int *arrEnd, + static DataArrayInt32 *New(); + int intValue() const; + int getHashCode() const; + DataArrayInt32 *deepCopy() const;//ok + DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }//ok + std::string repr() const; + std::string reprZip() const; + void writeVTK(std::ostream& ofs, int indent, const std::string& type, 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; + void transformWithIndArr(const int *indArrBg, const int *indArrEnd); + void transformWithIndArr(const MapKeyVal& m); + DataArrayInt32 *transformWithIndArrR(const int *indArrBg, const int *indArrEnd) const; + void splitByValueRange(const int *arrBg, const int *arrEnd, DataArrayInt32 *& castArr, DataArrayInt32 *& rankInsideCast, DataArrayInt32 *& castsPresent) const; - MEDCOUPLING_EXPORT bool isRange(int& strt, int& sttoopp, int& stteepp) const; - MEDCOUPLING_EXPORT DataArrayInt32 *invertArrayO2N2N2O(int newNbOfElem) const; - MEDCOUPLING_EXPORT DataArrayInt32 *invertArrayN2O2O2N(int oldNbOfElem) const; - MEDCOUPLING_EXPORT MCAuto< MapKeyVal > invertArrayN2O2O2NOptimized() const; - MEDCOUPLING_EXPORT DataArrayInt32 *invertArrayO2N2N2OBis(int newNbOfElem) const; - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleId(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleId(const DataArrayInt32& di) const { return DataArrayTemplate::mySelectByTupleId(di); } - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayInt32 *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } - MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } - MEDCOUPLING_EXPORT DataArrayInt32 *checkAndPreparePermutation() const; - MEDCOUPLING_EXPORT static DataArrayInt32 *FindPermutationFromFirstToSecond(const DataArrayInt32 *ids1, const DataArrayInt32 *ids2); - MEDCOUPLING_EXPORT void changeSurjectiveFormat(int targetNb, DataArrayInt32 *&arr, DataArrayInt32 *&arrI) const; - MEDCOUPLING_EXPORT static DataArrayInt32 *ConvertIndexArrayToO2N(int nbOfOldTuples, const int *arr, const int *arrIBg, const int *arrIEnd, int &newNbOfTuples); - MEDCOUPLING_EXPORT DataArrayInt32 *buildPermArrPerLevel() const; - MEDCOUPLING_EXPORT bool isIota(int sizeExpected) const; - MEDCOUPLING_EXPORT bool isUniform(int val) const; - MEDCOUPLING_EXPORT int checkUniformAndGuess() const; - MEDCOUPLING_EXPORT bool hasUniqueValues() const; - MEDCOUPLING_EXPORT void setSelectedComponents(const DataArrayInt32 *a, const std::vector& compoIds); - MEDCOUPLING_EXPORT DataArrayInt32Iterator *iterator(); - MEDCOUPLING_EXPORT DataArrayInt32 *findIdsEqual(int val) const; - MEDCOUPLING_EXPORT DataArrayInt32 *findIdsNotEqual(int val) const; - MEDCOUPLING_EXPORT DataArrayInt32 *findIdsEqualList(const int *valsBg, const int *valsEnd) const; - MEDCOUPLING_EXPORT DataArrayInt32 *findIdsNotEqualList(const int *valsBg, const int *valsEnd) const; - MEDCOUPLING_EXPORT DataArrayInt32 *findIdsEqualTuple(const int *tupleBg, const int *tupleEnd) const; - MEDCOUPLING_EXPORT MCAuto findIdForEach(const int *valsBg, const int *valsEnd) const; - MEDCOUPLING_EXPORT int changeValue(int oldValue, int newValue); - MEDCOUPLING_EXPORT int findIdFirstEqualTuple(const std::vector& tupl) const; - MEDCOUPLING_EXPORT int findIdFirstEqual(int value) const; - MEDCOUPLING_EXPORT int findIdFirstEqual(const std::vector& vals) const; - MEDCOUPLING_EXPORT int findIdSequence(const std::vector& vals) const; - MEDCOUPLING_EXPORT bool presenceOfTuple(const std::vector& tupl) const; - MEDCOUPLING_EXPORT bool presenceOfValue(int value) const; - MEDCOUPLING_EXPORT bool presenceOfValue(const std::vector& vals) const; - MEDCOUPLING_EXPORT int count(int value) const; - MEDCOUPLING_EXPORT void accumulate(int *res) const; - MEDCOUPLING_EXPORT int accumulate(int compId) const; - MEDCOUPLING_EXPORT DataArrayInt32 *accumulatePerChunck(const int *bgOfIndex, const int *endOfIndex) const; - MEDCOUPLING_EXPORT void getMinMaxValues(int& minValue, int& maxValue) const; - MEDCOUPLING_EXPORT void applyInv(int numerator); - MEDCOUPLING_EXPORT void applyDivideBy(int val); - MEDCOUPLING_EXPORT void applyModulus(int val); - MEDCOUPLING_EXPORT void applyRModulus(int val); - MEDCOUPLING_EXPORT void applyPow(int val); - MEDCOUPLING_EXPORT void applyRPow(int val); - MEDCOUPLING_EXPORT DataArrayInt32 *findIdsInRange(int vmin, int vmax) const; - MEDCOUPLING_EXPORT DataArrayInt32 *findIdsNotInRange(int vmin, int vmax) const; - MEDCOUPLING_EXPORT bool checkAllIdsInRange(int vmin, int vmax) const; - MEDCOUPLING_EXPORT static DataArrayInt32 *Aggregate(const DataArrayInt32 *a1, const DataArrayInt32 *a2, int offsetA2); - MEDCOUPLING_EXPORT static DataArrayInt32 *Aggregate(const std::vector& arr); - MEDCOUPLING_EXPORT static DataArrayInt32 *AggregateIndexes(const std::vector& arrs); - MEDCOUPLING_EXPORT static DataArrayInt32 *MakePartition(const std::vector& groups, int newNb, std::vector< std::vector >& fidsOfGroups); - MEDCOUPLING_EXPORT static DataArrayInt32 *BuildUnion(const std::vector& arr); - MEDCOUPLING_EXPORT static DataArrayInt32 *BuildIntersection(const std::vector& arr); - MEDCOUPLING_EXPORT static DataArrayInt32 *BuildListOfSwitchedOn(const std::vector& v); - MEDCOUPLING_EXPORT static DataArrayInt32 *BuildListOfSwitchedOff(const std::vector& v); - MEDCOUPLING_EXPORT static void PutIntoToSkylineFrmt(const std::vector< std::vector >& v, DataArrayInt32 *& data, DataArrayInt32 *& dataIndex); - MEDCOUPLING_EXPORT DataArrayInt32 *buildComplement(int nbOfElement) const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildSubstraction(const DataArrayInt32 *other) const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildSubstractionOptimized(const DataArrayInt32 *other) const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildUnion(const DataArrayInt32 *other) const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildIntersection(const DataArrayInt32 *other) const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildUnique() const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildUniqueNotSorted() const; - MEDCOUPLING_EXPORT DataArrayInt32 *deltaShiftIndex() const; - MEDCOUPLING_EXPORT void computeOffsets(); - MEDCOUPLING_EXPORT void computeOffsetsFull(); - MEDCOUPLING_EXPORT void findIdsRangesInListOfIds(const DataArrayInt32 *listOfIds, DataArrayInt32 *& rangeIdsFetched, DataArrayInt32 *& idsInInputListThatFetch) const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildExplicitArrByRanges(const DataArrayInt32 *offsets) const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildExplicitArrOfSliceOnScaledArr(int begin, int stop, int step) const; - MEDCOUPLING_EXPORT DataArrayInt32 *findRangeIdForEachTuple(const DataArrayInt32 *ranges) const; - MEDCOUPLING_EXPORT DataArrayInt32 *findIdInRangeForEachTuple(const DataArrayInt32 *ranges) const; - MEDCOUPLING_EXPORT void sortEachPairToMakeALinkedList(); - MEDCOUPLING_EXPORT MCAuto fromLinkedListOfPairToList() const; - MEDCOUPLING_EXPORT DataArrayInt32 *getDifferentValues() const; - MEDCOUPLING_EXPORT std::vector partitionByDifferentValues(std::vector& differentIds) const; - MEDCOUPLING_EXPORT std::vector< std::pair > splitInBalancedSlices(int nbOfSlices) const; - MEDCOUPLING_EXPORT static DataArrayInt32 *Modulus(const DataArrayInt32 *a1, const DataArrayInt32 *a2); - MEDCOUPLING_EXPORT void modulusEqual(const DataArrayInt32 *other); - MEDCOUPLING_EXPORT static DataArrayInt32 *Pow(const DataArrayInt32 *a1, const DataArrayInt32 *a2); - MEDCOUPLING_EXPORT void powEqual(const DataArrayInt32 *other); - MEDCOUPLING_EXPORT MemArray& accessToMemArray() { return _mem; } - MEDCOUPLING_EXPORT const MemArray& accessToMemArray() const { return _mem; } - public: - MEDCOUPLING_EXPORT static int *CheckAndPreparePermutation(const int *start, const int *end); - MEDCOUPLING_EXPORT static DataArrayInt32 *Range(int begin, int end, int 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); + bool isRange(int& strt, int& sttoopp, int& stteepp) const; + DataArrayInt32 *invertArrayO2N2N2O(int newNbOfElem) const; + DataArrayInt32 *invertArrayN2O2O2N(int oldNbOfElem) const; + MCAuto< MapKeyVal > invertArrayN2O2O2NOptimized() const; + DataArrayInt32 *invertArrayO2N2N2OBis(int newNbOfElem) const; + DataArrayInt32 *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleId(new2OldBg,new2OldEnd); } + DataArrayInt32 *selectByTupleId(const DataArrayInt32& di) const { return DataArrayTemplate::mySelectByTupleId(di); } + DataArrayInt32 *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + DataArrayInt32 *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } + DataArrayInt32 *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } + DataArrayInt32 *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } + DataArrayInt32 *checkAndPreparePermutation() const; + static DataArrayInt32 *FindPermutationFromFirstToSecond(const DataArrayInt32 *ids1, const DataArrayInt32 *ids2); + void changeSurjectiveFormat(int targetNb, DataArrayInt32 *&arr, DataArrayInt32 *&arrI) const; + static DataArrayInt32 *ConvertIndexArrayToO2N(int nbOfOldTuples, const int *arr, const int *arrIBg, const int *arrIEnd, int &newNbOfTuples); + DataArrayInt32 *buildPermArrPerLevel() const; + bool isIota(int sizeExpected) const; + bool isUniform(int val) const; + int checkUniformAndGuess() const; + bool hasUniqueValues() const; + void setSelectedComponents(const DataArrayInt32 *a, const std::vector& compoIds); + DataArrayInt32Iterator *iterator(); + DataArrayInt32 *findIdsEqual(int val) const; + DataArrayInt32 *findIdsNotEqual(int val) const; + DataArrayInt32 *findIdsEqualList(const int *valsBg, const int *valsEnd) const; + DataArrayInt32 *findIdsNotEqualList(const int *valsBg, const int *valsEnd) const; + DataArrayInt32 *findIdsEqualTuple(const int *tupleBg, const int *tupleEnd) const; + MCAuto findIdForEach(const int *valsBg, const int *valsEnd) const; + int changeValue(int oldValue, int newValue); + int findIdFirstEqualTuple(const std::vector& tupl) const; + int findIdFirstEqual(int value) const; + int findIdFirstEqual(const std::vector& vals) const; + int findIdSequence(const std::vector& vals) const; + bool presenceOfTuple(const std::vector& tupl) const; + bool presenceOfValue(int value) const; + bool presenceOfValue(const std::vector& vals) const; + int count(int value) const; + void accumulate(int *res) const; + int accumulate(int compId) const; + DataArrayInt32 *accumulatePerChunck(const int *bgOfIndex, const int *endOfIndex) const; + void getMinMaxValues(int& minValue, int& maxValue) const; + void applyInv(int numerator); + void applyDivideBy(int val); + void applyModulus(int val); + void applyRModulus(int val); + void applyPow(int val); + void applyRPow(int val); + DataArrayInt32 *findIdsInRange(int vmin, int vmax) const; + DataArrayInt32 *findIdsNotInRange(int vmin, int vmax) const; + bool checkAllIdsInRange(int vmin, int vmax) const; + static DataArrayInt32 *Aggregate(const DataArrayInt32 *a1, const DataArrayInt32 *a2, int offsetA2); + static DataArrayInt32 *Aggregate(const std::vector& arr); + static DataArrayInt32 *AggregateIndexes(const std::vector& arrs); + static DataArrayInt32 *MakePartition(const std::vector& groups, int newNb, std::vector< std::vector >& fidsOfGroups); + static DataArrayInt32 *BuildUnion(const std::vector& arr); + static DataArrayInt32 *BuildIntersection(const std::vector& arr); + static DataArrayInt32 *BuildListOfSwitchedOn(const std::vector& v); + static DataArrayInt32 *BuildListOfSwitchedOff(const std::vector& v); + static void PutIntoToSkylineFrmt(const std::vector< std::vector >& v, DataArrayInt32 *& data, DataArrayInt32 *& dataIndex); + DataArrayInt32 *buildComplement(int nbOfElement) const; + DataArrayInt32 *buildSubstraction(const DataArrayInt32 *other) const; + DataArrayInt32 *buildSubstractionOptimized(const DataArrayInt32 *other) const; + DataArrayInt32 *buildUnion(const DataArrayInt32 *other) const; + DataArrayInt32 *buildIntersection(const DataArrayInt32 *other) const; + DataArrayInt32 *buildUnique() const; + DataArrayInt32 *buildUniqueNotSorted() const; + DataArrayInt32 *deltaShiftIndex() const; + void computeOffsets(); + void computeOffsetsFull(); + void findIdsRangesInListOfIds(const DataArrayInt32 *listOfIds, DataArrayInt32 *& rangeIdsFetched, DataArrayInt32 *& idsInInputListThatFetch) const; + DataArrayInt32 *buildExplicitArrByRanges(const DataArrayInt32 *offsets) const; + DataArrayInt32 *buildExplicitArrOfSliceOnScaledArr(int begin, int stop, int step) const; + DataArrayInt32 *findRangeIdForEachTuple(const DataArrayInt32 *ranges) const; + DataArrayInt32 *findIdInRangeForEachTuple(const DataArrayInt32 *ranges) const; + void sortEachPairToMakeALinkedList(); + MCAuto fromLinkedListOfPairToList() const; + DataArrayInt32 *getDifferentValues() const; + std::vector partitionByDifferentValues(std::vector& differentIds) const; + std::vector< std::pair > splitInBalancedSlices(int nbOfSlices) const; + static DataArrayInt32 *Modulus(const DataArrayInt32 *a1, const DataArrayInt32 *a2); + void modulusEqual(const DataArrayInt32 *other); + static DataArrayInt32 *Pow(const DataArrayInt32 *a1, const DataArrayInt32 *a2); + void powEqual(const DataArrayInt32 *other); + MemArray& accessToMemArray() { return _mem; } + const MemArray& accessToMemArray() const { return _mem; } + public: + static int *CheckAndPreparePermutation(const int *start, const int *end); + static DataArrayInt32 *Range(int begin, int end, int step); + public: + 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); private: ~DataArrayInt32() { } DataArrayInt32() { } @@ -692,71 +692,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 int 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 int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleId(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const DataArrayInt& di) const { return DataArrayTemplate::mySelectByTupleId(di); } - MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - MEDCOUPLING_EXPORT DataArrayChar *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } - MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafeSlice(int bg, int end2, int 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 DataArrayInt *findIdsEqual(char val) const; - MEDCOUPLING_EXPORT DataArrayInt *findIdsNotEqual(char val) const; - MEDCOUPLING_EXPORT int findIdSequence(const std::vector& vals) const; - MEDCOUPLING_EXPORT int findIdFirstEqualTuple(const std::vector& tupl) const; - MEDCOUPLING_EXPORT int findIdFirstEqual(char value) const; - MEDCOUPLING_EXPORT int 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 DataArrayInt *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; } - 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); + virtual DataArrayChar *buildEmptySpecializedDAChar() const = 0; + int 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 int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleId(new2OldBg,new2OldEnd); } + DataArrayChar *selectByTupleId(const DataArrayInt& di) const { return DataArrayTemplate::mySelectByTupleId(di); } + DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + DataArrayChar *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } + DataArrayChar *selectByTupleIdSafeSlice(int bg, int end2, int 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); } + DataArrayInt *findIdsEqual(char val) const; + DataArrayInt *findIdsNotEqual(char val) const; + int findIdSequence(const std::vector& vals) const; + int findIdFirstEqualTuple(const std::vector& tupl) const; + int findIdFirstEqual(char value) const; + int 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; + DataArrayInt *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: + //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() { } @@ -764,26 +764,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() { } @@ -797,7 +797,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; @@ -810,12 +810,12 @@ namespace MEDCoupling class DataArrayTuple { public: - MEDCOUPLING_EXPORT DataArrayTuple(T *pt, int nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT int 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(int nbOfTuples, int nbOfCompo) const; + DataArrayTuple(T *pt, int nbOfComp); + std::string repr() const; + int getNumberOfCompo() const { return _nb_of_compo; } + const T *getConstPointer() const { return _pt; } + T *getPointer() { return _pt; } + typename Traits::ArrayType *buildDA(int nbOfTuples, int nbOfCompo) const; protected: T zeValue() const; protected: @@ -825,66 +825,66 @@ 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, int nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT double doubleValue() const; - MEDCOUPLING_EXPORT DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const; + DataArrayDoubleTuple(double *pt, int nbOfComp); + std::string repr() const; + double doubleValue() const; + DataArrayDouble *buildDADouble(int nbOfTuples, int 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, int nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT float floatValue() const; - MEDCOUPLING_EXPORT DataArrayFloat *buildDAFloat(int nbOfTuples, int nbOfCompo) const; + DataArrayFloatTuple(float *pt, int nbOfComp); + std::string repr() const; + float floatValue() const; + DataArrayFloat *buildDAFloat(int nbOfTuples, int nbOfCompo) const; }; - class DataArrayIntIterator : public DataArrayIterator + class MEDCOUPLING_EXPORT DataArrayIntIterator : public DataArrayIterator { public: - MEDCOUPLING_EXPORT DataArrayIntIterator(DataArrayInt *da); - MEDCOUPLING_EXPORT ~DataArrayIntIterator() { } + DataArrayIntIterator(DataArrayInt *da); + ~DataArrayIntIterator() { } }; - class DataArrayInt32Tuple : public DataArrayTuple + class MEDCOUPLING_EXPORT DataArrayInt32Tuple : public DataArrayTuple { public: - MEDCOUPLING_EXPORT DataArrayInt32Tuple(int *pt, int nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT int intValue() const; - MEDCOUPLING_EXPORT DataArrayInt32 *buildDAInt(int nbOfTuples, int nbOfCompo) const; + DataArrayInt32Tuple(int *pt, int nbOfComp); + std::string repr() const; + int intValue() const; + DataArrayInt32 *buildDAInt(int nbOfTuples, int 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; @@ -893,16 +893,16 @@ namespace MEDCoupling int _nb_tuple; }; - class DataArrayAsciiCharTuple + class MEDCOUPLING_EXPORT DataArrayAsciiCharTuple { public: - MEDCOUPLING_EXPORT DataArrayAsciiCharTuple(char *pt, int nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT int 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(int nbOfTuples, int nbOfCompo) const; + DataArrayAsciiCharTuple(char *pt, int nbOfComp); + std::string repr() const; + int getNumberOfCompo() const { return _nb_of_compo; } + const char *getConstPointer() const { return _pt; } + char *getPointer() { return _pt; } + char asciiCharValue() const; + DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const; private: char *_pt; int _nb_of_compo; @@ -910,12 +910,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; @@ -924,16 +924,16 @@ namespace MEDCoupling int _nb_tuple; }; - class DataArrayByteTuple + class MEDCOUPLING_EXPORT DataArrayByteTuple { public: - MEDCOUPLING_EXPORT DataArrayByteTuple(char *pt, int nbOfComp); - MEDCOUPLING_EXPORT std::string repr() const; - MEDCOUPLING_EXPORT int 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(int nbOfTuples, int nbOfCompo) const; + DataArrayByteTuple(char *pt, int nbOfComp); + std::string repr() const; + int getNumberOfCompo() const { return _nb_of_compo; } + const char *getConstPointer() const { return _pt; } + char *getPointer() { return _pt; } + char byteValue() const; + DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const; private: char *_pt; int _nb_of_compo; diff --git a/src/MEDCoupling/MEDCouplingPartDefinition.cxx b/src/MEDCoupling/MEDCouplingPartDefinition.cxx index 9652e8ddd..6d5c92ad0 100644 --- a/src/MEDCoupling/MEDCouplingPartDefinition.cxx +++ b/src/MEDCoupling/MEDCouplingPartDefinition.cxx @@ -22,6 +22,10 @@ #include +#ifdef WIN32 +#include +#endif + using namespace MEDCoupling; PartDefinition *PartDefinition::New(int start, int stop, int step) diff --git a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx index ba461e5a4..51b716ba0 100644 --- a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx @@ -2016,7 +2016,7 @@ DataArrayInt *MEDCouplingUMesh::conformize2D(double eps) */ DataArrayInt *MEDCouplingUMesh::colinearize2D(double eps) { - internalColinearize2D(eps, false); + return internalColinearize2D(eps, false); } /*! @@ -2028,7 +2028,7 @@ DataArrayInt *MEDCouplingUMesh::colinearize2D(double eps) */ DataArrayInt *MEDCouplingUMesh::colinearizeKeepingConform2D(double eps) { - internalColinearize2D(eps, true); + return internalColinearize2D(eps, true); } diff --git a/src/MEDCoupling_Swig/CMakeLists.txt b/src/MEDCoupling_Swig/CMakeLists.txt index e45a6af1b..f23027b02 100644 --- a/src/MEDCoupling_Swig/CMakeLists.txt +++ b/src/MEDCoupling_Swig/CMakeLists.txt @@ -87,7 +87,12 @@ IF(MEDCOUPLING_BUILD_DOC) swig_ready) ENDIF() -SWIG_ADD_MODULE(MEDCoupling python MEDCoupling.i) +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(MEDCoupling python MEDCoupling.i) +ELSE() + SWIG_ADD_LIBRARY(MEDCoupling LANGUAGE python SOURCES MEDCoupling.i) +ENDIF() + SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingcpp) SWIG_CHECK_GENERATION(MEDCoupling) SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON) @@ -103,7 +108,13 @@ SET (SWIG_MODULE_MEDCouplingRemapper_EXTRA_DEPS ${MEDCoupling_SWIG_DPYS_FILES} ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX}) -SWIG_ADD_MODULE(MEDCouplingRemapper python MEDCouplingRemapper.i) + +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(MEDCouplingRemapper python MEDCouplingRemapper.i) +ELSE() + SWIG_ADD_LIBRARY(MEDCouplingRemapper LANGUAGE python SOURCES MEDCouplingRemapper.i) +ENDIF() + SWIG_LINK_LIBRARIES(MEDCouplingRemapper ${PYTHON_LIBRARIES} medcouplingremapper) IF(WIN32) diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index 40dcdafcd..9a94201a1 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -31,6 +31,9 @@ #include "MEDCouplingMappedExtrudedMesh.hxx" #include "MEDCouplingCMesh.hxx" #include "MEDCouplingIMesh.hxx" +#ifdef WIN32 +#include "MEDCouplingMap.txx" +#endif #include "MEDCouplingCurveLinearMesh.hxx" #include "MEDCoupling1GTUMesh.hxx" #include "MEDCouplingField.hxx" diff --git a/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx b/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx index 359bc7ecd..996ea502a 100644 --- a/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx +++ b/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx @@ -23,6 +23,10 @@ #include "MEDCouplingMemArray.hxx" +#ifdef WIN32 +#include +#endif + #include #ifdef WITH_NUMPY diff --git a/src/MEDLoader/Swig/CMakeLists.txt b/src/MEDLoader/Swig/CMakeLists.txt index 35532b6b2..b6853c2d6 100644 --- a/src/MEDLoader/Swig/CMakeLists.txt +++ b/src/MEDLoader/Swig/CMakeLists.txt @@ -68,11 +68,19 @@ IF(MEDCOUPLING_BUILD_DOC) swig_ready) ENDIF() -SWIG_ADD_MODULE(MEDLoader python MEDLoader.i) + +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(MEDLoader python MEDLoader.i) +ELSE() + SWIG_ADD_LIBRARY(MEDLoader LANGUAGE python SOURCES MEDLoader.i) +ENDIF() + SWIG_LINK_LIBRARIES(MEDLoader ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medloader medcouplingcpp ) SWIG_CHECK_GENERATION(MEDLoader) IF(WIN32) SET_TARGET_PROPERTIES(_MEDLoader PROPERTIES DEBUG_OUTPUT_NAME _MEDLoader_d) + # To increase the size of the .obj file on Windows because MEDLoaderPYTHON_wrap.cxx, generated by SWIG, is too big + TARGET_COMPILE_OPTIONS(_MEDLoader PRIVATE /bigobj) ENDIF(WIN32) INSTALL(TARGETS _MEDLoader DESTINATION ${MEDCOUPLING_INSTALL_PYTHON}) diff --git a/src/MEDPartitioner_Swig/CMakeLists.txt b/src/MEDPartitioner_Swig/CMakeLists.txt index c53153aec..9477822a4 100644 --- a/src/MEDPartitioner_Swig/CMakeLists.txt +++ b/src/MEDPartitioner_Swig/CMakeLists.txt @@ -52,7 +52,12 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints ) -SWIG_ADD_MODULE(MEDPartitioner python MEDPartitioner.i) +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(MEDPartitioner python MEDPartitioner.i) +ELSE() + SWIG_ADD_LIBRARY(MEDPartitioner LANGUAGE python SOURCES MEDPartitioner.i) +ENDIF() + SWIG_LINK_LIBRARIES(MEDPartitioner ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medpartitionercpp) SWIG_CHECK_GENERATION(MEDPartitioner) diff --git a/src/ParaMEDMEM_Swig/CMakeLists.txt b/src/ParaMEDMEM_Swig/CMakeLists.txt index 6e66dca05..a3fd5daa8 100644 --- a/src/ParaMEDMEM_Swig/CMakeLists.txt +++ b/src/ParaMEDMEM_Swig/CMakeLists.txt @@ -49,7 +49,12 @@ SET (SWIG_MODULE_ParaMEDMEM_EXTRA_DEPS ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX}) -SWIG_ADD_MODULE(ParaMEDMEM python ParaMEDMEM.i) +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(ParaMEDMEM python ParaMEDMEM.i) +ELSE() + SWIG_ADD_LIBRARY(ParaMEDMEM LANGUAGE python SOURCES ParaMEDMEM.i) +ENDIF() + SWIG_LINK_LIBRARIES(ParaMEDMEM ${PYTHON_LIBRARIES} paramedmem) SWIG_CHECK_GENERATION(ParaMEDMEM) diff --git a/src/PyWrapping/CMakeLists.txt b/src/PyWrapping/CMakeLists.txt index b5ab6867b..3d49b5e4a 100644 --- a/src/PyWrapping/CMakeLists.txt +++ b/src/PyWrapping/CMakeLists.txt @@ -82,14 +82,19 @@ IF(MEDCOUPLING_USE_MPI) LIST(APPEND medcoupling_LIB_dependancies paramedmem) ENDIF(MEDCOUPLING_USE_MPI) -SWIG_ADD_MODULE(medcoupling python medcoupling.i) -SWIG_LINK_LIBRARIES(medcoupling ${medcoupling_LIB_dependancies}) -SWIG_CHECK_GENERATION(medcoupling) +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(medcoupling1 python medcoupling.i) +ELSE() + SWIG_ADD_LIBRARY(medcoupling1 LANGUAGE python SOURCES medcoupling.i) +ENDIF() + +SWIG_LINK_LIBRARIES(medcoupling1 ${medcoupling_LIB_dependancies}) +SWIG_CHECK_GENERATION(medcoupling1) IF(WIN32) - SET_TARGET_PROPERTIES(_medcoupling PROPERTIES DEBUG_OUTPUT_NAME _medcoupling_d) + SET_TARGET_PROPERTIES(_medcoupling1 PROPERTIES DEBUG_OUTPUT_NAME _medcoupling1_d) ENDIF(WIN32) -INSTALL(TARGETS _medcoupling DESTINATION ${MEDCOUPLING_INSTALL_PYTHON}) +INSTALL(TARGETS _medcoupling1 DESTINATION ${MEDCOUPLING_INSTALL_PYTHON}) INSTALL(FILES medcoupling.i medcoupling_pycode DESTINATION ${MEDCOUPLING_INSTALL_HEADERS}) SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/medcoupling.py ${MEDCOUPLING_INSTALL_PYTHON}) diff --git a/src/PyWrapping/medcoupling.i b/src/PyWrapping/medcoupling.i index c97318d5b..3e3abc7cc 100644 --- a/src/PyWrapping/medcoupling.i +++ b/src/PyWrapping/medcoupling.i @@ -21,6 +21,12 @@ %module medcoupling +%{ +#ifdef WIN32 +#include "MEDCouplingMap.txx" +#endif +%} + #define MEDCOUPLINGREMAPPER_EXPORT #define INTERPKERNEL_EXPORT #define MEDCOUPLING_EXPORT diff --git a/src/RENUMBER_Swig/CMakeLists.txt b/src/RENUMBER_Swig/CMakeLists.txt index 8cd351a3a..baa3989fa 100644 --- a/src/RENUMBER_Swig/CMakeLists.txt +++ b/src/RENUMBER_Swig/CMakeLists.txt @@ -49,7 +49,12 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints ) -SWIG_ADD_MODULE(MEDRenumber python MEDRenumber.i) +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(MEDRenumber python MEDRenumber.i) +ELSE() + SWIG_ADD_LIBRARY(MEDRenumber LANGUAGE python SOURCES MEDRenumber.i) +ENDIF() + SWIG_LINK_LIBRARIES(MEDRenumber ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} renumbercpp) SWIG_CHECK_GENERATION(MEDRenumber) diff --git a/src/RENUMBER_Swig/MEDRenumber.i b/src/RENUMBER_Swig/MEDRenumber.i index 5c6a3646f..e2c08fbff 100644 --- a/src/RENUMBER_Swig/MEDRenumber.i +++ b/src/RENUMBER_Swig/MEDRenumber.i @@ -19,6 +19,7 @@ %module MEDRenumber +%include "MEDCouplingCommon.i" %include "MEDRenumberCommon.i" %pythoncode %{ diff --git a/src/RENUMBER_Swig/MEDRenumberCommon.i b/src/RENUMBER_Swig/MEDRenumberCommon.i index 3c1cec8a8..8a9b71ccc 100644 --- a/src/RENUMBER_Swig/MEDRenumberCommon.i +++ b/src/RENUMBER_Swig/MEDRenumberCommon.i @@ -38,7 +38,7 @@ using namespace INTERP_KERNEL; %init %{ import_array(); %} #endif -%init %{ initializeMe(); %} +%init %{ initializeMe_renumber(); %} %feature("autodoc", "1"); %feature("docstring"); @@ -51,7 +51,7 @@ using namespace INTERP_KERNEL; %include "MEDCouplingMemArray.i" %{ - void initializeMe() + void initializeMe_renumber() {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions. SWIGTITraits::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble; SWIGTITraits::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat; -- 2.39.2