use crate::{CriticalPair, PersistentClass, SparseDistanceMatrix};
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct PersistenceCycleTerm {
pub u: usize,
pub v: usize,
pub coefficient: u32,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct PersistenceTriangleTerm {
pub vertices: [usize; 3],
pub coefficient: u32,
}
#[derive(Debug, Clone)]
pub struct PersistentClassArtifact {
pub(super) source: SparseDistanceMatrix,
pub(super) threshold: Option<f64>,
pub(super) class: PersistentClass,
pub(super) critical_pair: CriticalPair,
pub(super) cycle: Vec<PersistenceCycleTerm>,
pub(super) bounding_chain: Vec<PersistenceTriangleTerm>,
}
impl PersistentClassArtifact {
pub fn source(&self) -> &SparseDistanceMatrix {
&self.source
}
pub fn threshold(&self) -> Option<f64> {
self.threshold
}
pub fn class(&self) -> &PersistentClass {
&self.class
}
pub fn critical_pair(&self) -> &CriticalPair {
&self.critical_pair
}
pub fn cycle(&self) -> &[PersistenceCycleTerm] {
&self.cycle
}
pub fn bounding_chain(&self) -> &[PersistenceTriangleTerm] {
&self.bounding_chain
}
}