summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnur Nigmetov <a.nigmetov@gmail.com>2017-04-14 20:31:56 +0600
committerArnur Nigmetov <a.nigmetov@gmail.com>2017-04-14 20:31:56 +0600
commit0d3a01257675ee637c09046c739eaa235984b515 (patch)
treec72401928bfa82bb10d28fc8d4e601ddfbf5d1e9
parent211b596991529e2c7f4458454faa92bede554d80 (diff)
Bug in Wasserstein fixed: internal_p not passed to kd-tree
-rw-r--r--geom_matching/wasserstein/src/auction_oracle.cpp1
-rw-r--r--geom_matching/wasserstein/src/auction_runner_gs.cpp2
2 files changed, 3 insertions, 0 deletions
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<D
dnnPointHandles.push_back(&dnnPoints[i]);
}
DnnTraits traits;
+ traits.internal_p = internal_p;
kdtree = new dnn::KDTree<DnnTraits>(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<int>(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;