Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

PCTreeForest.h
Go to the documentation of this file.
1 
32 #pragma once
33 
37 
38 #include <cstdint>
39 #include <vector>
40 
41 #define OGDF_PCTREE_REUSE_NODES
42 
43 namespace ogdf::pc_tree {
44 using UnionFindIndex = size_t;
45 
46 const UnionFindIndex UNIONFINDINDEX_EMPTY = std::numeric_limits<UnionFindIndex>::max();
47 
54  friend class PCNode;
55  friend class PCTree;
56  friend class PCTreeRegistry;
57 
58 private:
59  std::vector<PCTree*> m_trees;
60  std::vector<PCNode*> m_cNodes;
61  ogdf::DisjointSets<> m_parents {1 << 8};
62  int m_nextNodeId = 0;
63  size_t m_timestamp = 0;
66 
67 #ifdef OGDF_PCTREE_REUSE_NODES
68  PCNode* m_reusableNodes = nullptr;
69 #endif
70 
71 public:
77  PCTreeForest(bool autodelete = true) : m_nodeArrayRegistry(this), m_autodelete(autodelete) {};
78 
79  virtual ~PCTreeForest();
80 
82  PCTree* makeTree(void);
83 
85  void clear(void);
86 
87  operator const PCTreeRegistry&() const { return m_nodeArrayRegistry; }
88 };
89 }
ogdf::pc_tree::PCTreeForest::PCTreeForest
PCTreeForest(bool autodelete=true)
Definition: PCTreeForest.h:77
ogdf::pc_tree
Definition: NodePCRotation.h:37
ogdf::pc_tree::PCTree
A PC-tree represents a set of cyclic orders of its leaves by labeling its inner nodes as either P- or...
Definition: PCTree.h:109
ogdf::pc_tree::PCTreeRegistry
A registry that allows labelling the nodes of a PC-tree.
Definition: PCRegistry.h:40
ogdf::pc_tree::PCTreeForest::m_nodeArrayRegistry
PCTreeRegistry m_nodeArrayRegistry
Definition: PCTreeForest.h:64
ogdf::pc_tree::PCTreeForest
Multiple PCTrees can be created within the same PCTreeForest, which allows merging the trees later on...
Definition: PCTreeForest.h:53
ogdf::DisjointSets
A Union/Find data structure for maintaining disjoint sets.
Definition: DisjointSets.h:90
ogdf::pc_tree::PCTreeForest::m_cNodes
std::vector< PCNode * > m_cNodes
Definition: PCTreeForest.h:60
PCRegistry.h
A registry that allows labelling the nodes of a PC-tree.
ogdf::pc_tree::UNIONFINDINDEX_EMPTY
const UnionFindIndex UNIONFINDINDEX_EMPTY
Definition: PCTreeForest.h:46
ogdf::pc_tree::UnionFindIndex
size_t UnionFindIndex
Definition: PCTreeForest.h:44
PCEnum.h
Predeclaration of various PC-tree related classes and enums.
ogdf::pc_tree::PCNode
A node in a PC-tree that is either a P-node, C-node or leaf.
Definition: PCNode.h:58
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::pc_tree::PCTreeForest::m_trees
std::vector< PCTree * > m_trees
Definition: PCTreeForest.h:59
DisjointSets.h
Implementation of disjoint sets data structures (union-find functionality).
ogdf::pc_tree::PCTreeForest::m_autodelete
bool m_autodelete
Definition: PCTreeForest.h:65