Run clang-format

This commit is contained in:
Patrick Niklaus 2016-01-08 01:31:57 +01:00
parent 6b18e4f7e9
commit 6991a38703
149 changed files with 457 additions and 498 deletions

View File

@ -74,8 +74,11 @@ class Contractor
// using ContractorHeap = util::BinaryHeap<NodeID, NodeID, int, ContractorHeapData, // using ContractorHeap = util::BinaryHeap<NodeID, NodeID, int, ContractorHeapData,
// ArrayStorage<NodeID, NodeID> // ArrayStorage<NodeID, NodeID>
// >; // >;
using ContractorHeap = using ContractorHeap = util::BinaryHeap<NodeID,
util::BinaryHeap<NodeID, NodeID, int, ContractorHeapData, util::XORFastHashStorage<NodeID, NodeID>>; NodeID,
int,
ContractorHeapData,
util::XORFastHashStorage<NodeID, NodeID>>;
using ContractorEdge = ContractorGraph::InputEdge; using ContractorEdge = ContractorGraph::InputEdge;
struct ContractorThreadData struct ContractorThreadData
@ -258,7 +261,8 @@ class Contractor
// } // }
// } // }
// //
// util::SimpleLogger().Write() << "edges at node with id " << highestNode << " has degree // util::SimpleLogger().Write() << "edges at node with id " << highestNode << " has
// degree
// " << maxdegree; // " << maxdegree;
// for(unsigned i = contractor_graph->BeginEdges(highestNode); i < // for(unsigned i = contractor_graph->BeginEdges(highestNode); i <
// contractor_graph->EndEdges(highestNode); ++i) { // contractor_graph->EndEdges(highestNode); ++i) {
@ -345,7 +349,8 @@ class Contractor
if (!flushed_contractor && (number_of_contracted_nodes > if (!flushed_contractor && (number_of_contracted_nodes >
static_cast<NodeID>(number_of_nodes * 0.65 * core_factor))) static_cast<NodeID>(number_of_nodes * 0.65 * core_factor)))
{ {
util::DeallocatingVector<ContractorEdge> new_edge_set; // this one is not explicitely util::DeallocatingVector<ContractorEdge>
new_edge_set; // this one is not explicitely
// cleared since it goes out of // cleared since it goes out of
// scope anywa // scope anywa
std::cout << " [flush " << number_of_contracted_nodes << " nodes] " << std::flush; std::cout << " [flush " << number_of_contracted_nodes << " nodes] " << std::flush;
@ -595,7 +600,8 @@ class Contractor
// avgdegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() ); // avgdegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() );
// quaddegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() ); // quaddegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() );
// //
// util::SimpleLogger().Write() << "rest: " << remaining_nodes.size() << ", max: " // util::SimpleLogger().Write() << "rest: " << remaining_nodes.size() << ",
// max: "
// << maxdegree << ", min: " << mindegree << ", avg: " << avgdegree << ", // << maxdegree << ", min: " << mindegree << ", avg: " << avgdegree << ",
// quad: " << quaddegree; // quad: " << quaddegree;
@ -639,7 +645,8 @@ class Contractor
} }
util::SimpleLogger().Write() << "[core] " << remaining_nodes.size() << " nodes " util::SimpleLogger().Write() << "[core] " << remaining_nodes.size() << " nodes "
<< contractor_graph->GetNumberOfEdges() << " edges." << std::endl; << contractor_graph->GetNumberOfEdges() << " edges."
<< std::endl;
thread_data_list.data.clear(); thread_data_list.data.clear();
} }
@ -1067,7 +1074,6 @@ class Contractor
std::vector<bool> is_core_node; std::vector<bool> is_core_node;
util::XORFastHash fast_hash; util::XORFastHash fast_hash;
}; };
} }
} }

View File

@ -55,7 +55,6 @@ struct ContractorOptions
static void GenerateOutputFilesNames(ContractorConfig &extractor_config); static void GenerateOutputFilesNames(ContractorConfig &extractor_config);
}; };
} }
} }

View File

@ -119,7 +119,6 @@ struct RangebasedCRC32
private: private:
IteratorbasedCRC32 crc32; IteratorbasedCRC32 crc32;
}; };
} }
} }

View File

@ -47,7 +47,8 @@ class Prepare
void WriteCoreNodeMarker(std::vector<bool> &&is_core_node) const; void WriteCoreNodeMarker(std::vector<bool> &&is_core_node) const;
void WriteNodeLevels(std::vector<float> &&node_levels) const; void WriteNodeLevels(std::vector<float> &&node_levels) const;
void ReadNodeLevels(std::vector<float> &contraction_order) const; void ReadNodeLevels(std::vector<float> &contraction_order) const;
std::size_t WriteContractedGraph(unsigned number_of_edge_based_nodes, std::size_t
WriteContractedGraph(unsigned number_of_edge_based_nodes,
const util::DeallocatingVector<QueryEdge> &contracted_edge_list); const util::DeallocatingVector<QueryEdge> &contracted_edge_list);
void FindComponents(unsigned max_edge_id, void FindComponents(unsigned max_edge_id,
const util::DeallocatingVector<extractor::EdgeBasedEdge> &edges, const util::DeallocatingVector<extractor::EdgeBasedEdge> &edges,
@ -55,13 +56,13 @@ class Prepare
private: private:
ContractorConfig config; ContractorConfig config;
std::size_t LoadEdgeExpandedGraph(const std::string &edge_based_graph_path, std::size_t
LoadEdgeExpandedGraph(const std::string &edge_based_graph_path,
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list, util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
const std::string &edge_segment_lookup_path, const std::string &edge_segment_lookup_path,
const std::string &edge_penalty_path, const std::string &edge_penalty_path,
const std::string &segment_speed_path); const std::string &segment_speed_path);
}; };
} }
} }

View File

@ -53,7 +53,6 @@ struct QueryEdge
data.id == right.data.id); data.id == right.data.id);
} }
}; };
} }
} }

View File

@ -115,7 +115,8 @@ class SharedMemory
region = boost::interprocess::mapped_region(shm, boost::interprocess::read_write); region = boost::interprocess::mapped_region(shm, boost::interprocess::read_write);
remover.SetID(shm.get_shmid()); remover.SetID(shm.get_shmid());
util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size << " bytes"; util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size
<< " bytes";
} }
} }
@ -247,7 +248,8 @@ class SharedMemory
region = boost::interprocess::mapped_region(shm, boost::interprocess::read_write); region = boost::interprocess::mapped_region(shm, boost::interprocess::read_write);
remover.SetID(key); remover.SetID(key);
util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size << " bytes"; util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size
<< " bytes";
} }
} }
@ -356,7 +358,6 @@ template <class LockFileT = OSRMLockFile> class SharedMemoryFactory_tmpl
}; };
using SharedMemoryFactory = SharedMemoryFactory_tmpl<>; using SharedMemoryFactory = SharedMemoryFactory_tmpl<>;
} }
} }

View File

