minor reformatting / shaping up

This commit is contained in:
Dennis Luxen 2014-04-25 16:00:39 +02:00
parent e0027a78e1
commit 9a153708e6

View File

@ -87,35 +87,33 @@ public:
} }
//Stalling //Stalling
for( for (EdgeID edge = facade->BeginEdges( node ); edge < facade->EndEdges(node); ++edge)
EdgeID edge = facade->BeginEdges( node ); {
edge < facade->EndEdges(node);
++edge
) {
const EdgeData & data = facade->GetEdgeData(edge); const EdgeData & data = facade->GetEdgeData(edge);
const bool reverse_flag = (!forward_direction) ? data.forward : data.backward; const bool reverse_flag = ((!forward_direction) ? data.forward : data.backward);
if( reverse_flag ) { if (reverse_flag)
{
const NodeID to = facade->GetTarget(edge); const NodeID to = facade->GetTarget(edge);
const int edge_weight = data.distance; const int edge_weight = data.distance;
BOOST_ASSERT_MSG(edge_weight > 0, "edge_weight invalid"); BOOST_ASSERT_MSG(edge_weight > 0, "edge_weight invalid");
if(forward_heap.WasInserted( to )) { if (forward_heap.WasInserted(to))
if(forward_heap.GetKey( to ) + edge_weight < distance) { {
if(forward_heap.GetKey( to ) + edge_weight < distance)
{
return; return;
} }
} }
} }
} }
for( for (EdgeID edge = facade->BeginEdges(node), end_edge = facade->EndEdges(node); edge < end_edge; ++edge)
EdgeID edge = facade->BeginEdges(node), end_edge = facade->EndEdges(node); {
edge < end_edge;
++edge
) {
const EdgeData & data = facade->GetEdgeData(edge); const EdgeData & data = facade->GetEdgeData(edge);
bool forward_directionFlag = (forward_direction ? data.forward : data.backward); bool forward_directionFlag = (forward_direction ? data.forward : data.backward);
if( forward_directionFlag ) { if (forward_directionFlag)
{
const NodeID to = facade->GetTarget(edge); const NodeID to = facade->GetTarget(edge);
const int edge_weight = data.distance; const int edge_weight = data.distance;
@ -137,13 +135,8 @@ public:
} }
} }
inline void UnpackPath(const std::vector<NodeID> & packed_path, const PhantomNodes & phantom_node_pair, std::vector<PathData> & unpacked_path) const
//TODO: refactor parameters to only edge ids for start and end {
inline void UnpackPath(
const std::vector<NodeID> & packed_path,
const PhantomNodes & phantom_node_pair,
std::vector<PathData> & unpacked_path
) const {
const bool start_traversed_in_reverse = (packed_path.front() != phantom_node_pair.source_phantom.forward_node_id); const bool start_traversed_in_reverse = (packed_path.front() != phantom_node_pair.source_phantom.forward_node_id);
const bool target_traversed_in_reverse = (packed_path.back() != phantom_node_pair.target_phantom.forward_node_id); const bool target_traversed_in_reverse = (packed_path.back() != phantom_node_pair.target_phantom.forward_node_id);