reformat
This commit is contained in:
parent
84ffedd95d
commit
b3ec9c9323
@ -72,9 +72,7 @@ class StaticRTree
|
||||
public:
|
||||
struct RectangleInt2D
|
||||
{
|
||||
RectangleInt2D() : min_lon(INT_MAX), max_lon(INT_MIN), min_lat(INT_MAX), max_lat(INT_MIN)
|
||||
{
|
||||
}
|
||||
RectangleInt2D() : min_lon(INT_MAX), max_lon(INT_MIN), min_lat(INT_MAX), max_lat(INT_MIN) {}
|
||||
|
||||
int32_t min_lon, max_lon;
|
||||
int32_t min_lat, max_lat;
|
||||
@ -207,9 +205,7 @@ class StaticRTree
|
||||
|
||||
struct TreeNode
|
||||
{
|
||||
TreeNode() : child_count(0), child_is_on_disk(false)
|
||||
{
|
||||
}
|
||||
TreeNode() : child_count(0), child_is_on_disk(false) {}
|
||||
RectangleT minimum_bounding_rectangle;
|
||||
uint32_t child_count : 31;
|
||||
bool child_is_on_disk : 1;
|
||||
@ -224,9 +220,7 @@ class StaticRTree
|
||||
{
|
||||
}
|
||||
|
||||
WrappedInputElement() : m_array_index(UINT_MAX), m_hilbert_value(0)
|
||||
{
|
||||
}
|
||||
WrappedInputElement() : m_array_index(UINT_MAX), m_hilbert_value(0) {}
|
||||
|
||||
uint32_t m_array_index;
|
||||
uint64_t m_hilbert_value;
|
||||
@ -239,9 +233,7 @@ class StaticRTree
|
||||
|
||||
struct LeafNode
|
||||
{
|
||||
LeafNode() : object_count(0)
|
||||
{
|
||||
}
|
||||
LeafNode() : object_count(0) {}
|
||||
uint32_t object_count;
|
||||
std::array<DataT, RTREE_LEAF_NODE_SIZE> objects;
|
||||
};
|
||||
@ -252,9 +244,7 @@ class StaticRTree
|
||||
: node_id(n_id), min_dist(dist)
|
||||
{
|
||||
}
|
||||
QueryCandidate() : node_id(UINT_MAX), min_dist(std::numeric_limits<double>::max())
|
||||
{
|
||||
}
|
||||
QueryCandidate() : node_id(UINT_MAX), min_dist(std::numeric_limits<double>::max()) {}
|
||||
uint32_t node_id;
|
||||
double min_dist;
|
||||
inline bool operator<(const QueryCandidate &other) const
|
||||
|
@ -97,8 +97,8 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
||||
BOOST_ASSERT_MSG(!m_coordinate_list->empty(), "coordinates must be loaded before r-tree");
|
||||
|
||||
RTreeNode *tree_ptr = (RTreeNode *)(shared_memory + data_layout->GetRSearchTreeOffset());
|
||||
m_static_rtree = std::make_shared<
|
||||
StaticRTree<RTreeLeaf, ShM<FixedPointCoordinate, true>::vector, true>>(
|
||||
m_static_rtree =
|
||||
std::make_shared<StaticRTree<RTreeLeaf, ShM<FixedPointCoordinate, true>::vector, true>>(
|
||||
tree_ptr, data_layout->r_search_tree_size, file_index_path, m_coordinate_list);
|
||||
}
|
||||
|
||||
|
19
prepare.cpp
19
prepare.cpp
@ -253,7 +253,8 @@ int main(int argc, char *argv[])
|
||||
speed_profile.has_turn_penalty_function = lua_function_exists(lua_state, "turn_function");
|
||||
|
||||
std::vector<ImportEdge> edge_list;
|
||||
NodeID number_of_node_based_nodes = readBinaryOSRMGraphFromStream(in,
|
||||
NodeID number_of_node_based_nodes =
|
||||
readBinaryOSRMGraphFromStream(in,
|
||||
edge_list,
|
||||
barrier_node_list,
|
||||
traffic_light_list,
|
||||
@ -276,8 +277,10 @@ int main(int argc, char *argv[])
|
||||
*/
|
||||
|
||||
SimpleLogger().Write() << "Generating edge-expanded graph representation";
|
||||
std::shared_ptr<NodeBasedDynamicGraph> node_based_graph = NodeBasedDynamicGraphFromImportEdges(number_of_node_based_nodes, edge_list);
|
||||
std::unique_ptr<RestrictionMap> restriction_map = std::unique_ptr<RestrictionMap>(new RestrictionMap(node_based_graph, restriction_list));
|
||||
std::shared_ptr<NodeBasedDynamicGraph> node_based_graph =
|
||||
NodeBasedDynamicGraphFromImportEdges(number_of_node_based_nodes, edge_list);
|
||||
std::unique_ptr<RestrictionMap> restriction_map =
|
||||
std::unique_ptr<RestrictionMap>(new RestrictionMap(node_based_graph, restriction_list));
|
||||
EdgeBasedGraphFactory *edge_based_graph_factor =
|
||||
new EdgeBasedGraphFactory(node_based_graph,
|
||||
std::move(restriction_map),
|
||||
@ -378,7 +381,8 @@ int main(int argc, char *argv[])
|
||||
max_used_node_id = std::max(max_used_node_id, edge.source);
|
||||
max_used_node_id = std::max(max_used_node_id, edge.target);
|
||||
}
|
||||
SimpleLogger().Write(logDEBUG) << "input graph has " << number_of_edge_based_nodes << " nodes";
|
||||
SimpleLogger().Write(logDEBUG) << "input graph has " << number_of_edge_based_nodes
|
||||
<< " nodes";
|
||||
SimpleLogger().Write(logDEBUG) << "contracted graph has " << max_used_node_id << " nodes";
|
||||
max_used_node_id += 1;
|
||||
|
||||
@ -436,8 +440,8 @@ int main(int argc, char *argv[])
|
||||
BOOST_ASSERT(current_edge.target < max_used_node_id);
|
||||
if (current_edge.data.distance <= 0)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "Edge: " << edge
|
||||
<< ",source: " << contracted_edge_list[edge].source
|
||||
SimpleLogger().Write(logWARNING)
|
||||
<< "Edge: " << edge << ",source: " << contracted_edge_list[edge].source
|
||||
<< ", target: " << contracted_edge_list[edge].target
|
||||
<< ", dist: " << current_edge.data.distance;
|
||||
|
||||
@ -465,7 +469,8 @@ int main(int argc, char *argv[])
|
||||
SimpleLogger().Write() << "Contraction: "
|
||||
<< (number_of_edge_based_nodes / contraction_duration.count())
|
||||
<< " nodes/sec and "
|
||||
<< number_of_used_edges / contraction_duration.count() << " edges/sec";
|
||||
<< number_of_used_edges / contraction_duration.count()
|
||||
<< " edges/sec";
|
||||
|
||||
node_array.clear();
|
||||
SimpleLogger().Write() << "finished preprocessing";
|
||||
|
Loading…
Reference in New Issue
Block a user