MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / max_level_width

Function max_level_width

cpp/dolfinx/graph/ordering.cpp:78–86  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Get the (maximum) width of a level structure

Source from the content-addressed store, hash-verified

76//-----------------------------------------------------------------------------
77// Get the (maximum) width of a level structure
78std::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
89graph::AdjacencyList<int>

Callers 1

gps_reorder_unlabelledFunction · 0.85

Calls 1

offsetsMethod · 0.80

Tested by

no test coverage detected