Add Hnsw::iter() method
This commit is contained in:
parent
68b5c72067
commit
fbfefdba6f
|
@ -187,6 +187,14 @@ where
|
||||||
}
|
}
|
||||||
found
|
found
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Iterate over the keys and values in this index
|
||||||
|
pub fn iter(&self) -> impl Iterator<Item = (PointId, &P)> {
|
||||||
|
self.points
|
||||||
|
.iter()
|
||||||
|
.enumerate()
|
||||||
|
.map(|(i, p)| (PointId(i as u32), p))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Keeps mutable state for searching a point's nearest neighbors
|
/// Keeps mutable state for searching a point's nearest neighbors
|
||||||
|
|
Loading…
Reference in New Issue