Added similarity relation.

This commit is contained in:
vorboyvo 2025-09-24 13:51:49 -04:00
parent f58cd7f2f6
commit 9b282c4acb
2 changed files with 21 additions and 1 deletions

View file

@ -5,5 +5,9 @@ mod tree;
mod test;
fn main() {
unimplemented!();
// safely: trust me!!
// having fun or funly having?
unsafe {
std::hint::unreachable_unchecked()
}
}

View file

@ -93,3 +93,19 @@ impl<T: Eq, U: Float> Tree<T, U> {
}
}
pub struct SimilarityRelation<T: Eq> {
left: T,
right: T,
with_respect_to: T
}
// implement symmetry
impl<T: Eq> PartialEq for SimilarityRelation<T> {
fn eq(&self, other: &Self) -> bool {
(
(self.left == other.left && self.right == other.right)
|| (self.left == other.right && self.right == other.left)
)
&& self.with_respect_to == other.with_respect_to
}
}