diff options
author | Arnur Nigmetov <a.nigmetov@gmail.com> | 2016-09-05 13:32:05 +0200 |
---|---|---|
committer | Arnur Nigmetov <a.nigmetov@gmail.com> | 2016-09-05 13:32:05 +0200 |
commit | 7b850b8ee43fb7f8a0b2a1565ed01102d40b0a14 (patch) | |
tree | 171852c6acd2c8be4390c53a52debf70ca4930b3 /geom_matching/wasserstein/include/auction_runner_jac.h | |
parent | d1cf630f193cff61c83999600550634032ed1739 (diff) |
Technical changes for R integration
Avoid including iostream (R complains about that). All output protected by
preprocessor directive (R checker should not see an instance of std::cout << in
your code). Also added getWassersteinCost to be in line with the Dionysus
implementation used in TDA.
Diffstat (limited to 'geom_matching/wasserstein/include/auction_runner_jac.h')
-rw-r--r-- | geom_matching/wasserstein/include/auction_runner_jac.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/geom_matching/wasserstein/include/auction_runner_jac.h b/geom_matching/wasserstein/include/auction_runner_jac.h index ae0cb56..22d42b0 100644 --- a/geom_matching/wasserstein/include/auction_runner_jac.h +++ b/geom_matching/wasserstein/include/auction_runner_jac.h @@ -45,12 +45,13 @@ using AuctionOracle = AuctionOracleKDTreeRestricted; // 1. epsilonCommonRatio // 2. maxIterNum -class AuctionRunnerJak { +class AuctionRunnerJac { public: - AuctionRunnerJak(const std::vector<DiagramPoint>& A, const std::vector<DiagramPoint>& B, const double q, const double _delta, const double _internal_p); + AuctionRunnerJac(const std::vector<DiagramPoint>& A, const std::vector<DiagramPoint>& B, const double q, const double _delta, const double _internal_p); void setEpsilon(double newVal) { assert(epsilon > 0.0); epsilon = newVal; }; - double getEpsilon(void) const { return epsilon; } - double getWassersteinDistance(void); + double getEpsilon() const { return epsilon; } + double getWassersteinDistance(); + double getWassersteinCost(); static constexpr double epsilonCommonRatio { 5 }; // next epsilon = current epsilon / epsilonCommonRatio static constexpr int maxIterNum { 25 }; // maximal number of iterations of epsilon-scaling private: @@ -66,6 +67,7 @@ private: double internal_p; double weightAdjConst; double wassersteinDistance; + double wassersteinCost; std::vector<IdxValPair> bidTable; // to get the 2 best items std::unique_ptr<AuctionOracle> oracle; @@ -76,18 +78,18 @@ private: // private methods void assignGoodToBidder(const IdxType bidderIdx, const IdxType itemsIdx); void assignToBestBidder(const IdxType itemsIdx); - void clearBidTable(void); - void runAuction(void); - void runAuctionPhase(void); + void clearBidTable(); + void runAuction(); + void runAuctionPhase(); void submitBid(IdxType bidderIdx, const IdxValPair& itemsBidValuePair); - void flushAssignment(void); + void flushAssignment(); // for debug only - void sanityCheck(void); - void printDebug(void); - int countUnhappy(void); - void printMatching(void); - double getDistanceToQthPowerInternal(void); + void sanityCheck(); + void printDebug(); + int countUnhappy(); + void printMatching(); + double getDistanceToQthPowerInternal(); }; |