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

Method min

src/models/types.rs:438–449  ·  view source on GitHub ↗
(metric: DistanceMetric)

Source from the content-addressed store, hash-verified

436 }
437
438 pub fn min(metric: DistanceMetric) -> Self {
439 match metric {
440 DistanceMetric::Cosine => Self::CosineSimilarity(CosineSimilarity(-1.0)),
441 DistanceMetric::Euclidean => {
442 Self::EuclideanDistance(EuclideanDistance(f32::NEG_INFINITY))
443 }
444 DistanceMetric::Hamming => Self::HammingDistance(HammingDistance(f32::NEG_INFINITY)),
445 DistanceMetric::DotProduct => {
446 Self::DotProductDistance(DotProductDistance(f32::NEG_INFINITY))
447 }
448 }
449 }
450
451 pub fn max(metric: DistanceMetric) -> Self {
452 match metric {

Callers 10

quantizeMethod · 0.80
read_with_cursorMethod · 0.80
write_with_cursorMethod · 0.80
fromMethod · 0.80
sequential_searchMethod · 0.80
usv_searchMethod · 0.80
quantizeMethod · 0.80
quantizeMethod · 0.80

Calls 4

CosineSimilarityClass · 0.85
EuclideanDistanceClass · 0.85
HammingDistanceClass · 0.85
DotProductDistanceClass · 0.85

Tested by

no test coverage detected