- class DataArrayIntIterator;
-
- class DataArrayInt : public DataArrayTemplateClassic<int>
- {
- public:
- 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<bool>& v) const;
- MEDCOUPLING_EXPORT void switchOnTupleEqualTo(int val, std::vector<bool>& vec) const;
- MEDCOUPLING_EXPORT void switchOnTupleNotEqualTo(int val, std::vector<bool>& 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;
- 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 DataArrayInt *fromNoInterlace() const;
- MEDCOUPLING_EXPORT DataArrayInt *toNoInterlace() const;
- MEDCOUPLING_EXPORT DataArrayInt *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate<int>::mySelectByTupleId(new2OldBg,new2OldEnd); }
- MEDCOUPLING_EXPORT DataArrayInt *selectByTupleId(const DataArrayInt& di) const { return DataArrayTemplate<int>::mySelectByTupleId(di); }
- MEDCOUPLING_EXPORT DataArrayInt *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate<int>::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); }
- MEDCOUPLING_EXPORT DataArrayInt *keepSelectedComponents(const std::vector<int>& compoIds) const { return DataArrayTemplate<int>::myKeepSelectedComponents(compoIds); }
- MEDCOUPLING_EXPORT DataArrayInt *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate<int>::mySelectByTupleIdSafeSlice(bg,end2,step); }
- MEDCOUPLING_EXPORT DataArrayInt *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const { return DataArrayTemplate<int>::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<int>& 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<int>& tupl) const;
- MEDCOUPLING_EXPORT int findIdFirstEqual(int value) const;
- MEDCOUPLING_EXPORT int findIdFirstEqual(const std::vector<int>& vals) const;
- MEDCOUPLING_EXPORT int findIdSequence(const std::vector<int>& vals) const;
- MEDCOUPLING_EXPORT bool presenceOfTuple(const std::vector<int>& tupl) const;
- MEDCOUPLING_EXPORT bool presenceOfValue(int value) const;
- MEDCOUPLING_EXPORT bool presenceOfValue(const std::vector<int>& 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 applyInv(int numerator);
- MEDCOUPLING_EXPORT void applyDivideBy(int val);
- MEDCOUPLING_EXPORT void applyModulus(int val);
- MEDCOUPLING_EXPORT void applyRModulus(int val);
- MEDCOUPLING_EXPORT void applyPow(int val);
- MEDCOUPLING_EXPORT void applyRPow(int val);
- MEDCOUPLING_EXPORT DataArrayInt *findIdsInRange(int vmin, int vmax) const;
- MEDCOUPLING_EXPORT DataArrayInt *findIdsNotInRange(int vmin, int vmax) const;
- MEDCOUPLING_EXPORT bool checkAllIdsInRange(int vmin, int vmax) const;
- MEDCOUPLING_EXPORT static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2);
- MEDCOUPLING_EXPORT static DataArrayInt *Aggregate(const std::vector<const DataArrayInt *>& arr);
- MEDCOUPLING_EXPORT static DataArrayInt *AggregateIndexes(const std::vector<const DataArrayInt *>& arrs);
- MEDCOUPLING_EXPORT static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2);
- MEDCOUPLING_EXPORT static DataArrayInt *Meld(const std::vector<const DataArrayInt *>& arr);
- MEDCOUPLING_EXPORT static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups);
- MEDCOUPLING_EXPORT static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr);
- MEDCOUPLING_EXPORT static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr);
- MEDCOUPLING_EXPORT static DataArrayInt *BuildListOfSwitchedOn(const std::vector<bool>& v);
- MEDCOUPLING_EXPORT static DataArrayInt *BuildListOfSwitchedOff(const std::vector<bool>& v);
- MEDCOUPLING_EXPORT static void PutIntoToSkylineFrmt(const std::vector< std::vector<int> >& 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<DataArrayInt> fromLinkedListOfPairToList() const;
- MEDCOUPLING_EXPORT DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const;
- MEDCOUPLING_EXPORT DataArrayInt *getDifferentValues() const;
- MEDCOUPLING_EXPORT std::vector<DataArrayInt *> partitionByDifferentValues(std::vector<int>& differentIds) const;
- MEDCOUPLING_EXPORT std::vector< std::pair<int,int> > splitInBalancedSlices(int nbOfSlices) const;
- template<class InputIterator>
- 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 *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 MemArray<int>& accessToMemArray() { return _mem; }
- MEDCOUPLING_EXPORT const MemArray<int>& accessToMemArray() const { return _mem; }
- public:
- MEDCOUPLING_EXPORT static int *CheckAndPreparePermutation(const int *start, const int *end);
- MEDCOUPLING_EXPORT static DataArrayInt *Range(int begin, int end, int step);
- public:
- MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
- MEDCOUPLING_EXPORT void getTinySerializationStrInformation(std::vector<std::string>& tinyInfo) const;
- MEDCOUPLING_EXPORT bool resizeForUnserialization(const std::vector<int>& tinyInfoI);
- MEDCOUPLING_EXPORT void finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<std::string>& tinyInfoS);
+namespace MEDCoupling
+{
+ template<class T>
+ class DataArrayDiscrete : public DataArrayTemplateClassic<T>
+ {
+ public:
+ using DataArrayType = typename Traits<T>::ArrayType;
+ public:
+ static DataArrayType *New();
+ T intValue() const;
+ bool isEqual(const DataArrayDiscrete<T>& other) const;
+ bool isEqualIfNotWhy(const DataArrayDiscrete<T>& other, std::string& reason) const;
+ bool isEqualWithoutConsideringStr(const DataArrayDiscrete<T>& other) const;
+ bool isEqualWithoutConsideringStrAndOrder(const typename Traits<T>::ArrayType& other) const;
+ void switchOnTupleEqualTo(T val, std::vector<bool>& vec) const;
+ void switchOnTupleNotEqualTo(T val, std::vector<bool>& vec) const;
+ DataArrayIdType *occurenceRankInThis() const;
+ DataArrayIdType *buildPermutationArr(const DataArrayDiscrete<T>& other) const;
+ DataArrayIdType *indicesOfSubPart(const DataArrayDiscrete<T>& partOfThis) const;
+ void checkMonotonic(bool increasing) const;
+ bool isMonotonic(bool increasing) const;
+ void checkStrictlyMonotonic(bool increasing) const;
+ bool isStrictlyMonotonic(bool increasing) const;
+ mcIdType getHashCode() const;
+ void reprCppStream(const std::string& varName, std::ostream& stream) const;
+ void reprQuickOverview(std::ostream& stream) const;
+ void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
+ void writeVTK(std::ostream& ofs, mcIdType indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const;
+ void transformWithIndArr(const T *indArrBg, const T *indArrEnd);
+ void transformWithIndArr(const MapKeyVal<T, T>& m);
+ DataArrayIdType *findIdsEqual(T val) const;
+ DataArrayIdType *transformWithIndArrR(const T *indArr2Bg, const T *indArrEnd) const;
+ void splitByValueRange(const T *arrBg, const T *arrEnd,
+ DataArrayType *& castArr, DataArrayType *& rankInsideCast, DataArrayType *& castsPresent) const;
+ bool isRange(T& strt, T& sttoopp, T& stteepp) const;
+ DataArrayIdType *invertArrayO2N2N2O(mcIdType newNbOfElem) const;
+ DataArrayIdType *invertArrayN2O2O2N(mcIdType oldNbOfElem) const;
+ DataArrayIdType *invertArrayO2N2N2OBis(mcIdType newNbOfElem) const;
+ MCAuto< MapKeyVal<T, mcIdType> > invertArrayN2O2O2NOptimized() const;
+ MCAuto< MapKeyVal<mcIdType, T> > giveN2OOptimized() const;
+ MCAuto<DataArrayIdType> findIdForEach(const T *valsBg, const T *valsEnd) const;
+ DataArrayIdType *checkAndPreparePermutation() const;
+ void changeSurjectiveFormat(T targetNb, DataArrayIdType *&arr, DataArrayIdType *&arrI) const;
+ DataArrayIdType *buildPermArrPerLevel() const;
+ bool isIota(mcIdType sizeExpected) const;
+ bool isUniform(T val) const;
+ T checkUniformAndGuess() const;
+ bool hasUniqueValues() const;
+ void setSelectedComponents(const DataArrayType *a, const std::vector<std::size_t>& compoIds);
+ DataArrayIdType *locateComponentId(const DataArrayType *valToSearchIntoTuples, const DataArrayIdType *tupleIdHint) const;
+ DataArrayIdType *findIdsNotEqual(T val) const;
+ DataArrayIdType *findIdsEqualTuple(const T *tupleBg, const T *tupleEnd) const;
+ DataArrayIdType *findIdsEqualList(const T *valsBg, const T *valsEnd) const;
+ DataArrayIdType *findIdsNotEqualList(const T *valsBg, const T *valsEnd) const;
+ mcIdType findIdFirstEqual(T value) const;
+ mcIdType findIdFirstEqual(const std::vector<T>& vals) const;
+ mcIdType findIdFirstEqualTuple(const std::vector<T>& tupl) const;
+ mcIdType findIdSequence(const std::vector<T>& vals) const;
+ mcIdType changeValue(T oldValue, T newValue);
+ mcIdType count(T value) const;
+ bool presenceOfTuple(const std::vector<T>& tupl) const;
+ bool presenceOfValue(T value) const;
+ bool presenceOfValue(const std::vector<T>& vals) const;
+ void accumulate(T *res) const;
+ T accumulate(std::size_t compId) const;
+ DataArrayType *accumulatePerChunck(const mcIdType *bgOfIndex, const mcIdType *endOfIndex) const;
+ void getMinMaxValues(T& minValue, T& maxValue) const;
+ void applyInv(T numerator);
+ void applyDivideBy(T val);
+ void applyModulus(T val);
+ void applyRModulus(T val);
+ void applyPow(T val);
+ void applyRPow(T val);
+ DataArrayIdType *findIdsInRange(T vmin, T vmax) const;
+ DataArrayIdType *findIdsNotInRange(T vmin, T vmax) const;
+ bool checkAllIdsInRange(T vmin, T vmax) const;
+ static DataArrayType *Aggregate(const DataArrayType *a1, const DataArrayType *a2, T offsetA2);
+ static DataArrayType *Aggregate(const std::vector<const DataArrayType *>& arr);
+ static DataArrayType *AggregateIndexes(const std::vector<const DataArrayType *>& arrs);
+ static DataArrayType *BuildUnion(const std::vector<const DataArrayType *>& arr);
+ static DataArrayType *BuildIntersection(const std::vector<const DataArrayType *>& arr);
+ static void PutIntoToSkylineFrmt(const std::vector< std::vector<T> >& v, DataArrayType *& data, DataArrayIdType *& dataIndex);
+ DataArrayIdType *buildComplement(mcIdType nbOfElement) const;
+ DataArrayType *buildSubstraction(const DataArrayType *other) const;
+ DataArrayType *buildSubstractionOptimized(const DataArrayType *other) const;
+ DataArrayType *buildUnion(const DataArrayType *other) const;
+ DataArrayType *buildIntersection(const DataArrayType *other) const;
+ DataArrayIdType *indexOfSameConsecutiveValueGroups() const;
+ DataArrayType *buildUnique() const;
+ DataArrayType *buildUniqueNotSorted() const;
+ DataArrayType *deltaShiftIndex() const;
+ void computeOffsets();
+ void computeOffsetsFull();
+ void findIdsRangesInListOfIds(const DataArrayType *listOfIds, DataArrayIdType *& rangeIdsFetched, DataArrayType *& idsInInputListThatFetch) const;
+ DataArrayType *buildExplicitArrByRanges(const DataArrayType *offsets) const;
+ DataArrayType *buildExplicitArrOfSliceOnScaledArr(T begin, T stop, T step) const;
+ DataArrayIdType *findRangeIdForEachTuple(const DataArrayType *ranges) const;
+ DataArrayType *findIdInRangeForEachTuple(const DataArrayType *ranges) const;
+ void sortEachPairToMakeALinkedList();
+ void sortToHaveConsecutivePairs();
+ MCAuto<DataArrayType> fromLinkedListOfPairToList() const;
+ DataArrayType *getDifferentValues() const;
+ std::vector<DataArrayIdType *> partitionByDifferentValues(std::vector<T>& differentIds) const;
+ std::vector< std::pair<mcIdType,mcIdType> > splitInBalancedSlices(mcIdType nbOfSlices) const;
+ static DataArrayType *Modulus(const DataArrayType *a1, const DataArrayType *a2);
+ void modulusEqual(const DataArrayType *other);
+ static DataArrayType *Pow(const DataArrayType *a1, const DataArrayType *a2);
+ void powEqual(const DataArrayType *other);
+ //MemArray<T>& accessToMemArray() { return _mem; }
+ //const MemArray<T>& accessToMemArray() const { return _mem; }
+ public:
+ static DataArrayIdType *FindPermutationFromFirstToSecond(const DataArrayType *ids1, const DataArrayType *ids2);
+ static DataArrayIdType *FindPermutationFromFirstToSecondDuplicate(const DataArrayType *ids1, const DataArrayType *ids2);
+ static mcIdType *CheckAndPreparePermutation(const T *start, const T *end);
+ static DataArrayType *BuildListOfSwitchedOn(const std::vector<bool>& v);
+ static DataArrayType *BuildListOfSwitchedOff(const std::vector<bool>& v);
+ static DataArrayIdType *ConvertIndexArrayToO2N(mcIdType nbOfOldTuples, const mcIdType *arr, const mcIdType *arrIBg, const mcIdType *arrIEnd, mcIdType &newNbOfTuples);
+ static DataArrayIdType *MakePartition(const std::vector<const DataArrayType *>& groups, mcIdType newNb, std::vector< std::vector<mcIdType> >& fidsOfGroups);
+ public:
+ static void ExtractFromIndexedArrays(const mcIdType *idsOfSelectBg, const mcIdType *idsOfSelectEnd,
+ const DataArrayType *arrIn, const DataArrayIdType *arrIndxIn,
+ DataArrayType* &arrOut, DataArrayIdType* &arrIndexOut);
+ static void ExtractFromIndexedArraysSlice(mcIdType idsOfSelectStart, mcIdType idsOfSelectStop, mcIdType idsOfSelectStep,
+ const DataArrayType *arrIn, const DataArrayIdType *arrIndxIn,
+ DataArrayType* &arrOut, DataArrayIdType* &arrIndexOut);
+ static void SetPartOfIndexedArrays(const mcIdType *idsOfSelectBg, const mcIdType *idsOfSelectEnd,
+ const DataArrayType *arrIn, const DataArrayIdType *arrIndxIn,
+ const DataArrayType *srcArr, const DataArrayIdType *srcArrIndex,
+ DataArrayType* &arrOut, DataArrayIdType* &arrIndexOut);
+ static void SetPartOfIndexedArraysSlice(mcIdType start, mcIdType end, mcIdType step,
+ const DataArrayType *arrIn, const DataArrayIdType *arrIndxIn,
+ const DataArrayType *srcArr, const DataArrayIdType *srcArrIndex,
+ DataArrayType* &arrOut, DataArrayIdType* &arrIndexOut);
+ static void SetPartOfIndexedArraysSameIdx(const mcIdType *idsOfSelectBg, const mcIdType *idsOfSelectEnd,
+ DataArrayType *arrInOut, const DataArrayIdType *arrIndxIn,
+ const DataArrayType *srcArr, const DataArrayIdType *srcArrIndex);
+ static void SetPartOfIndexedArraysSameIdxSlice(mcIdType start, mcIdType end, mcIdType step,
+ DataArrayType *arrInOut, const DataArrayIdType *arrIndxIn,
+ const DataArrayType *srcArr, const DataArrayIdType *srcArrIndex);
+ static bool RemoveIdsFromIndexedArrays(const T *idsToRemoveBg, const T *idsToRemoveEnd,
+ DataArrayType *arr, DataArrayIdType *arrIndx, mcIdType offsetForRemoval=0);
+ static DataArrayType *Range(T begin, T end, T step);
+ public:
+ void getTinySerializationIntInformation(std::vector<mcIdType>& tinyInfo) const;
+ void getTinySerializationStrInformation(std::vector<std::string>& tinyInfo) const;
+ bool resizeForUnserialization(const std::vector<mcIdType>& tinyInfoI);
+ void finishUnserialization(const std::vector<mcIdType>& tinyInfoI, const std::vector<std::string>& tinyInfoS);
+ protected:
+ template<class ALG>
+ void switchOnTupleAlg(T val, std::vector<bool>& vec, ALG algo) const;
+ protected:
+ ~DataArrayDiscrete() { }
+ };
+
+ template<class T>
+ class DataArrayDiscreteSigned : public DataArrayDiscrete<T>
+ {
+ public:
+ bool isFittingWith(const std::vector<bool>& v) const;
+ protected:
+ ~DataArrayDiscreteSigned() { }
+ };
+
+ class DataArrayInt32Iterator;
+
+ class MEDCOUPLING_EXPORT DataArrayInt32 : public DataArrayDiscreteSigned<Int32>
+ {
+ friend class DataArrayDiscrete<Int32>;
+ public:
+ DataArrayInt32 *deepCopy() const;
+ DataArrayInt32 *copySorted(bool asc=true) const override { return this->copySortedImpl(asc); }
+ DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }
+ MCAuto<DataArrayInt64> convertToInt64Arr() const;
+ public:
+ DataArrayInt32 *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); }
+ DataArrayInt32 *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); }
+ DataArrayInt32 *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleIdSafe(new2OldBg,new2OldEnd); }
+ DataArrayInt32 *keepSelectedComponents(const std::vector<std::size_t>& compoIds) const { return this->myKeepSelectedComponents(compoIds); }
+ DataArrayInt32 *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return this->mySelectByTupleIdSafeSlice(bg,end2,step); }
+ DataArrayInt32 *selectByTupleRanges(const std::vector<std::pair<mcIdType,mcIdType> >& ranges) const { return this->mySelectByTupleRanges(ranges); }
+ std::string getClassName() const override { return std::string("DataArrayInt32"); }
+ public:
+ DataArrayInt32Iterator *iterator();