@ -96,7 +96,8 @@ void ApiResponseGenerator<DataFacadeT>::DescribeRoute(const RouteParameters &con
const InternalRouteResult &raw_route, const InternalRouteResult &raw_route,
util::json::Object &json_result) util::json::Object &json_result)
{ {
if( not raw_route.is_valid() ){ if (not raw_route.is_valid())
{
return; return;
} }
const constexpr bool ALLOW_SIMPLIFICATION = true; const constexpr bool ALLOW_SIMPLIFICATION = true;
@ -140,7 +141,8 @@ void ApiResponseGenerator<DataFacadeT>::DescribeRoute(const RouteParameters &con
auto alternate_geometry_string = auto alternate_geometry_string =
GetGeometry(config.compression, alternate_segment_list); GetGeometry(config.compression, alternate_segment_list);
util::json::Array json_alternate_geometries_array; util::json::Array json_alternate_geometries_array;
json_alternate_geometries_array.values.emplace_back(std::move(alternate_geometry_string)); json_alternate_geometries_array.values.emplace_back(
std::move(alternate_geometry_string));
json_result.values["alternative_geometries"] = json_alternate_geometries_array; json_result.values["alternative_geometries"] = json_alternate_geometries_array;
} }
@ -192,7 +194,8 @@ ApiResponseGenerator<DataFacadeT>::SummarizeRoute(const InternalRouteResult &raw
{ {
const auto start_name_id = raw_route.segment_end_coordinates.front().source_phantom.name_id; const auto start_name_id = raw_route.segment_end_coordinates.front().source_phantom.name_id;
json_route_summary.values["start_point"] = facade->get_name_for_id(start_name_id); json_route_summary.values["start_point"] = facade->get_name_for_id(start_name_id);
const auto destination_name_id = raw_route.segment_end_coordinates.back().target_phantom.name_id; const auto destination_name_id =
raw_route.segment_end_coordinates.back().target_phantom.name_id;
json_route_summary.values["end_point"] = facade->get_name_for_id(destination_name_id); json_route_summary.values["end_point"] = facade->get_name_for_id(destination_name_id);
} }
json_route_summary.values["total_time"] = segment_list.GetDuration(); json_route_summary.values["total_time"] = segment_list.GetDuration();
@ -217,8 +220,10 @@ ApiResponseGenerator<DataFacadeT>::ListViaPoints(const InternalRouteResult &raw_
{ {
std::string tmp; std::string tmp;
util::json::Array json_coordinate; util::json::Array json_coordinate;
json_coordinate.values.emplace_back(nodes.target_phantom.location.lat / COORDINATE_PRECISION); json_coordinate.values.emplace_back(nodes.target_phantom.location.lat /
json_coordinate.values.emplace_back(nodes.target_phantom.location.lon / COORDINATE_PRECISION); COORDINATE_PRECISION);
json_coordinate.values.emplace_back(nodes.target_phantom.location.lon /
COORDINATE_PRECISION);
json_via_points_array.values.emplace_back(std::move(json_coordinate)); json_via_points_array.values.emplace_back(std::move(json_coordinate));
} }
return json_via_points_array; return json_via_points_array;
@ -235,7 +240,8 @@ ApiResponseGenerator<DataFacadeT>::ListViaIndices(const Segments &segment_list)
} }
template <typename DataFacadeT> template <typename DataFacadeT>
util::json::Value ApiResponseGenerator<DataFacadeT>::GetGeometry(const bool return_encoded, const Segments &segments) const util::json::Value ApiResponseGenerator<DataFacadeT>::GetGeometry(const bool return_encoded,
const Segments &segments) const
{ {
if (return_encoded) if (return_encoded)
return PolylineFormatter().printEncodedString(segments.Get()); return PolylineFormatter().printEncodedString(segments.Get());
@ -284,7 +290,8 @@ ApiResponseGenerator<DataFacadeT>::BuildHintData(const InternalRouteResult &raw_
} }
template <typename DataFacadeT> template <typename DataFacadeT>
ApiResponseGenerator<DataFacadeT> MakeApiResponseGenerator(DataFacadeT *facade){ ApiResponseGenerator<DataFacadeT> MakeApiResponseGenerator(DataFacadeT *facade)
{
return ApiResponseGenerator<DataFacadeT>(facade); return ApiResponseGenerator<DataFacadeT>(facade);
} }

View File

@ -85,8 +85,8 @@ template <class EdgeDataT> class BaseDataFacade
const int bearing = 0, const int bearing = 0,
const int bearing_range = 180) = 0; const int bearing_range = 180) = 0;
virtual std::pair<PhantomNode, PhantomNode> virtual std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate, const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0, const int bearing = 0,
const int bearing_range = 180) = 0; const int bearing_range = 180) = 0;
@ -102,7 +102,6 @@ template <class EdgeDataT> class BaseDataFacade
virtual std::string GetTimestamp() const = 0; virtual std::string GetTimestamp() const = 0;
}; };
} }
} }
} }

View File

@ -37,7 +37,8 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
using QueryGraph = util::StaticGraph<typename super::EdgeData>; using QueryGraph = util::StaticGraph<typename super::EdgeData>;
using InputEdge = typename QueryGraph::InputEdge; using InputEdge = typename QueryGraph::InputEdge;
using RTreeLeaf = typename super::RTreeLeaf; using RTreeLeaf = typename super::RTreeLeaf;
using InternalRTree = util::StaticRTree<RTreeLeaf, util::ShM<util::FixedPointCoordinate, false>::vector, false>; using InternalRTree =
util::StaticRTree<RTreeLeaf, util::ShM<util::FixedPointCoordinate, false>::vector, false>;
using InternalGeospatialQuery = GeospatialQuery<InternalRTree>; using InternalGeospatialQuery = GeospatialQuery<InternalRTree>;
InternalDataFacade() {} InternalDataFacade() {}
@ -98,8 +99,8 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
BOOST_ASSERT_MSG(0 != node_list.size(), "node list empty"); BOOST_ASSERT_MSG(0 != node_list.size(), "node list empty");
// BOOST_ASSERT_MSG(0 != edge_list.size(), "edge list empty"); // BOOST_ASSERT_MSG(0 != edge_list.size(), "edge list empty");
util::SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and " << edge_list.size() util::SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and "
<< " edges"; << edge_list.size() << " edges";
m_query_graph = std::unique_ptr<QueryGraph>(new QueryGraph(node_list, edge_list)); m_query_graph = std::unique_ptr<QueryGraph>(new QueryGraph(node_list, edge_list));
BOOST_ASSERT_MSG(0 == node_list.size(), "node list not flushed"); BOOST_ASSERT_MSG(0 == node_list.size(), "node list not flushed");
@ -120,7 +121,8 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
for (unsigned i = 0; i < number_of_coordinates; ++i) for (unsigned i = 0; i < number_of_coordinates; ++i)
{ {
nodes_input_stream.read((char *)&current_node, sizeof(extractor::QueryNode)); nodes_input_stream.read((char *)&current_node, sizeof(extractor::QueryNode));
m_coordinate_list->at(i) = util::FixedPointCoordinate(current_node.lat, current_node.lon); m_coordinate_list->at(i) =
util::FixedPointCoordinate(current_node.lat, current_node.lon);
BOOST_ASSERT((std::abs(m_coordinate_list->at(i).lat) >> 30) == 0); BOOST_ASSERT((std::abs(m_coordinate_list->at(i).lat) >> 30) == 0);
BOOST_ASSERT((std::abs(m_coordinate_list->at(i).lon) >> 30) == 0); BOOST_ASSERT((std::abs(m_coordinate_list->at(i).lon) >> 30) == 0);
} }
@ -140,7 +142,8 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
extractor::OriginalEdgeData current_edge_data; extractor::OriginalEdgeData current_edge_data;
for (unsigned i = 0; i < number_of_edges; ++i) for (unsigned i = 0; i < number_of_edges; ++i)
{ {
edges_input_stream.read((char *)&(current_edge_data), sizeof(extractor::OriginalEdgeData)); edges_input_stream.read((char *)&(current_edge_data),
sizeof(extractor::OriginalEdgeData));
m_via_node_list[i] = current_edge_data.via_node; m_via_node_list[i] = current_edge_data.via_node;
m_name_ID_list[i] = current_edge_data.name_id; m_name_ID_list[i] = current_edge_data.name_id;
m_turn_instruction_list[i] = current_edge_data.turn_instruction; m_turn_instruction_list[i] = current_edge_data.turn_instruction;
@ -371,8 +374,8 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
bearing_range); bearing_range);
} }
std::pair<PhantomNode, PhantomNode> std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate, const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0, const int bearing = 0,
const int bearing_range = 180) override final const int bearing_range = 180) override final
{ {
@ -444,7 +447,6 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
std::string GetTimestamp() const override final { return m_timestamp; } std::string GetTimestamp() const override final { return m_timestamp; }
}; };
} }
} }
} }

View File

@ -36,7 +36,6 @@ struct SharedBarriers
// Is there any query? // Is there any query?
int number_of_queries; int number_of_queries;
}; };
} }
} }
} }

View File

