use ndarray::Array1;
use ndarray::ArrayView1;
use std::fmt::Debug;
#[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize)]
pub enum MetricType {
Euclidean,
Generic,
}
pub trait Metric: Debug + Send + Sync {
fn metric_type(&self) -> MetricType {
MetricType::Generic
}
fn distance(&self, a: ArrayView1<f32>, b: ArrayView1<f32>) -> (f32, Array1<f32>);
fn disconnection_threshold(&self) -> f32 {
f32::INFINITY
}
fn squared_distance(&self, _a: ArrayView1<f32>, _b: ArrayView1<f32>) -> Option<f32> {
None
}
}