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,
// ArrayStorage<NodeID, NodeID>
// >;
using ContractorHeap =
util::BinaryHeap<NodeID, NodeID, int, ContractorHeapData, util::XORFastHashStorage<NodeID, NodeID>>;
using ContractorHeap = util::BinaryHeap<NodeID,
NodeID,
int,
ContractorHeapData,
util::XORFastHashStorage<NodeID, NodeID>>;
using ContractorEdge = ContractorGraph::InputEdge;
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;
// for(unsigned i = contractor_graph->BeginEdges(highestNode); i <
// contractor_graph->EndEdges(highestNode); ++i) {
@ -345,9 +349,10 @@ class Contractor
if (!flushed_contractor && (number_of_contracted_nodes >
static_cast<NodeID>(number_of_nodes * 0.65 * core_factor)))
{
util::DeallocatingVector<ContractorEdge> new_edge_set; // this one is not explicitely
// cleared since it goes out of
// scope anywa
util::DeallocatingVector<ContractorEdge>
new_edge_set; // this one is not explicitely
// cleared since it goes out of
// scope anywa
std::cout << " [flush " << number_of_contracted_nodes << " nodes] " << std::flush;
// Delete old heap data to free memory that we need for the coming operations
@ -595,7 +600,8 @@ class Contractor
// avgdegree /= 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 << ",
// quad: " << quaddegree;
@ -639,7 +645,8 @@ class Contractor
}
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();
}
@ -1067,7 +1074,6 @@ class Contractor
std::vector<bool> is_core_node;
util::XORFastHash fast_hash;
};
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -115,7 +115,8 @@ class SharedMemory
region = boost::interprocess::mapped_region(shm, boost::interprocess::read_write);
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);
remover.SetID(key);
util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size << " bytes";
util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size
<< " bytes";
}
}
@ -346,7 +348,7 @@ template <class LockFileT = OSRMLockFile> class SharedMemoryFactory_tmpl
catch (const boost::interprocess::interprocess_exception &e)
{
util::SimpleLogger().Write(logWARNING) << "caught exception: " << e.what() << ", code "
<< e.get_error_code();
<< e.get_error_code();
throw util::exception(e.what());
}
}
@ -356,7 +358,6 @@ template <class LockFileT = OSRMLockFile> class SharedMemoryFactory_tmpl
};
using SharedMemoryFactory = SharedMemoryFactory_tmpl<>;
}
}

View File

@ -96,14 +96,15 @@ void ApiResponseGenerator<DataFacadeT>::DescribeRoute(const RouteParameters &con
const InternalRouteResult &raw_route,
util::json::Object &json_result)
{
if( not raw_route.is_valid() ){
return;
if (not raw_route.is_valid())
{
return;
}
const constexpr bool ALLOW_SIMPLIFICATION = true;
const constexpr bool EXTRACT_ROUTE = false;
const constexpr bool EXTRACT_ALTERNATIVE = true;
Segments segment_list(raw_route, EXTRACT_ROUTE, config.zoom_level, ALLOW_SIMPLIFICATION,
facade);
facade);
json_result.values["route_summary"] = SummarizeRoute(raw_route, segment_list);
json_result.values["via_points"] = ListViaPoints(raw_route);
json_result.values["via_indices"] = ListViaIndices(segment_list);
@ -125,7 +126,7 @@ void ApiResponseGenerator<DataFacadeT>::DescribeRoute(const RouteParameters &con
if (raw_route.has_alternative())
{
Segments alternate_segment_list(raw_route, EXTRACT_ALTERNATIVE, config.zoom_level,
ALLOW_SIMPLIFICATION, facade);
ALLOW_SIMPLIFICATION, facade);
// Alternative Route Summaries are stored in an array to (down the line) allow multiple
// alternatives
@ -140,7 +141,8 @@ void ApiResponseGenerator<DataFacadeT>::DescribeRoute(const RouteParameters &con
auto alternate_geometry_string =
GetGeometry(config.compression, alternate_segment_list);
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;
}
@ -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;
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["total_time"] = segment_list.GetDuration();
@ -217,8 +220,10 @@ ApiResponseGenerator<DataFacadeT>::ListViaPoints(const InternalRouteResult &raw_
{
std::string tmp;
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.lon / COORDINATE_PRECISION);
json_coordinate.values.emplace_back(nodes.target_phantom.location.lat /
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));
}
return json_via_points_array;
@ -235,7 +240,8 @@ ApiResponseGenerator<DataFacadeT>::ListViaIndices(const Segments &segment_list)
}
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)
return PolylineFormatter().printEncodedString(segments.Get());
@ -284,11 +290,12 @@ ApiResponseGenerator<DataFacadeT>::BuildHintData(const InternalRouteResult &raw_
}
template <typename DataFacadeT>
ApiResponseGenerator<DataFacadeT> MakeApiResponseGenerator(DataFacadeT *facade){
return ApiResponseGenerator<DataFacadeT>(facade);
ApiResponseGenerator<DataFacadeT> MakeApiResponseGenerator(DataFacadeT *facade)
{
return ApiResponseGenerator<DataFacadeT>(facade);
}
} // namespace engine
} // namespace osrm
#endif //ENGINE_GUIDANCE_API_RESPONSE_GENERATOR_HPP_
#endif // ENGINE_GUIDANCE_API_RESPONSE_GENERATOR_HPP_

