@@ -487,7 +487,13 @@ void routingStep(const DataFacade<Algorithm> &facade,
487
487
488
488
using UnpackedNodes = std::vector<NodeID>;
489
489
using UnpackedEdges = std::vector<EdgeID>;
490
- using UnpackedPath = std::tuple<EdgeWeight, UnpackedNodes, UnpackedEdges>;
490
+
491
+ struct UnpackedPath
492
+ {
493
+ EdgeWeight weight;
494
+ UnpackedNodes nodes;
495
+ UnpackedEdges edges;
496
+ };
491
497
492
498
template <typename Algorithm, typename Heap, typename ... Args>
493
499
std::optional<std::pair<NodeID, EdgeWeight>> runSearch (const DataFacade<Algorithm> &facade,
@@ -551,7 +557,7 @@ UnpackedPath search(SearchEngineData<Algorithm> &engine_working_data,
551
557
facade, forward_heap, reverse_heap, force_step_nodes, weight_upper_bound, args...);
552
558
if (!searchResult)
553
559
{
554
- return std::make_tuple ( INVALID_EDGE_WEIGHT, std::vector<NodeID>(), std::vector<EdgeID>()) ;
560
+ return { INVALID_EDGE_WEIGHT, std::vector<NodeID>(), std::vector<EdgeID>()} ;
555
561
}
556
562
557
563
auto [middle, weight] = *searchResult;
@@ -595,25 +601,27 @@ UnpackedPath search(SearchEngineData<Algorithm> &engine_working_data,
595
601
forward_heap.Insert (source, {0 }, {source});
596
602
reverse_heap.Insert (target, {0 }, {target});
597
603
598
- auto [subpath_weight, subpath_nodes, subpath_edges] = search (engine_working_data,
599
- facade,
600
- forward_heap,
601
- reverse_heap,
602
- force_step_nodes,
603
- INVALID_EDGE_WEIGHT,
604
- sublevel,
605
- parent_cell_id);
606
- BOOST_ASSERT (!subpath_edges.empty ());
607
- BOOST_ASSERT (subpath_nodes.size () > 1 );
608
- BOOST_ASSERT (subpath_nodes.front () == source);
609
- BOOST_ASSERT (subpath_nodes.back () == target);
610
- unpacked_nodes.insert (
611
- unpacked_nodes.end (), std::next (subpath_nodes.begin ()), subpath_nodes.end ());
612
- unpacked_edges.insert (unpacked_edges.end (), subpath_edges.begin (), subpath_edges.end ());
604
+ auto unpacked_subpath = search (engine_working_data,
605
+ facade,
606
+ forward_heap,
607
+ reverse_heap,
608
+ force_step_nodes,
609
+ INVALID_EDGE_WEIGHT,
610
+ sublevel,
611
+ parent_cell_id);
612
+ BOOST_ASSERT (!unpacked_subpath.edges .empty ());
613
+ BOOST_ASSERT (unpacked_subpath.nodes .size () > 1 );
614
+ BOOST_ASSERT (unpacked_subpath.nodes .front () == source);
615
+ BOOST_ASSERT (unpacked_subpath.nodes .back () == target);
616
+ unpacked_nodes.insert (unpacked_nodes.end (),
617
+ std::next (unpacked_subpath.nodes .begin ()),
618
+ unpacked_subpath.nodes .end ());
619
+ unpacked_edges.insert (
620
+ unpacked_edges.end (), unpacked_subpath.edges .begin (), unpacked_subpath.edges .end ());
613
621
}
614
622
}
615
623
616
- return std::make_tuple ( weight, std::move (unpacked_nodes), std::move (unpacked_edges)) ;
624
+ return { weight, std::move (unpacked_nodes), std::move (unpacked_edges)} ;
617
625
}
618
626
619
627
template <typename Algorithm, typename ... Args>
@@ -654,13 +662,15 @@ inline void search(SearchEngineData<Algorithm> &engine_working_data,
654
662
const EdgeWeight weight_upper_bound = INVALID_EDGE_WEIGHT)
655
663
{
656
664
// TODO: change search calling interface to use unpacked_edges result
657
- std::tie (weight, unpacked_nodes, std::ignore) = search (engine_working_data,
658
- facade,
659
- forward_heap,
660
- reverse_heap,
661
- force_step_nodes,
662
- weight_upper_bound,
663
- endpoints);
665
+ auto unpacked_path = search (engine_working_data,
666
+ facade,
667
+ forward_heap,
668
+ reverse_heap,
669
+ force_step_nodes,
670
+ weight_upper_bound,
671
+ endpoints);
672
+ weight = unpacked_path.weight ;
673
+ unpacked_nodes = std::move (unpacked_path.nodes );
664
674
}
665
675
666
676
// TODO: refactor CH-related stub to use unpacked_edges
0 commit comments