/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #pragma once #include "cmConfigure.h" // IWYU pragma: keep #include #include #include "cmGraphAdjacencyList.h" /** \class cmComputeComponentGraph * \brief Analyze a graph to determine strongly connected components. * * Convert a directed graph into a directed acyclic graph whose nodes * correspond to strongly connected components of the original graph. * * We use Tarjan's algorithm to enumerate the components efficiently. * An advantage of this approach is that the components are identified * in a topologically sorted order. */ class cmComputeComponentGraph { public: // Represent the graph with an adjacency list. using NodeList = cmGraphNodeList; using EdgeList = cmGraphEdgeList; using Graph = cmGraphAdjacencyList; cmComputeComponentGraph(Graph const& input); ~cmComputeComponentGraph(); /** Run the computation. */ void Compute(); /** Get the adjacency list of the component graph. */ Graph const& GetComponentGraph() const { return this->ComponentGraph; } EdgeList const& GetComponentGraphEdges(int c) const { return this->ComponentGraph[c]; } /** Get map from component index to original node indices. */ std::vector const& GetComponents() const { return this->Components; } NodeList const& GetComponent(int c) const { return this->Components[c]; } /** Get map from original node index to component index. */ std::vector const& GetComponentMap() const { return this->TarjanComponents; } private: void TransferEdges(); Graph const& InputGraph; Graph ComponentGraph; // Tarjan's algorithm. struct TarjanEntry { int Root; int VisitIndex; }; std::vector TarjanVisited; std::vector TarjanComponents; std::vector TarjanEntries; std::vector Components; std::stack TarjanStack; int TarjanWalkId; int TarjanIndex; void Tarjan(); void TarjanVisit(int i); // Connected components. }; ats/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c?h=v3.27.3'>stats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-22 13:58:08 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-22 20:51:15 (GMT)
commit48297cf770664e59283b3bf3a35a2ceab7b55f1f (patch)
tree7d71cffd7f20bb0fcf8cc4f634e75ea37f5db2af /Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c
parent91e4d27765945e27b623fbb4e3a066ee9157970a (diff)
downloadCMake-48297cf770664e59283b3bf3a35a2ceab7b55f1f.zip
CMake-48297cf770664e59283b3bf3a35a2ceab7b55f1f.tar.gz
CMake-48297cf770664e59283b3bf3a35a2ceab7b55f1f.tar.bz2
libarchive: Suppress clang-analyzer warnings
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c