Upgrade formatting to clang-format 10 (#5895)

* Update formatting tools to clang-format-10

* Reformat using clang-format-10.0.09
This commit is contained in:
Daniel Patterson
2020-11-26 07:21:39 -08:00
committed by GitHub
parent a3f1c2afb0
commit 50d9632ed7
373 changed files with 1198 additions and 1163 deletions
+3 -2
View File
@@ -77,8 +77,9 @@ inline BisectionGraph makeBisectionGraph(const std::vector<util::Coordinate> &co
};
// create a bisection node, requires the ID of the node as well as the lower bound to its edges
const auto make_bisection_node = [&edges, &coordinates](
const std::size_t node_id, const auto begin_itr, const auto end_itr) {
const auto make_bisection_node = [&edges, &coordinates](const std::size_t node_id,
const auto begin_itr,
const auto end_itr) {
std::size_t range_begin = std::distance(edges.begin(), begin_itr);
std::size_t range_end = std::distance(edges.begin(), end_itr);
return BisectionGraph::NodeT(range_begin, range_end, coordinates[node_id], node_id);
@@ -17,7 +17,7 @@ using Partition = std::vector<CellID>;
std::tuple<std::vector<Partition>, std::vector<std::uint32_t>>
bisectionToPartition(const std::vector<BisectionID> &node_to_bisection_id,
const std::vector<std::size_t> &max_cell_sizes);
}
}
} // namespace partitioner
} // namespace osrm
#endif
+2 -2
View File
@@ -48,7 +48,7 @@ void printCellStatistics(const Partition &partition, const CellStorage &storage)
<< (2 * entries * sizeof(EdgeWeight)) << " bytes)";
}
}
}
}
} // namespace partitioner
} // namespace osrm
#endif
+13 -14
View File
@@ -45,7 +45,7 @@ template <storage::Ownership Ownership>
inline void write(storage::tar::FileWriter &writer,
const std::string &name,
const detail::CellStorageImpl<Ownership> &storage);
}
} // namespace serialization
namespace detail
{
@@ -102,10 +102,9 @@ template <storage::Ownership Ownership> class CellStorageImpl
{
using ValueT = decltype(*std::declval<ValuePtrT>());
typedef boost::iterator_facade<ColumnIterator<ValueT>,
ValueT,
boost::random_access_traversal_tag>
base_t;
typedef boost::
iterator_facade<ColumnIterator<ValueT>, ValueT, boost::random_access_traversal_tag>
base_t;
public:
typedef typename base_t::value_type value_type;
@@ -195,10 +194,10 @@ template <storage::Ownership Ownership> class CellStorageImpl
const NodeID *const all_sources,
const NodeID *const all_destinations)
: num_source_nodes{data.num_source_nodes},
num_destination_nodes{data.num_destination_nodes},
weights{all_weights + data.value_offset},
durations{all_durations + data.value_offset},
distances{all_distances + data.value_offset},
num_destination_nodes{data.num_destination_nodes}, weights{all_weights +
data.value_offset},
durations{all_durations + data.value_offset}, distances{all_distances +
data.value_offset},
source_boundary{all_sources + data.source_boundary_offset},
destination_boundary{all_destinations + data.destination_boundary_offset}
{
@@ -216,8 +215,8 @@ template <storage::Ownership Ownership> class CellStorageImpl
const NodeID *const all_destinations)
: num_source_nodes{data.num_source_nodes},
num_destination_nodes{data.num_destination_nodes}, weights{nullptr},
durations{nullptr}, distances{nullptr},
source_boundary{all_sources + data.source_boundary_offset},
durations{nullptr}, distances{nullptr}, source_boundary{all_sources +
data.source_boundary_offset},
destination_boundary{all_destinations + data.destination_boundary_offset}
{
BOOST_ASSERT(num_source_nodes == 0 || all_sources != nullptr);
@@ -451,8 +450,8 @@ template <storage::Ownership Ownership> class CellStorageImpl
Vector<CellData> cells;
Vector<std::uint64_t> level_to_cell_offset;
};
}
}
}
} // namespace detail
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITIONER_CUSTOMIZE_CELL_STORAGE_HPP
+2 -2
View File
@@ -53,7 +53,7 @@ struct DynamicEdgeBasedGraphEdge : DynamicEdgeBasedGraph::InputEdge
using Base = DynamicEdgeBasedGraph::InputEdge;
using Base::Base;
};
}
}
} // namespace partitioner
} // namespace osrm
#endif
+18 -18
View File
@@ -143,22 +143,22 @@ inline std::vector<extractor::EdgeBasedEdge>
graphToEdges(const DynamicEdgeBasedGraph &edge_based_graph)
{
auto range = tbb::blocked_range<NodeID>(0, edge_based_graph.GetNumberOfNodes());
auto max_turn_id =
tbb::parallel_reduce(range,
NodeID{0},
[&edge_based_graph](const auto range, NodeID initial) {
NodeID max_turn_id = initial;
for (auto node = range.begin(); node < range.end(); ++node)
{
for (auto edge : edge_based_graph.GetAdjacentEdgeRange(node))
{
const auto &data = edge_based_graph.GetEdgeData(edge);
max_turn_id = std::max(max_turn_id, data.turn_id);
}
}
return max_turn_id;
},
[](const NodeID lhs, const NodeID rhs) { return std::max(lhs, rhs); });
auto max_turn_id = tbb::parallel_reduce(
range,
NodeID{0},
[&edge_based_graph](const auto range, NodeID initial) {
NodeID max_turn_id = initial;
for (auto node = range.begin(); node < range.end(); ++node)
{
for (auto edge : edge_based_graph.GetAdjacentEdgeRange(node))
{
const auto &data = edge_based_graph.GetEdgeData(edge);
max_turn_id = std::max(max_turn_id, data.turn_id);
}
}
return max_turn_id;
},
[](const NodeID lhs, const NodeID rhs) { return std::max(lhs, rhs); });
std::vector<extractor::EdgeBasedEdge> edges(max_turn_id + 1);
tbb::parallel_for(range, [&](const auto range) {
@@ -198,7 +198,7 @@ inline DynamicEdgeBasedGraph LoadEdgeBasedGraph(const boost::filesystem::path &p
return DynamicEdgeBasedGraph(number_of_edge_based_nodes, std::move(tidied), checksum);
}
} // ns partition
} // ns osrm
} // namespace partitioner
} // namespace osrm
#endif
+3 -3
View File
@@ -96,8 +96,8 @@ inline void writeGraph(const boost::filesystem::path &path,
writer.WriteFrom("/mld/connectivity_checksum", connectivity_checksum);
serialization::write(writer, "/mld/multilevelgraph", graph);
}
}
}
}
} // namespace files
} // namespace partitioner
} // namespace osrm
#endif
+3 -3
View File
@@ -33,7 +33,7 @@ template <typename EdgeDataT, storage::Ownership Ownership>
void write(storage::tar::FileWriter &writer,
const std::string &name,
const MultiLevelGraph<EdgeDataT, Ownership> &graph);
}
} // namespace serialization
template <typename EdgeDataT, storage::Ownership Ownership>
class MultiLevelGraph : public util::StaticGraph<EdgeDataT, Ownership>
@@ -236,7 +236,7 @@ class MultiLevelGraph : public util::StaticGraph<EdgeDataT, Ownership>
using MultiLevelEdgeBasedGraph =
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
}
}
} // namespace partitioner
} // namespace osrm
#endif
@@ -41,7 +41,7 @@ template <storage::Ownership Ownership>
void write(storage::tar::FileWriter &writer,
const std::string &name,
const detail::MultiLevelPartitionImpl<Ownership> &mlp);
}
} // namespace serialization
namespace detail
{
@@ -338,8 +338,8 @@ inline MultiLevelPartitionImpl<storage::Ownership::View>::MultiLevelPartitionImp
: level_data(nullptr)
{
}
}
}
}
} // namespace detail
} // namespace partitioner
} // namespace osrm
#endif
+2 -2
View File
@@ -44,7 +44,7 @@ struct PartitionerConfig final : storage::IOConfig
std::size_t small_component_size;
std::vector<std::size_t> max_cell_sizes;
};
}
}
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITIONER_CONFIG_HPP
+2 -2
View File
@@ -109,7 +109,7 @@ std::size_t removeUnconnectedBoundaryNodes(const GraphT &edge_based_graph,
return num_unconnected;
}
}
}
} // namespace partitioner
} // namespace osrm
#endif
+2 -2
View File
@@ -49,7 +49,7 @@ void reorderFirstLast(RandomAccessRange &rng, std::size_t n, Compare comp)
return reorderFirstLast(begin(rng), end(rng), n, comp);
}
} // ns partition
} // ns osrm
} // namespace partitioner
} // namespace osrm
#endif
+3 -3
View File
@@ -65,8 +65,8 @@ inline void write(storage::tar::FileWriter &writer,
storage::serialization::write(
writer, name + "/level_to_cell_offset", storage.level_to_cell_offset);
}
}
}
}
} // namespace serialization
} // namespace partitioner
} // namespace osrm
#endif