View File

@ -85,10 +85,10 @@ template <class EdgeDataT> class BaseDataFacade
const int bearing = 0,
const int bearing_range = 180) = 0;
virtual std::pair<PhantomNode, PhantomNode>
NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0,
const int bearing_range = 180) = 0;
virtual std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0,
const int bearing_range = 180) = 0;
virtual unsigned GetCheckSum() const = 0;
@ -102,7 +102,6 @@ template <class EdgeDataT> class BaseDataFacade
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 InputEdge = typename QueryGraph::InputEdge;
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>;
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 != edge_list.size(), "edge list empty");
util::SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and " << edge_list.size()
<< " edges";
util::SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and "
<< edge_list.size() << " edges";
m_query_graph = std::unique_ptr<QueryGraph>(new QueryGraph(node_list, edge_list));
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)
{
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).lon) >> 30) == 0);
}
@ -140,7 +142,8 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
extractor::OriginalEdgeData current_edge_data;
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_name_ID_list[i] = current_edge_data.name_id;
m_turn_instruction_list[i] = current_edge_data.turn_instruction;
@ -371,10 +374,10 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
bearing_range);
}
std::pair<PhantomNode, PhantomNode>
NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0,
const int bearing_range = 180) override final
std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0,
const int bearing_range = 180) override final
{
if (!m_static_rtree.get())
{
@ -444,7 +447,6 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
std::string GetTimestamp() const override final { return m_timestamp; }
};
}
}
}

View File

