9#include <tracking/trackFindingCDC/collectors/selectors/BestMatchSelector.h>
11#include <tracking/trackFindingCDC/numerics/WeightComperator.h>
13#include <gtest/gtest.h>
16using namespace TrackFindingCDC;
20 TEST(TrackFindingCDCTest, best_match_selector)
25 double c = 3, d = 4, e = 5;
27 std::vector<WeightedRelation<int, const double>> relations = {
34 std::sort(relations.begin(), relations.end());
35 selector.apply(relations);
37 std::sort(relations.begin(), relations.end(),
GreaterWeight());
39 ASSERT_EQ(relations.size(), 2);
40 ASSERT_EQ(relations[0].getWeight(), 1.1);
41 ASSERT_EQ(relations[0].getFrom(), &a);
42 ASSERT_EQ(relations[0].getTo(), &c);
43 ASSERT_EQ(relations[1].getWeight(), 0.6);
44 ASSERT_EQ(relations[1].getFrom(), &b);
45 ASSERT_EQ(relations[1].getTo(), &e);
Selector to remove all relations in the list, which share the same collection item - except the one w...
Type for two related objects with a weight.
Abstract base class for different kinds of events.
Functor factory turning a binary functor and two functors into a new functor which executes the binar...