MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / cellsToPartition

Function cellsToPartition

src/partitioner/bisection_to_partition.cpp:31–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31Partition cellsToPartition(const std::vector<CellBisection> &cells,
32 const std::vector<std::uint32_t> &permutation)
33{
34 Partition partition(permutation.size(), INVALID_CELL_ID);
35 CellID cell_id = 0;
36 for (const auto &cell : cells)
37 {
38 std::for_each(permutation.begin() + cell.begin,
39 permutation.begin() + cell.end,
40 [&partition, cell_id](const auto node_id) { partition[node_id] = cell_id; });
41 cell_id++;
42 }
43 BOOST_ASSERT(std::find(partition.begin(), partition.end(), INVALID_CELL_ID) == partition.end());
44
45 return partition;
46}
47
48void partitionLevel(const std::vector<BisectionID> &node_to_bisection_id,
49 std::size_t max_cell_size,

Callers 1

bisectionToPartitionFunction · 0.85

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected