rename start->source

This commit is contained in:
Dennis Luxen 2014-05-28 18:19:27 +02:00
parent cc864191b8
commit 2f203ac22c
2 changed files with 15 additions and 15 deletions

View File

@ -374,8 +374,8 @@ class Contractor
// walk over all nodes
for (unsigned i = 0; i < contractor_graph->GetNumberOfNodes(); ++i)
{
const NodeID start = i;
for (auto current_edge : contractor_graph->GetAdjacentEdgeRange(start))
const NodeID source = i;
for (auto current_edge : contractor_graph->GetAdjacentEdgeRange(source))
{
ContractorGraph::EdgeData &data =
contractor_graph->GetEdgeData(current_edge);
@ -384,7 +384,7 @@ class Contractor
{
// Save edges of this node w/o renumbering.
temporary_storage.WriteToSlot(
edge_storage_slot, (char *)&start, sizeof(NodeID));
edge_storage_slot, (char *)&source, sizeof(NodeID));
temporary_storage.WriteToSlot(
edge_storage_slot, (char *)&target, sizeof(NodeID));
temporary_storage.WriteToSlot(edge_storage_slot,
@ -397,12 +397,12 @@ class Contractor
// node is not yet contracted.
// add (renumbered) outgoing edges to new DynamicGraph.
ContractorEdge new_edge;
new_edge.source = new_node_id_from_orig_id_map[start];
new_edge.source = new_node_id_from_orig_id_map[source];
new_edge.target = new_node_id_from_orig_id_map[target];
new_edge.data = data;
new_edge.data.is_original_via_node_ID = true;
BOOST_ASSERT_MSG(UINT_MAX != new_node_id_from_orig_id_map[start],
"new start id not resolveable");
BOOST_ASSERT_MSG(UINT_MAX != new_node_id_from_orig_id_map[source],
"new source id not resolveable");
BOOST_ASSERT_MSG(UINT_MAX != new_node_id_from_orig_id_map[target],
"new target id not resolveable");
new_edge_set.push_back(new_edge);
@ -612,18 +612,18 @@ class Contractor
BOOST_ASSERT(0 == orig_node_id_to_new_id_map.capacity());
TemporaryStorage &temporary_storage = TemporaryStorage::GetInstance();
// loads edges of graph before renumbering, no need for further numbering action.
NodeID start;
NodeID source;
NodeID target;
ContractorGraph::EdgeData data;
Edge restored_edge;
for (unsigned i = 0; i < temp_edge_counter; ++i)
{
temporary_storage.ReadFromSlot(edge_storage_slot, (char *)&start, sizeof(NodeID));
temporary_storage.ReadFromSlot(edge_storage_slot, (char *)&source, sizeof(NodeID));
temporary_storage.ReadFromSlot(edge_storage_slot, (char *)&target, sizeof(NodeID));
temporary_storage.ReadFromSlot(
edge_storage_slot, (char *)&data, sizeof(ContractorGraph::EdgeData));
restored_edge.source = start;
restored_edge.source = source;
restored_edge.target = target;
restored_edge.data.distance = data.distance;
restored_edge.data.shortcut = data.shortcut;

View File

@ -155,7 +155,7 @@ EdgeBasedGraphFactory::InsertEdgeBasedNode(NodeID u, NodeID v, EdgeID e1, bool b
const unsigned geometry_size = forward_geometry.size();
BOOST_ASSERT(geometry_size > 1);
NodeID current_edge_start_coordinate_id = u;
NodeID current_edge_source_coordinate_id = u;
if (forward_data.edgeBasedNodeID != SPECIAL_NODEID)
{
@ -169,15 +169,15 @@ EdgeBasedGraphFactory::InsertEdgeBasedNode(NodeID u, NodeID v, EdgeID e1, bool b
// traverse arrays from start and end respectively
for (unsigned i = 0; i < geometry_size; ++i)
{
BOOST_ASSERT(current_edge_start_coordinate_id ==
BOOST_ASSERT(current_edge_source_coordinate_id ==
reverse_geometry[geometry_size - 1 - i].first);
const NodeID current_edge_target_coordinate_id = forward_geometry[i].first;
BOOST_ASSERT(current_edge_target_coordinate_id != current_edge_start_coordinate_id);
BOOST_ASSERT(current_edge_target_coordinate_id != current_edge_source_coordinate_id);
// build edges
m_edge_based_node_list.emplace_back(forward_data.edgeBasedNodeID,
reverse_data.edgeBasedNodeID,
current_edge_start_coordinate_id,
current_edge_source_coordinate_id,
current_edge_target_coordinate_id,
forward_data.nameID,
forward_geometry[i].second,
@ -187,7 +187,7 @@ EdgeBasedGraphFactory::InsertEdgeBasedNode(NodeID u, NodeID v, EdgeID e1, bool b
m_geometry_compressor.GetPositionForID(e1),
i,
belongs_to_tiny_cc);
current_edge_start_coordinate_id = current_edge_target_coordinate_id;
current_edge_source_coordinate_id = current_edge_target_coordinate_id;
BOOST_ASSERT(m_edge_based_node_list.back().IsCompressed());
@ -198,7 +198,7 @@ EdgeBasedGraphFactory::InsertEdgeBasedNode(NodeID u, NodeID v, EdgeID e1, bool b
v != m_edge_based_node_list.back().u);
}
BOOST_ASSERT(current_edge_start_coordinate_id == v);
BOOST_ASSERT(current_edge_source_coordinate_id == v);
BOOST_ASSERT(m_edge_based_node_list.back().IsCompressed());
}
else