Use nested namespace
It's a mechanical change to modernize the code base
This commit is contained in:
@@ -14,9 +14,7 @@
|
||||
#include <iterator>
|
||||
#include <utility>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
// Node in the bisection graph. We require the original node id (since we remap the nodes all the
|
||||
@@ -111,7 +109,6 @@ std::vector<BisectionInputEdge> adaptToBisectionEdge(std::vector<InputEdge> edge
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_PARTITIONER_BISECTION_GRAPH_HPP_
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
// Non-owning immutable sub-graph view into a base graph.
|
||||
@@ -64,7 +62,6 @@ class BisectionGraphView
|
||||
const BisectionGraph::ConstNodeIterator end;
|
||||
};
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_PARTITIONER_GRAPHVIEW_HPP_
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
using Partition = std::vector<CellID>;
|
||||
@@ -17,7 +15,6 @@ 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
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
template <typename Partition, typename CellStorage>
|
||||
void printCellStatistics(const Partition &partition, const CellStorage &storage)
|
||||
@@ -48,7 +46,6 @@ void printCellStatistics(const Partition &partition, const CellStorage &storage)
|
||||
<< (2 * entries * sizeof(EdgeWeight)) << " bytes)";
|
||||
}
|
||||
}
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@@ -448,7 +446,6 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
||||
Vector<std::uint64_t> level_to_cell_offset;
|
||||
};
|
||||
} // namespace detail
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_PARTITIONER_CUSTOMIZE_CELL_STORAGE_HPP
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
class DinicMaxFlow
|
||||
@@ -88,7 +86,6 @@ class DinicMaxFlow
|
||||
const std::size_t flow_value) const;
|
||||
};
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
// Implementation of Dinics [1] algorithm for max-flow/min-cut.
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
struct EdgeBasedGraphEdgeData : extractor::EdgeBasedEdge::EdgeData
|
||||
@@ -53,7 +51,6 @@ struct DynamicEdgeBasedGraphEdge : DynamicEdgeBasedGraph::InputEdge
|
||||
using Base = DynamicEdgeBasedGraph::InputEdge;
|
||||
using Base::Base;
|
||||
};
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,9 +21,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
// Bidirectional (s,t) to (s,t) and (t,s)
|
||||
@@ -198,7 +196,6 @@ inline DynamicEdgeBasedGraph LoadEdgeBasedGraph(const boost::filesystem::path &p
|
||||
return DynamicEdgeBasedGraph(number_of_edge_based_nodes, tidied, checksum);
|
||||
}
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
|
||||
#include "storage/io.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
{
|
||||
namespace files
|
||||
namespace osrm::partitioner::files
|
||||
{
|
||||
|
||||
// read .osrm.partition file
|
||||
@@ -96,8 +92,6 @@ 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
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
#include "partitioner/bisection_graph_view.hpp"
|
||||
#include "partitioner/dinic_max_flow.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
DinicMaxFlow::MinCut computeInertialFlowCut(const BisectionGraphView &view,
|
||||
@@ -14,7 +12,6 @@ DinicMaxFlow::MinCut computeInertialFlowCut(const BisectionGraphView &view,
|
||||
const double balance,
|
||||
const double source_sink_rate);
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_PARTITIONER_INERTIAL_FLOW_HPP_
|
||||
|
||||
@@ -15,10 +15,7 @@
|
||||
#include <boost/iterator/permutation_iterator.hpp>
|
||||
#include <boost/range/combine.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
template <typename EdgeDataT, storage::Ownership Ownership> class MultiLevelGraph;
|
||||
|
||||
@@ -236,7 +233,6 @@ class MultiLevelGraph : public util::StaticGraph<EdgeDataT, Ownership>
|
||||
|
||||
using MultiLevelEdgeBasedGraph =
|
||||
MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
|
||||
#include <boost/range/adaptor/reversed.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@@ -344,7 +342,6 @@ inline MultiLevelPartitionImpl<storage::Ownership::View>::MultiLevelPartitionImp
|
||||
{
|
||||
}
|
||||
} // namespace detail
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
#include "util/typedefs.hpp"
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
// forward declaration to allow finding friends
|
||||
@@ -156,7 +154,6 @@ template <typename NodeEntryT, typename EdgeEntryT> class RemappableGraph
|
||||
std::vector<EdgeT> edges;
|
||||
};
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_PARTITIONER_GRAPH_HPP_
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
|
||||
#include "partitioner/partitioner_config.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
// tool access to the recursive partitioner
|
||||
@@ -15,7 +13,6 @@ class Partitioner
|
||||
int Run(const PartitionerConfig &config);
|
||||
};
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_PARTITIONER_PARTITIONER_HPP_
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
|
||||
#include "storage/io_config.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
struct PartitionerConfig final : storage::IOConfig
|
||||
@@ -44,7 +42,6 @@ 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
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
class RecursiveBisection
|
||||
@@ -32,7 +30,6 @@ class RecursiveBisection
|
||||
RecursiveBisectionState internal_state;
|
||||
};
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_PARTITIONER_RECURSIVE_BISECTION_HPP_
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
#include "partitioner/bisection_graph_view.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
// Keeps track of the bisection ids, modifies the graph accordingly, splitting it into a left/right
|
||||
@@ -50,7 +48,6 @@ class RecursiveBisectionState
|
||||
std::vector<BisectionID> bisection_ids;
|
||||
};
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_PARTITIONER_RECURSIVE_BISECTION_STATE_HPP_
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
using Partition = std::vector<CellID>;
|
||||
|
||||
@@ -109,7 +107,6 @@ std::size_t removeUnconnectedBoundaryNodes(const GraphT &edge_based_graph,
|
||||
|
||||
return num_unconnected;
|
||||
}
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
#include "util/dynamic_graph.hpp"
|
||||
#include "util/static_graph.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
std::vector<std::uint32_t> makePermutation(const DynamicEdgeBasedGraph &graph,
|
||||
const std::vector<Partition> &partitions);
|
||||
@@ -93,7 +91,6 @@ inline void renumber(std::vector<extractor::StorageManeuverOverride> &maneuver_o
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
#include <cstddef>
|
||||
#include <iterator>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
// Reorders the first n elements in the range to satisfy the comparator,
|
||||
@@ -49,7 +47,6 @@ void reorderFirstLast(RandomAccessRange &rng, std::size_t n, Compare comp)
|
||||
return reorderFirstLast(begin(rng), end(rng), n, comp);
|
||||
}
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
#include "storage/shared_memory_ownership.hpp"
|
||||
#include "storage/tar.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
{
|
||||
namespace serialization
|
||||
namespace osrm::partitioner::serialization
|
||||
{
|
||||
|
||||
template <storage::Ownership Ownership>
|
||||
@@ -65,8 +61,6 @@ 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
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
#include "util/integer_range.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
namespace osrm::partitioner
|
||||
{
|
||||
|
||||
class TarjanGraphWrapper
|
||||
@@ -23,7 +21,6 @@ class TarjanGraphWrapper
|
||||
const BisectionGraph &bisection_graph;
|
||||
};
|
||||
|
||||
} // namespace partitioner
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_PARTITIONER_TARJAN_GRAPH_WRAPPER_HPP_
|
||||
|
||||
Reference in New Issue
Block a user