@ -36,7 +36,6 @@ struct SharedBarriers
// Is there any query?
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 InputEdge = typename QueryGraph::InputEdge;
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 TimeStampedRTreePair = std::pair<unsigned, std::shared_ptr<SharedRTree>>;
using RTreeNode = typename SharedRTree::TreeNode;
@ -125,19 +126,22 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
void LoadNodeAndEdgeInformation()
{
util::FixedPointCoordinate *coordinate_list_ptr = data_layout->GetBlockPtr<util::FixedPointCoordinate>(
shared_memory, SharedDataLayout::COORDINATE_LIST);
util::FixedPointCoordinate *coordinate_list_ptr =
data_layout->GetBlockPtr<util::FixedPointCoordinate>(shared_memory,
SharedDataLayout::COORDINATE_LIST);
m_coordinate_list = util::make_unique<util::ShM<util::FixedPointCoordinate, true>::vector>(
coordinate_list_ptr, data_layout->num_entries[SharedDataLayout::COORDINATE_LIST]);
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(
travel_mode_list_ptr, data_layout->num_entries[SharedDataLayout::TRAVEL_MODE]);
m_travel_mode_list.swap(travel_mode_list);
extractor::TurnInstruction *turn_instruction_list_ptr = data_layout->GetBlockPtr<extractor::TurnInstruction>(
shared_memory, SharedDataLayout::TURN_INSTRUCTION);
extractor::TurnInstruction *turn_instruction_list_ptr =
data_layout->GetBlockPtr<extractor::TurnInstruction>(
shared_memory, SharedDataLayout::TURN_INSTRUCTION);
typename util::ShM<extractor::TurnInstruction, true>::vector turn_instruction_list(
turn_instruction_list_ptr,
data_layout->num_entries[SharedDataLayout::TURN_INSTRUCTION]);
@ -258,7 +262,8 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
file_index_path = boost::filesystem::path(file_index_ptr);
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. "
"Is any data loaded into shared memory?");
}
@ -397,10 +402,10 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
bearing_range);
}
std::pair<PhantomNode, PhantomNode>
NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0,
const int bearing_range = 180) override final
std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0,
const int bearing_range = 180) override final
{
if (!m_static_rtree.get() || CURRENT_TIMESTAMP != m_static_rtree->first)
{
@ -452,7 +457,6 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
std::string GetTimestamp() const override final { return m_timestamp; }
};
}
}
}

View File

@ -54,41 +54,41 @@ struct SharedDataLayout
void PrintInformation() const
{
util::SimpleLogger().Write(logDEBUG) << "NAME_OFFSETS "
<< ": " << GetBlockSize(NAME_OFFSETS);
<< ": " << GetBlockSize(NAME_OFFSETS);
util::SimpleLogger().Write(logDEBUG) << "NAME_BLOCKS "
<< ": " << GetBlockSize(NAME_BLOCKS);
<< ": " << GetBlockSize(NAME_BLOCKS);
util::SimpleLogger().Write(logDEBUG) << "NAME_CHAR_LIST "
<< ": " << GetBlockSize(NAME_CHAR_LIST);
<< ": " << GetBlockSize(NAME_CHAR_LIST);
util::SimpleLogger().Write(logDEBUG) << "NAME_ID_LIST "
<< ": " << GetBlockSize(NAME_ID_LIST);
<< ": " << GetBlockSize(NAME_ID_LIST);
util::SimpleLogger().Write(logDEBUG) << "VIA_NODE_LIST "
<< ": " << GetBlockSize(VIA_NODE_LIST);
<< ": " << GetBlockSize(VIA_NODE_LIST);
util::SimpleLogger().Write(logDEBUG) << "GRAPH_NODE_LIST "
<< ": " << GetBlockSize(GRAPH_NODE_LIST);
<< ": " << GetBlockSize(GRAPH_NODE_LIST);
util::SimpleLogger().Write(logDEBUG) << "GRAPH_EDGE_LIST "
<< ": " << GetBlockSize(GRAPH_EDGE_LIST);
<< ": " << GetBlockSize(GRAPH_EDGE_LIST);
util::SimpleLogger().Write(logDEBUG) << "COORDINATE_LIST "
<< ": " << GetBlockSize(COORDINATE_LIST);
<< ": " << GetBlockSize(COORDINATE_LIST);
util::SimpleLogger().Write(logDEBUG) << "TURN_INSTRUCTION "
<< ": " << GetBlockSize(TURN_INSTRUCTION);
<< ": " << GetBlockSize(TURN_INSTRUCTION);
util::SimpleLogger().Write(logDEBUG) << "TRAVEL_MODE "
<< ": " << GetBlockSize(TRAVEL_MODE);
<< ": " << GetBlockSize(TRAVEL_MODE);
util::SimpleLogger().Write(logDEBUG) << "R_SEARCH_TREE "
<< ": " << GetBlockSize(R_SEARCH_TREE);
<< ": " << GetBlockSize(R_SEARCH_TREE);
util::SimpleLogger().Write(logDEBUG) << "GEOMETRIES_INDEX "
<< ": " << GetBlockSize(GEOMETRIES_INDEX);
<< ": " << GetBlockSize(GEOMETRIES_INDEX);
util::SimpleLogger().Write(logDEBUG) << "GEOMETRIES_LIST "
<< ": " << GetBlockSize(GEOMETRIES_LIST);
<< ": " << GetBlockSize(GEOMETRIES_LIST);
util::SimpleLogger().Write(logDEBUG) << "GEOMETRIES_INDICATORS"
<< ": " << GetBlockSize(GEOMETRIES_INDICATORS);
<< ": " << GetBlockSize(GEOMETRIES_INDICATORS);
util::SimpleLogger().Write(logDEBUG) << "HSGR_CHECKSUM "
<< ": " << GetBlockSize(HSGR_CHECKSUM);
<< ": " << GetBlockSize(HSGR_CHECKSUM);
util::SimpleLogger().Write(logDEBUG) << "TIMESTAMP "
<< ": " << GetBlockSize(TIMESTAMP);
<< ": " << GetBlockSize(TIMESTAMP);
util::SimpleLogger().Write(logDEBUG) << "FILE_INDEX_PATH "
<< ": " << GetBlockSize(FILE_INDEX_PATH);
<< ": " << GetBlockSize(FILE_INDEX_PATH);
util::SimpleLogger().Write(logDEBUG) << "CORE_MARKER "
<< ": " << GetBlockSize(CORE_MARKER);
<< ": " << GetBlockSize(CORE_MARKER);
}
template <typename T> inline void SetBlockSize(BlockID bid, uint64_t entries)
@ -171,7 +171,6 @@ struct SharedDataTimestamp
SharedDataType data;
unsigned timestamp;
};
}
}
}