@ -38,7 +38,8 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
using NameIndexBlock = typename util::RangeTable<16, true>::BlockT; using NameIndexBlock = typename util::RangeTable<16, true>::BlockT;
using InputEdge = typename QueryGraph::InputEdge; using InputEdge = typename QueryGraph::InputEdge;
using RTreeLeaf = typename super::RTreeLeaf; using RTreeLeaf = typename super::RTreeLeaf;
using SharedRTree = util::StaticRTree<RTreeLeaf, util::ShM<util::FixedPointCoordinate, true>::vector, true>; using SharedRTree =
util::StaticRTree<RTreeLeaf, util::ShM<util::FixedPointCoordinate, true>::vector, true>;
using SharedGeospatialQuery = GeospatialQuery<SharedRTree>; using SharedGeospatialQuery = GeospatialQuery<SharedRTree>;
using TimeStampedRTreePair = std::pair<unsigned, std::shared_ptr<SharedRTree>>; using TimeStampedRTreePair = std::pair<unsigned, std::shared_ptr<SharedRTree>>;
using RTreeNode = typename SharedRTree::TreeNode; using RTreeNode = typename SharedRTree::TreeNode;
@ -125,18 +126,21 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
void LoadNodeAndEdgeInformation() void LoadNodeAndEdgeInformation()
{ {
util::FixedPointCoordinate *coordinate_list_ptr = data_layout->GetBlockPtr<util::FixedPointCoordinate>( util::FixedPointCoordinate *coordinate_list_ptr =
shared_memory, SharedDataLayout::COORDINATE_LIST); data_layout->GetBlockPtr<util::FixedPointCoordinate>(shared_memory,
SharedDataLayout::COORDINATE_LIST);
m_coordinate_list = util::make_unique<util::ShM<util::FixedPointCoordinate, true>::vector>( m_coordinate_list = util::make_unique<util::ShM<util::FixedPointCoordinate, true>::vector>(
coordinate_list_ptr, data_layout->num_entries[SharedDataLayout::COORDINATE_LIST]); coordinate_list_ptr, data_layout->num_entries[SharedDataLayout::COORDINATE_LIST]);
extractor::TravelMode *travel_mode_list_ptr = extractor::TravelMode *travel_mode_list_ptr =
data_layout->GetBlockPtr<extractor::TravelMode>(shared_memory, SharedDataLayout::TRAVEL_MODE); data_layout->GetBlockPtr<extractor::TravelMode>(shared_memory,
SharedDataLayout::TRAVEL_MODE);
typename util::ShM<extractor::TravelMode, true>::vector travel_mode_list( typename util::ShM<extractor::TravelMode, true>::vector travel_mode_list(
travel_mode_list_ptr, data_layout->num_entries[SharedDataLayout::TRAVEL_MODE]); travel_mode_list_ptr, data_layout->num_entries[SharedDataLayout::TRAVEL_MODE]);
m_travel_mode_list.swap(travel_mode_list); m_travel_mode_list.swap(travel_mode_list);
extractor::TurnInstruction *turn_instruction_list_ptr = data_layout->GetBlockPtr<extractor::TurnInstruction>( extractor::TurnInstruction *turn_instruction_list_ptr =
data_layout->GetBlockPtr<extractor::TurnInstruction>(
shared_memory, SharedDataLayout::TURN_INSTRUCTION); shared_memory, SharedDataLayout::TURN_INSTRUCTION);
typename util::ShM<extractor::TurnInstruction, true>::vector turn_instruction_list( typename util::ShM<extractor::TurnInstruction, true>::vector turn_instruction_list(
turn_instruction_list_ptr, turn_instruction_list_ptr,
@ -258,7 +262,8 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
file_index_path = boost::filesystem::path(file_index_ptr); file_index_path = boost::filesystem::path(file_index_ptr);
if (!boost::filesystem::exists(file_index_path)) if (!boost::filesystem::exists(file_index_path))
{ {
util::SimpleLogger().Write(logDEBUG) << "Leaf file name " << file_index_path.string(); util::SimpleLogger().Write(logDEBUG) << "Leaf file name "
<< file_index_path.string();
throw util::exception("Could not load leaf index file. " throw util::exception("Could not load leaf index file. "
"Is any data loaded into shared memory?"); "Is any data loaded into shared memory?");
} }
@ -397,8 +402,8 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
bearing_range); bearing_range);
} }
std::pair<PhantomNode, PhantomNode> std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate, const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0, const int bearing = 0,
const int bearing_range = 180) override final const int bearing_range = 180) override final
{ {
@ -452,7 +457,6 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
std::string GetTimestamp() const override final { return m_timestamp; } std::string GetTimestamp() const override final { return m_timestamp; }
}; };
} }
} }
} }

View File

@ -171,7 +171,6 @@ struct SharedDataTimestamp
SharedDataType data; SharedDataType data;
unsigned timestamp; unsigned timestamp;
}; };
} }
} }
} }

View File

@ -55,7 +55,6 @@ class DouglasPeucker
void Run(RandomAccessIt begin, RandomAccessIt end, const unsigned zoom_level); void Run(RandomAccessIt begin, RandomAccessIt end, const unsigned zoom_level);
void Run(std::vector<SegmentInformation> &input_geometry, const unsigned zoom_level); void Run(std::vector<SegmentInformation> &input_geometry, const unsigned zoom_level);
}; };
} }
} }

View File

@ -77,8 +77,8 @@ template <typename RTreeT> class GeospatialQuery
// Returns the nearest phantom node. If this phantom node is not from a big component // Returns the nearest phantom node. If this phantom node is not from a big component
// a second phantom node is return that is the nearest coordinate in a big component. // a second phantom node is return that is the nearest coordinate in a big component.
std::pair<PhantomNode, PhantomNode> std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate, const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0, const int bearing = 0,
const int bearing_range = 180) const int bearing_range = 180)
{ {
@ -139,9 +139,10 @@ template <typename RTreeT> class GeospatialQuery
{ {
util::FixedPointCoordinate point_on_segment; util::FixedPointCoordinate point_on_segment;
double ratio; double ratio;
const auto current_perpendicular_distance = util::coordinate_calculation::perpendicularDistance( const auto current_perpendicular_distance =
coordinates->at(data.u), coordinates->at(data.v), input_coordinate, point_on_segment, util::coordinate_calculation::perpendicularDistance(
ratio); coordinates->at(data.u), coordinates->at(data.v), input_coordinate,
point_on_segment, ratio);
auto transformed = PhantomNodeWithDistance{PhantomNode{data, point_on_segment}, auto transformed = PhantomNodeWithDistance{PhantomNode{data, point_on_segment},
current_perpendicular_distance}; current_perpendicular_distance};
@ -163,8 +164,8 @@ template <typename RTreeT> class GeospatialQuery
const int filter_bearing, const int filter_bearing,
const int filter_bearing_range) const int filter_bearing_range)
{ {
const double forward_edge_bearing = const double forward_edge_bearing = util::coordinate_calculation::bearing(
util::coordinate_calculation::bearing(coordinates->at(segment.u), coordinates->at(segment.v)); coordinates->at(segment.u), coordinates->at(segment.v));
const double backward_edge_bearing = (forward_edge_bearing + 180) > 360 const double backward_edge_bearing = (forward_edge_bearing + 180) > 360
? (forward_edge_bearing - 180) ? (forward_edge_bearing - 180)
@ -184,7 +185,6 @@ template <typename RTreeT> class GeospatialQuery
RTreeT &rtree; RTreeT &rtree;
const std::shared_ptr<CoordinateList> coordinates; const std::shared_ptr<CoordinateList> coordinates;
}; };
} }
} }

View File

