pub enum Distance {
Cosine,
L2,
Ip,
}Expand description
Distance metric. Scores are “smaller = closer” for every variant
(cosine → 1 - cos, ip → -dot), so one ascending merge works.
Variants§
Cosine
Cosine distance (vectors pre-normalized at insert).
L2
Squared euclidean.
Ip
Negative inner product.
Implementations§
Trait Implementations§
impl Copy for Distance
impl Eq for Distance
impl StructuralPartialEq for Distance
Auto Trait Implementations§
impl Freeze for Distance
impl RefUnwindSafe for Distance
impl Send for Distance
impl Sync for Distance
impl Unpin for Distance
impl UnsafeUnpin for Distance
impl UnwindSafe for Distance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more