MCPcopy Create free account
hub / github.com/comaps/comaps / MakeResult

Method MakeResult

libs/routing/nearest_edge_finder.cpp:78–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void NearestEdgeFinder::MakeResult(vector<EdgeProjectionT> & res, size_t maxCountFeatures)
79{
80 sort(m_candidates.begin(), m_candidates.end(),
81 [](Candidate const & r1, Candidate const & r2) { return r1.m_squaredDist < r2.m_squaredDist; });
82
83 res.clear();
84 res.reserve(maxCountFeatures);
85
86 for (Candidate const & candidate : m_candidates)
87 {
88 CandidateToResult(candidate, maxCountFeatures, res);
89 if (res.size() >= maxCountFeatures)
90 return;
91 }
92}
93
94void NearestEdgeFinder::CandidateToResult(Candidate const & candidate, size_t maxCountFeatures,
95 vector<EdgeProjectionT> & res) const

Callers 3

FindClosestEdgesMethod · 0.45
RoadsToNearestEdgesMethod · 0.45
TestNearestOnMock1Function · 0.45

Calls 5

beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45

Tested by 1

TestNearestOnMock1Function · 0.36