Rename namespace partition to partitioner

Rename module partition to partitioner.
This cultivates naming used in existing modules like extractor,
customizer, etc. - noun vs verb (word partition is both though).
This commit is contained in:
Mateusz Loskot 2018-02-01 16:47:43 +01:00 committed by Patrick Niklaus
parent 03f598b93d
commit 8114104a43
61 changed files with 308 additions and 305 deletions

View File

@ -431,7 +431,7 @@ script:
- ./unit_tests/engine-tests
- ./unit_tests/util-tests
- ./unit_tests/server-tests
- ./unit_tests/partition-tests
- ./unit_tests/partitioner-tests
- |
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
npm run nodejs-tests

View File

@ -126,7 +126,7 @@ configure_file(
)
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
file(GLOB PartitionerGlob src/partition/*.cpp)
file(GLOB PartitionerGlob src/partitioner/*.cpp)
file(GLOB CustomizerGlob src/customize/*.cpp)
file(GLOB ContractorGlob src/contractor/*.cpp)
file(GLOB UpdaterGlob src/updater/*.cpp)
@ -723,14 +723,14 @@ file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/approach.hpp include/engine/phantom_node.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp include/util/bearing.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/storage/io_config.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
set(PartitionerHeader include/partition/partitioner.hpp include/partition/partition_config.hpp)
set(PartitionerHeader include/partitioner/partitioner.hpp include/partitioner/partitioner_config.hpp)
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
set(StorageHeader include/storage/storage.hpp include/storage/io_config.hpp include/storage/storage_config.hpp)
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partition)
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partitioner)
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
install(FILES ${LibraryGlob} DESTINATION include/osrm)
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)

View File

@ -1,8 +1,8 @@
#ifndef OSRM_CELLS_CUSTOMIZER_HPP
#define OSRM_CELLS_CUSTOMIZER_HPP
#include "partition/cell_storage.hpp"
#include "partition/multi_level_partition.hpp"
#include "partitioner/cell_storage.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "util/query_heap.hpp"
#include <tbb/enumerable_thread_specific.h>
@ -29,12 +29,12 @@ class CellCustomizer
util::QueryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::ArrayStorage<NodeID, int>>;
using HeapPtr = tbb::enumerable_thread_specific<Heap>;
CellCustomizer(const partition::MultiLevelPartition &partition) : partition(partition) {}
CellCustomizer(const partitioner::MultiLevelPartition &partition) : partition(partition) {}
template <typename GraphT>
void Customize(const GraphT &graph,
Heap &heap,
const partition::CellStorage &cells,
const partitioner::CellStorage &cells,
const std::vector<bool> &allowed_nodes,
CellMetric &metric,
LevelID level,
@ -97,7 +97,7 @@ class CellCustomizer
template <typename GraphT>
void Customize(const GraphT &graph,
const partition::CellStorage &cells,
const partitioner::CellStorage &cells,
const std::vector<bool> &allowed_nodes,
CellMetric &metric) const
{
@ -121,7 +121,7 @@ class CellCustomizer
private:
template <typename GraphT>
void RelaxNode(const GraphT &graph,
const partition::CellStorage &cells,
const partitioner::CellStorage &cells,
const std::vector<bool> &allowed_nodes,
const CellMetric &metric,
Heap &heap,
@ -209,7 +209,7 @@ class CellCustomizer
}
}
const partition::MultiLevelPartition &partition;
const partitioner::MultiLevelPartition &partition;
};
}
}

View File

@ -2,8 +2,8 @@
#define OSRM_CUSTOMIZE_EDGE_BASED_GRAPH_HPP
#include "extractor/edge_based_edge.hpp"
#include "partition/edge_based_graph.hpp"
#include "partition/multi_level_graph.hpp"
#include "partitioner/edge_based_graph.hpp"
#include "partitioner/multi_level_graph.hpp"
#include "util/static_graph.hpp"
#include "util/typedefs.hpp"
@ -16,19 +16,20 @@ namespace osrm
namespace customizer
{
using EdgeBasedGraphEdgeData = partition::EdgeBasedGraphEdgeData;
using EdgeBasedGraphEdgeData = partitioner::EdgeBasedGraphEdgeData;
struct MultiLevelEdgeBasedGraph
: public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>
: public partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>
{
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
using Base =
partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>;
using Base::Base;
};
struct MultiLevelEdgeBasedGraphView
: public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>
: public partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>
{
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
using Base = partitioner::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::View>;
using Base::Base;
};

View File

@ -1,7 +1,7 @@
#ifndef OSRM_CUSTOMIZER_SERIALIZATION_HPP
#define OSRM_CUSTOMIZER_SERIALIZATION_HPP
#include "partition/cell_storage.hpp"
#include "partitioner/cell_storage.hpp"
#include "storage/io.hpp"
#include "storage/serialization.hpp"

View File

@ -5,8 +5,8 @@
#include "extractor/edge_based_edge.hpp"
#include "engine/algorithm.hpp"
#include "partition/cell_storage.hpp"
#include "partition/multi_level_partition.hpp"
#include "partitioner/cell_storage.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "util/filtered_graph.hpp"
#include "util/integer_range.hpp"
@ -75,9 +75,9 @@ template <> class AlgorithmDataFacade<MLD>
virtual EdgeRange GetAdjacentEdgeRange(const NodeID node) const = 0;
virtual const partition::MultiLevelPartitionView &GetMultiLevelPartition() const = 0;
virtual const partitioner::MultiLevelPartitionView &GetMultiLevelPartition() const = 0;
virtual const partition::CellStorageView &GetCellStorage() const = 0;
virtual const partitioner::CellStorageView &GetCellStorage() const = 0;
virtual const customizer::CellMetricView &GetCellMetric() const = 0;

View File

@ -24,8 +24,8 @@
#include "contractor/query_graph.hpp"
#include "partition/cell_storage.hpp"
#include "partition/multi_level_partition.hpp"
#include "partitioner/cell_storage.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "storage/shared_datatype.hpp"
#include "storage/shared_memory_ownership.hpp"
@ -912,8 +912,8 @@ class ContiguousInternalMemoryDataFacade<CH>
template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public AlgorithmDataFacade<MLD>
{
// MLD data
partition::MultiLevelPartitionView mld_partition;
partition::CellStorageView mld_cell_storage;
partitioner::MultiLevelPartitionView mld_partition;
partitioner::CellStorageView mld_cell_storage;
customizer::CellMetricView mld_cell_metric;
using QueryGraph = customizer::MultiLevelEdgeBasedGraphView;
using GraphNode = QueryGraph::NodeArrayEntry;
@ -939,7 +939,7 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_CELL_TO_CHILDREN) > 0);
auto level_data =
data_layout.GetBlockPtr<partition::MultiLevelPartitionView::LevelData>(
data_layout.GetBlockPtr<partitioner::MultiLevelPartitionView::LevelData>(
memory_block, storage::DataLayout::MLD_LEVEL_DATA);
auto mld_partition_ptr = data_layout.GetBlockPtr<PartitionID>(
@ -955,7 +955,7 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
util::vector_view<CellID> cell_to_children(mld_chilren_ptr, children_entries_count);
mld_partition =
partition::MultiLevelPartitionView{level_data, partition, cell_to_children};
partitioner::MultiLevelPartitionView{level_data, partition, cell_to_children};
}
const auto weights_block_id = static_cast<storage::DataLayout::BlockID>(
@ -988,7 +988,7 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
memory_block, storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
auto mld_destination_boundary_ptr = data_layout.GetBlockPtr<NodeID>(
memory_block, storage::DataLayout::MLD_CELL_DESTINATION_BOUNDARY);
auto mld_cells_ptr = data_layout.GetBlockPtr<partition::CellStorageView::CellData>(
auto mld_cells_ptr = data_layout.GetBlockPtr<partitioner::CellStorageView::CellData>(
memory_block, storage::DataLayout::MLD_CELLS);
auto mld_cell_level_offsets_ptr = data_layout.GetBlockPtr<std::uint64_t>(
memory_block, storage::DataLayout::MLD_CELL_LEVEL_OFFSETS);
@ -1005,15 +1005,15 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
source_boundary_entries_count);
util::vector_view<NodeID> destination_boundary(mld_destination_boundary_ptr,
destination_boundary_entries_count);
util::vector_view<partition::CellStorageView::CellData> cells(mld_cells_ptr,
cells_entries_counts);
util::vector_view<partitioner::CellStorageView::CellData> cells(mld_cells_ptr,
cells_entries_counts);
util::vector_view<std::uint64_t> level_offsets(mld_cell_level_offsets_ptr,
cell_level_offsets_entries_count);
mld_cell_storage = partition::CellStorageView{std::move(source_boundary),
std::move(destination_boundary),
std::move(cells),
std::move(level_offsets)};
mld_cell_storage = partitioner::CellStorageView{std::move(source_boundary),
std::move(destination_boundary),
std::move(cells),
std::move(level_offsets)};
}
}
void InitializeGraphPointer(storage::DataLayout &data_layout, char *memory_block)
@ -1050,12 +1050,12 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
InitializeInternalPointers(allocator->GetLayout(), allocator->GetMemory(), exclude_index);
}
const partition::MultiLevelPartitionView &GetMultiLevelPartition() const override
const partitioner::MultiLevelPartitionView &GetMultiLevelPartition() const override
{
return mld_partition;
}
const partition::CellStorageView &GetCellStorage() const override { return mld_cell_storage; }
const partitioner::CellStorageView &GetCellStorage() const override { return mld_cell_storage; }
const customizer::CellMetricView &GetCellMetric() const override { return mld_cell_metric; }

View File

@ -1,21 +0,0 @@
#ifndef OSRM_PARTITION_PARTITIONER_HPP_
#define OSRM_PARTITION_PARTITIONER_HPP_
#include "partition/partition_config.hpp"
namespace osrm
{
namespace partition
{
// tool access to the recursive partitioner
class Partitioner
{
public:
int Run(const PartitionConfig &config);
};
} // namespace partition
} // namespace osrm
#endif // OSRM_PARTITION_PARTITIONER_HPP_

View File

@ -1,7 +1,7 @@
#ifndef OSRM_PARTITION_ANNOTATE_HPP_
#define OSRM_PARTITION_ANNOTATE_HPP_
#ifndef OSRM_PARTITIONER_ANNOTATE_HPP_
#define OSRM_PARTITIONER_ANNOTATE_HPP_
#include "partition/bisection_graph.hpp"
#include "partitioner/bisection_graph.hpp"
#include "util/typedefs.hpp"
#include <cstdint>
#include <utility>
@ -9,7 +9,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
// takes the result of a recursive bisection and turns it into an annotated partition for MLD. These
@ -130,7 +130,7 @@ class AnnotatedPartition
const std::vector<BisectionID> &bisection_ids) const;
};
} // namespace partition
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITION_ANNOTATE_HPP_
#endif // OSRM_PARTITIONER_ANNOTATE_HPP_

View File

@ -1,10 +1,10 @@
#ifndef OSRM_BISECTION_GRAPH_HPP_
#define OSRM_BISECTION_GRAPH_HPP_
#ifndef OSRM_PARTITIONER_BISECTION_GRAPH_HPP_
#define OSRM_PARTITIONER_BISECTION_GRAPH_HPP_
#include "util/coordinate.hpp"
#include "util/typedefs.hpp"
#include "partition/partition_graph.hpp"
#include "partitioner/partition_graph.hpp"
#include "extractor/edge_based_edge.hpp"
@ -16,7 +16,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
// Node in the bisection graph. We require the original node id (since we remap the nodes all the
@ -109,7 +109,7 @@ std::vector<BisectionInputEdge> adaptToBisectionEdge(std::vector<InputEdge> edge
return result;
}
} // namespace partition
} // namespace partitioner
} // namespace osrm
#endif // OSRM_BISECTION_GRAPH_HPP_
#endif // OSRM_PARTITIONER_BISECTION_GRAPH_HPP_

View File

@ -1,7 +1,7 @@
#ifndef OSRM_PARTITION_BISECTION_GRAPHVIEW_HPP_
#define OSRM_PARTITION_BISECTION_GRAPHVIEW_HPP_
#ifndef OSRM_PARTITIONER_BISECTION_GRAPHVIEW_HPP_
#define OSRM_PARTITIONER_BISECTION_GRAPHVIEW_HPP_
#include "partition/bisection_graph.hpp"
#include "partitioner/bisection_graph.hpp"
#include <boost/iterator/filter_iterator.hpp>
#include <boost/iterator/iterator_facade.hpp>
@ -12,7 +12,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
// Non-owning immutable sub-graph view into a base graph.
@ -64,7 +64,7 @@ class BisectionGraphView
const BisectionGraph::ConstNodeIterator end;
};
} // namespace partition
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITION_GRAPHVIEW_HPP_
#endif // OSRM_PARTITIONER_GRAPHVIEW_HPP_

View File

@ -1,14 +1,14 @@
#ifndef BISECTION_TO_PARTITION_HPP
#define BISECTION_TO_PARTITION_HPP
#ifndef OSRM_PARTITIONER_BISECTION_TO_PARTITION_HPP
#define OSRM_PARTITIONER_BISECTION_TO_PARTITION_HPP
#include "partition/multi_level_partition.hpp"
#include "partition/recursive_bisection.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "partitioner/recursive_bisection.hpp"
#include <vector>
namespace osrm
{
namespace partition
namespace partitioner
{
using Partition = std::vector<CellID>;

View File

@ -1,7 +1,7 @@
#ifndef OSRM_CUSTOMIZE_CELL_STORAGE_HPP
#define OSRM_CUSTOMIZE_CELL_STORAGE_HPP
#ifndef OSRM_PARTITIONER_CUSTOMIZE_CELL_STORAGE_HPP
#define OSRM_PARTITIONER_CUSTOMIZE_CELL_STORAGE_HPP
#include "partition/multi_level_partition.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "util/assert.hpp"
#include "util/for_each_range.hpp"
@ -26,7 +26,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
namespace detail
{
@ -202,7 +202,7 @@ template <storage::Ownership Ownership> class CellStorageImpl
template <typename GraphT,
typename = std::enable_if<Ownership == storage::Ownership::Container>>
CellStorageImpl(const partition::MultiLevelPartition &partition, const GraphT &base_graph)
CellStorageImpl(const partitioner::MultiLevelPartition &partition, const GraphT &base_graph)
{
// pre-allocate storge for CellData so we can have random access to it by cell id
unsigned number_of_cells = 0;
@ -405,4 +405,4 @@ template <storage::Ownership Ownership> class CellStorageImpl
}
}
#endif // OSRM_CUSTOMIZE_CELL_STORAGE_HPP
#endif // OSRM_PARTITIONER_CUSTOMIZE_CELL_STORAGE_HPP

View File

@ -1,5 +1,5 @@
#ifndef OSRM_COMPRESSED_NODE_BASED_GRAPH_READER_HPP
#define OSRM_COMPRESSED_NODE_BASED_GRAPH_READER_HPP
#ifndef OSRM_PARTITIONER_COMPRESSED_NODE_BASED_GRAPH_READER_HPP
#define OSRM_PARTITIONER_COMPRESSED_NODE_BASED_GRAPH_READER_HPP
#include "storage/io.hpp"
#include "util/coordinate.hpp"
@ -10,7 +10,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
struct CompressedNodeBasedGraphEdge

View File

@ -1,7 +1,7 @@
#ifndef OSRM_PARTITION_DINIC_MAX_FLOW_HPP_
#define OSRM_PARTITION_DINIC_MAX_FLOW_HPP_
#ifndef OSRM_PARTITIONER_DINIC_MAX_FLOW_HPP_
#define OSRM_PARTITIONER_DINIC_MAX_FLOW_HPP_
#include "partition/bisection_graph_view.hpp"
#include "partitioner/bisection_graph_view.hpp"
#include <cstdint>
#include <functional>
@ -12,7 +12,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
class DinicMaxFlow
@ -88,10 +88,10 @@ class DinicMaxFlow
const std::size_t flow_value) const;
};
} // namespace partition
} // namespace partitioner
} // namespace osrm
// Implementation of Dinics [1] algorithm for max-flow/min-cut.
// [1] https://www.cs.bgu.ac.il/~dinitz/D70.pdf
#endif // OSRM_PARTITION_DINIC_MAX_FLOW_HPP_
#endif // OSRM_PARTITIONER_DINIC_MAX_FLOW_HPP_

View File

@ -1,5 +1,5 @@
#ifndef OSRM_EDGE_BASED_GRAPH_HPP
#define OSRM_EDGE_BASED_GRAPH_HPP
#ifndef OSRM_PARTITIONER_EDGE_BASED_GRAPH_HPP
#define OSRM_PARTITIONER_EDGE_BASED_GRAPH_HPP
#include "extractor/edge_based_edge.hpp"
#include "storage/io.hpp"
@ -16,7 +16,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
struct EdgeBasedGraphEdgeData : extractor::EdgeBasedEdge::EdgeData

View File

@ -1,7 +1,7 @@
#ifndef OSRM_EDGE_BASED_GRAPH_READER_HPP
#define OSRM_EDGE_BASED_GRAPH_READER_HPP
#ifndef OSRM_PARTITIONER_EDGE_BASED_GRAPH_READER_HPP
#define OSRM_PARTITIONER_EDGE_BASED_GRAPH_READER_HPP
#include "partition/edge_based_graph.hpp"
#include "partitioner/edge_based_graph.hpp"
#include "extractor/edge_based_edge.hpp"
#include "extractor/files.hpp"
@ -23,7 +23,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
// Bidirectional (s,t) to (s,t) and (t,s)

View File

@ -1,15 +1,15 @@
#ifndef OSRM_PARTITION_SERILIZATION_HPP
#define OSRM_PARTITION_SERILIZATION_HPP
#ifndef OSRM_PARTITIONER_SERILIZATION_HPP
#define OSRM_PARTITIONER_SERILIZATION_HPP
#include "customizer/edge_based_graph.hpp"
#include "partition/serialization.hpp"
#include "partitioner/serialization.hpp"
#include "storage/io.hpp"
namespace osrm
{
namespace partition
namespace partitioner
{
namespace files
{

View File

@ -1,12 +1,12 @@
#ifndef OSRM_PARTITION_INERTIAL_FLOW_HPP_
#define OSRM_PARTITION_INERTIAL_FLOW_HPP_
#ifndef OSRM_PARTITIONER_INERTIAL_FLOW_HPP_
#define OSRM_PARTITIONER_INERTIAL_FLOW_HPP_
#include "partition/bisection_graph_view.hpp"
#include "partition/dinic_max_flow.hpp"
#include "partitioner/bisection_graph_view.hpp"
#include "partitioner/dinic_max_flow.hpp"
namespace osrm
{
namespace partition
namespace partitioner
{
DinicMaxFlow::MinCut computeInertialFlowCut(const BisectionGraphView &view,
@ -14,7 +14,7 @@ DinicMaxFlow::MinCut computeInertialFlowCut(const BisectionGraphView &view,
const double balance,
const double source_sink_rate);
} // namespace partition
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITION_INERTIAL_FLOW_HPP_
#endif // OSRM_PARTITIONER_INERTIAL_FLOW_HPP_

View File

@ -1,7 +1,7 @@
#ifndef OSRM_PARTITION_MULTI_LEVEL_GRAPH_HPP
#define OSRM_PARTITION_MULTI_LEVEL_GRAPH_HPP
#ifndef OSRM_PARTITIONER_MULTI_LEVEL_GRAPH_HPP
#define OSRM_PARTITIONER_MULTI_LEVEL_GRAPH_HPP
#include "partition/multi_level_partition.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "storage/io_fwd.hpp"
#include "storage/shared_memory_ownership.hpp"
@ -17,7 +17,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
template <typename EdgeDataT, storage::Ownership Ownership> class MultiLevelGraph;

View File

@ -1,5 +1,5 @@
#ifndef OSRM_UTIL_MULTI_LEVEL_PARTITION_HPP
#define OSRM_UTIL_MULTI_LEVEL_PARTITION_HPP
#ifndef OSRM_PARTITIONER_MULTI_LEVEL_PARTITION_HPP
#define OSRM_PARTITIONER_MULTI_LEVEL_PARTITION_HPP
#include "util/exception.hpp"
#include "util/for_each_pair.hpp"
@ -22,7 +22,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
namespace detail
{

View File

@ -1,5 +1,5 @@
#ifndef OSRM_PARTITION_GRAPH_HPP_
#define OSRM_PARTITION_GRAPH_HPP_
#ifndef OSRM_PARTITIONER_GRAPH_HPP_
#define OSRM_PARTITIONER_GRAPH_HPP_
#include <algorithm>
#include <cstddef>
@ -12,7 +12,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
// forward declaration to allow finding friends
@ -156,7 +156,7 @@ template <typename NodeEntryT, typename EdgeEntryT> class RemappableGraph
std::vector<EdgeT> edges;
};
} // namespace partition
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITION_GRAPH_HPP_
#endif // OSRM_PARTITIONER_GRAPH_HPP_

View File

@ -0,0 +1,21 @@
#ifndef OSRM_PARTITIONER_PARTITIONER_HPP_
#define OSRM_PARTITIONER_PARTITIONER_HPP_
#include "partitioner/partitioner_config.hpp"
namespace osrm
{
namespace partitioner
{
// tool access to the recursive partitioner
class Partitioner
{
public:
int Run(const PartitionerConfig &config);
};
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITIONER_PARTITIONER_HPP_

View File

@ -1,5 +1,5 @@
#ifndef PARTITIONER_CONFIG_HPP
#define PARTITIONER_CONFIG_HPP
#ifndef OSRM_PARTITIONER_CONFIG_HPP
#define OSRM_PARTITIONER_CONFIG_HPP
#include <boost/filesystem/path.hpp>
@ -10,12 +10,12 @@
namespace osrm
{
namespace partition
namespace partitioner
{
struct PartitionConfig final : storage::IOConfig
struct PartitionerConfig final : storage::IOConfig
{
PartitionConfig()
PartitionerConfig()
: IOConfig(
{".osrm", ".osrm.fileIndex", ".osrm.ebg_nodes"},
{".osrm.hsgr", ".osrm.cnbg"},
@ -42,4 +42,4 @@ struct PartitionConfig final : storage::IOConfig
}
}
#endif // PARTITIONER_CONFIG_HPP
#endif // OSRM_PARTITIONER_CONFIG_HPP

View File

@ -1,8 +1,8 @@
#ifndef OSRM_PARTITION_RECURSIVE_BISECTION_HPP_
#define OSRM_PARTITION_RECURSIVE_BISECTION_HPP_
#ifndef OSRM_PARTITIONER_RECURSIVE_BISECTION_HPP_
#define OSRM_PARTITIONER_RECURSIVE_BISECTION_HPP_
#include "partition/bisection_graph.hpp"
#include "partition/recursive_bisection_state.hpp"
#include "partitioner/bisection_graph.hpp"
#include "partitioner/recursive_bisection_state.hpp"
#include "util/typedefs.hpp"
#include <cstddef>
@ -10,7 +10,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
class RecursiveBisection
@ -32,7 +32,7 @@ class RecursiveBisection
RecursiveBisectionState internal_state;
};
} // namespace partition
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITION_RECURSIVE_BISECTION_HPP_
#endif // OSRM_PARTITIONER_RECURSIVE_BISECTION_HPP_

View File

@ -1,17 +1,17 @@
#ifndef OSRM_PARTITION_RECURSIVE_BISECTION_STATE_HPP_
#define OSRM_PARTITION_RECURSIVE_BISECTION_STATE_HPP_
#ifndef OSRM_PARTITIONER_RECURSIVE_BISECTION_STATE_HPP_
#define OSRM_PARTITIONER_RECURSIVE_BISECTION_STATE_HPP_
#include <cstddef>
#include <cstdint>
#include <vector>
#include "partition/bisection_graph.hpp"
#include "partition/bisection_graph_view.hpp"
#include "partitioner/bisection_graph.hpp"
#include "partitioner/bisection_graph_view.hpp"
#include "util/typedefs.hpp"
namespace osrm
{
namespace partition
namespace partitioner
{
// Keeps track of the bisection ids, modifies the graph accordingly, splitting it into a left/right
@ -50,7 +50,7 @@ class RecursiveBisectionState
std::vector<BisectionID> bisection_ids;
};
} // namespace partition
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITION_RECURSIVE_BISECTION_STATE_HPP_
#endif // OSRM_PARTITIONER_RECURSIVE_BISECTION_STATE_HPP_

View File

@ -1,5 +1,5 @@
#ifndef OSRM_PARTITION_REMOVE_UNCONNECTED_HPP
#define OSRM_PARTITION_REMOVE_UNCONNECTED_HPP
#ifndef OSRM_PARTITIONER_REMOVE_UNCONNECTED_HPP
#define OSRM_PARTITIONER_REMOVE_UNCONNECTED_HPP
#include "util/log.hpp"
#include "util/typedefs.hpp"
@ -11,7 +11,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
using Partition = std::vector<CellID>;

View File

@ -1,19 +1,19 @@
#ifndef OSRM_PARTITION_RENUMBER_HPP
#define OSRM_PARTITION_RENUMBER_HPP
#ifndef OSRM_PARTITIONER_RENUMBER_HPP
#define OSRM_PARTITIONER_RENUMBER_HPP
#include "extractor/edge_based_node_segment.hpp"
#include "extractor/nbg_to_ebg.hpp"
#include "extractor/node_data_container.hpp"
#include "partition/bisection_to_partition.hpp"
#include "partition/edge_based_graph.hpp"
#include "partitioner/bisection_to_partition.hpp"
#include "partitioner/edge_based_graph.hpp"
#include "util/dynamic_graph.hpp"
#include "util/static_graph.hpp"
namespace osrm
{
namespace partition
namespace partitioner
{
std::vector<std::uint32_t> makePermutation(const DynamicEdgeBasedGraph &graph,
const std::vector<Partition> &partitions);
@ -73,7 +73,7 @@ inline void renumber(std::vector<extractor::NBGToEBG> &mapping,
}
}
} // namespace partition
} // namespace partitioner
} // namespace osrm
#endif

View File

@ -1,5 +1,5 @@
#ifndef OSRM_REORDER_FIRST_LAST_HPP
#define OSRM_REORDER_FIRST_LAST_HPP
#ifndef OSRM_PARTITIONER_REORDER_FIRST_LAST_HPP
#define OSRM_PARTITIONER_REORDER_FIRST_LAST_HPP
#include <boost/assert.hpp>
@ -9,7 +9,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
// Reorders the first n elements in the range to satisfy the comparator,

View File

@ -1,10 +1,10 @@
#ifndef OSRM_PARTITION_SERIALIZATION_HPP
#define OSRM_PARTITION_SERIALIZATION_HPP
#ifndef OSRM_PARTITIONER_SERIALIZATION_HPP
#define OSRM_PARTITIONER_SERIALIZATION_HPP
#include "partition/cell_storage.hpp"
#include "partition/edge_based_graph.hpp"
#include "partition/multi_level_graph.hpp"
#include "partition/multi_level_partition.hpp"
#include "partitioner/cell_storage.hpp"
#include "partitioner/edge_based_graph.hpp"
#include "partitioner/multi_level_graph.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "storage/io.hpp"
#include "storage/serialization.hpp"
@ -12,7 +12,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
namespace serialization
{

View File

@ -1,13 +1,13 @@
#ifndef OSRM_PARTITION_TARJAN_GRAPH_WRAPPER_HPP_
#define OSRM_PARTITION_TARJAN_GRAPH_WRAPPER_HPP_
#ifndef OSRM_PARTITIONER_TARJAN_GRAPH_WRAPPER_HPP_
#define OSRM_PARTITIONER_TARJAN_GRAPH_WRAPPER_HPP_
#include "partition/bisection_graph.hpp"
#include "partitioner/bisection_graph.hpp"
#include "util/integer_range.hpp"
#include "util/typedefs.hpp"
namespace osrm
{
namespace partition
namespace partitioner
{
class TarjanGraphWrapper
@ -23,7 +23,7 @@ class TarjanGraphWrapper
const BisectionGraph &bisection_graph;
};
} // namespace partition
} // namespace partitioner
} // namespace osrm
#endif // OSRM_PARTITION_TARJAN_GRAPH_WRAPPER_HPP_
#endif // OSRM_PARTITIONER_TARJAN_GRAPH_WRAPPER_HPP_

View File

@ -5,10 +5,10 @@
#include "customizer/edge_based_graph.hpp"
#include "customizer/files.hpp"
#include "partition/cell_storage.hpp"
#include "partition/edge_based_graph_reader.hpp"
#include "partition/files.hpp"
#include "partition/multi_level_partition.hpp"
#include "partitioner/cell_storage.hpp"
#include "partitioner/edge_based_graph_reader.hpp"
#include "partitioner/files.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "storage/shared_memory_ownership.hpp"
@ -79,7 +79,7 @@ void CellStorageStatistics(const Graph &graph,
}
auto LoadAndUpdateEdgeExpandedGraph(const CustomizationConfig &config,
const partition::MultiLevelPartition &mlp)
const partitioner::MultiLevelPartition &mlp)
{
updater::Updater updater(config.updater_config);
@ -87,16 +87,16 @@ auto LoadAndUpdateEdgeExpandedGraph(const CustomizationConfig &config,
std::vector<extractor::EdgeBasedEdge> edge_based_edge_list;
std::tie(num_nodes, edge_based_edge_list) = updater.LoadAndUpdateEdgeExpandedGraph();
auto directed = partition::splitBidirectionalEdges(edge_based_edge_list);
auto directed = partitioner::splitBidirectionalEdges(edge_based_edge_list);
auto tidied =
partition::prepareEdgesForUsageInGraph<StaticEdgeBasedGraphEdge>(std::move(directed));
partitioner::prepareEdgesForUsageInGraph<StaticEdgeBasedGraphEdge>(std::move(directed));
auto edge_based_graph = customizer::MultiLevelEdgeBasedGraph(mlp, num_nodes, std::move(tidied));
return edge_based_graph;
}
std::vector<CellMetric> customizeFilteredMetrics(const MultiLevelEdgeBasedGraph &graph,
const partition::CellStorage &storage,
const partitioner::CellStorage &storage,
const CellCustomizer &customizer,
const std::vector<std::vector<bool>> &node_filters)
{
@ -117,15 +117,15 @@ int Customizer::Run(const CustomizationConfig &config)
{
TIMER_START(loading_data);
partition::MultiLevelPartition mlp;
partition::files::readPartition(config.GetPath(".osrm.partition"), mlp);
partitioner::MultiLevelPartition mlp;
partitioner::files::readPartition(config.GetPath(".osrm.partition"), mlp);
auto graph = LoadAndUpdateEdgeExpandedGraph(config, mlp);
util::Log() << "Loaded edge based graph: " << graph.GetNumberOfEdges() << " edges, "
<< graph.GetNumberOfNodes() << " nodes";
partition::CellStorage storage;
partition::files::readCells(config.GetPath(".osrm.cells"), storage);
partitioner::CellStorage storage;
partitioner::files::readCells(config.GetPath(".osrm.cells"), storage);
TIMER_STOP(loading_data);
extractor::EdgeBasedNodeDataContainer node_data;
@ -148,7 +148,7 @@ int Customizer::Run(const CustomizationConfig &config)
util::Log() << "MLD customization writing took " << TIMER_SEC(writing_mld_data) << " seconds";
TIMER_START(writing_graph);
partition::files::writeGraph(config.GetPath(".osrm.mldgr"), graph);
partitioner::files::writeGraph(config.GetPath(".osrm.mldgr"), graph);
TIMER_STOP(writing_graph);
util::Log() << "Graph writing took " << TIMER_SEC(writing_graph) << " seconds";

View File

@ -27,7 +27,7 @@ namespace routing_algorithms
using namespace mld;
using Heap = SearchEngineData<Algorithm>::QueryHeap;
using Partition = partition::MultiLevelPartitionView;
using Partition = partitioner::MultiLevelPartitionView;
using Facade = DataFacade<Algorithm>;
// Implementation details

View File

@ -1,4 +1,4 @@
#include "partition/annotated_partition.hpp"
#include "partitioner/annotated_partition.hpp"
#include <algorithm>
#include <climits> // for CHAR_BIT
@ -16,7 +16,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
namespace
@ -383,5 +383,5 @@ AnnotatedPartition::ComputeCellIDs(std::vector<std::pair<BisectionID, std::int32
return cell_ids;
}
} // namespace partition
} // namespace partitioner
} // namespace osrm

View File

@ -1,4 +1,4 @@
#include "partition/bisection_graph_view.hpp"
#include "partitioner/bisection_graph_view.hpp"
#include <iostream>
#include <iterator>
@ -7,7 +7,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
BisectionGraphView::BisectionGraphView(const BisectionGraph &bisection_graph_)
@ -52,5 +52,5 @@ const BisectionGraphView::EdgeT &BisectionGraphView::Edge(const EdgeID eid) cons
return bisection_graph.Edge(eid);
}
} // namespace partition
} // namespace partitioner
} // namespace osrm

View File

@ -1,8 +1,8 @@
#include "partition/bisection_to_partition.hpp"
#include "partitioner/bisection_to_partition.hpp"
namespace osrm
{
namespace partition
namespace partitioner
{
namespace

View File

@ -1,4 +1,4 @@
#include "partition/dinic_max_flow.hpp"
#include "partitioner/dinic_max_flow.hpp"
#include "util/integer_range.hpp"
#include <algorithm>
@ -10,7 +10,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
namespace
@ -310,5 +310,5 @@ bool DinicMaxFlow::Validate(const BisectionGraphView &view,
return separated && in_range_source && in_range_sink;
}
} // namespace partition
} // namespace partitioner
} // namespace osrm

View File

@ -1,7 +1,7 @@
#include "partition/inertial_flow.hpp"
#include "partition/bisection_graph.hpp"
#include "partition/bisection_graph_view.hpp"
#include "partition/reorder_first_last.hpp"
#include "partitioner/inertial_flow.hpp"
#include "partitioner/bisection_graph.hpp"
#include "partitioner/bisection_graph_view.hpp"
#include "partitioner/reorder_first_last.hpp"
#include <algorithm>
#include <cmath>
@ -19,7 +19,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
namespace
{
@ -159,5 +159,5 @@ DinicMaxFlow::MinCut computeInertialFlowCut(const BisectionGraphView &view,
return bestMinCut(view, num_slopes, source_sink_rate, balance);
}
} // namespace partition
} // namespace partitioner
} // namespace osrm

View File

@ -1,14 +1,14 @@
#include "partition/partitioner.hpp"
#include "partition/bisection_graph.hpp"
#include "partition/bisection_to_partition.hpp"
#include "partition/cell_storage.hpp"
#include "partition/compressed_node_based_graph_reader.hpp"
#include "partition/edge_based_graph_reader.hpp"
#include "partition/files.hpp"
#include "partition/multi_level_partition.hpp"
#include "partition/recursive_bisection.hpp"
#include "partition/remove_unconnected.hpp"
#include "partition/renumber.hpp"
#include "partitioner/partitioner.hpp"
#include "partitioner/bisection_graph.hpp"
#include "partitioner/bisection_to_partition.hpp"
#include "partitioner/cell_storage.hpp"
#include "partitioner/compressed_node_based_graph_reader.hpp"
#include "partitioner/edge_based_graph_reader.hpp"
#include "partitioner/files.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "partitioner/recursive_bisection.hpp"
#include "partitioner/remove_unconnected.hpp"
#include "partitioner/renumber.hpp"
#include "extractor/files.hpp"
@ -34,7 +34,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
void LogGeojson(const std::string &filename, const std::vector<std::uint32_t> &bisection_ids)
@ -95,7 +95,7 @@ void LogGeojson(const std::string &filename, const std::vector<std::uint32_t> &b
}
}
auto getGraphBisection(const PartitionConfig &config)
auto getGraphBisection(const PartitionerConfig &config)
{
auto compressed_node_based_graph =
LoadCompressedNodeBasedGraph(config.GetPath(".osrm.cnbg").string());
@ -126,7 +126,7 @@ auto getGraphBisection(const PartitionConfig &config)
return recursive_bisection.BisectionIDs();
}
int Partitioner::Run(const PartitionConfig &config)
int Partitioner::Run(const PartitionerConfig &config)
{
const std::vector<BisectionID> &node_based_partition_ids = getGraphBisection(config);
@ -230,5 +230,5 @@ int Partitioner::Run(const PartitionConfig &config)
return 0;
}
} // namespace partition
} // namespace partitioner
} // namespace osrm

View File

@ -1,8 +1,8 @@
#include "partition/recursive_bisection.hpp"
#include "partition/inertial_flow.hpp"
#include "partitioner/recursive_bisection.hpp"
#include "partitioner/inertial_flow.hpp"
#include "partition/bisection_graph_view.hpp"
#include "partition/recursive_bisection_state.hpp"
#include "partitioner/bisection_graph_view.hpp"
#include "partitioner/recursive_bisection_state.hpp"
#include "util/log.hpp"
#include "util/timing_util.hpp"
@ -19,7 +19,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
RecursiveBisection::RecursiveBisection(BisectionGraph &bisection_graph_,
@ -107,5 +107,5 @@ const std::vector<BisectionID> &RecursiveBisection::BisectionIDs() const
std::uint32_t RecursiveBisection::SCCDepth() const { return internal_state.SCCDepth(); }
} // namespace partition
} // namespace partitioner
} // namespace osrm

View File

@ -1,6 +1,6 @@
#include "partition/recursive_bisection_state.hpp"
#include "partitioner/recursive_bisection_state.hpp"
#include "extractor/tarjan_scc.hpp"
#include "partition/tarjan_graph_wrapper.hpp"
#include "partitioner/tarjan_graph_wrapper.hpp"
#include <algorithm>
#include <climits> // for CHAR_BIT
@ -10,7 +10,7 @@
namespace osrm
{
namespace partition
namespace partitioner
{
RecursiveBisectionState::RecursiveBisectionState(BisectionGraph &bisection_graph_)
@ -181,5 +181,5 @@ const std::vector<BisectionID> &RecursiveBisectionState::BisectionIDs() const
std::uint32_t RecursiveBisectionState::SCCDepth() const { return scc_levels; }
} // namespace partition
} // namespace partitioner
} // namespace osrm

View File

@ -1,10 +1,10 @@
#include "partition/renumber.hpp"
#include "partitioner/renumber.hpp"
#include "util/permutation.hpp"
namespace osrm
{
namespace partition
namespace partitioner
{
namespace
{

View File

@ -1,8 +1,8 @@
#include "partition/tarjan_graph_wrapper.hpp"
#include "partitioner/tarjan_graph_wrapper.hpp"
namespace osrm
{
namespace partition
namespace partitioner
{
TarjanGraphWrapper::TarjanGraphWrapper(const BisectionGraph &bisection_graph_)
@ -22,5 +22,5 @@ NodeID TarjanGraphWrapper::GetTarget(const EdgeID eid) const
return bisection_graph.Edge(eid).target;
}
} // namespace partition
} // namespace partitioner
} // namespace osrm

View File

@ -24,10 +24,10 @@
#include "extractor/query_node.hpp"
#include "extractor/travel_mode.hpp"
#include "partition/cell_storage.hpp"
#include "partition/edge_based_graph_reader.hpp"
#include "partition/files.hpp"
#include "partition/multi_level_partition.hpp"
#include "partitioner/cell_storage.hpp"
#include "partitioner/edge_based_graph_reader.hpp"
#include "partitioner/files.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "engine/datafacade/datafacade_base.hpp"
@ -446,8 +446,8 @@ void Storage::PopulateLayout(DataLayout &layout)
io::FileReader reader(config.GetPath(".osrm.partition"),
io::FileReader::VerifyFingerprint);
reader.Skip<partition::MultiLevelPartition::LevelData>(1);
layout.SetBlockSize<partition::MultiLevelPartition::LevelData>(
reader.Skip<partitioner::MultiLevelPartition::LevelData>(1);
layout.SetBlockSize<partitioner::MultiLevelPartition::LevelData>(
DataLayout::MLD_LEVEL_DATA, 1);
const auto partition_entries_count = reader.ReadVectorSize<PartitionID>();
layout.SetBlockSize<PartitionID>(DataLayout::MLD_PARTITION, partition_entries_count);
@ -456,7 +456,7 @@ void Storage::PopulateLayout(DataLayout &layout)
}
else
{
layout.SetBlockSize<partition::MultiLevelPartition::LevelData>(
layout.SetBlockSize<partitioner::MultiLevelPartition::LevelData>(
DataLayout::MLD_LEVEL_DATA, 0);
layout.SetBlockSize<PartitionID>(DataLayout::MLD_PARTITION, 0);
layout.SetBlockSize<CellID>(DataLayout::MLD_CELL_TO_CHILDREN, 0);
@ -471,9 +471,9 @@ void Storage::PopulateLayout(DataLayout &layout)
const auto destination_node_count = reader.ReadVectorSize<NodeID>();
layout.SetBlockSize<NodeID>(DataLayout::MLD_CELL_DESTINATION_BOUNDARY,
destination_node_count);
const auto cell_count = reader.ReadVectorSize<partition::CellStorage::CellData>();
layout.SetBlockSize<partition::CellStorage::CellData>(DataLayout::MLD_CELLS,
cell_count);
const auto cell_count = reader.ReadVectorSize<partitioner::CellStorage::CellData>();
layout.SetBlockSize<partitioner::CellStorage::CellData>(DataLayout::MLD_CELLS,
cell_count);
const auto level_offsets_count = reader.ReadVectorSize<std::uint64_t>();
layout.SetBlockSize<std::uint64_t>(DataLayout::MLD_CELL_LEVEL_OFFSETS,
level_offsets_count);
@ -930,7 +930,7 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
BOOST_ASSERT(layout.GetBlockSize(storage::DataLayout::MLD_PARTITION) > 0);
auto level_data =
layout.GetBlockPtr<partition::MultiLevelPartitionView::LevelData, true>(
layout.GetBlockPtr<partitioner::MultiLevelPartitionView::LevelData, true>(
memory_ptr, storage::DataLayout::MLD_LEVEL_DATA);
auto mld_partition_ptr = layout.GetBlockPtr<PartitionID, true>(
@ -945,9 +945,9 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
layout.GetBlockEntries(storage::DataLayout::MLD_CELL_TO_CHILDREN);
util::vector_view<CellID> cell_to_children(mld_chilren_ptr, children_entries_count);
partition::MultiLevelPartitionView mlp{
partitioner::MultiLevelPartitionView mlp{
std::move(level_data), std::move(partition), std::move(cell_to_children)};
partition::files::readPartition(config.GetPath(".osrm.partition"), mlp);
partitioner::files::readPartition(config.GetPath(".osrm.partition"), mlp);
}
if (boost::filesystem::exists(config.GetPath(".osrm.cells")))
@ -959,7 +959,7 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
memory_ptr, storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY);
auto mld_destination_boundary_ptr = layout.GetBlockPtr<NodeID, true>(
memory_ptr, storage::DataLayout::MLD_CELL_DESTINATION_BOUNDARY);
auto mld_cells_ptr = layout.GetBlockPtr<partition::CellStorageView::CellData, true>(
auto mld_cells_ptr = layout.GetBlockPtr<partitioner::CellStorageView::CellData, true>(
memory_ptr, storage::DataLayout::MLD_CELLS);
auto mld_cell_level_offsets_ptr = layout.GetBlockPtr<std::uint64_t, true>(
memory_ptr, storage::DataLayout::MLD_CELL_LEVEL_OFFSETS);
@ -976,16 +976,16 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
source_boundary_entries_count);
util::vector_view<NodeID> destination_boundary(mld_destination_boundary_ptr,
destination_boundary_entries_count);
util::vector_view<partition::CellStorageView::CellData> cells(mld_cells_ptr,
cells_entries_counts);
util::vector_view<partitioner::CellStorageView::CellData> cells(mld_cells_ptr,
cells_entries_counts);
util::vector_view<std::uint64_t> level_offsets(mld_cell_level_offsets_ptr,
cell_level_offsets_entries_count);
partition::CellStorageView storage{std::move(source_boundary),
std::move(destination_boundary),
std::move(cells),
std::move(level_offsets)};
partition::files::readCells(config.GetPath(".osrm.cells"), storage);
partitioner::CellStorageView storage{std::move(source_boundary),
std::move(destination_boundary),
std::move(cells),
std::move(level_offsets)};
partitioner::files::readCells(config.GetPath(".osrm.cells"), storage);
}
if (boost::filesystem::exists(config.GetPath(".osrm.cell_metrics")))
@ -1042,7 +1042,7 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
customizer::MultiLevelEdgeBasedGraphView graph_view(
std::move(node_list), std::move(edge_list), std::move(node_to_offset));
partition::files::readGraph(config.GetPath(".osrm.mldgr"), graph_view);
partitioner::files::readGraph(config.GetPath(".osrm.mldgr"), graph_view);
}
}
}

View File

@ -1,5 +1,5 @@
#include "partition/partition_config.hpp"
#include "partition/partitioner.hpp"
#include "partitioner/partitioner.hpp"
#include "partitioner/partitioner_config.hpp"
#include "osrm/exception.hpp"
#include "util/log.hpp"
@ -69,8 +69,10 @@ void validate(boost::any &v, const std::vector<std::string> &values, MaxCellSize
v = boost::any(MaxCellSizesArgument{output});
}
return_code
parseArguments(int argc, char *argv[], std::string &verbosity, partition::PartitionConfig &config)
return_code parseArguments(int argc,
char *argv[],
std::string &verbosity,
partitioner::PartitionerConfig &config)
{
// declare a group of options that will be allowed only on command line
boost::program_options::options_description generic_options("Options");
@ -189,7 +191,7 @@ int main(int argc, char *argv[]) try
{
util::LogPolicy::GetInstance().Unmute();
std::string verbosity;
partition::PartitionConfig partition_config;
partitioner::PartitionerConfig partition_config;
const auto result = parseArguments(argc, argv, verbosity, partition_config);
@ -238,7 +240,7 @@ int main(int argc, char *argv[]) try
util::Log() << "Computing recursive bisection";
TIMER_START(bisect);
auto exitcode = partition::Partitioner().Run(partition_config);
auto exitcode = partitioner::Partitioner().Run(partition_config);
TIMER_STOP(bisect);
util::Log() << "Bisection took " << TIMER_SEC(bisect) << " seconds.";

View File

@ -11,8 +11,8 @@ file(GLOB ExtractorTestsSources
extractor/*.cpp)
file(GLOB PartitionTestsSources
partition_tests.cpp
partition/*.cpp)
partitioner_tests.cpp
partitioner/*.cpp)
file(GLOB CustomizerTestsSources
customizer_tests.cpp
@ -58,7 +58,7 @@ add_executable(extractor-tests
${ExtractorTestsSources}
$<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
add_executable(partition-tests
add_executable(partitioner-tests
EXCLUDE_FROM_ALL
${PartitionTestsSources}
$<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:UTIL>)
@ -120,14 +120,14 @@ target_include_directories(library-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(library-extract-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(library-contract-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(util-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(partition-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(partitioner-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(customizer-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(updater-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(contractor-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(engine-tests ${ENGINE_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(extractor-tests ${EXTRACTOR_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(partition-tests ${PARTITIONER_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(partitioner-tests ${PARTITIONER_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(customizer-tests ${CUSTOMIZER_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(updater-tests ${UPDATER_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(library-tests osrm ${ENGINE_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
@ -138,4 +138,4 @@ target_link_libraries(util-tests ${UTIL_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_L
target_link_libraries(contractor-tests ${CONTRACTOR_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
add_custom_target(tests
DEPENDS engine-tests extractor-tests contractor-tests partition-tests updater-tests customizer-tests library-tests library-extract-tests server-tests util-tests)
DEPENDS engine-tests extractor-tests contractor-tests partitioner-tests updater-tests customizer-tests library-tests library-extract-tests server-tests util-tests)

View File

@ -1,15 +1,15 @@
#include "common/range_tools.hpp"
#include "customizer/cell_customizer.hpp"
#include "partition/multi_level_graph.hpp"
#include "partition/multi_level_partition.hpp"
#include "partitioner/multi_level_graph.hpp"
#include "partitioner/multi_level_partition.hpp"
#include "util/static_graph.hpp"
#include <boost/test/unit_test.hpp>
using namespace osrm;
using namespace osrm::customizer;
using namespace osrm::partition;
using namespace osrm::partitioner;
using namespace osrm::util;
namespace
@ -40,7 +40,7 @@ auto makeGraph(const MultiLevelPartition &mlp, const std::vector<MockEdge> &mock
edges.push_back(Edge{m.target, m.start, m.weight, 2 * m.weight, false, true});
}
std::sort(edges.begin(), edges.end());
return partition::MultiLevelGraph<EdgeData, osrm::storage::Ownership::Container>(
return partitioner::MultiLevelGraph<EdgeData, osrm::storage::Ownership::Container>(
mlp, max_id + 1, edges);
}
}

View File

@ -1,5 +1,5 @@
#include "partition/bisection_graph.hpp"
#include "partition/graph_generator.hpp"
#include "partitioner/bisection_graph.hpp"
#include "partitioner/graph_generator.hpp"
#include <algorithm>
#include <vector>
@ -7,7 +7,7 @@
#include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp>
using namespace osrm::partition;
using namespace osrm::partitioner;
using namespace osrm::util;
BOOST_AUTO_TEST_SUITE(bisection_graph)

View File

@ -1,6 +1,6 @@
#include "partition/bisection_graph_view.hpp"
#include "partition/graph_generator.hpp"
#include "partition/recursive_bisection_state.hpp"
#include "partitioner/bisection_graph_view.hpp"
#include "partitioner/graph_generator.hpp"
#include "partitioner/recursive_bisection_state.hpp"
#include <algorithm>
#include <climits>
@ -9,7 +9,7 @@
#include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp>
using namespace osrm::partition;
using namespace osrm::partitioner;
using namespace osrm::util;
BOOST_AUTO_TEST_SUITE(graph_view)

View File

@ -1,7 +1,7 @@
#include <boost/numeric/conversion/cast.hpp>
#include <boost/test/unit_test.hpp>
#include "partition/bisection_to_partition.hpp"
#include "partitioner/bisection_to_partition.hpp"
#define CHECK_SIZE_RANGE(range, ref) BOOST_CHECK_EQUAL(range.end() - range.begin(), ref)
#define CHECK_EQUAL_RANGE(range, ref) \
@ -13,7 +13,7 @@
} while (0)
using namespace osrm;
using namespace osrm::partition;
using namespace osrm::partitioner;
BOOST_AUTO_TEST_SUITE(bisection_to_partition_tests)

View File

@ -1,11 +1,11 @@
#include "common/range_tools.hpp"
#include <boost/test/unit_test.hpp>
#include "partition/cell_storage.hpp"
#include "partitioner/cell_storage.hpp"
#include "util/static_graph.hpp"
using namespace osrm;
using namespace osrm::partition;
using namespace osrm::partitioner;
namespace
{

View File

@ -1,7 +1,7 @@
#include "partition/bisection_graph_view.hpp"
#include "partition/dinic_max_flow.hpp"
#include "partition/graph_generator.hpp"
#include "partition/recursive_bisection_state.hpp"
#include "partitioner/bisection_graph_view.hpp"
#include "partitioner/dinic_max_flow.hpp"
#include "partitioner/graph_generator.hpp"
#include "partitioner/recursive_bisection_state.hpp"
#include <algorithm>
#include <vector>
@ -9,7 +9,7 @@
#include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp>
using namespace osrm::partition;
using namespace osrm::partitioner;
using namespace osrm::util;
BOOST_AUTO_TEST_SUITE(dinic_algorithm)

View File

@ -1,4 +1,4 @@
#include "partition/multi_level_graph.hpp"
#include "partitioner/multi_level_graph.hpp"
#include "util/typedefs.hpp"
#include "../common/range_tools.hpp"
@ -11,7 +11,7 @@
#include <vector>
using namespace osrm;
using namespace osrm::partition;
using namespace osrm::partitioner;
namespace
{

View File

@ -1,7 +1,7 @@
#include <boost/numeric/conversion/cast.hpp>
#include <boost/test/unit_test.hpp>
#include "partition/multi_level_partition.hpp"
#include "partitioner/multi_level_partition.hpp"
#define CHECK_SIZE_RANGE(range, ref) BOOST_CHECK_EQUAL(range.second - range.first, ref)
#define CHECK_EQUAL_RANGE(range, ref) \
@ -13,7 +13,7 @@
} while (0)
using namespace osrm;
using namespace osrm::partition;
using namespace osrm::partitioner;
BOOST_AUTO_TEST_SUITE(multi_level_partition_tests)

View File

@ -1,6 +1,6 @@
#include "partition/recursive_bisection.hpp"
#include "partition/graph_generator.hpp"
#include "partition/recursive_bisection_state.hpp"
#include "partitioner/recursive_bisection.hpp"
#include "partitioner/graph_generator.hpp"
#include "partitioner/recursive_bisection_state.hpp"
#include <algorithm>
#include <vector>
@ -12,7 +12,7 @@
#include <tbb/task_scheduler_init.h>
tbb::task_scheduler_init init(2);
using namespace osrm::partition;
using namespace osrm::partitioner;
using namespace osrm::util;
BOOST_AUTO_TEST_SUITE(recursive_bisection)

View File

@ -1,7 +1,7 @@
#include <boost/numeric/conversion/cast.hpp>
#include <boost/test/unit_test.hpp>
#include "partition/remove_unconnected.hpp"
#include "partitioner/remove_unconnected.hpp"
#include "util/static_graph.hpp"
@ -15,7 +15,7 @@
} while (0)
using namespace osrm;
using namespace osrm::partition;
using namespace osrm::partitioner;
namespace
{

View File

@ -1,12 +1,12 @@
#include <boost/numeric/conversion/cast.hpp>
#include <boost/test/unit_test.hpp>
#include "partition/renumber.hpp"
#include "partitioner/renumber.hpp"
#include "../common/range_tools.hpp"
using namespace osrm;
using namespace osrm::partition;
using namespace osrm::partitioner;
namespace
{

View File

@ -1,4 +1,4 @@
#include "partition/reorder_first_last.hpp"
#include "partitioner/reorder_first_last.hpp"
#include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp>
@ -9,7 +9,7 @@
#include <utility>
#include <vector>
using namespace osrm::partition;
using namespace osrm::partitioner;
BOOST_AUTO_TEST_SUITE(reorder_first_last)

View File

@ -1,6 +1,6 @@
#include "partition/bisection_graph_view.hpp"
#include "partition/graph_generator.hpp"
#include "partition/recursive_bisection_state.hpp"
#include "partitioner/bisection_graph_view.hpp"
#include "partitioner/graph_generator.hpp"
#include "partitioner/recursive_bisection_state.hpp"
#include <algorithm>
#include <vector>
@ -8,7 +8,7 @@
#include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp>
using namespace osrm::partition;
using namespace osrm::partitioner;
using namespace osrm::util;
BOOST_AUTO_TEST_SUITE(scc_integration)