moving common code into function

This commit is contained in:
Dennis Luxen 2013-09-22 22:18:54 +02:00
parent b5b262c722
commit a9fdabf926

View File

@ -34,6 +34,10 @@ class ShortestPathRouting : public BasicRoutingInterface<DataFacadeT>{
typedef SearchEngineData::QueryHeap QueryHeap; typedef SearchEngineData::QueryHeap QueryHeap;
SearchEngineData & engine_working_data; SearchEngineData & engine_working_data;
int ComputeEdgeOffset(const PhantomNode & phantom) {
return phantom.weight1 + (phantom.isBidirected() ? phantom.weight2 : 0);
}
public: public:
ShortestPathRouting( ShortestPathRouting(
DataFacadeT * facade, DataFacadeT * facade,
@ -142,8 +146,12 @@ public:
); );
// INFO("rv2: " << phantom_node_pair.targetPhantom.edgeBasedNode+1 << ", w;" << phantom_node_pair.targetPhantom.weight2 ); // INFO("rv2: " << phantom_node_pair.targetPhantom.edgeBasedNode+1 << ", w;" << phantom_node_pair.targetPhantom.weight2 );
} }
const int forward_offset = phantom_node_pair.startPhantom.weight1 + (phantom_node_pair.startPhantom.isBidirected() ? phantom_node_pair.startPhantom.weight2 : 0); const int forward_offset = ComputeEdgeOffset(
const int reverse_offset = phantom_node_pair.targetPhantom.weight1 + (phantom_node_pair.targetPhantom.isBidirected() ? phantom_node_pair.targetPhantom.weight2 : 0); phantom_node_pair.startPhantom
);
const int reverse_offset = ComputeEdgeOffset(
phantom_node_pair.targetPhantom
);
//run two-Target Dijkstra routing step. //run two-Target Dijkstra routing step.
while(0 < (forward_heap1.Size() + reverse_heap1.Size() )){ while(0 < (forward_heap1.Size() + reverse_heap1.Size() )){