Skip to content

Commit

Permalink
Added method to access union find without path compression from undo-log
Browse files Browse the repository at this point in the history
  • Loading branch information
dewert99 committed Mar 12, 2024
1 parent 2c1c95f commit da807b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/raw/semi_persistent1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ impl<L: Language, D, U: AsUnwrap<UndoLog>> RawEGraph<L, D, U> {
self.pop_nodes1(node_count);
}

/// Return the direct parent from the union find without path compression
pub fn find_direct_parent(&self, id: Id) -> Id {
self.undo_log.as_unwrap().undo_find.parent(id)
}

fn pop_memo1(&mut self, old_count: usize) {
assert!(self.memo.len() >= old_count);
let memo_log = &mut self.undo_log.as_mut_unwrap().memo_log;
Expand Down

0 comments on commit da807b0

Please sign in to comment.