From 14bbf619311968a39a98fdc3f6667384f5efc230 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 16 Jan 2020 10:19:22 +0100 Subject: Allow ranges of values, not just references --- geom_matching/wasserstein/include/wasserstein.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'geom_matching/wasserstein/include/wasserstein.h') diff --git a/geom_matching/wasserstein/include/wasserstein.h b/geom_matching/wasserstein/include/wasserstein.h index d8d6b2e..5be7691 100644 --- a/geom_matching/wasserstein/include/wasserstein.h +++ b/geom_matching/wasserstein/include/wasserstein.h @@ -106,11 +106,11 @@ namespace ws std::map m1, m2; - for(const auto& pair1 : dgm1) { + for(auto&& pair1 : dgm1) { m1[pair1]++; } - for(const auto& pair2 : dgm2) { + for(auto&& pair2 : dgm2) { m2[pair2]++; } @@ -296,7 +296,7 @@ wasserstein_cost(const PairContainer& A, std::vector x_plus_B, x_minus_B, y_plus_B, y_minus_B; // loop over A, add projections of A-points to corresponding positions // in B-vector - for(auto& pair_A : A) { + for(auto&& pair_A : A) { a_empty = false; RealType x = Traits::get_x(pair_A); RealType y = Traits::get_y(pair_A); @@ -315,7 +315,7 @@ wasserstein_cost(const PairContainer& A, } } // the same for B - for(auto& pair_B : B) { + for(auto&& pair_B : B) { b_empty = false; RealType x = Traits::get_x(pair_B); RealType y = Traits::get_y(pair_B); -- cgit v1.2.3