@ -146,7 +146,8 @@ void SegmentList<DataFacadeT>::AddLeg(const std::vector<PathData> &leg_data,
const extractor::TravelMode travel_mode = const extractor::TravelMode travel_mode =
(traversed_in_reverse ? target_node.backward_travel_mode : target_node.forward_travel_mode); (traversed_in_reverse ? target_node.backward_travel_mode : target_node.forward_travel_mode);
segments.emplace_back(target_node.location, target_node.name_id, segment_duration, 0.f, segments.emplace_back(target_node.location, target_node.name_id, segment_duration, 0.f,
is_via_leg ? extractor::TurnInstruction::ReachViaLocation : extractor::TurnInstruction::NoTurn, is_via_leg ? extractor::TurnInstruction::ReachViaLocation
: extractor::TurnInstruction::NoTurn,
true, true, travel_mode); true, true, travel_mode);
} }
@ -220,8 +221,8 @@ void SegmentList<DataFacadeT>::Finalize(const bool extract_alternative,
{ {
// move down names by one, q&d hack // move down names by one, q&d hack
segments[i - 1].name_id = segments[i].name_id; segments[i - 1].name_id = segments[i].name_id;
segments[i].length = util::coordinate_calculation::greatCircleDistance(segments[i - 1].location, segments[i].length = util::coordinate_calculation::greatCircleDistance(
segments[i].location); segments[i - 1].location, segments[i].location);
} }
float segment_length = 0.; float segment_length = 0.;

View File

@ -22,8 +22,8 @@ namespace engine
namespace guidance namespace guidance
{ {
template <typename DataFacadeT> template <typename DataFacadeT>
inline util::json::Array inline util::json::Array AnnotateRoute(const std::vector<SegmentInformation> &route_segments,
AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT* facade) DataFacadeT *facade)
{ {
util::json::Array json_instruction_array; util::json::Array json_instruction_array;
if (route_segments.empty()) if (route_segments.empty())
@ -59,8 +59,8 @@ AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT
std::string current_turn_instruction; std::string current_turn_instruction;
if (extractor::TurnInstruction::LeaveRoundAbout == current_instruction) if (extractor::TurnInstruction::LeaveRoundAbout == current_instruction)
{ {
temp_instruction = temp_instruction = std::to_string(util::cast::enum_to_underlying(
std::to_string(util::cast::enum_to_underlying(extractor::TurnInstruction::EnterRoundAbout)); extractor::TurnInstruction::EnterRoundAbout));
current_turn_instruction += temp_instruction; current_turn_instruction += temp_instruction;
current_turn_instruction += "-"; current_turn_instruction += "-";
temp_instruction = std::to_string(round_about.leave_at_exit + 1); temp_instruction = std::to_string(round_about.leave_at_exit + 1);
@ -110,8 +110,8 @@ AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT
} }
util::json::Array json_last_instruction_row; util::json::Array json_last_instruction_row;
temp_instruction = temp_instruction = std::to_string(
std::to_string(util::cast::enum_to_underlying(extractor::TurnInstruction::ReachedYourDestination)); util::cast::enum_to_underlying(extractor::TurnInstruction::ReachedYourDestination));
json_last_instruction_row.values.emplace_back(std::move(temp_instruction)); json_last_instruction_row.values.emplace_back(std::move(temp_instruction));
json_last_instruction_row.values.push_back(""); json_last_instruction_row.values.push_back("");
json_last_instruction_row.values.push_back(0); json_last_instruction_row.values.push_back(0);

View File

@ -19,7 +19,8 @@ struct PathData
{ {
PathData() PathData()
: node(SPECIAL_NODEID), name_id(INVALID_EDGE_WEIGHT), segment_duration(INVALID_EDGE_WEIGHT), : node(SPECIAL_NODEID), name_id(INVALID_EDGE_WEIGHT), segment_duration(INVALID_EDGE_WEIGHT),
turn_instruction(extractor::TurnInstruction::NoTurn), travel_mode(TRAVEL_MODE_INACCESSIBLE) turn_instruction(extractor::TurnInstruction::NoTurn),
travel_mode(TRAVEL_MODE_INACCESSIBLE)
{ {
} }
@ -65,7 +66,6 @@ struct InternalRouteResult
{ {
} }
}; };
} }
} }

View File

@ -94,7 +94,6 @@ class BayesClassifier
double positive_apriori_probability; double positive_apriori_probability;
double negative_apriori_probability; double negative_apriori_probability;
}; };
} }
} }
} }

View File

@ -34,8 +34,7 @@ struct EmissionLogProbability
double operator()(const double distance) const double operator()(const double distance) const
{ {
return -0.5 * (log_2_pi + (distance / sigma_z) * (distance / sigma_z)) - return -0.5 * (log_2_pi + (distance / sigma_z) * (distance / sigma_z)) - log_sigma_z;
log_sigma_z;
} }
}; };
@ -116,8 +115,7 @@ template <class CandidateLists> struct HiddenMarkovModel
viterbi[initial_timestamp][s] = viterbi[initial_timestamp][s] =
emission_log_probability(candidates_list[initial_timestamp][s].distance); emission_log_probability(candidates_list[initial_timestamp][s].distance);
parents[initial_timestamp][s] = std::make_pair(initial_timestamp, s); parents[initial_timestamp][s] = std::make_pair(initial_timestamp, s);
pruned[initial_timestamp][s] = pruned[initial_timestamp][s] = viterbi[initial_timestamp][s] < MINIMAL_LOG_PROB;
viterbi[initial_timestamp][s] < MINIMAL_LOG_PROB;
suspicious[initial_timestamp][s] = false; suspicious[initial_timestamp][s] = false;
breakage[initial_timestamp] = breakage[initial_timestamp] =
@ -140,7 +138,6 @@ template <class CandidateLists> struct HiddenMarkovModel
return initial_timestamp; return initial_timestamp;
} }
}; };
} }
} }
} }

View File

@ -63,7 +63,6 @@ struct ObjectEncoder
} }
} }
}; };
} }
} }

View File

@ -34,7 +34,8 @@ struct PhantomNode
PhantomNode(); PhantomNode();
template <class OtherT> PhantomNode(const OtherT &other, const util::FixedPointCoordinate &foot_point) template <class OtherT>
PhantomNode(const OtherT &other, const util::FixedPointCoordinate &foot_point)
{ {
forward_node_id = other.forward_edge_based_node_id; forward_node_id = other.forward_edge_based_node_id;
reverse_node_id = other.reverse_edge_based_node_id; reverse_node_id = other.reverse_edge_based_node_id;
@ -137,7 +138,6 @@ inline std::ostream &operator<<(std::ostream &out, const PhantomNode &pn)
<< "loc: " << pn.location; << "loc: " << pn.location;
return out; return out;
} }
} }
} }

View File

@ -219,7 +219,6 @@ template <class DataFacadeT> class DistanceTablePlugin final : public BasePlugin
std::string descriptor_string; std::string descriptor_string;
DataFacadeT *facade; DataFacadeT *facade;
}; };
} }
} }
} }

View File

@ -80,7 +80,6 @@ class HelloWorldPlugin final : public BasePlugin
private: private:
std::string descriptor_string; std::string descriptor_string;
}; };
} }
} }
} }

View File

@ -37,7 +37,9 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
using SubMatching = routing_algorithms::SubMatching; using SubMatching = routing_algorithms::SubMatching;
using SubMatchingList = routing_algorithms::SubMatchingList; using SubMatchingList = routing_algorithms::SubMatchingList;
using CandidateLists = routing_algorithms::CandidateLists; using CandidateLists = routing_algorithms::CandidateLists;
using ClassifierT = map_matching::BayesClassifier<map_matching::LaplaceDistribution, map_matching::LaplaceDistribution, double>; using ClassifierT = map_matching::BayesClassifier<map_matching::LaplaceDistribution,
map_matching::LaplaceDistribution,
double>;
using TraceClassification = ClassifierT::ClassificationT; using TraceClassification = ClassifierT::ClassificationT;
public: public:
@ -220,8 +222,7 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
if (route_parameters.print_instructions) if (route_parameters.print_instructions)
{ {
subtrace.values["instructions"] = subtrace.values["instructions"] =
guidance::AnnotateRoute<DataFacadeT>( guidance::AnnotateRoute<DataFacadeT>(segment_list.Get(), facade);
segment_list.Get(), facade);
} }
util::json::Object json_route_summary; util::json::Object json_route_summary;
@ -379,7 +380,6 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
int max_locations_map_matching; int max_locations_map_matching;
ClassifierT classifier; ClassifierT classifier;
}; };
} }
} }
} }

