MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / makeGraph

Function makeGraph

unit_tests/partitioner/multi_level_graph.cpp:22–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20};
21
22auto makeGraph(const MultiLevelPartition &mlp, const std::vector<MockEdge> &mock_edges)
23{
24 struct EdgeData
25 {
26 bool forward;
27 bool backward;
28 };
29 using Edge = util::static_graph_details::SortableEdgeWithData<EdgeData>;
30 std::vector<Edge> edges;
31 std::size_t max_id = 0;
32 for (const auto &m : mock_edges)
33 {
34 max_id = std::max<std::size_t>(max_id, std::max(m.source, m.target));
35 edges.push_back(Edge{m.source, m.target, true, false});
36 edges.push_back(Edge{m.target, m.source, false, true});
37 }
38 std::sort(edges.begin(), edges.end());
39 return MultiLevelGraph<EdgeData, osrm::storage::Ownership::Container>(mlp, max_id + 1, edges);
40}
41} // namespace
42
43BOOST_AUTO_TEST_SUITE(multi_level_graph)

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.70

Calls 3

push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected