+/*!
+ * This method operates FoG where F is \a this and G is \a other.
+ * Example : if \a other is SlicePart(4,14,1) and if \a this is DataArrayPartDefinition([0,1,2,3,6,7,8,9]) -> DataArrayPartDefinition([4,5,6,7,11,12,13]) will be returned
+ */
+PartDefinition *DataArrayPartDefinition::composeWith(const PartDefinition *other) const
+{
+ if(!other)
+ throw INTERP_KERNEL::Exception("DataArrayPartDefinition::composeWith : input PartDef must be not NULL !");
+ checkConsistencyLight();
+ other->checkConsistencyLight();
+ const SlicePartDefinition *spd(dynamic_cast<const SlicePartDefinition *>(other));
+ if(spd)
+ {//special case for optim
+ mcIdType a(0),b(0),c(0);
+ spd->getSlice(a,b,c);
+ if(c==1)
+ {
+ MCAuto<DataArrayIdType> arr(DataArrayIdType::New());
+ arr->alloc(_arr->getNumberOfTuples(),1);
+ std::transform(_arr->begin(),_arr->end(),arr->getPointer(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,a));
+ return DataArrayPartDefinition::New(arr);
+ }
+ }
+ //
+ MCAuto<DataArrayIdType> arr1(other->toDAI());
+ MCAuto<DataArrayIdType> arr2(arr1->selectByTupleIdSafe(_arr->begin(),_arr->end()));
+ return DataArrayPartDefinition::New(arr2);
+}
+
+void DataArrayPartDefinition::checkConsistencyLight() const
+{
+ CheckInternalArrayOK(_arr);
+}
+
+/*!
+ * This method tries to simplify \a this if possible.
+ *
+ * \return a new reference (equal to this) to be decrRefed.
+ */
+PartDefinition *DataArrayPartDefinition::tryToSimplify() const
+{
+ checkConsistencyLight();
+ mcIdType a(0),b(0),c(0);
+ if(_arr->isRange(a,b,c))
+ {
+ return SlicePartDefinition::New(a,b,c);
+ }
+ else
+ {
+ PartDefinition *ret(const_cast<DataArrayPartDefinition *>(this));
+ ret->incrRef();
+ return ret;
+ }
+}
+
+void DataArrayPartDefinition::serialize(std::vector<mcIdType>& tinyInt, std::vector< MCAuto<DataArrayIdType> >& bigArraysI) const
+{
+ bigArraysI.push_back(_arr);
+}
+
+DataArrayIdType *DataArrayPartDefinition::toDAI() const