Finds the node at a given dimension Traverses the tree iteratively and returns a reference to the node.
(&self, dim_index: u32)
| 258 | /// Finds the node at a given dimension |
| 259 | /// Traverses the tree iteratively and returns a reference to the node. |
| 260 | pub fn find_node(&self, dim_index: u32) -> Option<&InvertedIndexNode> { |
| 261 | let mut current_node = &self.root; |
| 262 | let path = calculate_path(dim_index, self.root.dim_index); |
| 263 | for child_index in path { |
| 264 | let child = current_node.children.get(child_index as usize)?; |
| 265 | let node_res = unsafe { &*child }; |
| 266 | current_node = node_res; |
| 267 | } |
| 268 | |
| 269 | Some(current_node) |
| 270 | } |
| 271 | |
| 272 | // Inserts vec_id, quantized value u8 at particular node based on path |
| 273 | pub fn insert( |
no test coverage detected