View File

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

View File

@ -77,10 +77,10 @@ template <typename RTreeT> class GeospatialQuery
// 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.
std::pair<PhantomNode, PhantomNode>
NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0,
const int bearing_range = 180)
std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
const util::FixedPointCoordinate &input_coordinate,
const int bearing = 0,
const int bearing_range = 180)
{
bool has_small_component = false;
bool has_big_component = false;
@ -139,9 +139,10 @@ template <typename RTreeT> class GeospatialQuery
{
util::FixedPointCoordinate point_on_segment;
double ratio;
const auto current_perpendicular_distance = util::coordinate_calculation::perpendicularDistance(
coordinates->at(data.u), coordinates->at(data.v), input_coordinate, point_on_segment,
ratio);
const auto current_perpendicular_distance =
util::coordinate_calculation::perpendicularDistance(
coordinates->at(data.u), coordinates->at(data.v), input_coordinate,
point_on_segment, ratio);
auto transformed = PhantomNodeWithDistance{PhantomNode{data, point_on_segment},
current_perpendicular_distance};
@ -163,8 +164,8 @@ template <typename RTreeT> class GeospatialQuery
const int filter_bearing,
const int filter_bearing_range)
{
const double forward_edge_bearing =
util::coordinate_calculation::bearing(coordinates->at(segment.u), coordinates->at(segment.v));
const double forward_edge_bearing = util::coordinate_calculation::bearing(
coordinates->at(segment.u), coordinates->at(segment.v));
const double backward_edge_bearing = (forward_edge_bearing + 180) > 360
? (forward_edge_bearing - 180)
@ -172,11 +173,11 @@ template <typename RTreeT> class GeospatialQuery
const bool forward_bearing_valid =
util::bearing::CheckInBounds(std::round(forward_edge_bearing), filter_bearing,
filter_bearing_range) &&
filter_bearing_range) &&
segment.forward_edge_based_node_id != SPECIAL_NODEID;
const bool backward_bearing_valid =
util::bearing::CheckInBounds(std::round(backward_edge_bearing), filter_bearing,
filter_bearing_range) &&
filter_bearing_range) &&
segment.reverse_edge_based_node_id != SPECIAL_NODEID;
return std::make_pair(forward_bearing_valid, backward_bearing_valid);
}
@ -184,7 +185,6 @@ template <typename RTreeT> class GeospatialQuery
RTreeT &rtree;
const std::shared_ptr<CoordinateList> coordinates;
};
}
}

