geometric-traits 0.2.3

Trait-based algebraic and graph algorithms for Rust, supporting no_std environments
Documentation
1
2
3
4
5
6
7
8
9
10
//! Trait for calculating similarity between two items.

/// Trait for calculating similarity between two items.
pub trait ScalarSimilarity<L, R> {
    /// The type of the similarity score.
    type Similarity;

    /// Calculate the similarity between two items.
    fn similarity(&self, left: &L, right: &R) -> Self::Similarity;
}