View File

@ -30,8 +30,7 @@ template <class DataFacadeT> class NearestPlugin final : public BasePlugin
util::json::Object &json_result) override final util::json::Object &json_result) override final
{ {
// check number of parameters // check number of parameters
if (route_parameters.coordinates.empty() || if (route_parameters.coordinates.empty() || !route_parameters.coordinates.front().IsValid())
!route_parameters.coordinates.front().IsValid())
{ {
return Status::Error; return Status::Error;
} }
@ -101,7 +100,6 @@ template <class DataFacadeT> class NearestPlugin final : public BasePlugin
DataFacadeT *facade; DataFacadeT *facade;
std::string descriptor_string; std::string descriptor_string;
}; };
} }
} }
} }

View File

@ -112,7 +112,6 @@ class BasePlugin
return snapped_phantoms; return snapped_phantoms;
} }
}; };
} }
} }
} }

View File

@ -36,7 +36,6 @@ template <class DataFacadeT> class TimestampPlugin final : public BasePlugin
const DataFacadeT *facade; const DataFacadeT *facade;
std::string descriptor_string; std::string descriptor_string;
}; };
} }
} }
} }

View File

@ -149,8 +149,8 @@ template <class DataFacadeT> class RoundTripPlugin final : public BasePlugin
} }
// Run TarjanSCC // Run TarjanSCC
auto wrapper = std::make_shared<util::MatrixGraphWrapper<EdgeWeight>>(result_table.GetTable(), auto wrapper = std::make_shared<util::MatrixGraphWrapper<EdgeWeight>>(
number_of_locations); result_table.GetTable(), number_of_locations);
auto scc = extractor::TarjanSCC<util::MatrixGraphWrapper<EdgeWeight>>(wrapper); auto scc = extractor::TarjanSCC<util::MatrixGraphWrapper<EdgeWeight>>(wrapper);
scc.run(); scc.run();
@ -301,13 +301,12 @@ template <class DataFacadeT> class RoundTripPlugin final : public BasePlugin
if (component_size < BF_MAX_FEASABLE) if (component_size < BF_MAX_FEASABLE)
{ {
scc_route = scc_route = trip::BruteForceTrip(start, end, number_of_locations, result_table);
trip::BruteForceTrip(start, end, number_of_locations, result_table);
} }
else else
{ {
scc_route = trip::FarthestInsertionTrip(start, end, number_of_locations, scc_route =
result_table); trip::FarthestInsertionTrip(start, end, number_of_locations, result_table);
} }
// use this output if debugging of route is needed: // use this output if debugging of route is needed:
@ -366,7 +365,6 @@ template <class DataFacadeT> class RoundTripPlugin final : public BasePlugin
return Status::Ok; return Status::Ok;
} }
}; };
} }
} }
} }

View File

@ -166,7 +166,6 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin
return Status::Ok; return Status::Ok;
} }
}; };
} }
} }
} }

View File

@ -25,7 +25,6 @@ class PolylineCompressor
std::vector<util::FixedPointCoordinate> decode_string(const std::string &geometry_string) const; std::vector<util::FixedPointCoordinate> decode_string(const std::string &geometry_string) const;
}; };
} }
} }

View File

@ -19,7 +19,6 @@ struct PolylineFormatter
util::json::Array printUnencodedString(const std::vector<SegmentInformation> &polyline) const; util::json::Array printUnencodedString(const std::vector<SegmentInformation> &polyline) const;
}; };
} }
} }

View File

@ -139,7 +139,6 @@ template <class DataFacadeT, class SegmentT> struct ExtractRouteNames
return route_names; return route_names;
} }
}; };
} }
} }

View File

@ -564,7 +564,8 @@ class AlternativeRouting final
const NodeID node = forward_heap.DeleteMin(); const NodeID node = forward_heap.DeleteMin();
const int distance = forward_heap.GetKey(node); const int distance = forward_heap.GetKey(node);
// const NodeID parentnode = forward_heap.GetData(node).parent; // const NodeID parentnode = forward_heap.GetData(node).parent;
// util::SimpleLogger().Write() << (is_forward_directed ? "[fwd] " : "[rev] ") << "settled edge (" // util::SimpleLogger().Write() << (is_forward_directed ? "[fwd] " : "[rev] ") << "settled
// edge ("
// << parentnode << "," << node << "), dist: " << distance; // << parentnode << "," << node << "), dist: " << distance;
const int scaled_distance = const int scaled_distance =
@ -588,10 +589,12 @@ class AlternativeRouting final
{ {
*middle_node = node; *middle_node = node;
*upper_bound_to_shortest_path_distance = new_distance; *upper_bound_to_shortest_path_distance = new_distance;
// util::SimpleLogger().Write() << "accepted middle_node " << *middle_node << " at // util::SimpleLogger().Write() << "accepted middle_node " << *middle_node
// << " at
// distance " << new_distance; // distance " << new_distance;
// } else { // } else {
// util::SimpleLogger().Write() << "discarded middle_node " << *middle_node << " // util::SimpleLogger().Write() << "discarded middle_node " << *middle_node
// << "
// at distance " << new_distance; // at distance " << new_distance;
} }
} }
@ -846,7 +849,6 @@ class AlternativeRouting final
return (upper_bound <= t_test_path_length); return (upper_bound <= t_test_path_length);
} }
}; };
} }
} }
} }

View File

@ -131,7 +131,6 @@ class DirectShortestPathRouting final
raw_route_data.unpacked_path_segments.front()); raw_route_data.unpacked_path_segments.front());
} }
}; };
} }
} }
} }

View File

@ -147,8 +147,8 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching<
} }
else else
{ {
trace_split = trace_split || (t - prev_unbroken_timestamps.back() > trace_split =
MAX_BROKEN_STATES); trace_split || (t - prev_unbroken_timestamps.back() > MAX_BROKEN_STATES);
} }
if (trace_split) if (trace_split)
@ -194,8 +194,8 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching<
const auto &current_timestamps_list = candidates_list[t]; const auto &current_timestamps_list = candidates_list[t];
const auto &current_coordinate = trace_coordinates[t]; const auto &current_coordinate = trace_coordinates[t];
const auto haversine_distance = const auto haversine_distance = util::coordinate_calculation::haversineDistance(
util::coordinate_calculation::haversineDistance(prev_coordinate, current_coordinate); prev_coordinate, current_coordinate);
// compute d_t for this timestamp and the next one // compute d_t for this timestamp and the next one
for (const auto s : util::irange<std::size_t>(0u, prev_viterbi.size())) for (const auto s : util::irange<std::size_t>(0u, prev_viterbi.size()))
@ -246,8 +246,7 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching<
current_parents[s_prime] = std::make_pair(prev_unbroken_timestamp, s); current_parents[s_prime] = std::make_pair(prev_unbroken_timestamp, s);
current_lengths[s_prime] = network_distance; current_lengths[s_prime] = network_distance;
current_pruned[s_prime] = false; current_pruned[s_prime] = false;
current_suspicious[s_prime] = current_suspicious[s_prime] = d_t > SUSPICIOUS_DISTANCE_DELTA;
d_t > SUSPICIOUS_DISTANCE_DELTA;
model.breakage[t] = false; model.breakage[t] = false;
} }
} }
@ -355,7 +354,6 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching<
matching_debug.add_breakage(model.breakage); matching_debug.add_breakage(model.breakage);
} }
}; };
} }
} }
} }

View File

