using Int64 = std::int64_t;
using Int32 = std::int32_t;
using mcIdType = std::int32_t;
+
+ inline mcIdType ToIdType(std::size_t val) { return mcIdType(val); }
}
#define DataArrayInt DataArrayInt32
* \throw If \a this->getNumberOfComponents() != 1.
* \sa DataArrayInt::findIdsEqualTuple
*/
-DataArrayInt *DataArrayInt::findIdsEqual(int val) const
+DataArrayIdType *DataArrayInt::findIdsEqual(int val) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqual : the array must have only one component, you can call 'rearrange' method before !");
const int *cptr(getConstPointer());
- MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayIdType> ret(DataArrayIdType::New()); ret->alloc(0,1);
std::size_t nbOfTuples(getNumberOfTuples());
for(std::size_t i=0;i<nbOfTuples;i++,cptr++)
if(*cptr==val)
- ret->pushBackSilent(i);
+ ret->pushBackSilent(ToIdType(i));
return ret.retn();
}
MEDCOUPLING_EXPORT bool hasUniqueValues() const;
MEDCOUPLING_EXPORT void setSelectedComponents(const DataArrayInt32 *a, const std::vector<int>& compoIds);
MEDCOUPLING_EXPORT DataArrayInt32Iterator *iterator();
- MEDCOUPLING_EXPORT DataArrayInt32 *findIdsEqual(int val) const;
+ MEDCOUPLING_EXPORT DataArrayIdType *findIdsEqual(int val) const;
MEDCOUPLING_EXPORT DataArrayInt32 *findIdsNotEqual(int val) const;
MEDCOUPLING_EXPORT DataArrayInt32 *findIdsEqualList(const int *valsBg, const int *valsEnd) const;
MEDCOUPLING_EXPORT DataArrayInt32 *findIdsNotEqualList(const int *valsBg, const int *valsEnd) const;