declareAsNew();
}
+void DataArrayDouble::aggregate(const DataArrayDouble *other)
+{
+ if(!other)
+ throw INTERP_KERNEL::Exception("DataArrayDouble::aggregate : null pointer !");
+ if(getNumberOfComponents()!=other->getNumberOfComponents())
+ throw INTERP_KERNEL::Exception("DataArrayDouble::aggregate : mismatch number of components !");
+ _mem.insertAtTheEnd(other->begin(),other->end());
+}
+
/*!
* Checks if 0.0 value is present in \a this array. If it is the case, an exception
* is thrown.
* This method assumes that \a this has one component and is allocated. This method scans all tuples in \a this and for all tuple equal to \a val
* put True to the corresponding entry in \a vec.
* \a vec is expected to be with the same size than the number of tuples of \a this.
+ *
+ * \sa DataArrayInt::switchOnTupleNotEqualTo.
*/
void DataArrayInt::switchOnTupleEqualTo(int val, std::vector<bool>& vec) const
{
vec[i]=true;
}
+/*!
+ * This method assumes that \a this has one component and is allocated. This method scans all tuples in \a this and for all tuple different from \a val
+ * put True to the corresponding entry in \a vec.
+ * \a vec is expected to be with the same size than the number of tuples of \a this.
+ *
+ * \sa DataArrayInt::switchOnTupleEqualTo.
+ */
+void DataArrayInt::switchOnTupleNotEqualTo(int val, std::vector<bool>& vec) const
+{
+ checkAllocated();
+ if(getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("DataArrayInt::switchOnTupleNotEqualTo : number of components of this should be equal to one !");
+ int nbOfTuples(getNumberOfTuples());
+ if(nbOfTuples!=(int)vec.size())
+ throw INTERP_KERNEL::Exception("DataArrayInt::switchOnTupleNotEqualTo : number of tuples of this should be equal to size of input vector of bool !");
+ const int *pt(begin());
+ for(int i=0;i<nbOfTuples;i++)
+ if(pt[i]!=val)
+ vec[i]=true;
+}
+
/*!
* Sorts values of the array.
* \param [in] asc - \a true means ascending order, \a false, descending.
declareAsNew();
}
+void DataArrayInt::aggregate(const DataArrayInt *other)
+{
+ if(!other)
+ throw INTERP_KERNEL::Exception("DataArrayInt::aggregate : null pointer !");
+ if(getNumberOfComponents()!=other->getNumberOfComponents())
+ throw INTERP_KERNEL::Exception("DataArrayInt::aggregate : mismatch number of components !");
+ _mem.insertAtTheEnd(other->begin(),other->end());
+}
+
/*!
* Returns a new DataArrayInt holding the same values as \a this array but differently
* arranged in memory. If \a this array holds 2 components of 3 values: