summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2020-01-16 10:19:22 +0100
committerMarc Glisse <marc.glisse@inria.fr>2020-01-16 10:19:22 +0100
commit14bbf619311968a39a98fdc3f6667384f5efc230 (patch)
tree4166b0f3c567b3a1a48f6436ad1fb47317cd4947
parent9a89971855acefe39dce0e2adadf53b88ca8f683 (diff)
Allow ranges of values, not just references
-rw-r--r--geom_matching/wasserstein/include/wasserstein.h8
1 files changed, 4 insertions, 4 deletions
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<PointType, int> 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<RealType> 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);