diff options
author | Arnur Nigmetov <a.nigmetov@gmail.com> | 2018-05-31 23:42:22 +0200 |
---|---|---|
committer | Arnur Nigmetov <a.nigmetov@gmail.com> | 2018-05-31 23:42:22 +0200 |
commit | c563d463ffce73b070b35e62baf980d19d0bc4ac (patch) | |
tree | 94712f7d2b7f618166b3021dfa3b03930739c945 /geom_matching/wasserstein/include/auction_runner_jac.hpp | |
parent | 8ffc1482c88fd1c503524f6e328f69fe3fdede6c (diff) |
2 bugs fixed in Jacobi for point cloud
Diffstat (limited to 'geom_matching/wasserstein/include/auction_runner_jac.hpp')
-rw-r--r-- | geom_matching/wasserstein/include/auction_runner_jac.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/geom_matching/wasserstein/include/auction_runner_jac.hpp b/geom_matching/wasserstein/include/auction_runner_jac.hpp index 8663bae..c519de1 100644 --- a/geom_matching/wasserstein/include/auction_runner_jac.hpp +++ b/geom_matching/wasserstein/include/auction_runner_jac.hpp @@ -42,7 +42,6 @@ derivative works thereof, in binary and source code form. #undef DEBUG_AUCTION #endif - namespace hera { namespace ws { @@ -350,6 +349,8 @@ namespace ws { typename AuctionRunnerJac<R, AO, PC>::Real AuctionRunnerJac<R, AO, PC>::get_relative_error(const bool debug_output) const { + if (partial_cost == 0.0 and unassigned_bidders.empty()) + return 0.0; Real result; #ifndef WASSERSTEIN_PURE_GEOM Real gamma = get_gamma(); @@ -560,7 +561,7 @@ namespace ws { wasserstein_cost = get_item_bidder_cost(0,0); return; } - double init_eps = (initial_epsilon > 0.0) ? initial_epsilon : oracle.max_val_ / 4.0; + R init_eps = (initial_epsilon > 0.0) ? initial_epsilon : oracle.max_val_ / 4.0; run_auction_phases(max_num_phases, init_eps); is_distance_computed = true; wasserstein_cost = partial_cost; @@ -703,7 +704,11 @@ namespace ws { template<class R, class AO, class PC> bool AuctionRunnerJac<R, AO, PC>::continue_auction_phase() const { +#ifdef WASSERSTEIN_PURE_GEOM + return not unassigned_bidders.empty(); +#else return not unassigned_bidders.empty() and not is_done(); +#endif } template<class R, class AO, class PC> |