From: Anthony Geay Date: Wed, 26 Apr 2017 05:44:37 +0000 (+0200) Subject: Revert "Windows compatibility." X-Git-Tag: V8_4_0a1~73 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a2d2ebe5413bf79e9f2800d19b240a3eac569276;p=tools%2Fmedcoupling.git Revert "Windows compatibility." This reverts commit dae6b7444d035860016153962d786ff962626793. Conflicts: src/MEDCoupling/MEDCouplingMemArray.hxx --- diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index 428680214..39ab1cdea 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -76,7 +76,7 @@ namespace MEDCoupling 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); + 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; @@ -125,84 +125,84 @@ namespace MEDCoupling class DataArrayInt; class DataArrayByte; - class MEDCOUPLING_EXPORT DataArray : public RefCountObject, public TimeLabel + class DataArray : public RefCountObject, public TimeLabel { public: - 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 int 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 DataArrayInt *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; + 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 int 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 DataArrayInt *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; protected: DataArray() { } ~DataArray() { } protected: - 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); + 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); protected: std::string _name; std::vector _info_on_compo; @@ -217,71 +217,71 @@ namespace MEDCoupling class DataArrayTemplate : public DataArray { public: - static MCAuto< typename Traits::ArrayTypeCh > NewFromStdVector(const typename std::vector& v); - std::vector< MCAuto< typename Traits::ArrayTypeCh > > explodeComponents() const; + MEDCOUPLING_EXPORT static MCAuto< typename Traits::ArrayTypeCh > NewFromStdVector(const typename std::vector& v); + MEDCOUPLING_EXPORT std::vector< MCAuto< typename Traits::ArrayTypeCh > > explodeComponents() const; // - std::size_t getHeapMemorySizeWithoutChildren() const; + std::size_t getHeapMemorySizeWithoutChildren() const; // - int getNumberOfTuples() const { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); } - std::size_t getNbOfElems() const { return _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(); } - 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; - 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; - void desallocate(); - void reserve(std::size_t nbOfElems); - void rearrange(int 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(int nbOfTuple, int nbOfCompo); - void deepCopyFrom(const DataArrayTemplate& other); - void reverse(); - void fillWithValue(T val); - void reAlloc(std::size_t newNbOfTuple); - void renumberInPlace(const int *old2New); - void renumberInPlaceR(const int *new2Old); - void sort(bool asc=true); - typename Traits::ArrayType *renumber(const int *old2New) const; - typename Traits::ArrayType *renumberR(const int *new2Old) const; - typename Traits::ArrayType *renumberAndReduce(const int *old2New, int newNbOfTuple) const; - typename Traits::ArrayType *changeNbOfComponents(int newNbOfComp, T dftValue) const; - typename Traits::ArrayType *subArray(int tupleIdBg, int tupleIdEnd=-1) const; - MCAuto::ArrayTypeCh> selectPartDef(const PartDefinition* pd) const; - void circularPermutation(int nbOfShift=1); - void circularPermutationPerTuple(int nbOfShift=1); - void reversePerTuple(); - void setPartOfValues1(const typename Traits::ArrayType *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true); - void setPartOfValuesSimple1(T a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp); - void setPartOfValues2(const typename Traits::ArrayType *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true); - void setPartOfValuesSimple2(T a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp); - void setPartOfValues3(const typename Traits::ArrayType *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true); - void setPartOfValuesSimple3(T a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp); - void setPartOfValues4(const typename Traits::ArrayType *a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true); - void setPartOfValuesSimple4(T a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp); - void setPartOfValuesAdv(const typename Traits::ArrayType *a, const DataArrayInt *tuplesSelec); - void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec); - void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step); - T getMaxValue(int& tupleId) const; - T getMaxValueInArray() const; - T getMinValue(int& tupleId) const; - T getMinValueInArray() const; + MEDCOUPLING_EXPORT int getNumberOfTuples() const { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); } + MEDCOUPLING_EXPORT 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(); } + 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(); } + void pack() const; + bool isAllocated() const; + void checkAllocated() const; + void desallocate(); + void reserve(std::size_t nbOfElems); + void rearrange(int 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(int nbOfTuple, int nbOfCompo); + void deepCopyFrom(const DataArrayTemplate& other); + void reverse(); + void fillWithValue(T val); + void reAlloc(std::size_t newNbOfTuple); + void renumberInPlace(const int *old2New); + void renumberInPlaceR(const int *new2Old); + void sort(bool asc=true); + typename Traits::ArrayType *renumber(const int *old2New) const; + typename Traits::ArrayType *renumberR(const int *new2Old) const; + typename Traits::ArrayType *renumberAndReduce(const int *old2New, int newNbOfTuple) const; + typename Traits::ArrayType *changeNbOfComponents(int newNbOfComp, T dftValue) const; + typename Traits::ArrayType *subArray(int tupleIdBg, int tupleIdEnd=-1) const; + MCAuto::ArrayTypeCh> selectPartDef(const PartDefinition* pd) const; + void circularPermutation(int nbOfShift=1); + void circularPermutationPerTuple(int nbOfShift=1); + void reversePerTuple(); + void setPartOfValues1(const typename Traits::ArrayType *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true); + void setPartOfValuesSimple1(T a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp); + void setPartOfValues2(const typename Traits::ArrayType *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true); + void setPartOfValuesSimple2(T a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp); + void setPartOfValues3(const typename Traits::ArrayType *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true); + void setPartOfValuesSimple3(T a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp); + void setPartOfValues4(const typename Traits::ArrayType *a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true); + void setPartOfValuesSimple4(T a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp); + void setPartOfValuesAdv(const typename Traits::ArrayType *a, const DataArrayInt *tuplesSelec); + void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec); + void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step); + T getMaxValue(int& tupleId) const; + T getMaxValueInArray() const; + T getMinValue(int& tupleId) const; + T getMinValueInArray() const; protected: typename Traits::ArrayType *mySelectByTupleId(const int *new2OldBg, const int *new2OldEnd) const; typename Traits::ArrayType *mySelectByTupleId(const DataArrayInt& di) const; @@ -297,149 +297,149 @@ namespace MEDCoupling namespace MEDCoupling { class DataArrayDoubleIterator; - class MEDCOUPLING_EXPORT DataArrayDouble : public DataArrayTemplate + class DataArrayDouble : public DataArrayTemplate { public: - static DataArrayDouble *New(); - double doubleValue() const; - DataArrayDouble *deepCopy() const; - DataArrayDouble *buildNewEmptyInstance() const { return DataArrayDouble::New(); } - DataArrayDouble *performCopyOrIncrRef(bool deepCopy) const; - void fillWithZero(); - void iota(double init=0.); - bool isUniform(double val, double eps) const; - void checkMonotonic(bool increasing, double eps) const; - bool isMonotonic(bool increasing, double eps) const; - std::string repr() const; - std::string reprZip() const; - std::string reprNotTooLong() const; - void writeVTK(std::ostream& ofs, int indent, const std::string& nameInFile, DataArrayByte *byteArr) const; - 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; - 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; - DataArrayInt *convertToIntArr() const; - DataArrayDouble *fromNoInterlace() const; - DataArrayDouble *toNoInterlace() const; - DataArrayDouble *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleId(new2OldBg,new2OldEnd); } - DataArrayDouble *selectByTupleId(const DataArrayInt& di) const { return DataArrayTemplate::mySelectByTupleId(di); } - DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - DataArrayDouble *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } - DataArrayDouble *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } - DataArrayDouble *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } - void meldWith(const DataArrayDouble *other); - bool areIncludedInMe(const DataArrayDouble *other, double prec, DataArrayInt *&tupleIds) const; - void findCommonTuples(double prec, int limitTupleId, DataArrayInt *&comm, DataArrayInt *&commIndex) const; - double minimalDistanceTo(const DataArrayDouble *other, int& thisTupleId, int& otherTupleId) const; - DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const; - DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const; - DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const; - DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const; - void setSelectedComponents(const DataArrayDouble *a, const std::vector& compoIds); - void getTuple(int tupleId, double *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } - static void SetArrayIn(DataArrayDouble *newArray, DataArrayDouble* &arrayToSet); - DataArrayDoubleIterator *iterator(); - template - void insertAtTheEnd(InputIterator first, InputIterator last); - void aggregate(const DataArrayDouble *other); - void writeOnPlace(std::size_t id, double element0, const double *others, int sizeOfOthers) { _mem.writeOnPlace(id,element0,others,sizeOfOthers); } - void checkNoNullValues() const; - void getMinMaxPerComponent(double *bounds) const; - DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const; - void computeTupleIdsNearTuples(const DataArrayDouble *other, double eps, DataArrayInt *& c, DataArrayInt *& cI) const; - void recenterForMaxPrecision(double eps); - double getMaxValue2(DataArrayInt*& tupleIds) const; - double getMinValue2(DataArrayInt*& 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 *sumPerTuple() const; - DataArrayDouble *maxPerTuple() const; - DataArrayDouble *maxPerTupleWithCompoId(DataArrayInt* &compoIdOfMaxPerTuple) const; - DataArrayDouble *buildEuclidianDistanceDenseMatrix() const; - DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const; - void sortPerTuple(bool asc); - void abs(); - DataArrayDouble *computeAbs() const; - void applyLin(double a, double b, int compoId); - void applyLin(double a, double b); - void applyInv(double numerator); - void applyPow(double val); - void applyRPow(double val); - DataArrayDouble *negate() const; - 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; - DataArrayInt *findIdsInRange(double vmin, double vmax) const; - DataArrayInt *findIdsNotInRange(double vmin, double vmax) const; - static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2); - static DataArrayDouble *Aggregate(const std::vector& arr); - static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2); - static DataArrayDouble *Meld(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 *Add(const DataArrayDouble *a1, const DataArrayDouble *a2); - void addEqual(const DataArrayDouble *other); - static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2); - void substractEqual(const DataArrayDouble *other); - static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2); - void multiplyEqual(const DataArrayDouble *other); - static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2); - void divideEqual(const DataArrayDouble *other); - static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2); - void powEqual(const DataArrayDouble *other); - void updateTime() const { } - MemArray& accessToMemArray() { return _mem; } - const MemArray& accessToMemArray() const { return _mem; } - 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]); + 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 DataArrayDouble *performCopyOrIncrRef(bool deepCopy) const; + MEDCOUPLING_EXPORT void fillWithZero(); + MEDCOUPLING_EXPORT void iota(double init=0.); + MEDCOUPLING_EXPORT bool isUniform(double val, double eps) const; + 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 std::string reprNotTooLong() const; + MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& nameInFile, DataArrayByte *byteArr) const; + 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 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 DataArrayInt *convertToIntArr() const; + MEDCOUPLING_EXPORT DataArrayDouble *fromNoInterlace() const; + MEDCOUPLING_EXPORT DataArrayDouble *toNoInterlace() const; + MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleId(new2OldBg,new2OldEnd); } + MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const DataArrayInt& di) const { return DataArrayTemplate::mySelectByTupleId(di); } + MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + MEDCOUPLING_EXPORT DataArrayDouble *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } + MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } + MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } + MEDCOUPLING_EXPORT void meldWith(const DataArrayDouble *other); + MEDCOUPLING_EXPORT bool areIncludedInMe(const DataArrayDouble *other, double prec, DataArrayInt *&tupleIds) const; + MEDCOUPLING_EXPORT void findCommonTuples(double prec, int limitTupleId, DataArrayInt *&comm, DataArrayInt *&commIndex) const; + MEDCOUPLING_EXPORT double minimalDistanceTo(const DataArrayDouble *other, int& thisTupleId, int& otherTupleId) const; + MEDCOUPLING_EXPORT DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const; + MEDCOUPLING_EXPORT DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const; + MEDCOUPLING_EXPORT DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const; + MEDCOUPLING_EXPORT DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const; + MEDCOUPLING_EXPORT void setSelectedComponents(const DataArrayDouble *a, const std::vector& compoIds); + MEDCOUPLING_EXPORT void getTuple(int tupleId, double *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } + MEDCOUPLING_EXPORT static void SetArrayIn(DataArrayDouble *newArray, DataArrayDouble* &arrayToSet); + MEDCOUPLING_EXPORT DataArrayDoubleIterator *iterator(); + template + void insertAtTheEnd(InputIterator first, InputIterator last); + MEDCOUPLING_EXPORT void aggregate(const DataArrayDouble *other); + MEDCOUPLING_EXPORT void writeOnPlace(std::size_t id, double element0, const double *others, int sizeOfOthers) { _mem.writeOnPlace(id,element0,others,sizeOfOthers); } + 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, DataArrayInt *& c, DataArrayInt *& cI) const; + MEDCOUPLING_EXPORT void recenterForMaxPrecision(double eps); + MEDCOUPLING_EXPORT double getMaxValue2(DataArrayInt*& tupleIds) const; + MEDCOUPLING_EXPORT double getMinValue2(DataArrayInt*& 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 *sumPerTuple() const; + MEDCOUPLING_EXPORT DataArrayDouble *maxPerTuple() const; + MEDCOUPLING_EXPORT DataArrayDouble *maxPerTupleWithCompoId(DataArrayInt* &compoIdOfMaxPerTuple) const; + MEDCOUPLING_EXPORT DataArrayDouble *buildEuclidianDistanceDenseMatrix() const; + MEDCOUPLING_EXPORT DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const; + MEDCOUPLING_EXPORT void sortPerTuple(bool asc); + MEDCOUPLING_EXPORT void abs(); + MEDCOUPLING_EXPORT DataArrayDouble *computeAbs() const; + MEDCOUPLING_EXPORT void applyLin(double a, double b, int compoId); + MEDCOUPLING_EXPORT void applyLin(double a, double b); + MEDCOUPLING_EXPORT void applyInv(double numerator); + MEDCOUPLING_EXPORT void applyPow(double val); + MEDCOUPLING_EXPORT void applyRPow(double val); + MEDCOUPLING_EXPORT DataArrayDouble *negate() const; + 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 DataArrayInt *findIdsInRange(double vmin, double vmax) const; + MEDCOUPLING_EXPORT DataArrayInt *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 *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2); + MEDCOUPLING_EXPORT static DataArrayDouble *Meld(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 *Add(const DataArrayDouble *a1, const DataArrayDouble *a2); + MEDCOUPLING_EXPORT void addEqual(const DataArrayDouble *other); + MEDCOUPLING_EXPORT static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2); + MEDCOUPLING_EXPORT void substractEqual(const DataArrayDouble *other); + MEDCOUPLING_EXPORT static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2); + MEDCOUPLING_EXPORT void multiplyEqual(const DataArrayDouble *other); + MEDCOUPLING_EXPORT static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2); + MEDCOUPLING_EXPORT void divideEqual(const DataArrayDouble *other); + MEDCOUPLING_EXPORT static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2); + MEDCOUPLING_EXPORT void powEqual(const DataArrayDouble *other); + MEDCOUPLING_EXPORT void updateTime() const { } + MEDCOUPLING_EXPORT MemArray& accessToMemArray() { return _mem; } + MEDCOUPLING_EXPORT const MemArray& accessToMemArray() const { return _mem; } + 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: - 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); + 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); public: template void findCommonTuplesAlg(const double *bbox, int nbNodes, int limitNodeId, double prec, DataArrayInt *c, DataArrayInt *cI) const; @@ -455,12 +455,12 @@ namespace MEDCoupling class DataArrayDoubleTuple; - class MEDCOUPLING_EXPORT DataArrayDoubleIterator + class DataArrayDoubleIterator { public: - DataArrayDoubleIterator(DataArrayDouble *da); - ~DataArrayDoubleIterator(); - DataArrayDoubleTuple *nextt(); + MEDCOUPLING_EXPORT DataArrayDoubleIterator(DataArrayDouble *da); + MEDCOUPLING_EXPORT ~DataArrayDoubleIterator(); + MEDCOUPLING_EXPORT DataArrayDoubleTuple *nextt(); private: DataArrayDouble *_da; double *_pt; @@ -469,16 +469,16 @@ namespace MEDCoupling int _nb_tuple; }; - class MEDCOUPLING_EXPORT DataArrayDoubleTuple + class DataArrayDoubleTuple { public: - DataArrayDoubleTuple(double *pt, int nbOfComp); - std::string repr() const; - int getNumberOfCompo() const { return _nb_of_compo; } - const double *getConstPointer() const { return _pt; } - double *getPointer() { return _pt; } - double doubleValue() const; - DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const; + MEDCOUPLING_EXPORT DataArrayDoubleTuple(double *pt, int nbOfComp); + MEDCOUPLING_EXPORT std::string repr() const; + MEDCOUPLING_EXPORT int getNumberOfCompo() const { return _nb_of_compo; } + MEDCOUPLING_EXPORT const double *getConstPointer() const { return _pt; } + MEDCOUPLING_EXPORT double *getPointer() { return _pt; } + MEDCOUPLING_EXPORT double doubleValue() const; + MEDCOUPLING_EXPORT DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const; private: double *_pt; int _nb_of_compo; @@ -486,173 +486,173 @@ namespace MEDCoupling class DataArrayIntIterator; - class MEDCOUPLING_EXPORT DataArrayInt : public DataArrayTemplate + class DataArrayInt : public DataArrayTemplate { public: - static DataArrayInt *New(); - int intValue() const; - int getHashCode() const; - DataArrayInt *deepCopy() const; - DataArrayInt *performCopyOrIncrRef(bool deepCopy) const; - DataArrayInt *buildNewEmptyInstance() const { return DataArrayInt::New(); } - bool isEqual(const DataArrayInt& other) const; - bool isEqualIfNotWhy(const DataArrayInt& other, std::string& reason) const; - bool isEqualWithoutConsideringStr(const DataArrayInt& other) const; - bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const; - bool isFittingWith(const std::vector& v) const; - void switchOnTupleEqualTo(int val, std::vector& vec) const; - void switchOnTupleNotEqualTo(int val, std::vector& vec) const; - DataArrayInt *buildPermutationArr(const DataArrayInt& other) const; - DataArrayInt *indicesOfSubPart(const DataArrayInt& partOfThis) const; - DataArrayInt *sumPerTuple() const; - void checkMonotonic(bool increasing) const; - bool isMonotonic(bool increasing) const; - void checkStrictlyMonotonic(bool increasing) const; - bool isStrictlyMonotonic(bool increasing) const; - void fillWithZero(); - void iota(int init=0); - std::string repr() const; - std::string reprZip() const; - std::string reprNotTooLong() const; - void writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const; - 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; - 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); - DataArrayInt *transformWithIndArrR(const int *indArrBg, const int *indArrEnd) const; - void splitByValueRange(const int *arrBg, const int *arrEnd, + MEDCOUPLING_EXPORT static DataArrayInt *New(); + MEDCOUPLING_EXPORT int intValue() const; + MEDCOUPLING_EXPORT int getHashCode() const; + MEDCOUPLING_EXPORT DataArrayInt *deepCopy() const; + MEDCOUPLING_EXPORT DataArrayInt *performCopyOrIncrRef(bool deepCopy) const; + MEDCOUPLING_EXPORT DataArrayInt *buildNewEmptyInstance() const { return DataArrayInt::New(); } + MEDCOUPLING_EXPORT bool isEqual(const DataArrayInt& other) const; + MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayInt& other, std::string& reason) const; + MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayInt& other) const; + MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const; + MEDCOUPLING_EXPORT bool isFittingWith(const std::vector& v) const; + MEDCOUPLING_EXPORT void switchOnTupleEqualTo(int val, std::vector& vec) const; + MEDCOUPLING_EXPORT void switchOnTupleNotEqualTo(int val, std::vector& vec) const; + MEDCOUPLING_EXPORT DataArrayInt *buildPermutationArr(const DataArrayInt& other) const; + MEDCOUPLING_EXPORT DataArrayInt *indicesOfSubPart(const DataArrayInt& partOfThis) const; + MEDCOUPLING_EXPORT DataArrayInt *sumPerTuple() 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 void fillWithZero(); + MEDCOUPLING_EXPORT void iota(int init=0); + MEDCOUPLING_EXPORT std::string repr() const; + MEDCOUPLING_EXPORT std::string reprZip() const; + MEDCOUPLING_EXPORT std::string reprNotTooLong() const; + MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const; + 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 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 DataArrayInt *transformWithIndArrR(const int *indArrBg, const int *indArrEnd) const; + MEDCOUPLING_EXPORT void splitByValueRange(const int *arrBg, const int *arrEnd, DataArrayInt *& castArr, DataArrayInt *& rankInsideCast, DataArrayInt *& castsPresent) const; - bool isRange(int& strt, int& sttoopp, int& stteepp) const; - DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const; - DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const; - DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const; - DataArrayDouble *convertToDblArr() const; - DataArrayInt *fromNoInterlace() const; - DataArrayInt *toNoInterlace() const; - DataArrayInt *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleId(new2OldBg,new2OldEnd); } - DataArrayInt *selectByTupleId(const DataArrayInt& di) const { return DataArrayTemplate::mySelectByTupleId(di); } - DataArrayInt *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } - DataArrayInt *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } - DataArrayInt *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } - DataArrayInt *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } - DataArrayInt *checkAndPreparePermutation() const; - static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2); - void changeSurjectiveFormat(int targetNb, DataArrayInt *&arr, DataArrayInt *&arrI) const; - static DataArrayInt *ConvertIndexArrayToO2N(int nbOfOldTuples, const int *arr, const int *arrIBg, const int *arrIEnd, int &newNbOfTuples); - DataArrayInt *buildPermArrPerLevel() const; - bool isIota(int sizeExpected) const; - bool isUniform(int val) const; - bool hasUniqueValues() const; - void meldWith(const DataArrayInt *other); - void setSelectedComponents(const DataArrayInt *a, const std::vector& compoIds); - void getTuple(int tupleId, int *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } - static void SetArrayIn(DataArrayInt *newArray, DataArrayInt* &arrayToSet); - DataArrayIntIterator *iterator(); - DataArrayInt *findIdsEqual(int val) const; - DataArrayInt *findIdsNotEqual(int val) const; - DataArrayInt *findIdsEqualList(const int *valsBg, const int *valsEnd) const; - DataArrayInt *findIdsNotEqualList(const int *valsBg, const int *valsEnd) const; - DataArrayInt *findIdsEqualTuple(const int *tupleBg, const int *tupleEnd) 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; - DataArrayInt *accumulatePerChunck(const int *bgOfIndex, const int *endOfIndex) const; - void getMinMaxValues(int& minValue, int& maxValue) const; - void abs(); - DataArrayInt *computeAbs() const; - void applyLin(int a, int b, int compoId); - void applyLin(int a, int b); - void applyInv(int numerator); - DataArrayInt *negate() const; - void applyDivideBy(int val); - void applyModulus(int val); - void applyRModulus(int val); - void applyPow(int val); - void applyRPow(int val); - DataArrayInt *findIdsInRange(int vmin, int vmax) const; - DataArrayInt *findIdsNotInRange(int vmin, int vmax) const; - DataArrayInt *findIdsStricltyNegative() const; - MCAuto findIdsGreaterOrEqualTo(int val) const; - MCAuto findIdsGreaterThan(int val) const; - MCAuto findIdsLowerOrEqualTo(int val) const; - MCAuto findIdsLowerThan(int val) const; - bool checkAllIdsInRange(int vmin, int vmax) const; - static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2); - static DataArrayInt *Aggregate(const std::vector& arr); - static DataArrayInt *AggregateIndexes(const std::vector& arrs); - static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2); - static DataArrayInt *Meld(const std::vector& arr); - static DataArrayInt *MakePartition(const std::vector& groups, int newNb, std::vector< std::vector >& fidsOfGroups); - static DataArrayInt *BuildUnion(const std::vector& arr); - static DataArrayInt *BuildIntersection(const std::vector& arr); - static DataArrayInt *BuildListOfSwitchedOn(const std::vector& v); - static DataArrayInt *BuildListOfSwitchedOff(const std::vector& v); - static void PutIntoToSkylineFrmt(const std::vector< std::vector >& v, DataArrayInt *& data, DataArrayInt *& dataIndex); - DataArrayInt *buildComplement(int nbOfElement) const; - DataArrayInt *buildSubstraction(const DataArrayInt *other) const; - DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const; - DataArrayInt *buildUnion(const DataArrayInt *other) const; - DataArrayInt *buildIntersection(const DataArrayInt *other) const; - DataArrayInt *buildUnique() const; - DataArrayInt *buildUniqueNotSorted() const; - DataArrayInt *deltaShiftIndex() const; - void computeOffsets(); - void computeOffsetsFull(); - void findIdsRangesInListOfIds(const DataArrayInt *listOfIds, DataArrayInt *& rangeIdsFetched, DataArrayInt *& idsInInputListThatFetch) const; - DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const; - DataArrayInt *buildExplicitArrOfSliceOnScaledArr(int begin, int stop, int step) const; - DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const; - DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const; - void sortEachPairToMakeALinkedList(); - MCAuto fromLinkedListOfPairToList() const; - DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const; - DataArrayInt *getDifferentValues() const; - std::vector partitionByDifferentValues(std::vector& differentIds) const; - std::vector< std::pair > splitInBalancedSlices(int nbOfSlices) const; - template - void insertAtTheEnd(InputIterator first, InputIterator last); - void aggregate(const DataArrayInt *other); - void writeOnPlace(std::size_t id, int element0, const int *others, int sizeOfOthers) { _mem.writeOnPlace(id,element0,others,sizeOfOthers); } - static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2); - void addEqual(const DataArrayInt *other); - static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2); - void substractEqual(const DataArrayInt *other); - static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2); - void multiplyEqual(const DataArrayInt *other); - static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2); - void divideEqual(const DataArrayInt *other); - static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2); - void modulusEqual(const DataArrayInt *other); - static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2); - void powEqual(const DataArrayInt *other); - void updateTime() const { } - MemArray& accessToMemArray() { return _mem; } - const MemArray& accessToMemArray() const { return _mem; } + MEDCOUPLING_EXPORT bool isRange(int& strt, int& sttoopp, int& stteepp) const; + MEDCOUPLING_EXPORT DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const; + MEDCOUPLING_EXPORT DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const; + MEDCOUPLING_EXPORT DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const; + MEDCOUPLING_EXPORT DataArrayDouble *convertToDblArr() const; + MEDCOUPLING_EXPORT DataArrayInt *fromNoInterlace() const; + MEDCOUPLING_EXPORT DataArrayInt *toNoInterlace() const; + MEDCOUPLING_EXPORT DataArrayInt *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleId(new2OldBg,new2OldEnd); } + MEDCOUPLING_EXPORT DataArrayInt *selectByTupleId(const DataArrayInt& di) const { return DataArrayTemplate::mySelectByTupleId(di); } + MEDCOUPLING_EXPORT DataArrayInt *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } + MEDCOUPLING_EXPORT DataArrayInt *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } + MEDCOUPLING_EXPORT DataArrayInt *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } + MEDCOUPLING_EXPORT DataArrayInt *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } + MEDCOUPLING_EXPORT DataArrayInt *checkAndPreparePermutation() const; + MEDCOUPLING_EXPORT static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2); + MEDCOUPLING_EXPORT void changeSurjectiveFormat(int targetNb, DataArrayInt *&arr, DataArrayInt *&arrI) const; + MEDCOUPLING_EXPORT static DataArrayInt *ConvertIndexArrayToO2N(int nbOfOldTuples, const int *arr, const int *arrIBg, const int *arrIEnd, int &newNbOfTuples); + MEDCOUPLING_EXPORT DataArrayInt *buildPermArrPerLevel() const; + MEDCOUPLING_EXPORT bool isIota(int sizeExpected) const; + MEDCOUPLING_EXPORT bool isUniform(int val) const; + MEDCOUPLING_EXPORT bool hasUniqueValues() const; + MEDCOUPLING_EXPORT void meldWith(const DataArrayInt *other); + MEDCOUPLING_EXPORT void setSelectedComponents(const DataArrayInt *a, const std::vector& compoIds); + MEDCOUPLING_EXPORT void getTuple(int tupleId, int *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } + MEDCOUPLING_EXPORT static void SetArrayIn(DataArrayInt *newArray, DataArrayInt* &arrayToSet); + MEDCOUPLING_EXPORT DataArrayIntIterator *iterator(); + MEDCOUPLING_EXPORT DataArrayInt *findIdsEqual(int val) const; + MEDCOUPLING_EXPORT DataArrayInt *findIdsNotEqual(int val) const; + MEDCOUPLING_EXPORT DataArrayInt *findIdsEqualList(const int *valsBg, const int *valsEnd) const; + MEDCOUPLING_EXPORT DataArrayInt *findIdsNotEqualList(const int *valsBg, const int *valsEnd) const; + MEDCOUPLING_EXPORT DataArrayInt *findIdsEqualTuple(const int *tupleBg, const int *tupleEnd) 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 DataArrayInt *accumulatePerChunck(const int *bgOfIndex, const int *endOfIndex) const; + MEDCOUPLING_EXPORT void getMinMaxValues(int& minValue, int& maxValue) const; + MEDCOUPLING_EXPORT void abs(); + MEDCOUPLING_EXPORT DataArrayInt *computeAbs() const; + MEDCOUPLING_EXPORT void applyLin(int a, int b, int compoId); + MEDCOUPLING_EXPORT void applyLin(int a, int b); + MEDCOUPLING_EXPORT void applyInv(int numerator); + MEDCOUPLING_EXPORT DataArrayInt *negate() const; + 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 DataArrayInt *findIdsInRange(int vmin, int vmax) const; + MEDCOUPLING_EXPORT DataArrayInt *findIdsNotInRange(int vmin, int vmax) const; + MEDCOUPLING_EXPORT DataArrayInt *findIdsStricltyNegative() const; + MEDCOUPLING_EXPORT bool checkAllIdsInRange(int vmin, int vmax) const; + MEDCOUPLING_EXPORT MCAuto findIdsGreaterOrEqualTo(int val) const; + MEDCOUPLING_EXPORT MCAuto findIdsGreaterThan(int val) const; + MEDCOUPLING_EXPORT MCAuto findIdsLowerOrEqualTo(int val) const; + MEDCOUPLING_EXPORT MCAuto findIdsLowerThan(int val) const; + MEDCOUPLING_EXPORT static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2); + MEDCOUPLING_EXPORT static DataArrayInt *Aggregate(const std::vector& arr); + MEDCOUPLING_EXPORT static DataArrayInt *AggregateIndexes(const std::vector& arrs); + MEDCOUPLING_EXPORT static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2); + MEDCOUPLING_EXPORT static DataArrayInt *Meld(const std::vector& arr); + MEDCOUPLING_EXPORT static DataArrayInt *MakePartition(const std::vector& groups, int newNb, std::vector< std::vector >& fidsOfGroups); + MEDCOUPLING_EXPORT static DataArrayInt *BuildUnion(const std::vector& arr); + MEDCOUPLING_EXPORT static DataArrayInt *BuildIntersection(const std::vector& arr); + MEDCOUPLING_EXPORT static DataArrayInt *BuildListOfSwitchedOn(const std::vector& v); + MEDCOUPLING_EXPORT static DataArrayInt *BuildListOfSwitchedOff(const std::vector& v); + MEDCOUPLING_EXPORT static void PutIntoToSkylineFrmt(const std::vector< std::vector >& v, DataArrayInt *& data, DataArrayInt *& dataIndex); + MEDCOUPLING_EXPORT DataArrayInt *buildComplement(int nbOfElement) const; + MEDCOUPLING_EXPORT DataArrayInt *buildSubstraction(const DataArrayInt *other) const; + MEDCOUPLING_EXPORT DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const; + MEDCOUPLING_EXPORT DataArrayInt *buildUnion(const DataArrayInt *other) const; + MEDCOUPLING_EXPORT DataArrayInt *buildIntersection(const DataArrayInt *other) const; + MEDCOUPLING_EXPORT DataArrayInt *buildUnique() const; + MEDCOUPLING_EXPORT DataArrayInt *buildUniqueNotSorted() const; + MEDCOUPLING_EXPORT DataArrayInt *deltaShiftIndex() const; + MEDCOUPLING_EXPORT void computeOffsets(); + MEDCOUPLING_EXPORT void computeOffsetsFull(); + MEDCOUPLING_EXPORT void findIdsRangesInListOfIds(const DataArrayInt *listOfIds, DataArrayInt *& rangeIdsFetched, DataArrayInt *& idsInInputListThatFetch) const; + MEDCOUPLING_EXPORT DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const; + MEDCOUPLING_EXPORT DataArrayInt *buildExplicitArrOfSliceOnScaledArr(int begin, int stop, int step) const; + MEDCOUPLING_EXPORT DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const; + MEDCOUPLING_EXPORT DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const; + MEDCOUPLING_EXPORT void sortEachPairToMakeALinkedList(); + MEDCOUPLING_EXPORT MCAuto fromLinkedListOfPairToList() const; + MEDCOUPLING_EXPORT DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const; + MEDCOUPLING_EXPORT DataArrayInt *getDifferentValues() const; + MEDCOUPLING_EXPORT std::vector partitionByDifferentValues(std::vector& differentIds) const; + MEDCOUPLING_EXPORT std::vector< std::pair > splitInBalancedSlices(int nbOfSlices) const; + template + void insertAtTheEnd(InputIterator first, InputIterator last); + MEDCOUPLING_EXPORT void aggregate(const DataArrayInt *other); + MEDCOUPLING_EXPORT void writeOnPlace(std::size_t id, int element0, const int *others, int sizeOfOthers) { _mem.writeOnPlace(id,element0,others,sizeOfOthers); } + MEDCOUPLING_EXPORT static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2); + MEDCOUPLING_EXPORT void addEqual(const DataArrayInt *other); + MEDCOUPLING_EXPORT static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2); + MEDCOUPLING_EXPORT void substractEqual(const DataArrayInt *other); + MEDCOUPLING_EXPORT static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2); + MEDCOUPLING_EXPORT void multiplyEqual(const DataArrayInt *other); + MEDCOUPLING_EXPORT static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2); + MEDCOUPLING_EXPORT void divideEqual(const DataArrayInt *other); + MEDCOUPLING_EXPORT static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2); + MEDCOUPLING_EXPORT void modulusEqual(const DataArrayInt *other); + MEDCOUPLING_EXPORT static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2); + MEDCOUPLING_EXPORT void powEqual(const DataArrayInt *other); + MEDCOUPLING_EXPORT void updateTime() const { } + MEDCOUPLING_EXPORT MemArray& accessToMemArray() { return _mem; } + MEDCOUPLING_EXPORT const MemArray& accessToMemArray() const { return _mem; } public: - static int *CheckAndPreparePermutation(const int *start, const int *end); - static DataArrayInt *Range(int begin, int end, int step); + MEDCOUPLING_EXPORT static int *CheckAndPreparePermutation(const int *start, const int *end); + MEDCOUPLING_EXPORT static DataArrayInt *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); + 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); private: - template - MCAuto findIdsAdv(const OP& op) const; + template + MCAuto findIdsAdv(const OP& op) const; private: ~DataArrayInt() { } DataArrayInt() { } @@ -676,12 +676,12 @@ namespace MEDCoupling class DataArrayIntTuple; - class MEDCOUPLING_EXPORT DataArrayIntIterator + class DataArrayIntIterator { public: - DataArrayIntIterator(DataArrayInt *da); - ~DataArrayIntIterator(); - DataArrayIntTuple *nextt(); + MEDCOUPLING_EXPORT DataArrayIntIterator(DataArrayInt *da); + MEDCOUPLING_EXPORT ~DataArrayIntIterator(); + MEDCOUPLING_EXPORT DataArrayIntTuple *nextt(); private: DataArrayInt *_da; int *_pt; @@ -690,91 +690,91 @@ namespace MEDCoupling int _nb_tuple; }; - class MEDCOUPLING_EXPORT DataArrayIntTuple + class DataArrayIntTuple { public: - DataArrayIntTuple(int *pt, int nbOfComp); - std::string repr() const; - int getNumberOfCompo() const { return _nb_of_compo; } - const int *getConstPointer() const { return _pt; } - int *getPointer() { return _pt; } - int intValue() const; - DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const; + MEDCOUPLING_EXPORT DataArrayIntTuple(int *pt, int nbOfComp); + MEDCOUPLING_EXPORT std::string repr() const; + MEDCOUPLING_EXPORT int getNumberOfCompo() const { return _nb_of_compo; } + MEDCOUPLING_EXPORT const int *getConstPointer() const { return _pt; } + MEDCOUPLING_EXPORT int *getPointer() { return _pt; } + MEDCOUPLING_EXPORT int intValue() const; + MEDCOUPLING_EXPORT DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const; private: int *_pt; int _nb_of_compo; }; - class MEDCOUPLING_EXPORT DataArrayChar : public DataArrayTemplate + class DataArrayChar : public DataArrayTemplate { public: - 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; - void fillWithZero(); - 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); } - void getTuple(int tupleId, char *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } - 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); - template - void insertAtTheEnd(InputIterator first, InputIterator last); - void updateTime() const { } - MemArray& accessToMemArray() { return _mem; } - const MemArray& accessToMemArray() const { return _mem; } + 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 void fillWithZero(); + 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 void getTuple(int tupleId, char *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } + 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); + template + void insertAtTheEnd(InputIterator first, InputIterator last); + MEDCOUPLING_EXPORT void updateTime() const { } + MEDCOUPLING_EXPORT MemArray& accessToMemArray() { return _mem; } + MEDCOUPLING_EXPORT 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); + //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); protected: DataArrayChar() { } }; class DataArrayByteIterator; - class MEDCOUPLING_EXPORT DataArrayByte : public DataArrayChar + class DataArrayByte : public DataArrayChar { public: - 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; + 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; private: ~DataArrayByte() { } DataArrayByte() { } @@ -782,12 +782,12 @@ namespace MEDCoupling class DataArrayByteTuple; - class MEDCOUPLING_EXPORT DataArrayByteIterator + class DataArrayByteIterator { public: - DataArrayByteIterator(DataArrayByte *da); - ~DataArrayByteIterator(); - DataArrayByteTuple *nextt(); + MEDCOUPLING_EXPORT DataArrayByteIterator(DataArrayByte *da); + MEDCOUPLING_EXPORT ~DataArrayByteIterator(); + MEDCOUPLING_EXPORT DataArrayByteTuple *nextt(); private: DataArrayByte *_da; char *_pt; @@ -796,16 +796,16 @@ namespace MEDCoupling int _nb_tuple; }; - class MEDCOUPLING_EXPORT DataArrayByteTuple + class DataArrayByteTuple { public: - 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; + 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; private: char *_pt; int _nb_of_compo; @@ -813,26 +813,26 @@ namespace MEDCoupling class DataArrayAsciiCharIterator; - class MEDCOUPLING_EXPORT DataArrayAsciiChar : public DataArrayChar + class DataArrayAsciiChar : public DataArrayChar { public: - 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; + 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; private: ~DataArrayAsciiChar() { } DataArrayAsciiChar() { } @@ -842,12 +842,12 @@ namespace MEDCoupling class DataArrayAsciiCharTuple; - class MEDCOUPLING_EXPORT DataArrayAsciiCharIterator + class DataArrayAsciiCharIterator { public: - DataArrayAsciiCharIterator(DataArrayAsciiChar *da); - ~DataArrayAsciiCharIterator(); - DataArrayAsciiCharTuple *nextt(); + MEDCOUPLING_EXPORT DataArrayAsciiCharIterator(DataArrayAsciiChar *da); + MEDCOUPLING_EXPORT ~DataArrayAsciiCharIterator(); + MEDCOUPLING_EXPORT DataArrayAsciiCharTuple *nextt(); private: DataArrayAsciiChar *_da; char *_pt; @@ -856,16 +856,16 @@ namespace MEDCoupling int _nb_tuple; }; - class MEDCOUPLING_EXPORT DataArrayAsciiCharTuple + class DataArrayAsciiCharTuple { public: - 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; + 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; private: char *_pt; int _nb_of_compo;