update util lib

This commit is contained in:
Patrick Brosi 2022-03-28 14:59:55 +02:00
parent a58ed3d54d
commit 361063185e
19 changed files with 440 additions and 1794 deletions

View file

@ -47,7 +47,30 @@ C EDijkstra::shortestPathImpl(Edge<N, E>* from, const std::set<Node<N, E>*>& to,
// _____________________________________________________________________________
template <typename N, typename E, typename C>
C EDijkstra::shortestPathImpl(const std::set<Edge<N, E>*> from,
C EDijkstra::shortestPathImpl(const std::set<Node<N, E>*>& from,
const std::set<Node<N, E>*>& to,
const util::graph::CostFunc<N, E, C>& costFunc,
const util::graph::HeurFunc<N, E, C>& heurFunc,
EList<N, E>* resEdges, NList<N, E>* resNodes) {
std::set<Edge<N, E>*> frEs;
std::set<Edge<N, E>*> toEs;
for (auto n : from) {
frEs.insert(n->getAdjListIn().begin(), n->getAdjListIn().end());
}
for (auto n : to) {
toEs.insert(n->getAdjListIn().begin(), n->getAdjListIn().end());
}
C cost = shortestPathImpl(frEs, toEs, costFunc, heurFunc, resEdges, resNodes);
return cost;
}
// _____________________________________________________________________________
template <typename N, typename E, typename C>
C EDijkstra::shortestPathImpl(const std::set<Edge<N, E>*>& from,
const std::set<Edge<N, E>*>& to,
const util::graph::CostFunc<N, E, C>& costFunc,
const util::graph::HeurFunc<N, E, C>& heurFunc,