+ */
+void DataArrayInt::applyInv(int numerator)
+{
+ checkAllocated();
+ int *ptr=getPointer();
+ std::size_t nbOfElems=getNbOfElems();
+ for(std::size_t i=0;i<nbOfElems;i++,ptr++)
+ {
+ if(*ptr!=0)
+ {
+ *ptr=numerator/(*ptr);
+ }
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::applyInv : presence of null value in tuple #" << i/getNumberOfComponents() << " component #" << i%getNumberOfComponents();
+ oss << " !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
+ declareAsNew();
+}
+
+/*!
+ * Modify all elements of \a this array, so that
+ * an element _x_ becomes \f$ x / val \f$.
+ * \param [in] val - the denominator used to modify array elements.
+ * \throw If \a this is not allocated.
+ * \throw If \a val == 0.
+ */
+void DataArrayInt::applyDivideBy(int val)
+{
+ if(val==0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::applyDivideBy : Trying to divide by 0 !");
+ checkAllocated();
+ int *ptr=getPointer();
+ std::size_t nbOfElems=getNbOfElems();
+ std::transform(ptr,ptr+nbOfElems,ptr,std::bind2nd(std::divides<int>(),val));
+ declareAsNew();
+}
+
+/*!
+ * Modify all elements of \a this array, so that
+ * an element _x_ becomes <em> x % val </em>.
+ * \param [in] val - the divisor used to modify array elements.
+ * \throw If \a this is not allocated.
+ * \throw If \a val <= 0.
+ */
+void DataArrayInt::applyModulus(int val)
+{
+ if(val<=0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::applyDivideBy : Trying to operate modulus on value <= 0 !");
+ checkAllocated();
+ int *ptr=getPointer();
+ std::size_t nbOfElems=getNbOfElems();
+ std::transform(ptr,ptr+nbOfElems,ptr,std::bind2nd(std::modulus<int>(),val));
+ declareAsNew();
+}
+
+/*!
+ * This method works only on data array with one component.
+ * This method returns a newly allocated array storing stored ascendantly tuple ids in \b this so that
+ * this[*id] in [\b vmin,\b vmax)
+ *
+ * \param [in] vmin begin of range. This value is included in range (included).
+ * \param [in] vmax end of range. This value is \b not included in range (excluded).
+ * \return a newly allocated data array that the caller should deal with.
+ *
+ * \sa DataArrayInt::getIdsNotInRange , DataArrayInt::getIdsStrictlyNegative
+ */
+DataArrayInt *DataArrayInt::getIdsInRange(int vmin, int vmax) const
+{
+ checkAllocated();
+ if(getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("DataArrayInt::getIdsInRange : this must have exactly one component !");
+ const int *cptr(begin());
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ int nbOfTuples(getNumberOfTuples());
+ for(int i=0;i<nbOfTuples;i++,cptr++)
+ if(*cptr>=vmin && *cptr<vmax)
+ ret->pushBackSilent(i);
+ return ret.retn();
+}
+
+/*!
+ * This method works only on data array with one component.
+ * This method returns a newly allocated array storing stored ascendantly tuple ids in \b this so that
+ * this[*id] \b not in [\b vmin,\b vmax)
+ *
+ * \param [in] vmin begin of range. This value is \b not included in range (excluded).
+ * \param [in] vmax end of range. This value is included in range (included).
+ * \return a newly allocated data array that the caller should deal with.
+ *
+ * \sa DataArrayInt::getIdsInRange , DataArrayInt::getIdsStrictlyNegative
+ */
+DataArrayInt *DataArrayInt::getIdsNotInRange(int vmin, int vmax) const
+{
+ checkAllocated();
+ if(getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotInRange : this must have exactly one component !");
+ const int *cptr(getConstPointer());
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ int nbOfTuples(getNumberOfTuples());
+ for(int i=0;i<nbOfTuples;i++,cptr++)
+ if(*cptr<vmin || *cptr>=vmax)
+ ret->pushBackSilent(i);
+ return ret.retn();
+}
+
+/*!
+ * This method works only on data array with one component. This method returns a newly allocated array storing stored ascendantly of tuple ids in \a this so that this[id]<0.
+ *
+ * \return a newly allocated data array that the caller should deal with.
+ * \sa DataArrayInt::getIdsInRange
+ */
+DataArrayInt *DataArrayInt::getIdsStrictlyNegative() const
+{
+ checkAllocated();
+ if(getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("DataArrayInt::getIdsStrictlyNegative : this must have exactly one component !");
+ const int *cptr(getConstPointer());
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ int nbOfTuples(getNumberOfTuples());
+ for(int i=0;i<nbOfTuples;i++,cptr++)
+ if(*cptr<0)
+ ret->pushBackSilent(i);
+ return ret.retn();
+}
+
+/*!
+ * This method works only on data array with one component.
+ * This method checks that all ids in \b this are in [ \b vmin, \b vmax ). If there is at least one element in \a this not in [ \b vmin, \b vmax ) an exception will be thrown.
+ *
+ * \param [in] vmin begin of range. This value is included in range (included).
+ * \param [in] vmax end of range. This value is \b not included in range (excluded).
+ * \return if all ids in \a this are so that (*this)[i]==i for all i in [ 0, \c this->getNumberOfTuples() ). */
+bool DataArrayInt::checkAllIdsInRange(int vmin, int vmax) const
+{
+ checkAllocated();
+ if(getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("DataArrayInt::checkAllIdsInRange : this must have exactly one component !");
+ int nbOfTuples=getNumberOfTuples();
+ bool ret=true;
+ const int *cptr=getConstPointer();
+ for(int i=0;i<nbOfTuples;i++,cptr++)
+ {
+ if(*cptr>=vmin && *cptr<vmax)
+ { ret=ret && *cptr==i; }
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::checkAllIdsInRange : tuple #" << i << " has value " << *cptr << " should be in [" << vmin << "," << vmax << ") !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
+ return ret;
+}
+
+/*!
+ * Modify all elements of \a this array, so that
+ * an element _x_ becomes <em> val % x </em>.
+ * \warning If an exception is thrown because of presence of an element <= 0 in \a this