Skip to main content

walk_tree

Function walk_tree 

Source
pub fn walk_tree<I, T>(
    nodes: &[QTreeNode<T>],
    root: i16,
    x: &[I],
    max_nodes: usize,
) -> i32
where I: Copy + Into<i32>, T: Copy + Into<i32>,
Expand description

Walk the tree rooted at root in the pool nodes to a leaf and return its value (C++ walkQTree). At most max_nodes splits are followed, so a cyclic pool ends; the node reached then gives its leaf_value, as in the C++. An index outside nodes or x ends the walk with 0 (see the module docs).