pub struct HeuristicMatching { /* private fields */ }Expand description
Heuristic matching algorithm for building correspondences between trees.
This implementation follows the algorithm described in the 3DM thesis:
- Find candidate matches using exact content hash or fuzzy matching
- Score candidates by counting matching descendants (DFS match)
- Select best candidate, resolving ambiguities using sibling context
- Remove small copies below copy_threshold
- Match similar unmatched nodes to neighbors’ siblings
- Set match types (FULL/CONTENT/CHILDREN) for copies
Implementations§
Source§impl HeuristicMatching
impl HeuristicMatching
Sourcepub fn with_copy_threshold(copy_threshold: i32) -> Self
pub fn with_copy_threshold(copy_threshold: i32) -> Self
Creates a new HeuristicMatching instance with custom copy threshold.
Sourcepub fn with_trees(base: &NodeRef, branch: &NodeRef) -> Self
pub fn with_trees(base: &NodeRef, branch: &NodeRef) -> Self
Creates a new HeuristicMatching and builds the matching.
Sourcepub fn set_is_left(&mut self, is_left: bool)
pub fn set_is_left(&mut self, is_left: bool)
Sets whether this matching is for the left branch.
Sourcepub fn copy_threshold(&self) -> i32
pub fn copy_threshold(&self) -> i32
Returns the copy threshold.
Trait Implementations§
Source§impl Default for HeuristicMatching
impl Default for HeuristicMatching
Source§impl Matching for HeuristicMatching
impl Matching for HeuristicMatching
Source§fn build_matching(&mut self, base: &NodeRef, branch: &NodeRef)
fn build_matching(&mut self, base: &NodeRef, branch: &NodeRef)
Builds a matching between a base tree and a branch tree. Read more
Source§fn get_area_stop_nodes(&self, stop_nodes: &mut Vec<NodeRef>, node: &NodeRef)
fn get_area_stop_nodes(&self, stop_nodes: &mut Vec<NodeRef>, node: &NodeRef)
Gets the children of leaf nodes in a matching subtree. Read more
Source§fn branch_root(&self) -> Option<&NodeRef>
fn branch_root(&self) -> Option<&NodeRef>
Returns a reference to the branch tree root.
Auto Trait Implementations§
impl Freeze for HeuristicMatching
impl !RefUnwindSafe for HeuristicMatching
impl !Send for HeuristicMatching
impl !Sync for HeuristicMatching
impl Unpin for HeuristicMatching
impl !UnwindSafe for HeuristicMatching
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more