fn lower_search(&self, layer: &[Node<M>], searcher: &mut Searcher<Met::Unit>) {
        // Clear the candidates so we can fill them with the best nodes in the last layer.
        searcher.candidates.clear();
        // Only preserve the best candidate. The original paper's algorithm uses `1` every time.
        // See Algorithm 5 line 5 of the paper. The paper makes no further comment on why `1` was chosen.
        let &Neighbor { index, distance } = searcher.nearest.first().unwrap();
        searcher.nearest.clear();
        // Update the node to the next layer.
        let new_index = layer[index].next_node as usize;
        let candidate = Neighbor {
            index: new_index,
            distance,
        };
        // Insert the index of the nearest neighbor into the nearest pool for the next layer.
        searcher.nearest.push(candidate);
        // Insert the index into the candidate pool as well.
        searcher.candidates.push(candidate);
    }
/// Ready a search for the next level down.
///
/// `m` is the maximum number of nearest neighbors to consider during the search.
Ready a search for the next level down.
`m` is the maximum number of nearest neighbors to consider during the search.
Ready a search for the next level down . ` m ` is the maximum number of nearest neighbors to consider during the search .
fn lower_search(&self, layer: &[Node<M>], searcher: &mut Searcher<Met::Unit>) {
        // Clear the candidates so we can fill them with the best nodes in the last layer.
        searcher.candidates.clear();
        // Only preserve the best candidate. The original paper's algorithm uses `1` every time.
        // See Algorithm 5 line 5 of the paper. The paper makes no further comment on why `1` was chosen.
        let &Neighbor { index, distance } = searcher.nearest.first().unwrap();
        searcher.nearest.clear();
        // Update the node to the next layer.
        let new_index = layer[index].next_node as usize;
        let candidate = Neighbor {
            index: new_index,
            distance,
        };
        // Insert the index of the nearest neighbor into the nearest pool for the next layer.
        searcher.nearest.push(candidate);
        // Insert the index into the candidate pool as well.
        searcher.candidates.push(candidate);
    }
fn lower_search ( & self , layer : & [ Node < M > ] , searcher : & mut Searcher < Met :: Unit > ) { // Clear the candidates so we can fill them with the best nodes in the last layer. searcher . candidates . clear ( ) ; // Only preserve the best candidate. The original paper's algorithm uses `1` every time. // See Algorithm 5 line 5 of the paper. The paper makes no further comment on why `1` was chosen. let & Neighbor { index , distance } = searcher . nearest . first ( ) . unwrap ( ) ; searcher . nearest . clear ( ) ; // Update the node to the next layer. let new_index = layer [ index ] . next_node as usize ; let candidate = Neighbor { index : new_index , distance , } ; // Insert the index of the nearest neighbor into the nearest pool for the next layer. searcher . nearest . push ( candidate ) ; // Insert the index into the candidate pool as well. searcher . candidates . push ( candidate ) ; }
Ready a search for the next level down.
Ready a search for the next level down .
&self
layer
&[Node<M>]
searcher
&mut Searcher<Met::Unit>
&self
layer
&[Node<M>]
searcher
&mut Searcher<Met::Unit>