|
pub fn layer_item_id(&self, level: usize, item: usize) -> usize { |
|
if level == 0 { |
|
item |
|
} else { |
|
self.layers[level][item as usize].zero_node |
|
} |
|
} |
This indexes layers with level where all other methods seem to use level - 1 here to compensate for the zero layer being stored in its own vector. This means that the feature for an unexpected node ends up being looked up.
hnsw/src/hnsw/hnsw_const.rs
Lines 239 to 245 in 1caa704
This indexes
layerswithlevelwhere all other methods seem to uselevel - 1here to compensate for the zero layer being stored in its own vector. This means that the feature for an unexpected node ends up being looked up.