66 throw std::range_error(
"__FUNCTION__: Histograms do not have equal ranges.");
69 std::vector<double> emd (h1.
bins(), 0.0);
72 for (
size_t i = 0; i < h1.
bins() - 1; ++i) {
73 emd[i + 1] = h1[i] + emd[i] - h2[i];
79 result += std::abs( emd[i + 1] ) * delta;
92 return earth_movers_distance_simple( hn1, hn2 );
94 return earth_movers_distance_simple( h1, h2 );