(metric: DistanceMetric)
| 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 { |
no test coverage detected