@ -25,7 +25,6 @@ SearchEngineData::SearchEngineHeapPtr SearchEngineData::reverse_heap_3;
namespace routing_algorithms namespace routing_algorithms
{ {
template <class DataFacadeT, class Derived> class BasicRoutingInterface template <class DataFacadeT, class Derived> class BasicRoutingInterface
{ {
private: private:
@ -231,7 +230,8 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
{ {
BOOST_ASSERT_MSG(!ed.shortcut, "original edge flagged as shortcut"); BOOST_ASSERT_MSG(!ed.shortcut, "original edge flagged as shortcut");
unsigned name_index = facade->GetNameIndexFromEdgeID(ed.id); unsigned name_index = facade->GetNameIndexFromEdgeID(ed.id);
const extractor::TurnInstruction turn_instruction = facade->GetTurnInstructionForEdgeID(ed.id); const extractor::TurnInstruction turn_instruction =
facade->GetTurnInstructionForEdgeID(ed.id);
const extractor::TravelMode travel_mode = facade->GetTravelModeForEdgeID(ed.id); const extractor::TravelMode travel_mode = facade->GetTravelModeForEdgeID(ed.id);
if (!facade->EdgeIsCompressed(ed.id)) if (!facade->EdgeIsCompressed(ed.id))
@ -260,7 +260,8 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
for (std::size_t i = start_index; i < end_index; ++i) for (std::size_t i = start_index; i < end_index; ++i)
{ {
unpacked_path.emplace_back(id_vector[i], name_index, unpacked_path.emplace_back(id_vector[i], name_index,
extractor::TurnInstruction::NoTurn, 0, travel_mode); extractor::TurnInstruction::NoTurn, 0,
travel_mode);
} }
unpacked_path.back().turn_instruction = turn_instruction; unpacked_path.back().turn_instruction = turn_instruction;
unpacked_path.back().segment_duration = ed.distance; unpacked_path.back().segment_duration = ed.distance;
@ -304,9 +305,10 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
{ {
BOOST_ASSERT(i < id_vector.size()); BOOST_ASSERT(i < id_vector.size());
BOOST_ASSERT(phantom_node_pair.target_phantom.forward_travel_mode > 0); BOOST_ASSERT(phantom_node_pair.target_phantom.forward_travel_mode > 0);
unpacked_path.emplace_back(PathData{ unpacked_path.emplace_back(
id_vector[i], phantom_node_pair.target_phantom.name_id, extractor::TurnInstruction::NoTurn, PathData{id_vector[i], phantom_node_pair.target_phantom.name_id,
0, phantom_node_pair.target_phantom.forward_travel_mode}); extractor::TurnInstruction::NoTurn, 0,
phantom_node_pair.target_phantom.forward_travel_mode});
} }
} }
@ -667,7 +669,6 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
return distance; return distance;
} }
}; };
} }
} }
} }

View File

@ -521,7 +521,6 @@ class ShortestPathRouting final
} }
} }
}; };
} }
} }
} }

View File

@ -41,7 +41,6 @@ template <class DataFacadeT> class SearchEngine
~SearchEngine() {} ~SearchEngine() {}
}; };
} }
} }

View File

@ -19,7 +19,8 @@ struct HeapData
struct SearchEngineData struct SearchEngineData
{ {
using QueryHeap = util::BinaryHeap<NodeID, NodeID, int, HeapData, util::UnorderedMapStorage<NodeID, int>>; using QueryHeap =
util::BinaryHeap<NodeID, NodeID, int, HeapData, util::UnorderedMapStorage<NodeID, int>>;
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>; using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
static SearchEngineHeapPtr forward_heap_1; static SearchEngineHeapPtr forward_heap_1;
@ -35,7 +36,6 @@ struct SearchEngineData
void InitializeOrClearThirdThreadLocalStorage(const unsigned number_of_nodes); void InitializeOrClearThirdThreadLocalStorage(const unsigned number_of_nodes);
}; };
} }
} }

View File

@ -49,12 +49,11 @@ struct SegmentInformation
const extractor::TravelMode travel_mode) const extractor::TravelMode travel_mode)
: location(std::move(location)), name_id(name_id), duration(duration), length(length), : location(std::move(location)), name_id(name_id), duration(duration), length(length),
pre_turn_bearing(0), post_turn_bearing(0), turn_instruction(turn_instruction), pre_turn_bearing(0), post_turn_bearing(0), turn_instruction(turn_instruction),
travel_mode(travel_mode), necessary(turn_instruction != extractor::TurnInstruction::NoTurn), travel_mode(travel_mode),
is_via_location(false) necessary(turn_instruction != extractor::TurnInstruction::NoTurn), is_via_location(false)
{ {
} }
}; };
} }
} }

View File

@ -77,7 +77,6 @@ std::vector<NodeID> BruteForceTrip(const NodeIDIterator start,
return route; return route;
} }
} }
} }
} }

View File

@ -190,7 +190,6 @@ std::vector<NodeID> FarthestInsertionTrip(const NodeIDIterator &start,
BOOST_ASSERT_MSG(static_cast<std::size_t>(max_to) < number_of_locations, "start node"); BOOST_ASSERT_MSG(static_cast<std::size_t>(max_to) < number_of_locations, "start node");
return FindRoute(number_of_locations, component_size, start, end, dist_table, max_from, max_to); return FindRoute(number_of_locations, component_size, start, end, dist_table, max_from, max_to);
} }
} }
} }
} }

View File

@ -92,7 +92,6 @@ std::vector<NodeID> NearestNeighbourTrip(const NodeIDIterator &start,
} }
return route; return route;
} }
} }
} }
} }

View File

@ -34,7 +34,6 @@ void TabuSearchTrip(const PhantomNodeArray &phantom_node_vector,
std::vector<int> &min_loc_permutation) std::vector<int> &min_loc_permutation)
{ {
} }
} }
} }
} }

View File

@ -43,7 +43,6 @@ class CompressedEdgeContainer
std::vector<unsigned> m_free_list; std::vector<unsigned> m_free_list;
std::unordered_map<EdgeID, unsigned> m_edge_id_to_list_index_map; std::unordered_map<EdgeID, unsigned> m_edge_id_to_list_index_map;
}; };
} }
} }

View File

@ -117,7 +117,6 @@ class EdgeBasedGraphFactory
void FlushVectorToStream(std::ofstream &edge_data_file, void FlushVectorToStream(std::ofstream &edge_data_file,
std::vector<OriginalEdgeData> &original_edge_data_vector) const; std::vector<OriginalEdgeData> &original_edge_data_vector) const;
}; };
} }
} }

View File

@ -89,7 +89,6 @@ struct EdgeBasedNode
TravelMode forward_travel_mode : 4; TravelMode forward_travel_mode : 4;
TravelMode backward_travel_mode : 4; TravelMode backward_travel_mode : 4;
}; };
} }
} }

View File

@ -31,7 +31,6 @@ struct ExternalMemoryNodeSTXXLCompare
value_type max_value(); value_type max_value();
value_type min_value(); value_type min_value();
}; };
} }
} }

View File

@ -65,7 +65,6 @@ class ExtractionContainers
const std::string &names_file_name, const std::string &names_file_name,
lua_State *segment_state); lua_State *segment_state);
}; };
} }
} }

View File

@ -94,7 +94,6 @@ unsigned parseDuration(const std::string &s)
return std::numeric_limits<unsigned>::max(); return std::numeric_limits<unsigned>::max();
} }
} }
} }

View File

@ -13,7 +13,6 @@ struct ExtractionNode
bool traffic_lights; bool traffic_lights;
bool barrier; bool barrier;
}; };
} }
} }

View File

@ -103,7 +103,6 @@ struct ExtractionWay
TravelMode forward_travel_mode : 4; TravelMode forward_travel_mode : 4;
TravelMode backward_travel_mode : 4; TravelMode backward_travel_mode : 4;
}; };
} }
} }

View File

@ -51,7 +51,6 @@ class ExtractorCallbacks
// warning: caller needs to take care of synchronization! // warning: caller needs to take care of synchronization!
void ProcessWay(const osmium::Way &current_way, const ExtractionWay &result_way); void ProcessWay(const osmium::Way &current_way, const ExtractionWay &result_way);
}; };
} }
} }

View File

@ -52,7 +52,6 @@ struct ExtractorOptions
static void GenerateOutputFilesNames(ExtractorConfig &extractor_config); static void GenerateOutputFilesNames(ExtractorConfig &extractor_config);
}; };
} }
} }

View File

