Remove dummy edges before inplace permutation
This commit is contained in:
parent
0a1d1901cc
commit
b2aeb47630
@ -413,6 +413,11 @@ template <typename EdgeDataT> class DynamicGraph
|
|||||||
util::inplacePermutation(node_array.begin(), node_array.end(), old_to_new_node);
|
util::inplacePermutation(node_array.begin(), node_array.end(), old_to_new_node);
|
||||||
|
|
||||||
// Build up edge permutation
|
// Build up edge permutation
|
||||||
|
if (edge_list.size() >= std::numeric_limits<EdgeID>::max())
|
||||||
|
{
|
||||||
|
throw util::exception("There are too many edges, OSRM only supports 2^32" + SOURCE_REF);
|
||||||
|
}
|
||||||
|
|
||||||
EdgeID new_edge_index = 0;
|
EdgeID new_edge_index = 0;
|
||||||
std::vector<EdgeID> old_to_new_edge(edge_list.size(), SPECIAL_EDGEID);
|
std::vector<EdgeID> old_to_new_edge(edge_list.size(), SPECIAL_EDGEID);
|
||||||
for (auto node : util::irange<NodeID>(0, number_of_nodes))
|
for (auto node : util::irange<NodeID>(0, number_of_nodes))
|
||||||
@ -421,11 +426,6 @@ template <typename EdgeDataT> class DynamicGraph
|
|||||||
// move all filled edges
|
// move all filled edges
|
||||||
for (auto edge : GetAdjacentEdgeRange(node))
|
for (auto edge : GetAdjacentEdgeRange(node))
|
||||||
{
|
{
|
||||||
if (new_edge_index == std::numeric_limits<EdgeID>::max())
|
|
||||||
{
|
|
||||||
throw util::exception("There are too many edges, OSRM only supports 2^32" +
|
|
||||||
SOURCE_REF);
|
|
||||||
}
|
|
||||||
edge_list[edge].target = old_to_new_node[edge_list[edge].target];
|
edge_list[edge].target = old_to_new_node[edge_list[edge].target];
|
||||||
BOOST_ASSERT(edge_list[edge].target != SPECIAL_NODEID);
|
BOOST_ASSERT(edge_list[edge].target != SPECIAL_NODEID);
|
||||||
old_to_new_edge[edge] = new_edge_index++;
|
old_to_new_edge[edge] = new_edge_index++;
|
||||||
|
Loading…
Reference in New Issue
Block a user