20 std::pair<std::vector<int>,
double>>;
31 std::vector<double> coordinates(0);
32 std::vector<std::vector<double>> weights(1);
33 for(
unsigned i = 0; i < goodDiagram.size(); ++i) {
35 goods_.emplace_back(g.first, g.second,
false, i);
36 coordinates.push_back(g.first);
37 coordinates.push_back(g.second);
38 weights[0].push_back(0.);
41 kdt_ = std::make_unique<KDT>(
true, wasserstein_);
42 correspondence_kdt_map_
43 = kdt_->build(coordinates.data(), goodDiagram.size(), 2, weights, 1);
49 for(
unsigned i = 0; i < bidderDiagram.size(); ++i) {
50 const ValuesPair &b = getPair(bidderDiagram[i]);
51 Bidder bidder(b.first, b.second,
false, i);
53 bidders_.emplace_back(bidder);
62 double runAuction(std::vector<MatchingType> &matchings) {
64 delta_, *kdt_, correspondence_kdt_map_);
70 const double w = auction.
run(matchings);
78 std::vector<MatchingType> matchings;
83 wasserstein_ = wasserstein;
91 double wasserstein_{2.};
94 std::unique_ptr<KDT> kdt_;
95 std::vector<KDT *> correspondence_kdt_map_;
100 static inline ValuesPair getPair(
const T &p) {
101 return {p.first, p.second};
107 PersistenceDiagramWarmRestartAuction<RipsPersistencePair>::getPair(
109 return {p.first.second, p.second.second};
114 PersistenceDiagramWarmRestartAuction<PersistencePair>::getPair(
116 return {p.birth.sfValue, p.death.sfValue};
void setPositionInAuction(const int pos)
void setDebugMsgPrefix(const std::string &prefix)
double run(std::vector< MatchingType > &matchings, const int kdt_index=0)
PersistenceDiagramWarmRestartAuction(const std::vector< T > &goodDiagram)
void reinitializeGoodsPrice()
void setWasserstein(double wasserstein)
void setNewBidder(const std::vector< T > &bidderDiagram)
double runAuction(std::vector< MatchingType > &matchings)
void setDelta(double delta)
TTK base package defining the standard types.
std::pair< double, double > ValuesPair
std::vector< Good > GoodDiagram
std::pair< std::pair< std::vector< int >, double >, std::pair< std::vector< int >, double > > RipsPersistencePair
std::vector< Bidder > BidderDiagram
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/| (_) |"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)