@ -53,7 +53,6 @@ struct FirstAndLastSegmentOfWayStxxlCompare
value_type max_value() { return FirstAndLastSegmentOfWay::max_value(); } value_type max_value() { return FirstAndLastSegmentOfWay::max_value(); }
value_type min_value() { return FirstAndLastSegmentOfWay::min_value(); } value_type min_value() { return FirstAndLastSegmentOfWay::min_value(); }
}; };
} }
} }

View File

@ -37,7 +37,6 @@ class GraphCompressor
SpeedProfileProperties speed_profile; SpeedProfileProperties speed_profile;
}; };
} }
} }

View File

@ -94,7 +94,6 @@ struct EdgeBasedEdge
bool forward : 1; bool forward : 1;
bool backward : 1; bool backward : 1;
}; };
} }
} }

View File

@ -152,7 +152,6 @@ struct CmpEdgeByOSMTargetID
value_type max_value() { return InternalExtractorEdge::max_osm_value(); } value_type max_value() { return InternalExtractorEdge::max_osm_value(); }
value_type min_value() { return InternalExtractorEdge::min_osm_value(); } value_type min_value() { return InternalExtractorEdge::min_osm_value(); }
}; };
} }
} }

View File

@ -15,7 +15,6 @@ struct Cmp
value_type max_value() { return MAX_OSM_NODEID; } value_type max_value() { return MAX_OSM_NODEID; }
value_type min_value() { return MIN_OSM_NODEID; } value_type min_value() { return MIN_OSM_NODEID; }
}; };
} }
} }

View File

@ -37,7 +37,6 @@ struct OriginalEdgeData
bool compressed_geometry; bool compressed_geometry;
TravelMode travel_mode; TravelMode travel_mode;
}; };
} }
} }

View File

@ -59,7 +59,6 @@ struct QueryNode
return std::numeric_limits<int>::lowest(); return std::numeric_limits<int>::lowest();
} }
}; };
} }
} }

View File

@ -149,7 +149,6 @@ class SourceContainer
std::vector<RasterSource> LoadedSources; std::vector<RasterSource> LoadedSources;
std::unordered_map<std::string, int> LoadedSourcePaths; std::unordered_map<std::string, int> LoadedSourcePaths;
}; };
} }
} }

View File

@ -108,7 +108,6 @@ struct CmpRestrictionContainerByTo
value_type max_value() const { return InputRestrictionContainer::max_value(); } value_type max_value() const { return InputRestrictionContainer::max_value(); }
value_type min_value() const { return InputRestrictionContainer::min_value(); } value_type min_value() const { return InputRestrictionContainer::min_value(); }
}; };
} }
} }

View File

@ -64,7 +64,6 @@ template <> struct hash<osrm::extractor::RestrictionTarget>
}; };
} }
namespace osrm namespace osrm
{ {
namespace extractor namespace extractor
@ -157,7 +156,6 @@ class RestrictionMap
std::unordered_set<NodeID> m_restriction_start_nodes; std::unordered_set<NodeID> m_restriction_start_nodes;
std::unordered_set<NodeID> m_no_turn_via_node_set; std::unordered_set<NodeID> m_no_turn_via_node_set;
}; };
} }
} }

View File

@ -14,7 +14,6 @@ namespace osmium
class Relation; class Relation;
} }
namespace osrm namespace osrm
{ {
namespace extractor namespace extractor
@ -52,7 +51,6 @@ class RestrictionParser
std::vector<std::string> restriction_exceptions; std::vector<std::string> restriction_exceptions;
bool use_turn_restrictions; bool use_turn_restrictions;
}; };
} }
} }

View File

@ -34,7 +34,6 @@ class ScriptingEnvironment
std::string file_name; std::string file_name;
tbb::enumerable_thread_specific<std::shared_ptr<lua_State>> script_contexts; tbb::enumerable_thread_specific<std::shared_ptr<lua_State>> script_contexts;
}; };
} }
} }

View File

@ -17,7 +17,6 @@ struct SpeedProfileProperties
int u_turn_penalty; int u_turn_penalty;
bool has_turn_penalty_function; bool has_turn_penalty_function;
}; };
} }
} }

View File

@ -178,7 +178,6 @@ template <typename GraphT> class TarjanSCC
unsigned get_component_id(const NodeID node) const { return components_index[node]; } unsigned get_component_id(const NodeID node) const { return components_index[node]; }
}; };
} }
} }

View File

@ -7,11 +7,11 @@ namespace extractor
{ {
using TravelMode = unsigned char; using TravelMode = unsigned char;
} }
} }
namespace { namespace
{
static const osrm::extractor::TravelMode TRAVEL_MODE_INACCESSIBLE = 0; static const osrm::extractor::TravelMode TRAVEL_MODE_INACCESSIBLE = 0;
static const osrm::extractor::TravelMode TRAVEL_MODE_DEFAULT = 1; static const osrm::extractor::TravelMode TRAVEL_MODE_DEFAULT = 1;
} }

View File

@ -79,7 +79,6 @@ struct TurnInstructionsClass
return true; return true;
} }
}; };
} }
} }

View File

@ -67,7 +67,6 @@ std::ostream &operator<<(std::ostream &out, const FixedPointCoordinate &coordina
} }
using util::FixedPointCoordinate; using util::FixedPointCoordinate;
} }
#endif /* COORDINATE_HPP_ */ #endif /* COORDINATE_HPP_ */

View File

@ -98,7 +98,8 @@ struct Array
} // namespace JSON } // namespace JSON
} // namespace util } // namespace util
namespace json { namespace json
{
using namespace osrm::util::json; using namespace osrm::util::json;
} }

View File

@ -45,7 +45,6 @@ struct LibOSRMConfig
int max_locations_map_matching = -1; int max_locations_map_matching = -1;
bool use_shared_memory = true; bool use_shared_memory = true;
}; };
} }
#endif // SERVER_CONFIG_HPP #endif // SERVER_CONFIG_HPP

View File

@ -43,7 +43,8 @@ struct Object;
} }
} }
namespace engine { namespace engine
{
struct RouteParameters; struct RouteParameters;
class OSRM class OSRM
{ {
@ -59,7 +60,6 @@ class OSRM
} }
using engine::OSRM; using engine::OSRM;
} }
#endif // OSRM_HPP #endif // OSRM_HPP

View File

@ -119,11 +119,9 @@ struct RouteParameters
std::vector<bool> is_destination; std::vector<bool> is_destination;
std::vector<bool> is_source; std::vector<bool> is_source;
}; };
} }
using engine::RouteParameters; using engine::RouteParameters;
} }
#endif // ROUTE_PARAMETERS_HPP #endif // ROUTE_PARAMETERS_HPP

View File

@ -68,7 +68,6 @@ namespace osrm
} \ } \
}; \ }; \
} }
} }
#endif // OSRM_STRONG_TYPEDEF_HPP #endif // OSRM_STRONG_TYPEDEF_HPP

View File

@ -102,7 +102,6 @@ template <typename Iterator, class HandlerT> struct APIGrammar : qi::grammar<Ite
HandlerT *handler; HandlerT *handler;
}; };
} }
} }

View File

@ -64,7 +64,6 @@ class Connection : public std::enable_shared_from_this<Connection>
http::reply current_reply; http::reply current_reply;
std::vector<char> compressed_output; std::vector<char> compressed_output;
}; };
} }
} }

View File

@ -14,7 +14,6 @@ enum compression_type
gzip_rfc1952, gzip_rfc1952,
deflate_rfc1951 deflate_rfc1951
}; };
} }
} }
} }

View File

@ -27,7 +27,6 @@ struct header
std::string name; std::string name;
std::string value; std::string value;
}; };
} }
} }
} }

View File

@ -38,7 +38,6 @@ class reply
std::string status_to_string(reply::status_type status); std::string status_to_string(reply::status_type status);
boost::asio::const_buffer status_to_buffer(reply::status_type status); boost::asio::const_buffer status_to_buffer(reply::status_type status);
}; };
} }
} }
} }

View File

@ -19,7 +19,6 @@ struct request
std::string agent; std::string agent;
boost::asio::ip::address endpoint; boost::asio::ip::address endpoint;
}; };
} }
} }
} }

