TTK
Loading...
Searching...
No Matches
PersistenceDiagramBarycenter.h
Go to the documentation of this file.
1
14
15#pragma once
16
17// base code includes
18#include <KDTree.h>
19#include <PDBarycenter.h>
21#include <Wrapper.h>
22
23namespace ttk {
24
26
27 public:
29 this->threadNumber_ = 1;
30 this->setDebugMsgPrefix("PersistenceDiagramBarycenter");
31 }
32
33 ~PersistenceDiagramBarycenter() override = default;
34
35 void execute(
36 std::vector<DiagramType> &intermediateDiagrams,
37 DiagramType &barycenter,
38 std::vector<std::vector<std::vector<MatchingType>>> &all_matchings);
39
40 inline void setNumberOfInputs(const int numberOfInputs) {
41 numberOfInputs_ = numberOfInputs;
42 }
43
44 inline void setDeterministic(const bool deterministic) {
45 deterministic_ = deterministic;
46 }
47
48 inline void setWasserstein(const std::string &wasserstein) {
49 wasserstein_ = (wasserstein == "inf") ? -1 : stoi(wasserstein);
50 }
51
52 inline void setUseProgressive(const bool use_progressive) {
53 if(use_progressive)
54 epsilon_decreases_ = true;
55 use_progressive_ = use_progressive;
56 }
57
58 inline void setAlpha(const double alpha) {
59 alpha_ = alpha;
60 }
61
62 inline void setLambda(const double lambda) {
63 lambda_ = lambda;
64 }
65
66 inline void setMethod(const int &method) {
67 method_ = method;
68 }
69
70 inline void setReinitPrices(const bool reinit_prices) {
71 reinit_prices_ = reinit_prices;
72 }
73
74 inline void setEpsilonDecreases(const bool epsilon_decreases) {
76 epsilon_decreases_ = true;
77 else
78 epsilon_decreases_ = epsilon_decreases;
79 }
80
81 inline void setEarlyStoppage(const bool early_stoppage) {
82 early_stoppage_ = early_stoppage;
83 }
84
85 inline void setNonMatchingWeight(const double nonMatchingWeight) {
86 nonMatchingWeight_ = nonMatchingWeight;
87 }
88
89 inline void setDeltaLim(double deltaLim) {
90 delta_lim_ = deltaLim;
91 }
92
93 protected:
94 bool deterministic_{true};
98 bool use_progressive_{true};
99 double alpha_{1.0};
100 double lambda_{1.0};
101 double nonMatchingWeight_ = 1.0;
102 double delta_lim_{0.01};
103
106
107 std::vector<std::vector<double>> all_matchings_;
108 std::vector<std::vector<double>> all_old_matchings_;
109 std::vector<BidderDiagram> bidder_diagrams_;
110 std::vector<GoodDiagram> barycenter_goods_;
111
112 bool reinit_prices_{true};
115 };
116
117} // namespace ttk
Minimalist debugging class.
Definition Debug.h:88
void setDebugMsgPrefix(const std::string &prefix)
Definition Debug.h:364
void setUseProgressive(const bool use_progressive)
std::vector< std::vector< double > > all_matchings_
void setEarlyStoppage(const bool early_stoppage)
~PersistenceDiagramBarycenter() override=default
std::vector< std::vector< double > > all_old_matchings_
void setEpsilonDecreases(const bool epsilon_decreases)
void setDeterministic(const bool deterministic)
void setWasserstein(const std::string &wasserstein)
void execute(std::vector< DiagramType > &intermediateDiagrams, DiagramType &barycenter, std::vector< std::vector< std::vector< MatchingType > > > &all_matchings)
void setNumberOfInputs(const int numberOfInputs)
void setNonMatchingWeight(const double nonMatchingWeight)
void setReinitPrices(const bool reinit_prices)
The Topology ToolKit.
std::vector< PersistencePair > DiagramType
Persistence Diagram type as a vector of Persistence pairs.