From 0d3a01257675ee637c09046c739eaa235984b515 Mon Sep 17 00:00:00 2001 From: Arnur Nigmetov Date: Fri, 14 Apr 2017 20:31:56 +0600 Subject: Bug in Wasserstein fixed: internal_p not passed to kd-tree --- geom_matching/wasserstein/src/auction_oracle.cpp | 1 + geom_matching/wasserstein/src/auction_runner_gs.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/geom_matching/wasserstein/src/auction_oracle.cpp b/geom_matching/wasserstein/src/auction_oracle.cpp index 9c764da..f13ffe6 100644 --- a/geom_matching/wasserstein/src/auction_oracle.cpp +++ b/geom_matching/wasserstein/src/auction_oracle.cpp @@ -970,6 +970,7 @@ AuctionOracleKDTreeRestricted::AuctionOracleKDTreeRestricted(const std::vector(traits, dnnPointHandles, wassersteinPower); size_t handleIdx {0}; diff --git a/geom_matching/wasserstein/src/auction_runner_gs.cpp b/geom_matching/wasserstein/src/auction_runner_gs.cpp index e568813..83d88c5 100644 --- a/geom_matching/wasserstein/src/auction_runner_gs.cpp +++ b/geom_matching/wasserstein/src/auction_runner_gs.cpp @@ -241,6 +241,7 @@ double AuctionRunnerGS::getDistanceToQthPowerInternal(void) { sanityCheck(); double result = 0.0; + //std::cout << "-------------------------------------------------------------------------\n"; for(size_t bIdx = 0; bIdx < numBidders; ++bIdx) { auto pA = bidders[bIdx]; assert( 0 <= biddersToItems[bIdx] and biddersToItems[bIdx] < static_cast(items.size()) ); @@ -248,6 +249,7 @@ double AuctionRunnerGS::getDistanceToQthPowerInternal(void) //std::cout << "pA = " << pA << ", pB = " << pB << ", pow(distLp(pA, pB, internal_p), wassersteinPower) = " << pow(distLp(pA, pB, internal_p), wassersteinPower) << ", dist = " << distLp(pA, pB, internal_p) << std::endl; result += pow(distLp(pA, pB, internal_p), wassersteinPower); } + //std::cout << "-------------------------------------------------------------------------\n"; wassersteinCost = result; wassersteinDistance = pow(result, 1.0 / wassersteinPower); return result; -- cgit v1.2.3