method to reset matching
This commit is contained in:
parent
05ab338cf2
commit
e232da1234
2 changed files with 13 additions and 0 deletions
11
graph.cpp
11
graph.cpp
|
@ -205,6 +205,17 @@ void Graph::reset_forest()
|
|||
node.ear_or_root_neighbor = cur_id;
|
||||
node.root_of_ear_component = cur_id;
|
||||
// Note that we do not change the matching itself here
|
||||
++cur_id;
|
||||
}
|
||||
}
|
||||
|
||||
void Graph::reset_matching()
|
||||
{
|
||||
NodeId cur_id = 0;
|
||||
for(auto & node : _nodes)
|
||||
{
|
||||
node.matched_neighbor = cur_id;
|
||||
++cur_id;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -182,6 +182,8 @@ public:
|
|||
bool is_out_of_forest(NodeId const id) const;
|
||||
|
||||
void reset_forest();
|
||||
|
||||
void reset_matching();
|
||||
private:
|
||||
std::vector<Node> _nodes;
|
||||
size_type _num_edges;
|
||||
|
|
Loading…
Reference in a new issue