pub fn similarity_matrix<V, F>(inputs: &[V], compare: &F) -> Vec<f64>
where F: Fn(&V, &V) -> f64 + Send + Sync, V: Sync + AsRef<str>,
Expand description

This function is very heavily inspired by the example provided within the kodama documentation (at https://docs.rs/kodama)

The biggest differences? This allows for the comparison operation to be provided, and it compares values leveraging Rayon to speed up the operations. Due to the use of Rayon, we construct an intermediate vector to hold positions for calculations.