return ret;
}
+/*!
+ * Contrary to DataArrayDouble::changeNbOfComponents method this method is \b not const. The content
+ * This method \b do \b not change the content of data but changes the splitting of this data seen by the caller.
+ * This method makes the assumption that 'this' is already allocated. If not an exception will be thrown.
+ * This method checks that getNbOfElems()%newNbOfCompo==0. If not an exception will be throw !
+ * This method erases all components info set before call !
+ */
+void DataArrayDouble::morphToNewNbOfComponents(int newNbOfCompo) throw(INTERP_KERNEL::Exception)
+{
+ checkAllocated();
+ int nbOfElems=getNbOfElems();
+ if(nbOfElems%newNbOfCompo!=0)
+ throw INTERP_KERNEL::Exception("DataArrayDouble::morphToNewNbOfComponents : nbOfElems%newNbOfCompo!=0 !");
+ _info_on_compo.clear();
+ _info_on_compo.resize(newNbOfCompo);
+ declareAsNew();
+}
+
DataArrayDouble *DataArrayDouble::keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception)
{
checkAllocated();
return ret;
}
+/*!
+ * Contrary to DataArrayInt::changeNbOfComponents method this method is \b not const. The content
+ * This method \b do \b not change the content of data but changes the splitting of this data seen by the caller.
+ * This method makes the assumption that 'this' is already allocated. If not an exception will be thrown.
+ * This method checks that getNbOfElems()%newNbOfCompo==0. If not an exception will be throw !
+ * This method erases all components info set before call !
+ */
+void DataArrayInt::morphToNewNbOfComponents(int newNbOfCompo) throw(INTERP_KERNEL::Exception)
+{
+ checkAllocated();
+ int nbOfElems=getNbOfElems();
+ if(nbOfElems%newNbOfCompo!=0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::morphToNewNbOfComponents : nbOfElems%newNbOfCompo!=0 !");
+ _info_on_compo.clear();
+ _info_on_compo.resize(newNbOfCompo);
+ declareAsNew();
+}
+
/*!
* This method builds a new instance of DataArrayInt (to deal with) that is reduction or an extension of 'this'.
* if 'newNbOfComp' < this->getNumberOfComponents() a reduction is done and for each tuple 'newNbOfComp' first components are kept.
MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const;
MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
+ MEDCOUPLING_EXPORT void morphToNewNbOfComponents(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayDouble *keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT bool isIdentity() const;
MEDCOUPLING_EXPORT bool isUniform(int val) const;
MEDCOUPLING_EXPORT DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
+ MEDCOUPLING_EXPORT void morphToNewNbOfComponents(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayInt *keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);