1 #ifndef PhysicsTools_PatUtils_GenericDuplicateRemover_h 2 #define PhysicsTools_PatUtils_GenericDuplicateRemover_h 10 template <
typename Comparator,
typename Arbitrator>
24 template <
typename Collection>
25 std::unique_ptr<std::vector<size_t>>
duplicates(
const Collection &
items)
const;
34 template <
typename Comparator,
typename Arbitrator>
35 template <
typename Collection>
37 const Collection &
items)
const {
38 size_t size = items.size();
40 std::vector<bool> bad(size,
false);
42 for (
size_t ie = 0; ie <
size; ++ie) {
46 for (
size_t je = ie + 1; je <
size; ++je) {
51 int toRemove =
arbiter_(items[ie], items[je]) ? je : ie;
57 auto ret = std::make_unique<std::vector<size_t>>();
59 for (
size_t i = 0;
i <
size; ++
i) {
ret
prodAgent to be discontinued
GenericDuplicateRemover()
GenericDuplicateRemover(const Comparator &comp, const Arbitrator &arbiter)
std::unique_ptr< std::vector< size_t > > duplicates(const Collection &items) const
~GenericDuplicateRemover()
GenericDuplicateRemover(const Comparator &comp)