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

Function PathOverlappingLen

tools/openlr/helpers.cpp:215–222  ·  view source on GitHub ↗

Returns a length of the longest suffix of |a| that matches any prefix of |b|. Neither |a| nor |b| can contain several repetitions of any edge. Returns -1 if |a| intersection |b| is not equal to some suffix of |a| and some prefix of |b|.

Source from the content-addressed store, hash-verified

213// Neither |a| nor |b| can contain several repetitions of any edge.
214// Returns -1 if |a| intersection |b| is not equal to some suffix of |a| and some prefix of |b|.
215int32_t PathOverlappingLen(Graph::EdgeVector const & a, Graph::EdgeVector const & b)
216{
217 auto const len = IntersectionLen(a, b);
218 if (SuffixEqualsPrefix(a, b, len))
219 return base::checked_cast<int32_t>(len);
220
221 return -1;
222}
223
224m2::PointD PointAtSegmentM(m2::PointD const & p1, m2::PointD const & p2, double const distanceM)
225{

Calls 2

IntersectionLenFunction · 0.85
SuffixEqualsPrefixFunction · 0.85

Tested by

no test coverage detected