//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
static mcIdType GetPosOfItemGivenBESRelativeNoThrow(T value, T begin, T end, T step);
};
static mcIdType GetPosOfItemGivenBESRelativeNoThrow(T value, T begin, T end, T step);
};
void setPartOfValuesBase3(const DataArray *aBase, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true);
virtual void *getVoidStarPointer() = 0;
virtual DataArray *deepCopy() const = 0;
void setPartOfValuesBase3(const DataArray *aBase, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType 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 DataArray *buildNewEmptyInstance() const = 0;
virtual bool isAllocated() const = 0;
virtual void checkAllocated() const = 0;
static mcIdType GetNumberOfItemGivenBES(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg);
static mcIdType GetNumberOfItemGivenBESRelative(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg);
static mcIdType GetPosOfItemGivenBESRelativeNoThrow(mcIdType value, mcIdType begin, mcIdType end, mcIdType step);
static mcIdType GetNumberOfItemGivenBES(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg);
static mcIdType GetNumberOfItemGivenBESRelative(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg);
static mcIdType GetPosOfItemGivenBESRelativeNoThrow(mcIdType value, mcIdType begin, mcIdType end, mcIdType 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 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);
+ void printForDebug(std::ostream& oss) const
+ {
+ this->checkAllocated();
+ char comma[3] = {'\0',' ','\0'};
+ std::for_each(this->begin(),this->end(),[&comma,&oss](const T& elt) { oss << comma << elt; comma[0]=','; } );
+ oss << std::endl;
+ }
T getIJ(std::size_t tupleId, std::size_t compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; }
void setIJ(std::size_t tupleId, std::size_t compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); }
void setIJSilent(std::size_t tupleId, std::size_t compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; }
T getIJ(std::size_t tupleId, std::size_t compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; }
void setIJ(std::size_t tupleId, std::size_t compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); }
void setIJSilent(std::size_t tupleId, std::size_t compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; }
MemArray<T>& accessToMemArray() { return _mem; }
const MemArray<T>& accessToMemArray() const { return _mem; }
protected:
MemArray<T>& accessToMemArray() { return _mem; }
const MemArray<T>& accessToMemArray() const { return _mem; }
protected:
typename Traits<T>::ArrayType *mySelectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const;
typename Traits<T>::ArrayType *mySelectByTupleId(const DataArrayIdType& di) const;
typename Traits<T>::ArrayType *mySelectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const;
typename Traits<T>::ArrayType *mySelectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const;
typename Traits<T>::ArrayType *mySelectByTupleId(const DataArrayIdType& di) const;
typename Traits<T>::ArrayType *mySelectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const;
MCAuto<DataArrayFloat> convertToFloatArr() const;
void applyLin(T a, T b, std::size_t compoId);
void applyLin(T a, T b);
MCAuto<DataArrayFloat> convertToFloatArr() const;
void applyLin(T a, T b, std::size_t compoId);
void applyLin(T a, T b);
static DataArrayFloat *New();
public:// abstract method overload
DataArrayFloat *deepCopy() const;
static DataArrayFloat *New();
public:// abstract method overload
DataArrayFloat *deepCopy() const;
std::string getClassName() const override { return std::string("DataArrayFloat"); }
DataArrayFloat *buildNewEmptyInstance() const { return DataArrayFloat::New(); }
DataArrayFloat *selectByTupleRanges(const std::vector<std::pair<mcIdType,mcIdType> >& ranges) const { return DataArrayTemplateFP<float>::mySelectByTupleRanges(ranges); }
std::string getClassName() const override { return std::string("DataArrayFloat"); }
DataArrayFloat *buildNewEmptyInstance() const { return DataArrayFloat::New(); }
DataArrayFloat *selectByTupleRanges(const std::vector<std::pair<mcIdType,mcIdType> >& ranges) const { return DataArrayTemplateFP<float>::mySelectByTupleRanges(ranges); }
static DataArrayDouble *New();
double doubleValue() const;
DataArrayDouble *deepCopy() const;
static DataArrayDouble *New();
double doubleValue() const;
DataArrayDouble *deepCopy() const;
std::string getClassName() const override { return std::string("DataArrayDouble"); }
DataArrayDouble *buildNewEmptyInstance() const { return DataArrayDouble::New(); }
void checkMonotonic(bool increasing, double eps) const;
std::string getClassName() const override { return std::string("DataArrayDouble"); }
DataArrayDouble *buildNewEmptyInstance() const { return DataArrayDouble::New(); }
void checkMonotonic(bool increasing, double eps) const;
DataArrayDouble *trace() const;
DataArrayDouble *deviator() const;
DataArrayDouble *magnitude() const;
DataArrayDouble *trace() const;
DataArrayDouble *deviator() const;
DataArrayDouble *magnitude() const;
DataArrayDouble *maxPerTuple() const;
DataArrayDouble *maxPerTupleWithCompoId(DataArrayIdType* &compoIdOfMaxPerTuple) const;
DataArrayDouble *buildEuclidianDistanceDenseMatrix() const;
DataArrayDouble *maxPerTuple() const;
DataArrayDouble *maxPerTupleWithCompoId(DataArrayIdType* &compoIdOfMaxPerTuple) const;
DataArrayDouble *buildEuclidianDistanceDenseMatrix() const;
bool resizeForUnserialization(const std::vector<mcIdType>& tinyInfoI);
void finishUnserialization(const std::vector<mcIdType>& tinyInfoI, const std::vector<std::string>& tinyInfoS);
public:
bool resizeForUnserialization(const std::vector<mcIdType>& tinyInfoI);
void finishUnserialization(const std::vector<mcIdType>& tinyInfoI, const std::vector<std::string>& tinyInfoS);
public:
void findCommonTuplesAlg(const double *bbox, mcIdType nbNodes, mcIdType limitNodeId, double prec, DataArrayIdType *c, DataArrayIdType *cI) const;
void findCommonTuplesAlg(const double *bbox, mcIdType nbNodes, mcIdType limitNodeId, double prec, DataArrayIdType *c, DataArrayIdType *cI) const;
static void FindClosestTupleIdAlg(const BBTreePts<SPACEDIM,mcIdType>& myTree, double dist, const double *pos, mcIdType nbOfTuples, const double *thisPt, mcIdType thisNbOfTuples, mcIdType *res);
static void FindClosestTupleIdAlg(const BBTreePts<SPACEDIM,mcIdType>& myTree, double dist, const double *pos, mcIdType nbOfTuples, const double *thisPt, mcIdType thisNbOfTuples, mcIdType *res);
static void FindTupleIdsNearTuplesAlg(const BBTreePts<SPACEDIM,mcIdType>& myTree, const double *pos, mcIdType nbOfTuples, double eps,
DataArrayIdType *c, DataArrayIdType *cI);
static void FindTupleIdsNearTuplesAlg(const BBTreePts<SPACEDIM,mcIdType>& myTree, const double *pos, mcIdType nbOfTuples, double eps,
DataArrayIdType *c, DataArrayIdType *cI);
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;
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 *buildPermutationArr(const DataArrayDiscrete<T>& other) const;
DataArrayIdType *indicesOfSubPart(const DataArrayDiscrete<T>& partOfThis) const;
void checkMonotonic(bool increasing) const;
DataArrayIdType *buildPermutationArr(const DataArrayDiscrete<T>& other) const;
DataArrayIdType *indicesOfSubPart(const DataArrayDiscrete<T>& partOfThis) const;
void checkMonotonic(bool increasing) const;
DataArrayIdType *findIdsEqual(T val) const;
DataArrayIdType *transformWithIndArrR(const T *indArr2Bg, const T *indArrEnd) const;
void splitByValueRange(const T *arrBg, const T *arrEnd,
DataArrayIdType *findIdsEqual(T val) const;
DataArrayIdType *transformWithIndArrR(const T *indArr2Bg, const T *indArrEnd) const;
void splitByValueRange(const T *arrBg, const T *arrEnd,
bool isRange(T& strt, T& sttoopp, T& stteepp) const;
DataArrayIdType *invertArrayO2N2N2O(mcIdType newNbOfElem) const;
DataArrayIdType *invertArrayN2O2O2N(mcIdType oldNbOfElem) const;
bool isRange(T& strt, T& sttoopp, T& stteepp) const;
DataArrayIdType *invertArrayO2N2N2O(mcIdType newNbOfElem) const;
DataArrayIdType *invertArrayN2O2O2N(mcIdType oldNbOfElem) const;
T checkUniformAndGuess() const;
bool hasUniqueValues() const;
void setSelectedComponents(const DataArrayType *a, const std::vector<std::size_t>& compoIds);
T checkUniformAndGuess() const;
bool hasUniqueValues() const;
void setSelectedComponents(const DataArrayType *a, const std::vector<std::size_t>& compoIds);
DataArrayIdType *findIdsNotEqual(T val) const;
DataArrayIdType *findIdsEqualTuple(const T *tupleBg, const T *tupleEnd) const;
DataArrayIdType *findIdsEqualList(const T *valsBg, const T *valsEnd) const;
DataArrayIdType *findIdsNotEqual(T val) const;
DataArrayIdType *findIdsEqualTuple(const T *tupleBg, const T *tupleEnd) const;
DataArrayIdType *findIdsEqualList(const T *valsBg, const T *valsEnd) const;
DataArrayType *buildSubstractionOptimized(const DataArrayType *other) const;
DataArrayType *buildUnion(const DataArrayType *other) const;
DataArrayType *buildIntersection(const DataArrayType *other) const;
DataArrayType *buildSubstractionOptimized(const DataArrayType *other) const;
DataArrayType *buildUnion(const DataArrayType *other) const;
DataArrayType *buildIntersection(const DataArrayType *other) const;
DataArrayType *buildUnique() const;
DataArrayType *buildUniqueNotSorted() const;
DataArrayType *deltaShiftIndex() const;
DataArrayType *buildUnique() const;
DataArrayType *buildUniqueNotSorted() const;
DataArrayType *deltaShiftIndex() const;
DataArrayIdType *findRangeIdForEachTuple(const DataArrayType *ranges) const;
DataArrayType *findIdInRangeForEachTuple(const DataArrayType *ranges) const;
void sortEachPairToMakeALinkedList();
DataArrayIdType *findRangeIdForEachTuple(const DataArrayType *ranges) const;
DataArrayType *findIdInRangeForEachTuple(const DataArrayType *ranges) const;
void sortEachPairToMakeALinkedList();
MCAuto<DataArrayType> fromLinkedListOfPairToList() const;
DataArrayType *getDifferentValues() const;
std::vector<DataArrayIdType *> partitionByDifferentValues(std::vector<T>& differentIds) const;
MCAuto<DataArrayType> fromLinkedListOfPairToList() const;
DataArrayType *getDifferentValues() const;
std::vector<DataArrayIdType *> partitionByDifferentValues(std::vector<T>& differentIds) const;
//const MemArray<T>& accessToMemArray() const { return _mem; }
public:
static DataArrayIdType *FindPermutationFromFirstToSecond(const DataArrayType *ids1, const DataArrayType *ids2);
//const MemArray<T>& accessToMemArray() const { return _mem; }
public:
static DataArrayIdType *FindPermutationFromFirstToSecond(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 mcIdType *CheckAndPreparePermutation(const T *start, const T *end);
static DataArrayType *BuildListOfSwitchedOn(const std::vector<bool>& v);
static DataArrayType *BuildListOfSwitchedOff(const std::vector<bool>& v);
- DataArrayInt32 *deepCopy() const;//ok
- DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }//ok
+ 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); }
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); }
public:
DataArrayInt64 *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); }
DataArrayInt64 *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); }
public:
DataArrayInt64 *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); }
DataArrayInt64 *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); }
DataArrayChar *buildEmptySpecializedDAChar() const;
DataArrayByteIterator *iterator();
DataArrayByte *deepCopy() const;
DataArrayChar *buildEmptySpecializedDAChar() const;
DataArrayByteIterator *iterator();
DataArrayByte *deepCopy() const;
DataArrayByte *performCopyOrIncrRef(bool deepCopy) const;
DataArrayByte *buildNewEmptyInstance() const { return DataArrayByte::New(); }
char byteValue() const;
DataArrayByte *performCopyOrIncrRef(bool deepCopy) const;
DataArrayByte *buildNewEmptyInstance() const { return DataArrayByte::New(); }
char byteValue() const;
DataArrayChar *buildEmptySpecializedDAChar() const;
DataArrayAsciiCharIterator *iterator();
DataArrayAsciiChar *deepCopy() const;
DataArrayChar *buildEmptySpecializedDAChar() const;
DataArrayAsciiCharIterator *iterator();
DataArrayAsciiChar *deepCopy() const;
DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const;
DataArrayAsciiChar *buildNewEmptyInstance() const { return DataArrayAsciiChar::New(); }
char asciiCharValue() const;
DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const;
DataArrayAsciiChar *buildNewEmptyInstance() const { return DataArrayAsciiChar::New(); }
char asciiCharValue() const;
float floatValue() const;
DataArrayFloat *buildDAFloat(std::size_t nbOfTuples, std::size_t nbOfCompo) const;
};
float floatValue() const;
DataArrayFloat *buildDAFloat(std::size_t nbOfTuples, std::size_t nbOfCompo) const;
};