X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingMemArray.hxx;h=af887b919a783e4bcaa21a340509139fdf4eeb95;hb=75006818415ac26dc594b6abb806ba3c292a545c;hp=ac91081aae3ae6a60e791ce5b3d285939ed674d4;hpb=ce3143614a66c93e9b3ad2a07eb015cc3ed64ce4;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index ac91081aa..af887b919 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -51,14 +51,14 @@ namespace MEDCoupling class MEDCouplingPointer { public: - MEDCouplingPointer():_internal(0),_external(0) { } - void null() { _internal=0; _external=0; } - bool isNull() const { return _internal==0 && _external==0; } - void setInternal(T *pointer); - void setExternal(const T *pointer); - const T *getConstPointer() const { if(_internal) return _internal; else return _external; } - const T *getConstPointerLoc(std::size_t offset) const { if(_internal) return _internal+offset; else return _external+offset; } - T *getPointer() { if(_internal) return _internal; if(_external) throw INTERP_KERNEL::Exception("Trying to write on an external pointer."); else return 0; } + MEDCOUPLING_EXPORT MEDCouplingPointer():_internal(0),_external(0) { } + MEDCOUPLING_EXPORT void null() { _internal=0; _external=0; } + MEDCOUPLING_EXPORT bool isNull() const { return _internal==0 && _external==0; } + MEDCOUPLING_EXPORT void setInternal(T *pointer); + MEDCOUPLING_EXPORT void setExternal(const T *pointer); + MEDCOUPLING_EXPORT const T *getConstPointer() const { if(_internal) return _internal; else return _external; } + MEDCOUPLING_EXPORT const T *getConstPointerLoc(std::size_t offset) const { if(_internal) return _internal+offset; else return _external+offset; } + MEDCOUPLING_EXPORT T *getPointer() { if(_internal) return _internal; if(_external) throw INTERP_KERNEL::Exception("Trying to write on an external pointer."); else return 0; } private: T *_internal; const T *_external; @@ -70,45 +70,45 @@ namespace MEDCoupling public: typedef void (*Deallocator)(void *,void *); public: - MemArray():_nb_of_elem(0),_nb_of_elem_alloc(0),_ownership(false),_dealloc(0),_param_for_deallocator(0) { } - MemArray(const MemArray& other); - bool isNull() const { return _pointer.isNull(); } - const T *getConstPointerLoc(std::size_t offset) const { return _pointer.getConstPointerLoc(offset); } - const T *getConstPointer() const { return _pointer.getConstPointer(); } - std::size_t getNbOfElem() const { return _nb_of_elem; } - std::size_t getNbOfElemAllocated() const { return _nb_of_elem_alloc; } - T *getPointer() { return _pointer.getPointer(); } - MemArray &operator=(const MemArray& other); - T operator[](std::size_t id) const { return _pointer.getConstPointer()[id]; } - T& operator[](std::size_t id) { return _pointer.getPointer()[id]; } - bool isEqual(const MemArray& other, T prec, std::string& reason) const; - void repr(int sl, std::ostream& stream) const; - bool reprHeader(int sl, std::ostream& stream) const; - void reprZip(int sl, std::ostream& stream) const; - void reprNotTooLong(int sl, std::ostream& stream) const; - void fillWithValue(const T& val); - T *fromNoInterlace(int nbOfComp) const; - T *toNoInterlace(int nbOfComp) const; - void sort(bool asc); - void reverse(int nbOfComp); - void alloc(std::size_t nbOfElements); - void reserve(std::size_t newNbOfElements); - void reAlloc(std::size_t newNbOfElements); - void useArray(const T *array, bool ownership, DeallocType type, std::size_t nbOfElem); - void useExternalArrayWithRWAccess(const T *array, std::size_t nbOfElem); - void writeOnPlace(std::size_t id, T element0, const T *others, std::size_t sizeOfOthers); + MEDCOUPLING_EXPORT MemArray():_nb_of_elem(0),_nb_of_elem_alloc(0),_ownership(false),_dealloc(0),_param_for_deallocator(0) { } + MEDCOUPLING_EXPORT MemArray(const MemArray& other); + MEDCOUPLING_EXPORT bool isNull() const { return _pointer.isNull(); } + MEDCOUPLING_EXPORT const T *getConstPointerLoc(std::size_t offset) const { return _pointer.getConstPointerLoc(offset); } + MEDCOUPLING_EXPORT const T *getConstPointer() const { return _pointer.getConstPointer(); } + MEDCOUPLING_EXPORT std::size_t getNbOfElem() const { return _nb_of_elem; } + MEDCOUPLING_EXPORT std::size_t getNbOfElemAllocated() const { return _nb_of_elem_alloc; } + MEDCOUPLING_EXPORT T *getPointer() { return _pointer.getPointer(); } + MEDCOUPLING_EXPORT MemArray &operator=(const MemArray& other); + MEDCOUPLING_EXPORT T operator[](std::size_t id) const { return _pointer.getConstPointer()[id]; } + MEDCOUPLING_EXPORT T& operator[](std::size_t id) { return _pointer.getPointer()[id]; } + MEDCOUPLING_EXPORT bool isEqual(const MemArray& other, T prec, std::string& reason) const; + MEDCOUPLING_EXPORT void repr(int sl, std::ostream& stream) const; + MEDCOUPLING_EXPORT bool reprHeader(int sl, std::ostream& stream) const; + MEDCOUPLING_EXPORT void reprZip(int sl, std::ostream& stream) const; + MEDCOUPLING_EXPORT void reprNotTooLong(int sl, std::ostream& stream) const; + MEDCOUPLING_EXPORT void fillWithValue(const T& val); + MEDCOUPLING_EXPORT T *fromNoInterlace(int nbOfComp) const; + MEDCOUPLING_EXPORT T *toNoInterlace(int nbOfComp) const; + MEDCOUPLING_EXPORT void sort(bool asc); + MEDCOUPLING_EXPORT void reverse(int nbOfComp); + MEDCOUPLING_EXPORT void alloc(std::size_t nbOfElements); + MEDCOUPLING_EXPORT void reserve(std::size_t newNbOfElements); + MEDCOUPLING_EXPORT void reAlloc(std::size_t newNbOfElements); + MEDCOUPLING_EXPORT void useArray(const T *array, bool ownership, DeallocType type, std::size_t nbOfElem); + MEDCOUPLING_EXPORT void useExternalArrayWithRWAccess(const T *array, std::size_t nbOfElem); + MEDCOUPLING_EXPORT void writeOnPlace(std::size_t id, T element0, const T *others, std::size_t sizeOfOthers); template void insertAtTheEnd(InputIterator first, InputIterator last); - void pushBack(T elem); - T popBack(); - void pack() const; - bool isDeallocatorCalled() const { return _ownership; } - Deallocator getDeallocator() const { return _dealloc; } - void setSpecificDeallocator(Deallocator dealloc) { _dealloc=dealloc; } - void setParameterForDeallocator(void *param) { _param_for_deallocator=param; } - void *getParameterForDeallocator() const { return _param_for_deallocator; } - void destroy(); - ~MemArray() { destroy(); } + MEDCOUPLING_EXPORT void pushBack(T elem); + MEDCOUPLING_EXPORT T popBack(); + MEDCOUPLING_EXPORT void pack() const; + MEDCOUPLING_EXPORT bool isDeallocatorCalled() const { return _ownership; } + MEDCOUPLING_EXPORT Deallocator getDeallocator() const { return _dealloc; } + MEDCOUPLING_EXPORT void setSpecificDeallocator(Deallocator dealloc) { _dealloc=dealloc; } + MEDCOUPLING_EXPORT void setParameterForDeallocator(void *param) { _param_for_deallocator=param; } + MEDCOUPLING_EXPORT void *getParameterForDeallocator() const { return _param_for_deallocator; } + MEDCOUPLING_EXPORT void destroy(); + MEDCOUPLING_EXPORT ~MemArray() { destroy(); } public: static void CPPDeallocator(void *pt, void *param); static void CDeallocator(void *pt, void *param); @@ -229,69 +229,74 @@ namespace MEDCoupling // 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(); } - bool empty() const; + MEDCOUPLING_EXPORT bool empty() const; MEDCOUPLING_EXPORT void *getVoidStarPointer() { return getPointer(); } MEDCOUPLING_EXPORT const T *getConstPointer() const { return _mem.getConstPointer(); } MEDCOUPLING_EXPORT const T *begin() const { return getConstPointer(); } MEDCOUPLING_EXPORT const T *end() const { return getConstPointer()+getNbOfElems(); } - 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 *rwBegin() { return getPointer(); } + MEDCOUPLING_EXPORT T *rwEnd() { return getPointer()+getNbOfElems(); } + MEDCOUPLING_EXPORT void alloc(std::size_t nbOfTuple, std::size_t nbOfCompo=1); + MEDCOUPLING_EXPORT void useArray(const T *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo); + MEDCOUPLING_EXPORT void useExternalArrayWithRWAccess(const T *array, int nbOfTuple, int nbOfCompo); + MEDCOUPLING_EXPORT 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 DataArrayInt32 *tuplesSelec); - void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt32 *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 void pack() const; + MEDCOUPLING_EXPORT bool isAllocated() const; + MEDCOUPLING_EXPORT void checkAllocated() const; + MEDCOUPLING_EXPORT void desallocate(); + MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems); + MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo); + MEDCOUPLING_EXPORT void transpose(); + MEDCOUPLING_EXPORT void pushBackSilent(T val); + MEDCOUPLING_EXPORT void pushBackValsSilent(const T *valsBg, const T *valsEnd); + MEDCOUPLING_EXPORT T popBackSilent(); + MEDCOUPLING_EXPORT T front() const; + MEDCOUPLING_EXPORT T back() const; + MEDCOUPLING_EXPORT std::size_t getNbOfElemAllocated() const { return _mem.getNbOfElemAllocated(); } + MEDCOUPLING_EXPORT void allocIfNecessary(int nbOfTuple, int nbOfCompo); + MEDCOUPLING_EXPORT void deepCopyFrom(const DataArrayTemplate& other); + MEDCOUPLING_EXPORT void reverse(); + MEDCOUPLING_EXPORT void fillWithValue(T val); + MEDCOUPLING_EXPORT void reAlloc(std::size_t newNbOfTuple); + MEDCOUPLING_EXPORT void renumberInPlace(const int *old2New); + MEDCOUPLING_EXPORT void renumberInPlaceR(const int *new2Old); + MEDCOUPLING_EXPORT void sort(bool asc=true); + MEDCOUPLING_EXPORT typename Traits::ArrayType *renumber(const int *old2New) const; + MEDCOUPLING_EXPORT typename Traits::ArrayType *renumberR(const int *new2Old) const; + MEDCOUPLING_EXPORT typename Traits::ArrayType *renumberAndReduce(const int *old2New, int newNbOfTuple) const; + MEDCOUPLING_EXPORT typename Traits::ArrayType *changeNbOfComponents(int newNbOfComp, T dftValue) const; + MEDCOUPLING_EXPORT typename Traits::ArrayType *subArray(int tupleIdBg, int tupleIdEnd=-1) const; + MEDCOUPLING_EXPORT MCAuto::ArrayTypeCh> selectPartDef(const PartDefinition* pd) const; + MEDCOUPLING_EXPORT void circularPermutation(int nbOfShift=1); + MEDCOUPLING_EXPORT void circularPermutationPerTuple(int nbOfShift=1); + MEDCOUPLING_EXPORT void reversePerTuple(); + MEDCOUPLING_EXPORT void setPartOfValues1(const typename Traits::ArrayType *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true); + MEDCOUPLING_EXPORT void setPartOfValuesSimple1(T a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp); + MEDCOUPLING_EXPORT void setPartOfValues2(const typename Traits::ArrayType *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true); + MEDCOUPLING_EXPORT void setPartOfValuesSimple2(T a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp); + MEDCOUPLING_EXPORT void setPartOfValues3(const typename Traits::ArrayType *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true); + MEDCOUPLING_EXPORT void setPartOfValuesSimple3(T a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp); + MEDCOUPLING_EXPORT void setPartOfValues4(const typename Traits::ArrayType *a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true); + MEDCOUPLING_EXPORT void setPartOfValuesSimple4(T a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp); + MEDCOUPLING_EXPORT void setPartOfValuesAdv(const typename Traits::ArrayType *a, const DataArrayInt32 *tuplesSelec); + MEDCOUPLING_EXPORT void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt32 *tuplesSelec); + MEDCOUPLING_EXPORT void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step); + MEDCOUPLING_EXPORT T getMaxValue(int& tupleId) const; + MEDCOUPLING_EXPORT T getMaxValueInArray() const; + MEDCOUPLING_EXPORT T getMaxAbsValue(std::size_t& tupleId) const; + MEDCOUPLING_EXPORT T getMaxAbsValueInArray() const; + MEDCOUPLING_EXPORT T getMinValue(int& tupleId) const; + MEDCOUPLING_EXPORT 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); } 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(); public: MEDCOUPLING_EXPORT MemArray& accessToMemArray() { return _mem; } MEDCOUPLING_EXPORT const MemArray& accessToMemArray() const { return _mem; } @@ -339,13 +344,22 @@ namespace MEDCoupling 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; + template + MCAuto< typename Traits::ArrayType > convertToOtherTypeOfArr() const; protected: static typename Traits::ArrayType *PerformCopyOrIncrRef(bool dCpy, const typename Traits::ArrayType& self); template MCAuto findIdsAdv(const OP& op) const; private: - template - MCAuto< typename Traits::ArrayType > convertToOtherTypeOfArr() const; template void somethingEqual(const typename Traits::ArrayType *other); }; @@ -355,7 +369,6 @@ namespace MEDCoupling { public: MEDCOUPLING_EXPORT bool isUniform(T val, T eps) const; - MEDCOUPLING_EXPORT void iota(T init=0.); }; } @@ -374,16 +387,10 @@ namespace MEDCoupling 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 reprStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprZipStream(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; public:// non abstract but essential - MEDCOUPLING_EXPORT std::string reprNotTooLong() const; - MEDCOUPLING_EXPORT void reprNotTooLongStream(std::ostream& stream) const; - MEDCOUPLING_EXPORT void reprNotTooLongWithoutNameStream(std::ostream& stream) const; 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; @@ -405,19 +412,11 @@ namespace MEDCoupling MEDCOUPLING_EXPORT double doubleValue() const; MEDCOUPLING_EXPORT DataArrayDouble *deepCopy() const; MEDCOUPLING_EXPORT DataArrayDouble *buildNewEmptyInstance() const { return DataArrayDouble::New(); } - MEDCOUPLING_EXPORT void fillWithZero(); 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; @@ -449,6 +448,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT double getAverageValue() const; MEDCOUPLING_EXPORT double norm2() const; MEDCOUPLING_EXPORT double normMax() const; + MEDCOUPLING_EXPORT void normMaxPerComponent(double * res) const; MEDCOUPLING_EXPORT double normMin() const; MEDCOUPLING_EXPORT void accumulate(double *res) const; MEDCOUPLING_EXPORT double accumulate(int compId) const; @@ -471,11 +471,11 @@ namespace MEDCoupling 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(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); @@ -533,6 +533,11 @@ namespace MEDCoupling 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; protected: template void switchOnTupleAlg(T val, std::vector& vec, ALG algo) const; @@ -559,24 +564,9 @@ namespace MEDCoupling MEDCOUPLING_EXPORT int getHashCode() const; MEDCOUPLING_EXPORT DataArrayInt32 *deepCopy() const;//ok MEDCOUPLING_EXPORT DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }//ok - MEDCOUPLING_EXPORT DataArrayInt32 *indicesOfSubPart(const DataArrayInt32& partOfThis) const; - MEDCOUPLING_EXPORT DataArrayInt32 *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; @@ -589,6 +579,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT DataArrayInt32 *invertArrayO2N2N2O(int newNbOfElem) const; MEDCOUPLING_EXPORT DataArrayInt32 *invertArrayN2O2O2N(int oldNbOfElem) const; MEDCOUPLING_EXPORT MCAuto< MapKeyVal > invertArrayN2O2O2NOptimized() const; + MEDCOUPLING_EXPORT MCAuto< MapKeyVal > giveN2OOptimized() 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); } @@ -612,6 +603,7 @@ namespace MEDCoupling 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; @@ -710,7 +702,6 @@ namespace MEDCoupling 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;