From 1607071fcd9d473eae295693fc97bee8c50d6a11 Mon Sep 17 00:00:00 2001 From: Arnur Nigmetov Date: Tue, 4 Apr 2017 14:20:16 +0200 Subject: Prepare to output real relative error. In Wasserstein distance computation AuctionRunner class now has a field relativeError which contains the relative error which we can guarantee, so if the user asked for 0.1 accuracy, but the result is 0.03 accurate, this information can be retrieved. --- geom_matching/wasserstein/src/auction_runner_jac.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'geom_matching/wasserstein/src/auction_runner_jac.cpp') diff --git a/geom_matching/wasserstein/src/auction_runner_jac.cpp b/geom_matching/wasserstein/src/auction_runner_jac.cpp index b892643..c807ec9 100644 --- a/geom_matching/wasserstein/src/auction_runner_jac.cpp +++ b/geom_matching/wasserstein/src/auction_runner_jac.cpp @@ -188,7 +188,7 @@ void AuctionRunnerJac::flushAssignment(void) void AuctionRunnerJac::runAuction(void) { - // relative error + relativeError = std::numeric_limits::max(); // choose some initial epsilon oracle->setEpsilon(oracle->maxVal / 4.0); assert( oracle->getEpsilon() > 0 ); @@ -210,6 +210,7 @@ void AuctionRunnerJac::runAuction(void) } else { denominator = pow(denominator, 1.0 / wassersteinPower); double numerator = currentResult - denominator; + relativeError = numerator / denominator; //std::cout << " numerator: " << numerator << " denominator: " << denominator << std::endl; //std::cout << " error bound: " << numerator / denominator << std::endl; // if relative error is greater than delta, continue -- cgit v1.2.3