summaryrefslogtreecommitdiff
path: root/geom_matching/wasserstein/include/auction_runner_gs.hpp
diff options
context:
space:
mode:
authorArnur Nigmetov <nigmetov@tugraz.at>2019-02-06 22:45:18 +0100
committerArnur Nigmetov <nigmetov@tugraz.at>2019-02-06 22:45:18 +0100
commitba25f264b5d309efcf77a6b72d1b784ae97f741f (patch)
treefb536fc0d0e9f241e6c7b37b45a94e31d25f1a8f /geom_matching/wasserstein/include/auction_runner_gs.hpp
parent657f73321f04d5d1c4cec8085ec43a73633b96af (diff)
Switch to opts, tolerate max-iterations-exceeded.
1. Use opts.h for command-line parsing in wasserstein_dist. 2. Real relative error at the end of auction is stored in params, params is passed by reference. 3. If -e command line option is given to wasserstein_dist, relative error will be printed. 4. If -t option is given to wasserstein_dist, no exception will be thrown, if maximum number of iterations is exceeded. 5. Run wasserstein_dist -h to see all options.
Diffstat (limited to 'geom_matching/wasserstein/include/auction_runner_gs.hpp')
-rw-r--r--geom_matching/wasserstein/include/auction_runner_gs.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/geom_matching/wasserstein/include/auction_runner_gs.hpp b/geom_matching/wasserstein/include/auction_runner_gs.hpp
index 141cb2c..4ef94db 100644
--- a/geom_matching/wasserstein/include/auction_runner_gs.hpp
+++ b/geom_matching/wasserstein/include/auction_runner_gs.hpp
@@ -68,6 +68,7 @@ AuctionRunnerGS<R, AO, PC>::AuctionRunnerGS(const PC& A,
initial_epsilon(params.initial_epsilon),
epsilon_common_ratio(params.epsilon_common_ratio == 0.0 ? 5.0 : params.epsilon_common_ratio),
max_num_phases(params.max_num_phases),
+ tolerate_max_iter_exceeded(params.tolerate_max_iter_exceeded),
dimension(params.dim),
oracle(bidders, items, params)
#ifdef LOG_AUCTION
@@ -294,7 +295,7 @@ void AuctionRunnerGS<R, AO, PC>::run_auction()
double 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;
- if (relative_error > delta) {
+ if (relative_error > delta and not tolerate_max_iter_exceeded) {
#ifndef FOR_R_TDA
std::cerr << "Maximum iteration number exceeded, exiting. Current result is: ";
std::cerr << pow(wasserstein_cost, 1.0/wasserstein_power) << std::endl;