#[derive(Debug, Clone, PartialEq, bincode::Encode, bincode::Decode)]
pub struct DpResult {
pub distance: f64,
pub matrix: Option<Vec<f64>>,
}
impl std::fmt::Display for DpResult {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.matrix {
Some(_) => write!(f, "{}", self.distance),
None => write!(f, "{}", self.distance),
}
}
}
impl DpResult {
pub fn new(distance: f64) -> Self {
Self {
distance,
matrix: None,
}
}
pub fn with_matrix(distance: f64, matrix: Vec<f64>) -> Self {
Self {
distance,
matrix: Some(matrix),
}
}
}
pub mod base;
pub mod batch;
pub mod discret_frechet;
pub mod distance_type;
pub mod dtw;
pub mod edr;
pub mod edwp;
pub mod erp;
pub mod euclidean;
pub mod frechet;
pub mod hausdorff;
pub mod lcss;
pub mod spherical;
pub mod sspd;
pub mod utils;