diff --git a/src/Vector/vector_dist.hpp b/src/Vector/vector_dist.hpp index 35067a3a05095b6fff8f7f9ad03b5b9f889b3666..93a86437a9ee5d608f74d451822b438be7815886 100644 --- a/src/Vector/vector_dist.hpp +++ b/src/Vector/vector_dist.hpp @@ -2587,6 +2587,23 @@ public: this->template ghost_put_<op,prp...>(v_pos,v_prp,g_m,opt_); } + /*! \brief Remove a set of elements from the distributed vector + * + * \param keys std::set of elements to eliminate. + * Values inside std::set are sorted by definition of the container + * + */ + void remove(std::set<size_t> & keys) + { + openfpm::vector<size_t> v_keys; v_keys.reserve(keys.size()); + + for (auto it = keys.begin(); it != keys.end(); ++it) + v_keys.add(*it); + + // keys are sorted and unique + this->remove(v_keys, 0); + } + /*! \brief Remove a set of elements from the distributed vector * * \warning keys must be sorted