[−][src]Function emd::distance_generic
pub fn distance_generic<D>(
X: &ArrayView2<f64>,
Y: &ArrayView2<f64>,
distance: D
) -> f64 where
D: Fn(&ArrayView1<f64>, &ArrayView1<f64>) -> f64,
Computes the EMD with a desired cost function (i.e., distance).
Uses the Euclidean distance between rows (vectors) in a matrix as a cost function. Each matrix may represent for example a multivariate histogram.
Arguments
X
- First matrixY
- Second matrixdistance
- Distance metric