----------------------------------------------------------------------------- Get the (maximum) width of a level structure
| 76 | //----------------------------------------------------------------------------- |
| 77 | // Get the (maximum) width of a level structure |
| 78 | std::size_t max_level_width(const graph::AdjacencyList<int>& levels) |
| 79 | { |
| 80 | const std::vector<std::int32_t>& offsets = levels.offsets(); |
| 81 | return std::transform_reduce( |
| 82 | offsets.begin(), std::prev(offsets.end()), std::next(offsets.begin()), |
| 83 | std::size_t(0), |
| 84 | [](auto x0, auto x1) -> std::size_t { return std::max(x1, x0); }, |
| 85 | [](auto x0, auto x1) -> std::size_t { return x1 - x0; }); |
| 86 | } |
| 87 | //----------------------------------------------------------------------------- |
| 88 | // Create a level structure from graph, rooted at node s |
| 89 | graph::AdjacencyList<int> |
no test coverage detected