View File

@ -63,4 +63,4 @@ inline void CombineSimilarSegments(std::vector<SegmentInformation> &segments)
} // namespace engine
} // namespace osrm
#endif //ENGINE_GUIDANCE_PROCESSING_SEGMENT_COMPRESSION_HPP_
#endif // ENGINE_GUIDANCE_PROCESSING_SEGMENT_COMPRESSION_HPP_

View File

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

View File

@ -21,13 +21,13 @@ namespace engine
{
namespace guidance
{
template< typename DataFacadeT >
inline util::json::Array
AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT* facade)
template <typename DataFacadeT>
inline util::json::Array AnnotateRoute(const std::vector<SegmentInformation> &route_segments,
DataFacadeT *facade)
{
util::json::Array json_instruction_array;
if( route_segments.empty() )
return json_instruction_array;
if (route_segments.empty())
return json_instruction_array;
// Segment information has following format:
//["instruction id","streetname",length,position,time,"length","earth_direction",azimuth]
std::int32_t necessary_segments_running_index = 0;
@ -42,7 +42,7 @@ AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT
round_about = {std::numeric_limits<std::int32_t>::max(), 0, 0};
std::string temp_dist, temp_length, temp_duration, temp_bearing, temp_instruction;
//Generate annotations for every segment
// Generate annotations for every segment
for (const SegmentInformation &segment : route_segments)
{
util::json::Array json_instruction_row;
@ -59,8 +59,8 @@ AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT
std::string current_turn_instruction;
if (extractor::TurnInstruction::LeaveRoundAbout == current_instruction)
{
temp_instruction =
std::to_string(util::cast::enum_to_underlying(extractor::TurnInstruction::EnterRoundAbout));
temp_instruction = std::to_string(util::cast::enum_to_underlying(
extractor::TurnInstruction::EnterRoundAbout));
current_turn_instruction += temp_instruction;
current_turn_instruction += "-";
temp_instruction = std::to_string(round_about.leave_at_exit + 1);
@ -110,9 +110,9 @@ AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT
}
util::json::Array json_last_instruction_row;
temp_instruction =
std::to_string(util::cast::enum_to_underlying(extractor::TurnInstruction::ReachedYourDestination));
json_last_instruction_row.values.emplace_back( std::move(temp_instruction));
temp_instruction = std::to_string(
util::cast::enum_to_underlying(extractor::TurnInstruction::ReachedYourDestination));
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(0);
json_last_instruction_row.values.push_back(necessary_segments_running_index - 1);

View File

@ -19,7 +19,8 @@ struct PathData
{
PathData()
: 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 negative_apriori_probability;
};
}
}
}

View File

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

View File

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

View File

@ -34,7 +34,8 @@ struct 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;
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;
return out;
}
}
}

View File

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

View File

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

View File

@ -37,7 +37,9 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
using SubMatching = routing_algorithms::SubMatching;
using SubMatchingList = routing_algorithms::SubMatchingList;
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;
public:
@ -203,13 +205,13 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
if (route_parameters.geometry || route_parameters.print_instructions)
{
using SegmentList = guidance::SegmentList<DataFacadeT>;
//Passing false to extract_alternative extracts the route.
// Passing false to extract_alternative extracts the route.
const constexpr bool EXTRACT_ROUTE = false;
// by passing false to segment_list, we skip the douglas peucker simplification
// and mark all segments as necessary within the generation process
const constexpr bool NO_ROUTE_SIMPLIFICATION = false;
SegmentList segment_list(raw_route, EXTRACT_ROUTE, route_parameters.zoom_level,
NO_ROUTE_SIMPLIFICATION, facade);
NO_ROUTE_SIMPLIFICATION, facade);
if (route_parameters.geometry)
{
@ -220,8 +222,7 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
if (route_parameters.print_instructions)
{
subtrace.values["instructions"] =
guidance::AnnotateRoute<DataFacadeT>(
segment_list.Get(), facade);
guidance::AnnotateRoute<DataFacadeT>(segment_list.Get(), facade);
}
util::json::Object json_route_summary;
@ -379,7 +380,6 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
int max_locations_map_matching;
ClassifierT classifier;
};
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -25,7 +25,6 @@ class PolylineCompressor
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;
};
}
}

View File

@ -28,7 +28,7 @@ template <class DataFacadeT, class SegmentT> struct ExtractRouteNames
const unsigned blocked_name_id) const
{
SegmentT result_segment;
result_segment.name_id = blocked_name_id; //make sure we get a valid name
result_segment.name_id = blocked_name_id; // make sure we get a valid name
result_segment.length = 0;
for (const SegmentT &segment : segment_list)
@ -139,7 +139,6 @@ template <class DataFacadeT, class SegmentT> struct ExtractRouteNames
return route_names;
}
};
}
}

View File

@ -564,7 +564,8 @@ class AlternativeRouting final
const NodeID node = forward_heap.DeleteMin();
const int distance = forward_heap.GetKey(node);
// 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;
const int scaled_distance =
@ -588,10 +589,12 @@ class AlternativeRouting final
{
*middle_node = node;
*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;
// } else {
// util::SimpleLogger().Write() << "discarded middle_node " << *middle_node << "
// util::SimpleLogger().Write() << "discarded middle_node " << *middle_node
// << "
// at distance " << new_distance;
}
}
@ -846,7 +849,6 @@ class AlternativeRouting final
return (upper_bound <= t_test_path_length);
}
};
}
}
}

View File

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

View File

@ -147,8 +147,8 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching<
}
else
{
trace_split = trace_split || (t - prev_unbroken_timestamps.back() >
MAX_BROKEN_STATES);
trace_split =
trace_split || (t - prev_unbroken_timestamps.back() > MAX_BROKEN_STATES);
}
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_coordinate = trace_coordinates[t];
const auto haversine_distance =
util::coordinate_calculation::haversineDistance(prev_coordinate, current_coordinate);
const auto haversine_distance = util::coordinate_calculation::haversineDistance(
prev_coordinate, current_coordinate);
// compute d_t for this timestamp and the next one
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_lengths[s_prime] = network_distance;
current_pruned[s_prime] = false;
current_suspicious[s_prime] =
d_t > SUSPICIOUS_DISTANCE_DELTA;
current_suspicious[s_prime] = d_t > SUSPICIOUS_DISTANCE_DELTA;
model.breakage[t] = false;
}
}
@ -355,7 +354,6 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching<
matching_debug.add_breakage(model.breakage);
}
};
}
}
}

View File

@ -25,7 +25,6 @@ SearchEngineData::SearchEngineHeapPtr SearchEngineData::reverse_heap_3;
namespace routing_algorithms
{
template <class DataFacadeT, class Derived> class BasicRoutingInterface
{
private:
@ -231,7 +230,8 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
{
BOOST_ASSERT_MSG(!ed.shortcut, "original edge flagged as shortcut");
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);
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)
{
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().segment_duration = ed.distance;
@ -304,9 +305,10 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
{
BOOST_ASSERT(i < id_vector.size());
BOOST_ASSERT(phantom_node_pair.target_phantom.forward_travel_mode > 0);
unpacked_path.emplace_back(PathData{
id_vector[i], phantom_node_pair.target_phantom.name_id, extractor::TurnInstruction::NoTurn,
0, phantom_node_pair.target_phantom.forward_travel_mode});
unpacked_path.emplace_back(
PathData{id_vector[i], phantom_node_pair.target_phantom.name_id,
extractor::TurnInstruction::NoTurn, 0,
phantom_node_pair.target_phantom.forward_travel_mode});
}
}
@ -658,16 +660,15 @@ template <class DataFacadeT, class Derived> class BasicRoutingInterface
{
current_coordinate = facade->GetCoordinateOfNode(p.node);
distance += util::coordinate_calculation::haversineDistance(previous_coordinate,
current_coordinate);
current_coordinate);
previous_coordinate = current_coordinate;
}
distance += util::coordinate_calculation::haversineDistance(previous_coordinate,
target_phantom.location);
target_phantom.location);
}
return distance;
}
};
}
}
}

