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

Function GetAreaIndex

generator/statistics.cpp:36–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34static constexpr double kAreas[] = {10, 20, 50, 100, 200, 500, 1000, 5000, 360 * 360 * 12400};
35
36size_t GetAreaIndex(double s)
37{
38 double const sInKm2 = s / 1000000;
39 auto const i = std::lower_bound(std::begin(kAreas), std::end(kAreas), sInKm2);
40 ASSERT(i != std::end(kAreas), ());
41 return std::distance(kAreas, i);
42}
43
44class AccumulateStatistic
45{

Callers 1

operator()Method · 0.85

Calls 4

ASSERTFunction · 0.85
distanceFunction · 0.85
beginFunction · 0.50
endFunction · 0.50

Tested by

no test coverage detected