17 static void removeTrack(GreedyAmbiguityResolution::State&
state,
19 for (
auto iMeasurement : state.measurementsPerTrack[iTrack]) {
20 state.tracksPerMeasurement[iMeasurement].erase(iTrack);
22 if (state.tracksPerMeasurement[iMeasurement].size() == 1) {
23 auto jTrack = *state.tracksPerMeasurement[iMeasurement].begin();
24 --state.sharedMeasurementsPerTrack[jTrack];
28 state.selectedTracks.erase(iTrack);
36 auto sharedMeasurementsComperator = [&
state](std::size_t
a, std::size_t
b) {
44 auto trackComperator = [&
state](std::size_t
a, std::size_t
b) {
46 auto relativeSharedMeasurements = [&
state](std::size_t
i) {
51 if (relativeSharedMeasurements(a) != relativeSharedMeasurements(
b)) {
52 return relativeSharedMeasurements(a) < relativeSharedMeasurements(
b);
66 auto maximumSharedMeasurements = *std::max_element(
68 sharedMeasurementsComperator);
70 "maximum shared measurements "
82 << badTrack <<
" nMeas "
86 removeTrack(state, badTrack);