diff options
Diffstat (limited to 'Source/cmComputeComponentGraph.h')
-rw-r--r-- | Source/cmComputeComponentGraph.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/Source/cmComputeComponentGraph.h b/Source/cmComputeComponentGraph.h index a2ce946c1..8cd4fe73a 100644 --- a/Source/cmComputeComponentGraph.h +++ b/Source/cmComputeComponentGraph.h @@ -1,22 +1,14 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ #ifndef cmComputeComponentGraph_h #define cmComputeComponentGraph_h -#include "cmStandardIncludes.h" +#include "cmConfigure.h" // IWYU pragma: keep #include "cmGraphAdjacencyList.h" #include <stack> +#include <vector> /** \class cmComputeComponentGraph * \brief Analyze a graph to determine strongly connected components. @@ -40,20 +32,24 @@ public: ~cmComputeComponentGraph(); /** Get the adjacency list of the component graph. */ - Graph const& GetComponentGraph() const - { return this->ComponentGraph; } + Graph const& GetComponentGraph() const { return this->ComponentGraph; } EdgeList const& GetComponentGraphEdges(int c) const - { return this->ComponentGraph[c]; } + { + return this->ComponentGraph[c]; + } /** Get map from component index to original node indices. */ std::vector<NodeList> const& GetComponents() const - { return this->Components; } - NodeList const& GetComponent(int c) const - { return this->Components[c]; } + { + return this->Components; + } + NodeList const& GetComponent(int c) const { return this->Components[c]; } /** Get map from original node index to component index. */ std::vector<int> const& GetComponentMap() const - { return this->TarjanComponents; } + { + return this->TarjanComponents; + } private: void TransferEdges(); @@ -67,17 +63,17 @@ private: int Root; int VisitIndex; }; - int TarjanWalkId; std::vector<int> TarjanVisited; std::vector<int> TarjanComponents; std::vector<TarjanEntry> TarjanEntries; + std::vector<NodeList> Components; std::stack<int> TarjanStack; + int TarjanWalkId; int TarjanIndex; void Tarjan(); void TarjanVisit(int i); // Connected components. - std::vector<NodeList> Components; }; #endif |