Files
revng-revng/lib/Yield/Support/GraphLayout/SugiyamaStyle/LayoutConversion.cpp
T
Ivan Krysak 3b700f7820 Sugiyama: Rename Layout into InternalCompute
Also renames `calculateSugiyamaLayout()` into `computeInternal()`.
2023-04-27 17:28:22 +02:00

17 lines
466 B
C++

/// \file LayoutConversion.cpp
/// \brief
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include "InternalCompute.h"
LayoutContainer convertToLayout(const LayerContainer &Layers) {
LayoutContainer Result;
for (size_t Index = 0; Index < Layers.size(); ++Index)
for (size_t NodeIndex = 0; NodeIndex < Layers[Index].size(); ++NodeIndex)
Result[Layers[Index][NodeIndex]] = { Index, NodeIndex };
return Result;
}