1 #ifndef PhysicsTools_PatUtils_GenericDuplicateRemover_h
2 #define PhysicsTools_PatUtils_GenericDuplicateRemover_h
10 template <
typename Comparator,
typename Arbitrator>
26 template <
typename Collection>
27 std::auto_ptr< std::vector<size_t> >
37 template<
typename Comparator,
typename Arbitrator>
38 template<
typename Collection>
39 std::auto_ptr< std::vector<size_t> >
42 size_t size = items.size();
44 std::vector<bool>
bad(size,
false);
46 for (
size_t ie = 0; ie <
size; ++ie) {
47 if (bad[ie])
continue;
49 for (
size_t je = ie+1; je <
size; ++je) {
51 if (bad[je])
continue;
53 if ( comparator_(items[ie], items[je]) ) {
54 int toRemove = arbiter_(items[ie], items[je]) ? je : ie;
60 std::auto_ptr< std::vector<size_t> >
ret(
new std::vector<size_t>());
62 for (
size_t i = 0;
i <
size; ++
i) {
63 if (bad[
i]) ret->push_back(i);
std::auto_ptr< std::vector< size_t > > duplicates(const Collection &items) const
GenericDuplicateRemover()
int bad(Items const &cont)
GenericDuplicateRemover(const Comparator &comp, const Arbitrator &arbiter)
~GenericDuplicateRemover()
GenericDuplicateRemover(const Comparator &comp)
tuple size
Write out results.