View File

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

View File

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

View File

@ -19,7 +19,8 @@ struct HeapData
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>;
static SearchEngineHeapPtr forward_heap_1;
@ -35,7 +36,6 @@ struct SearchEngineData
void InitializeOrClearThirdThreadLocalStorage(const unsigned number_of_nodes);
};
}
}

View File

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

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");
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;
}
}
}
}

View File

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

View File

@ -43,7 +43,6 @@ class CompressedEdgeContainer
std::vector<unsigned> m_free_list;
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,
std::vector<OriginalEdgeData> &original_edge_data_vector) const;
};
}
}

View File

@ -59,7 +59,7 @@ struct EdgeBasedNode
}
static inline util::FixedPointCoordinate Centroid(const util::FixedPointCoordinate &a,
const util::FixedPointCoordinate &b)
const util::FixedPointCoordinate &b)
{
util::FixedPointCoordinate centroid;
// The coordinates of the midpoint are given by:
@ -89,7 +89,6 @@ struct EdgeBasedNode
TravelMode forward_travel_mode : 4;
TravelMode backward_travel_mode : 4;
};
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -51,7 +51,6 @@ class ExtractorCallbacks
// warning: caller needs to take care of synchronization!
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);
};
}
}

View File

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

View File

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

View File

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

View File

@ -152,7 +152,6 @@ struct CmpEdgeByOSMTargetID
value_type max_value() { return InternalExtractorEdge::max_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 min_value() { return MIN_OSM_NODEID; }
};
}
}

View File

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

View File

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

View File

@ -149,7 +149,6 @@ class SourceContainer
std::vector<RasterSource> LoadedSources;
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 min_value() const { return InputRestrictionContainer::min_value(); }
};
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -147,7 +147,7 @@ template <typename GraphT> class TarjanSCC
if (size_of_current_component > 1000)
{
util::SimpleLogger().Write() << "large component [" << component_index
<< "]=" << size_of_current_component;
<< "]=" << size_of_current_component;
}
++component_index;
@ -178,7 +178,6 @@ template <typename GraphT> class TarjanSCC
unsigned get_component_id(const NodeID node) const { return components_index[node]; }
};
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -38,7 +38,6 @@ class reply
std::string status_to_string(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;
boost::asio::ip::address endpoint;
};
}
}
}

View File

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

View File

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

View File

@ -30,7 +30,8 @@ class Server
static std::shared_ptr<Server>
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 real_num_threads = std::min(hardware_threads, requested_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;
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
}
};
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -95,7 +95,7 @@ template <typename EdgeDataT> class DynamicGraph
for (const auto node : irange(0u, number_of_nodes))
{
for (const auto i : irange(node_array[node].first_edge,
node_array[node].first_edge + node_array[node].edges))
node_array[node].first_edge + node_array[node].edges))
{
edge_list[i].target = graph[edge].target;
BOOST_ASSERT(edge_list[i].target < number_of_nodes);
@ -320,7 +320,6 @@ template <typename EdgeDataT> class DynamicGraph
std::vector<Node> node_array;
DeallocatingVector<Edge> edge_list;
};
}
}

View File

@ -33,7 +33,6 @@ class FingerPrint
};
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");
}
}

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");
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;
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);
if (current_node.barrier)
{
@ -106,7 +107,8 @@ NodeID loadNodesFromFile(std::istream &input_stream,
/**
* 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;
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;
}
}
}

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