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 protected:
86 bool deterministic_{true};
90 bool use_progressive_{true};
91 double alpha_{1.0};
92 double lambda_{1.0};
93
96
97 std::vector<std::vector<double>> all_matchings_;
98 std::vector<std::vector<double>> all_old_matchings_;
99 std::vector<BidderDiagram> bidder_diagrams_;
100 std::vector<GoodDiagram> barycenter_goods_;
101
102 bool reinit_prices_{true};
105 };
106
107} // namespace ttk
int threadNumber_
Definition: BaseClass.h:95
Minimalist debugging class.
Definition: Debug.h:88
void setDebugMsgPrefix(const std::string &prefix)
Definition: Debug.h:364
std::vector< BidderDiagram > bidder_diagrams_
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 setReinitPrices(const bool reinit_prices)
The Topology ToolKit.
std::vector< PersistencePair > DiagramType
Persistence Diagram type as a vector of Persistence pairs.