TTK
Loading...
Searching...
No Matches
PersistenceDiagramDistanceMatrix.h
Go to the documentation of this file.
1
19
20#pragma once
21
22#include <array>
23
24#include <Debug.h>
27
28namespace ttk {
29
30 class PersistenceDiagramDistanceMatrix : virtual public Debug {
31
32 public:
34 this->setDebugMsgPrefix("PersistenceDiagramDistanceMatrix");
35 }
36
37 std::vector<std::vector<double>>
38 execute(const std::vector<DiagramType> &intermediateDiagrams,
39 const std::array<size_t, 2> &nInputs) const;
40
41 inline void setWasserstein(const int data) {
42 Wasserstein = data;
43 }
44 inline void setDos(const bool min, const bool sad, const bool max) {
45 do_min_ = min;
46 do_sad_ = sad;
47 do_max_ = max;
48 }
49 inline void setAlpha(const double alpha) {
50 Alpha = alpha;
51 }
52 inline void setLambda(const double lambda) {
53 Lambda = lambda;
54 }
55 inline void setDeltaLim(const double deltaLim) {
56 DeltaLim = deltaLim;
57 }
58 inline void setMaxNumberOfPairs(const size_t data) {
59 MaxNumberOfPairs = data;
60 }
61 inline void setMinPersistence(const double data) {
62 MinPersistence = data;
63 }
64 inline void setConstraint(const int data) {
65 if(data == 0) {
67 } else if(data == 1) {
69 } else if(data == 2) {
71 } else if(data == 3) {
73 } else if(data == 4) {
75 }
76 }
77
78 protected:
79 double
80 getMostPersistent(const std::vector<BidderDiagram> &bidder_diags) const;
81 double computePowerDistance(const BidderDiagram &D1,
82 const BidderDiagram &D2) const;
83 void getDiagramsDistMat(const std::array<size_t, 2> &nInputs,
84 std::vector<std::vector<double>> &distanceMatrix,
85 const std::vector<BidderDiagram> &diags_min,
86 const std::vector<BidderDiagram> &diags_sad,
87 const std::vector<BidderDiagram> &diags_max) const;
88 void setBidderDiagrams(const size_t nInputs,
89 std::vector<DiagramType> &inputDiagrams,
90 std::vector<BidderDiagram> &bidder_diags) const;
91
93 const std::vector<BidderDiagram> &bidder_diags,
94 std::vector<BidderDiagram> &current_bidder_diags,
95 const std::vector<double> &maxDiagPersistence) const;
96
98 double Alpha{1.0};
99 double DeltaLim{0.01};
100 // lambda : 0<=lambda<=1
101 // parametrizes the point used for the physical (critical) coordinates of
102 // the persistence paired lambda = 1 : extremum (min if pair min-sad, max if
103 // pair sad-max) lambda = 0 : saddle (bad stability) lambda = 1/2 : middle
104 // of the 2 critical points of the pair
105 double Lambda;
107 double MinPersistence{0.1};
108 bool do_min_{true}, do_sad_{true}, do_max_{true};
109
118 };
119} // namespace ttk
Minimalist debugging class.
Definition Debug.h:88
void setDebugMsgPrefix(const std::string &prefix)
Definition Debug.h:364
void enrichCurrentBidderDiagrams(const std::vector< BidderDiagram > &bidder_diags, std::vector< BidderDiagram > &current_bidder_diags, const std::vector< double > &maxDiagPersistence) const
std::vector< std::vector< double > > execute(const std::vector< DiagramType > &intermediateDiagrams, const std::array< size_t, 2 > &nInputs) const
double getMostPersistent(const std::vector< BidderDiagram > &bidder_diags) const
void setBidderDiagrams(const size_t nInputs, std::vector< DiagramType > &inputDiagrams, std::vector< BidderDiagram > &bidder_diags) const
double computePowerDistance(const BidderDiagram &D1, const BidderDiagram &D2) const
void getDiagramsDistMat(const std::array< size_t, 2 > &nInputs, std::vector< std::vector< double > > &distanceMatrix, const std::vector< BidderDiagram > &diags_min, const std::vector< BidderDiagram > &diags_sad, const std::vector< BidderDiagram > &diags_max) const
void setDos(const bool min, const bool sad, const bool max)
The Topology ToolKit.
std::vector< Bidder > BidderDiagram