MCPcopy Create free account
hub / github.com/cosdata/cosdata / DistanceFunction

Interface DistanceFunction

src/distance/mod.rs:8–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6use crate::models::types::VectorData;
7
8pub trait DistanceFunction: std::fmt::Debug + Send + Sync {
9 type Item;
10 fn calculate(
11 &self,
12 x: &VectorData,
13 y: &VectorData,
14 is_indexing: bool,
15 ) -> Result<Self::Item, DistanceError>;
16}
17
18#[derive(Debug)]
19pub enum DistanceError {

Callers

nothing calls this directly

Implementers 5

dotproduct.rssrc/distance/dotproduct.rs
hamming.rssrc/distance/hamming.rs
cosine.rssrc/distance/cosine.rs
euclidean.rssrc/distance/euclidean.rs
types.rssrc/models/types.rs

Calls

no outgoing calls

Tested by

no test coverage detected