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

Method cmp

src/models/types.rs:405–413  ·  view source on GitHub ↗
(&self, other: &Self)

Source from the content-addressed store, hash-verified

403
404impl Ord for MetricResult {
405 fn cmp(&self, other: &Self) -> std::cmp::Ordering {
406 match self {
407 Self::CosineSimilarity(val) => val.0.total_cmp(&other.get_value()),
408 Self::CosineDistance(val) => other.get_value().total_cmp(&val.0),
409 Self::EuclideanDistance(val) => other.get_value().total_cmp(&val.0),
410 Self::HammingDistance(val) => other.get_value().total_cmp(&val.0),
411 Self::DotProductDistance(val) => val.0.total_cmp(&other.get_value()),
412 }
413 }
414}
415
416impl MetricResult {

Callers 5

traverse_find_nearestFunction · 0.45
delete_embeddingFunction · 0.45
set_to_value_indexFunction · 0.45
partial_cmpMethod · 0.45

Calls 1

get_valueMethod · 0.80

Tested by

no test coverage detected