//
// 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 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);
static MCAuto< typename Traits<T>::ArrayTypeCh > NewFromArray(const T *arrBegin, const T *arrEnd);
std::vector< MCAuto< typename Traits<T>::ArrayTypeCh > > explodeComponents() const;
//
static MCAuto< typename Traits<T>::ArrayTypeCh > NewFromArray(const T *arrBegin, const T *arrEnd);
std::vector< MCAuto< typename Traits<T>::ArrayTypeCh > > explodeComponents() const;
//
+ 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; }
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);
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);
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;
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;
DataArrayInt32 *deepCopy() const;
DataArrayInt32 *copySorted(bool asc=true) const override { return this->copySortedImpl(asc); }
DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }
DataArrayInt32 *deepCopy() const;
DataArrayInt32 *copySorted(bool asc=true) const override { return this->copySortedImpl(asc); }
DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }
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); }
DataArrayInt64 *deepCopy() const;
DataArrayInt64 *copySorted(bool asc=true) const override { return this->copySortedImpl(asc); }
DataArrayInt64 *buildNewEmptyInstance() const { return DataArrayInt64::New(); }//ok
DataArrayInt64 *deepCopy() const;
DataArrayInt64 *copySorted(bool asc=true) const override { return this->copySortedImpl(asc); }
DataArrayInt64 *buildNewEmptyInstance() const { return DataArrayInt64::New(); }//ok
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;
};