diff --git a/include/engine/algorithm.hpp b/include/engine/algorithm.hpp index 0a710fa5b..aa1083576 100644 --- a/include/engine/algorithm.hpp +++ b/include/engine/algorithm.hpp @@ -19,9 +19,9 @@ struct CoreCH final { }; -template const char* name(); -template<> inline const char* name() { return "CH"; } -template<> inline const char* name() { return "CoreCH"; } +template const char *name(); +template <> inline const char *name() { return "CH"; } +template <> inline const char *name() { return "CoreCH"; } } namespace algorithm_trais diff --git a/include/engine/engine.hpp b/include/engine/engine.hpp index 81f650043..0d10dc8c4 100644 --- a/include/engine/engine.hpp +++ b/include/engine/engine.hpp @@ -63,12 +63,14 @@ template class Engine final : public EngineInterface { if (config.use_shared_memory) { - util::Log(logDEBUG) << "Using shared memory with algorithm " << algorithm::name(); + util::Log(logDEBUG) << "Using shared memory with algorithm " + << algorithm::name(); facade_provider = std::make_unique>(); } else { - util::Log(logDEBUG) << "Using internal memory with algorithm " << algorithm::name(); + util::Log(logDEBUG) << "Using internal memory with algorithm " + << algorithm::name(); facade_provider = std::make_unique>(config.storage_config); } @@ -157,7 +159,8 @@ template <> bool Engine::CheckCompability(const EngineConfig &con else { std::ifstream in(config.storage_config.hsgr_data_path.string().c_str()); - if (!in) return false; + if (!in) + return false; in.seekg(0, std::ios::end); auto size = in.tellg(); @@ -185,7 +188,8 @@ template <> bool Engine::CheckCompability(const EngineConfig else { std::ifstream in(config.storage_config.core_data_path.string().c_str()); - if (!in) return false; + if (!in) + return false; in.seekg(0, std::ios::end); std::size_t size = in.tellg(); diff --git a/include/engine/engine_config.hpp b/include/engine/engine_config.hpp index d231977c9..31de15514 100644 --- a/include/engine/engine_config.hpp +++ b/include/engine/engine_config.hpp @@ -57,7 +57,8 @@ namespace engine * * You can chose between three algorithms: * - Algorithm::CH - * Contraction Hierarchies, extremely fast queries but slow pre-processing. The default right now. + * Contraction Hierarchies, extremely fast queries but slow pre-processing. The default right + * now. * - Algorithm::CoreCH * Contractoin Hierachies with partial contraction for faster pre-processing but slower queries. * @@ -72,8 +73,8 @@ struct EngineConfig final enum class Algorithm { - CH, // will upgrade to CoreCH if it finds core data - CoreCH // will fail hard if there is no core data + CH, // will upgrade to CoreCH if it finds core data + CoreCH // will fail hard if there is no core data }; storage::StorageConfig storage_config; diff --git a/include/engine/routing_algorithms/map_matching.hpp b/include/engine/routing_algorithms/map_matching.hpp index 275e6ddcf..00e763e57 100644 --- a/include/engine/routing_algorithms/map_matching.hpp +++ b/include/engine/routing_algorithms/map_matching.hpp @@ -15,7 +15,6 @@ namespace engine namespace routing_algorithms { - using CandidateList = std::vector; using CandidateLists = std::vector; using SubMatchingList = std::vector; diff --git a/src/engine/plugins/tile.cpp b/src/engine/plugins/tile.cpp index e467826d3..0894d1937 100644 --- a/src/engine/plugins/tile.cpp +++ b/src/engine/plugins/tile.cpp @@ -259,7 +259,8 @@ std::vector getEdgeIndex(const std::vector &edges) // GetEdgesInBox is marked `const`, so we can't sort the array itself, // instead we create an array of indexes and sort that instead. std::vector sorted_edge_indexes(edges.size(), 0); - std::iota(sorted_edge_indexes.begin(), sorted_edge_indexes.end(), 0); // fill with 0,1,2,3,...N-1 + std::iota( + sorted_edge_indexes.begin(), sorted_edge_indexes.end(), 0); // fill with 0,1,2,3,...N-1 // Now, sort that array based on the edges list, using the u/v node IDs // as the sort condition @@ -653,17 +654,19 @@ void encodeVectorTile(const datafacade::ContiguousInternalMemoryDataFacadeBase & { // we need to pre-encode all values here because we need the full offsets later // for encoding the actual features. - std::vector> encoded_turn_data(all_turn_data.size()); - std::transform(all_turn_data.begin(), - all_turn_data.end(), - encoded_turn_data.begin(), - [&](const routing_algorithms::TurnData &t) { - auto angle_idx = use_point_int_value(t.in_angle); - auto turn_idx = use_point_int_value(t.turn_angle); - auto weight_idx = use_point_float_value(t.weight / - 10.0); // Note conversion to float here - return std::make_tuple(t.coordinate, angle_idx, turn_idx, weight_idx); - }); + std::vector> + encoded_turn_data(all_turn_data.size()); + std::transform( + all_turn_data.begin(), + all_turn_data.end(), + encoded_turn_data.begin(), + [&](const routing_algorithms::TurnData &t) { + auto angle_idx = use_point_int_value(t.in_angle); + auto turn_idx = use_point_int_value(t.turn_angle); + auto weight_idx = + use_point_float_value(t.weight / 10.0); // Note conversion to float here + return std::make_tuple(t.coordinate, angle_idx, turn_idx, weight_idx); + }); // Now write the points layer for turn penalty data: // Add a layer object to the PBF stream. 3=='layer' from the vector tile spec @@ -680,9 +683,8 @@ void encodeVectorTile(const datafacade::ContiguousInternalMemoryDataFacadeBase & int id = 1; // Helper function to encode a new point feature on a vector tile. - const auto encode_tile_point = [&]( - const FixedPoint &tile_point, - const auto &point_turn_data) { + const auto encode_tile_point = [&](const FixedPoint &tile_point, + const auto &point_turn_data) { protozero::pbf_writer feature_writer(point_layer_writer, util::vector_tile::FEATURE_TAG); // Field 3 is the "geometry type" field. Value 1 is "point" @@ -714,7 +716,8 @@ void encodeVectorTile(const datafacade::ContiguousInternalMemoryDataFacadeBase & // Loop over all the turns we found and add them as features to the layer for (const auto &turndata : encoded_turn_data) { - const auto tile_point = coordinatesToTilePoint(std::get<0>(turndata), tile_bbox); + const auto tile_point = + coordinatesToTilePoint(std::get<0>(turndata), tile_bbox); if (!boost::geometry::within(point_t(tile_point.x, tile_point.y), clip_box)) { continue; diff --git a/src/osrm/osrm.cpp b/src/osrm/osrm.cpp index 068a1fff9..3a5da0689 100644 --- a/src/osrm/osrm.cpp +++ b/src/osrm/osrm.cpp @@ -21,7 +21,8 @@ OSRM::OSRM(engine::EngineConfig &config) if (config.algorithm == EngineConfig::Algorithm::CoreCH || config.algorithm == EngineConfig::Algorithm::CH) { - bool corech_compatible = engine::Engine::CheckCompability(config); + bool corech_compatible = + engine::Engine::CheckCompability(config); // Activate CoreCH if we can because it is faster if (config.algorithm == EngineConfig::Algorithm::CH && corech_compatible) diff --git a/src/tools/routed.cpp b/src/tools/routed.cpp index f376016cd..7eba3dee3 100644 --- a/src/tools/routed.cpp +++ b/src/tools/routed.cpp @@ -1,6 +1,6 @@ #include "server/server.hpp" -#include "util/log.hpp" #include "util/exception.hpp" +#include "util/log.hpp" #include "util/version.hpp" #include "osrm/engine_config.hpp"