use std::cmp::Ordering;
#[derive(Clone, Copy, Debug, PartialEq)]
pub(crate) struct SimplexEntry {
pub(crate) id: usize,
pub(crate) value: f64,
}
impl Eq for SimplexEntry {}
impl Ord for SimplexEntry {
fn cmp(&self, other: &Self) -> Ordering {
crate::complex::compare_filtration(
self.value,
other.value,
Ordering::Equal,
other.id.cmp(&self.id),
)
}
}
impl PartialOrd for SimplexEntry {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}