X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingMemArray.hxx;h=6e74370e405bc464b9081d6495d0030c566662bc;hb=e7835cba1eb17f50ef4e130c2cb8d0f54bc25083;hp=ac91081aae3ae6a60e791ce5b3d285939ed674d4;hpb=ce3143614a66c93e9b3ad2a07eb015cc3ed64ce4;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index ac91081aa..6e74370e4 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -285,6 +285,8 @@ namespace MEDCoupling void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step); T getMaxValue(int& tupleId) const; T getMaxValueInArray() const; + T getMaxAbsValue(std::size_t& tupleId) const; + T getMaxAbsValueInArray() const; T getMinValue(int& tupleId) const; T getMinValueInArray() const; MEDCOUPLING_EXPORT void getTuple(int tupleId, T *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); } @@ -292,6 +294,7 @@ namespace MEDCoupling 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 +342,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 +367,6 @@ namespace MEDCoupling { public: MEDCOUPLING_EXPORT bool isUniform(T val, T eps) const; - MEDCOUPLING_EXPORT void iota(T init=0.); }; } @@ -374,16 +385,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 +410,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; @@ -471,11 +468,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 +530,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 +561,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; @@ -612,6 +599,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 +698,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;