View File

@ -35,7 +35,6 @@ class RequestHandler
private: private:
engine::OSRM *routing_machine; engine::OSRM *routing_machine;
}; };
} }
} }

View File

@ -17,7 +17,6 @@ namespace http
struct request; struct request;
} }
class RequestParser class RequestParser
{ {
public: public:
@ -71,7 +70,6 @@ class RequestParser
bool is_post_header; bool is_post_header;
int content_length; int content_length;
}; };
} }
} }

View File

@ -30,7 +30,8 @@ class Server
static std::shared_ptr<Server> static std::shared_ptr<Server>
CreateServer(std::string &ip_address, int ip_port, unsigned requested_num_threads) CreateServer(std::string &ip_address, int ip_port, unsigned requested_num_threads)
{ {
util::SimpleLogger().Write() << "http 1.1 compression handled by zlib version " << zlibVersion(); util::SimpleLogger().Write() << "http 1.1 compression handled by zlib version "
<< zlibVersion();
const unsigned hardware_threads = std::max(1u, std::thread::hardware_concurrency()); const unsigned hardware_threads = std::max(1u, std::thread::hardware_concurrency());
const unsigned real_num_threads = std::min(hardware_threads, requested_num_threads); const unsigned real_num_threads = std::min(hardware_threads, requested_num_threads);
return std::make_shared<Server>(ip_address, ip_port, real_num_threads); return std::make_shared<Server>(ip_address, ip_port, real_num_threads);
@ -93,7 +94,6 @@ class Server
std::shared_ptr<Connection> new_connection; std::shared_ptr<Connection> new_connection;
RequestHandler request_handler; RequestHandler request_handler;
}; };
} }
} }

View File

@ -90,7 +90,6 @@ inline bool CheckInBounds(const int A, const int B, const int range)
} }
} }
} }
} }
} }

View File

@ -290,7 +290,6 @@ class BinaryHeap
#endif #endif
} }
}; };
} }
} }

View File

@ -43,7 +43,6 @@ template <typename T, int Precision = 6> inline std::string to_string_with_preci
return rv; return rv;
} }
} }
} }
} }

View File

@ -16,7 +16,6 @@ struct ComputeAngle
const FixedPointCoordinate &second, const FixedPointCoordinate &second,
const FixedPointCoordinate &third) noexcept; const FixedPointCoordinate &third) noexcept;
}; };
} }
} }

View File

@ -53,7 +53,6 @@ double radToDeg(const double radian);
double bearing(const FixedPointCoordinate &first_coordinate, double bearing(const FixedPointCoordinate &first_coordinate,
const FixedPointCoordinate &second_coordinate); const FixedPointCoordinate &second_coordinate);
} }
} }
} }

View File

@ -258,7 +258,6 @@ bool GenerateDataStoreOptions(const int argc,
return true; return true;
} }
} }
} }

View File

@ -306,8 +306,7 @@ class DeallocatingVector
else else
{ // down-size { // down-size
const std::size_t number_of_necessary_buckets = 1 + (new_size / ELEMENTS_PER_BLOCK); const std::size_t number_of_necessary_buckets = 1 + (new_size / ELEMENTS_PER_BLOCK);
for (const auto bucket_index : for (const auto bucket_index : irange(number_of_necessary_buckets, bucket_list.size()))
irange(number_of_necessary_buckets, bucket_list.size()))
{ {
if (nullptr != bucket_list[bucket_index]) if (nullptr != bucket_list[bucket_index])
{ {
@ -378,7 +377,6 @@ void swap(DeallocatingVector<T, S> &lhs, DeallocatingVector<T, S> &rhs)
{ {
lhs.swap(rhs); lhs.swap(rhs);
} }
} }
} }

View File

@ -40,7 +40,6 @@ inline void DEBUG_SIGNAL(const NodeID /* node */,
} }
inline void DEBUG_TURNS_STOP() {} inline void DEBUG_TURNS_STOP() {}
} }
} }
@ -60,7 +59,6 @@ namespace osrm
namespace util namespace util
{ {
boost::filesystem::ofstream debug_geometry_file; boost::filesystem::ofstream debug_geometry_file;
bool dg_output_debug_geometry = false; bool dg_output_debug_geometry = false;
bool dg_first_debug_geometry = true; bool dg_first_debug_geometry = true;
@ -207,7 +205,6 @@ inline void DEBUG_TURNS_STOP()
dg_debug_turns_file.close(); dg_debug_turns_file.close();
} }
} }
} }
} }

View File

@ -62,7 +62,6 @@ template <typename T> class DistTableWrapper
std::vector<T> table_; std::vector<T> table_;
const std::size_t number_of_nodes_; const std::size_t number_of_nodes_;
}; };
} }
} }

View File

@ -320,7 +320,6 @@ template <typename EdgeDataT> class DynamicGraph
std::vector<Node> node_array; std::vector<Node> node_array;
DeallocatingVector<Edge> edge_list; DeallocatingVector<Edge> edge_list;
}; };
} }
} }

View File

@ -33,7 +33,6 @@ class FingerPrint
}; };
static_assert(std::is_trivial<FingerPrint>::value, "FingerPrint needs to be trivial."); static_assert(std::is_trivial<FingerPrint>::value, "FingerPrint needs to be trivial.");
} }
} }

View File

@ -187,7 +187,6 @@ class FixedPointNumber
}; };
static_assert(4 == sizeof(FixedPointNumber<1>), "FP19 has wrong size != 4"); static_assert(4 == sizeof(FixedPointNumber<1>), "FP19 has wrong size != 4");
} }
} }

View File

@ -16,7 +16,6 @@ template <typename FloatT> bool epsilon_compare(const FloatT number1, const Floa
static_assert(std::is_floating_point<FloatT>::value, "type must be floating point"); static_assert(std::is_floating_point<FloatT>::value, "type must be floating point");
return (std::abs(number1 - number2) < std::numeric_limits<FloatT>::epsilon()); return (std::abs(number1 - number2) < std::numeric_limits<FloatT>::epsilon());
} }
} }
} }

View File

@ -84,7 +84,8 @@ NodeID loadNodesFromFile(std::istream &input_stream,
extractor::ExternalMemoryNode current_node; extractor::ExternalMemoryNode current_node;
for (NodeID i = 0; i < n; ++i) for (NodeID i = 0; i < n; ++i)
{ {
input_stream.read(reinterpret_cast<char *>(&current_node), sizeof(extractor::ExternalMemoryNode)); input_stream.read(reinterpret_cast<char *>(&current_node),
sizeof(extractor::ExternalMemoryNode));
node_array.emplace_back(current_node.lat, current_node.lon, current_node.node_id); node_array.emplace_back(current_node.lat, current_node.lon, current_node.node_id);
if (current_node.barrier) if (current_node.barrier)
{ {
@ -106,7 +107,8 @@ NodeID loadNodesFromFile(std::istream &input_stream,
/** /**
* Reads a .osrm file and produces the edges. * Reads a .osrm file and produces the edges.
*/ */
NodeID loadEdgesFromFile(std::istream &input_stream, std::vector<extractor::NodeBasedEdge> &edge_list) NodeID loadEdgesFromFile(std::istream &input_stream,
std::vector<extractor::NodeBasedEdge> &edge_list)
{ {
EdgeID m; EdgeID m;
input_stream.read(reinterpret_cast<char *>(&m), sizeof(unsigned)); input_stream.read(reinterpret_cast<char *>(&m), sizeof(unsigned));
@ -196,7 +198,6 @@ unsigned readHSGRFromStream(const boost::filesystem::path &hsgr_file,
return number_of_nodes; return number_of_nodes;
} }
} }
} }

View File

@ -23,7 +23,6 @@ class HilbertCode
inline uint64_t BitInterleaving(const uint32_t a, const uint32_t b) const; inline uint64_t BitInterleaving(const uint32_t a, const uint32_t b) const;
inline void TransposeCoordinate(uint32_t *X) const; inline void TransposeCoordinate(uint32_t *X) const;
}; };
} }
} }

Some files were not shown because too many files have changed in this diff Show More