30 double geometricalFactor,
34 double nonMatchingWeight = 1.0)
43 double geometricalFactor,
47 std::vector<KDT *> &correspondence_kdt_map,
49 double initial_diag_price = {},
50 bool use_kdTree =
true,
51 double nonMatchingWeight = 1.0)
61 Good g{b.x_, b.y_,
true, -b.
id_ - 1};
62 g.projectOnDiagonal();
63 if(b.diagonal_price_ > 0) {
64 g.setPrice(b.diagonal_price_);
66 g.setPrice(initial_diag_price);
69 std::pair<int, double>
const pair = std::make_pair(i, g.getPrice());
75 Bidder b{g.x_, g.y_,
true, -g.id_ - 1};
76 b.projectOnDiagonal();
77 b.setPositionInAuction(
bidders_.size());
93 bool get_diagonal_matches =
false);
94 double run(std::vector<MatchingType> &matchings,
const int kdt_index = 0);
96 std::vector<MatchingType> matchings{};
97 return this->
run(matchings);
102 this->n_bidders_ = BD.size();
103 this->n_goods_ = GD.size();
112 g.projectOnDiagonal();
114 std::pair<int, double>
const pair = std::make_pair(i, g.getPrice());
121 b.projectOnDiagonal();
122 b.setPositionInAuction(
bidders_.size());
143 g.projectOnDiagonal();
145 std::pair<int, double>
const pair = std::make_pair(i, g.getPrice());
152 b.projectOnDiagonal();
153 b.setPositionInAuction(
bidders_.size());
165 for(
size_t i = 0; i < diagram1.size(); i++) {
175 for(
size_t i = 0; i < diagram2.size(); i++) {
177 Good const g{diagram2[i],
static_cast<int>(i),
lambda_};
188 std::vector<double> coordinates;
189 for(
size_t i = 0; i <
goods_.size(); i++) {
210 double max_persistence = 0;
211 for(
const auto &b : this->
bidders_) {
212 double const persistence = b.getPersistence();
213 if(persistence > max_persistence) {
214 max_persistence = persistence;
217 for(
const auto &g : this->
goods_) {
218 double const persistence = g.getPersistence();
219 if(persistence > max_persistence) {
220 max_persistence = persistence;
227 for(
size_t i = 0; i <
bidders_.size(); i++) {
235 for(
auto &g : this->
goods_) {
245 for(
size_t i = 0; i <
bidders_.size(); i++) {
259 if(denominator <= 0) {
260 return std::numeric_limits<double>::max();
277 double min_price = std::numeric_limits<double>::max();
280 if(price < min_price) {
294 std::priority_queue<std::pair<int, double>,
295 std::vector<std::pair<int, double>>,
void setDiagonalPrice(const double price)
void setPositionInAuction(const int pos)
KDTree< double, std::array< double, 5 > > KDT
const Good & getProperty() const
Minimalist debugging class.
KDTreeMap build(dataType *data, const int &ptNumber, const int &dimension, const std::vector< std::vector< dataType > > &weights={}, const int &weightNumber=1, const int &nodeNumber=-1, const bool &preciseBoundingBox=false)
std::array< float, 3 > coords_
double cost(const PersistenceDiagramAuctionActor &g, const int wasserstein, const double geometricalFactor, const double nonMatchingWeight) const
void runAuctionRound(int &n_biddings, const int kdt_index=0)
double getRelativePrecision()
std::vector< KDT * > & correspondence_kdt_map_
PersistenceDiagramAuction(int wasserstein, double geometricalFactor, double lambda, double delta_lim, bool use_kdTree, double nonMatchingWeight=1.0)
PersistenceDiagramAuction(BidderDiagram &bidders, GoodDiagram &goods, int wasserstein, double geometricalFactor, double lambda, double delta_lim, KDT &kdt, std::vector< KDT * > &correspondence_kdt_map, double epsilon={}, double initial_diag_price={}, bool use_kdTree=true, double nonMatchingWeight=1.0)
std::priority_queue< std::pair< int, double >, std::vector< std::pair< int, double > >, Compare > diagonal_queue_
void setEpsilon(const double epsilon)
void updateDiagonalPrices()
GoodDiagram default_goods_
void BuildAuctionDiagrams(const DiagramType &diagram1, const DiagramType &diagram2)
int getAugmentedNumberOfBidders()
GoodDiagram diagonal_goods_
double initLowerBoundCost(const int kdt_index=0)
double getMatchingsAndDistance(std::vector< MatchingType > &matchings, bool get_diagonal_matches=false)
double nonMatchingWeight_
double getMatchingDistance()
std::vector< KDT * > default_correspondence_kdt_map_
double getMinimalDiagonalPrice()
void BuildAuctionDiagrams(const BidderDiagram &BD, const GoodDiagram &GD)
void initLowerBoundCostWeight(double delta_lim)
double lowerBoundCostWeight_
void buildUnassignedBidders()
double geometricalFactor_
std::queue< int > unassignedBidders_
BidderDiagram default_bidders_
void setGoods(const DiagramType &diagram2)
void setBidders(const DiagramType &diagram1)
T1 pow(const T1 val, const T2 n)
std::vector< Bidder > BidderDiagram
std::vector< PersistencePair > DiagramType
Persistence Diagram type as a vector of Persistence pairs.
std::vector< Good > GoodDiagram