2017-01-13 02:32:17 -05:00
|
|
|
#ifndef OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP
|
|
|
|
#define OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP
|
2016-01-07 13:19:55 -05:00
|
|
|
|
2017-01-13 02:32:17 -05:00
|
|
|
#include "contractor/contractor_graph.hpp"
|
2016-01-07 13:19:55 -05:00
|
|
|
|
2017-08-20 19:24:05 -04:00
|
|
|
#include "util/filtered_graph.hpp"
|
|
|
|
|
2017-08-19 18:01:35 -04:00
|
|
|
#include <tuple>
|
2016-01-07 13:19:55 -05:00
|
|
|
#include <vector>
|
|
|
|
|
2022-12-11 04:10:26 -05:00
|
|
|
namespace osrm::contractor
|
2016-01-07 13:19:55 -05:00
|
|
|
{
|
|
|
|
|
2017-08-20 19:24:05 -04:00
|
|
|
std::vector<bool> contractGraph(ContractorGraph &graph,
|
|
|
|
std::vector<bool> node_is_uncontracted,
|
|
|
|
std::vector<bool> node_is_contractable,
|
|
|
|
std::vector<EdgeWeight> node_weights,
|
|
|
|
double core_factor = 1.0);
|
2017-08-19 07:01:32 -04:00
|
|
|
|
2017-08-20 19:24:05 -04:00
|
|
|
// Overload for contracting all nodes
|
|
|
|
inline auto contractGraph(ContractorGraph &graph,
|
|
|
|
std::vector<EdgeWeight> node_weights,
|
|
|
|
double core_factor = 1.0)
|
2017-08-19 18:01:35 -04:00
|
|
|
{
|
2017-08-20 19:24:05 -04:00
|
|
|
return contractGraph(graph, {}, {}, std::move(node_weights), core_factor);
|
2017-08-19 18:01:35 -04:00
|
|
|
}
|
2016-01-07 13:19:55 -05:00
|
|
|
|
2017-08-20 19:24:05 -04:00
|
|
|
// Overload no contracted nodes
|
|
|
|
inline auto contractGraph(ContractorGraph &graph,
|
|
|
|
std::vector<bool> node_is_contractable,
|
|
|
|
std::vector<EdgeWeight> node_weights,
|
|
|
|
double core_factor = 1.0)
|
|
|
|
{
|
|
|
|
return contractGraph(
|
|
|
|
graph, {}, std::move(node_is_contractable), std::move(node_weights), core_factor);
|
|
|
|
}
|
2016-01-07 13:19:55 -05:00
|
|
|
|
2017-01-13 02:32:17 -05:00
|
|
|
} // namespace osrm
|
|
|
|
|
|
|
|
#endif // OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP
|