Bump M up to 24
This commit is contained in:
parent
581b3a17e2
commit
04094ce06f
10
src/lib.rs
10
src/lib.rs
|
@ -617,7 +617,7 @@ impl Node for UpperNode {
|
|||
}
|
||||
|
||||
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
struct ZeroNode {
|
||||
/// The nearest neighbors on this layer
|
||||
///
|
||||
|
@ -625,6 +625,12 @@ struct ZeroNode {
|
|||
nearest: [PointId; M * 2],
|
||||
}
|
||||
|
||||
impl Default for ZeroNode {
|
||||
fn default() -> ZeroNode {
|
||||
ZeroNode { nearest: [PointId::invalid(); M * 2] }
|
||||
}
|
||||
}
|
||||
|
||||
impl Node for ZeroNode {
|
||||
fn nearest_mut(&mut self) -> &mut [PointId] {
|
||||
&mut self.nearest
|
||||
|
@ -760,4 +766,4 @@ impl Index<PointId> for [ZeroNode] {
|
|||
/// The parameter `M` from the paper
|
||||
///
|
||||
/// This should become a generic argument to `Hnsw` when possible.
|
||||
const M: usize = 12;
|
||||
const M: usize = 24;
|
||||
|
|
Loading…
Reference in New Issue