reset forest method
This commit is contained in:
parent
4c65b47f39
commit
433430f92c
2 changed files with 12 additions and 0 deletions
10
graph.cpp
10
graph.cpp
|
@ -196,4 +196,14 @@ bool Graph::is_out_of_forest(const ED::NodeId id) const
|
||||||
ear_or_root_neighbor(matched_neighbor(id)) == matched_neighbor(id);
|
ear_or_root_neighbor(matched_neighbor(id)) == matched_neighbor(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Graph::reset_forest()
|
||||||
|
{
|
||||||
|
NodeId cur_id = 0;
|
||||||
|
for(auto & node : _nodes) {
|
||||||
|
node._ear_or_root_neighbor = cur_id;
|
||||||
|
node._root_of_ear_component = cur_id;
|
||||||
|
// Note that we do not change the matching itself here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ED
|
} // namespace ED
|
||||||
|
|
|
@ -175,6 +175,8 @@ public:
|
||||||
bool is_inner(NodeId const id) const;
|
bool is_inner(NodeId const id) const;
|
||||||
|
|
||||||
bool is_out_of_forest(NodeId const id) const;
|
bool is_out_of_forest(NodeId const id) const;
|
||||||
|
|
||||||
|
void reset_forest();
|
||||||
private:
|
private:
|
||||||
std::vector<Node> _nodes;
|
std::vector<Node> _nodes;
|
||||||
size_type _num_edges;
|
size_type _num_edges;
|
||||||
|
|
Loading…
Reference in a new issue