37 execute(std::vector<DiagramType> &final_centroids,
38 std::vector<std::vector<std::vector<std::vector<MatchingType>>>>
52 std::vector<std::vector<std::vector<std::vector<MatchingType>>>>
57 const double delta_lim);
60 const double delta_lim);
63 const double delta_lim);
66 const double delta_lim);
80 void printMatchings(std::vector<std::vector<std::vector<MatchingType>>>);
86 std::vector<double> &previous_min_persistence,
87 std::vector<double> &min_persistence,
88 std::vector<std::vector<double>> &initial_diagonal_prices,
89 std::vector<std::vector<double>> &initial_off_diagonal_prices,
90 std::vector<int> &min_points_to_add,
91 bool add_points_to_barycenter,
92 bool first_enrichment);
102 std::vector<std::vector<std::vector<std::vector<MatchingType>>>> &);
105 std::vector<std::vector<MatchingType>> &matchings,
106 std::vector<std::vector<int>> &bidders_ids,
107 std::vector<BidderDiagram> ¤t_bidder_diagrams,
108 std::vector<BidderDiagram> &bidder_diagrams,
113 std::vector<std::vector<double>> *min_price,
114 std::vector<std::vector<double>> *min_diag_price,
115 std::vector<std::vector<std::vector<std::vector<MatchingType>>>>
125 std::vector<DiagramType> *data_saddle,
126 std::vector<DiagramType> *data_max) {
133 inline int setDos(
bool doMin,
bool doSad,
bool doMax) {
213 for(
int c = 0; c <
k_; ++c) {
214 msg.append(
" Cluster " + std::to_string(c) +
" = {");
215 for(
size_t idx = 0; idx <
clustering_[c].size(); ++idx) {
217 msg.append(std::to_string(
clustering_[c][idx]) +
"}");
222 msg.append(std::to_string(
clustering_[c][idx]) +
", ");
231 std::stringstream msg;
232 for(
int c = 0; c <
k_; ++c) {
233 msg <<
"Cluster " << c <<
" = {";
318 std::vector<bool>
r_;
319 std::vector<double>
u_;
320 std::vector<std::vector<double>>
l_;
Minimalist debugging class.
void setDebugMsgPrefix(const std::string &prefix)
void setKMeanspp(const bool use_kmeanspp)
std::vector< std::vector< int > > old_clustering_
void initializeAcceleratedKMeans()
std::vector< double > enrichCurrentBidderDiagrams(std::vector< double > &previous_min_persistence, std::vector< double > &min_persistence, std::vector< std::vector< double > > &initial_diagonal_prices, std::vector< std::vector< double > > &initial_off_diagonal_prices, std::vector< int > &min_points_to_add, bool add_points_to_barycenter, bool first_enrichment)
void setGeometricalFactor(const double geometrical_factor)
std::vector< int > inv_clustering_
void computeDistanceToCentroid()
double getLessPersistent(int type=-1)
std::vector< DiagramType > * inputDiagramsMax_
void setUseDeltaLim(const bool UseDeltaLim)
void computeBarycenterForTwo(std::vector< std::vector< MatchingType > > &matchings, std::vector< std::vector< int > > &bidders_ids, std::vector< BidderDiagram > ¤t_bidder_diagrams, std::vector< BidderDiagram > &bidder_diagrams, GoodDiagram &barycenter)
int setDos(bool doMin, bool doSad, bool doMax)
std::vector< std::vector< double > > centroidsDistanceMatrix_
void setDeltaLim(const double deltaLim)
std::vector< std::vector< double > > l_
std::vector< BidderDiagram > current_bidder_diagrams_saddle_
std::vector< PDBarycenter > barycenter_computer_min_
int setDiagrams(std::vector< DiagramType > *data_min, std::vector< DiagramType > *data_saddle, std::vector< DiagramType > *data_max)
BidderDiagram centroidToDiagram(const GoodDiagram ¢roid)
bool forceUseOfAlgorithm_
void initializeCentroidsKMeanspp()
double computeDistance(const BidderDiagram &D1, const BidderDiagram &D2, const double delta_lim)
std::vector< BidderDiagram > current_bidder_diagrams_min_
void setLambda(const double lambda)
void printRealDistancesToFile()
bool precision_criterion_
int distanceWritingOptions_
std::vector< BidderDiagram > bidder_diagrams_saddle_
std::vector< BidderDiagram > current_bidder_diagrams_max_
void invertInverseClusters()
std::array< double, 3 > getDistances() const
void setDistanceWritingOptions(const int distanceWritingOptions)
std::vector< PDBarycenter > barycenter_computer_max_
void setTimeLimit(const double time_limit)
void setUseProgressive(const bool use_progressive)
bool barycenter_inputs_reset_flag
void getCentroidDistanceMatrix()
std::vector< double > updateCentroidsPosition(std::vector< std::vector< double > > *min_price, std::vector< std::vector< double > > *min_diag_price, std::vector< std::vector< std::vector< std::vector< MatchingType > > > > &all_matchings, int only_matchings)
std::vector< GoodDiagram > centroids_with_price_min_
void printPricesToFile(int)
BidderDiagram diagramWithZeroPrices(const BidderDiagram &diagram)
double getMostPersistent(int type=-1)
void setUseKDTree(const bool use_kdtree)
std::vector< std::vector< int > > clustering_
std::vector< GoodDiagram > centroids_min_
GoodDiagram diagramToCentroid(const BidderDiagram &diagram)
void acceleratedUpdateClusters()
std::vector< double > distanceToCentroid_
std::vector< PDBarycenter > barycenter_computer_sad_
std::vector< std::vector< int > > current_bidder_ids_sad_
std::array< double, 3 > epsilon_
std::vector< BidderDiagram > bidder_diagrams_min_
std::vector< BidderDiagram > bidder_diagrams_max_
std::vector< GoodDiagram > centroids_saddle_
void setForceUseOfAlgorithm(const bool forceUseOfAlgorithm)
std::vector< std::vector< double > > getMinDiagonalPrices()
void setWasserstein(const int &wasserstein)
void computeBarycenterForTwoGlobal(std::vector< std::vector< std::vector< std::vector< MatchingType > > > > &)
~PDClustering() override=default
std::vector< std::vector< int > > centroids_sizes_
void initializeCentroids()
void initializeEmptyClusters()
std::vector< std::vector< double > > getMinPrices()
void printMatchings(std::vector< std::vector< std::vector< MatchingType > > >)
double geometrical_factor_
std::vector< std::vector< double > > getDistanceMatrix()
std::vector< DiagramType > * inputDiagramsMin_
void initializeBarycenterComputers(std::vector< double > &min_persistence)
std::vector< std::vector< int > > current_bidder_ids_min_
double nonMatchingWeight_
void setNonMatchingWeight(double nonMatchingWeight)
int setNumberOfInputs(int numberOfInputs)
GoodDiagram centroidWithZeroPrices(const GoodDiagram ¢roid)
std::vector< GoodDiagram > centroids_with_price_max_
std::vector< std::vector< int > > current_bidder_ids_max_
void resetDosToOriginalValues()
void setDeterministic(const bool deterministic)
std::vector< GoodDiagram > centroids_max_
void printOldClustering()
void printDistancesToFile()
std::vector< int > execute(std::vector< DiagramType > &final_centroids, std::vector< std::vector< std::vector< std::vector< MatchingType > > > > &all_matchings)
std::array< bool, 3 > original_dos
std::vector< DiagramType > * inputDiagramsSaddle_
std::vector< std::vector< int > > get_centroids_sizes()
void correctMatchings(std::vector< std::vector< std::vector< std::vector< MatchingType > > > > &previous_matchings)
void setAccelerated(const bool use_accelerated)
std::vector< GoodDiagram > centroids_with_price_saddle_
std::vector< Bidder > BidderDiagram
std::vector< Good > GoodDiagram
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)