TTK
Loading...
Searching...
No Matches
PairCells.h
Go to the documentation of this file.
1
12
13#pragma once
14
15#include <Debug.h>
17
18#ifdef TTK_ENABLE_CGAL
19#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
20#endif
21
22#include <set>
23
24namespace ttk::rpd {
25
26 class PairCells : virtual public Debug {
27 public:
28#ifdef TTK_ENABLE_CGAL
29 PairCells(const std::vector<CGAL::Epick::Point_2> &points,
30 double upperBound = inf,
31 bool parallelSort = false,
32 bool parallelMatrixConstruction = false);
33#endif
34 PairCells(const PointCloud &points,
35 bool distanceMatrix = false,
36 double upperBound = inf,
37 bool parallelSort = false,
38 bool parallelMatrixConstruction = false);
39 PairCells(float *data,
40 int n,
41 int dim,
42 double upperBound = inf,
43 bool parallelSort = false,
44 bool parallelMatrixConstruction = false);
45
46 void run();
47
48 void getDiagram(MultidimensionalDiagram &diagrams) const;
50 std::vector<Generator1> &generators) const;
51
52 void getCascades(std::vector<Cascade> &cascades, EdgeSets3 &critical) const;
53 void getCascades(EdgeSets4 &critical) const;
54 void enrichCascades(std::set<Edge> &cascadeSet,
55 EdgeSets4 &critical,
56 std::vector<int> const &globalIndices) const;
57
58 private:
59 const int n_;
60 std::vector<double> compressedDM_{};
61 const double bound_;
62 const bool parallelSort_;
63 const bool parallelMatrixConstruction_;
64
65 std::vector<FiltratedEdge> edges_{};
66 std::vector<FiltratedTriangle> triangles_{};
67 std::vector<id_t> edgesIndices_{};
68 std::vector<id_t> edgesOrder_{};
69 std::vector<id_t> trianglesIndices_{};
70
71 std::vector<id_t> edgesPartner_{};
72 std::vector<id_t> trianglesPartner_{};
73 std::vector<std::vector<id_t>> boundaries_{};
74 int nEdges_{};
75 int nPairedEdges_{0};
76 int nTriangles_{};
77
78 std::vector<std::vector<id_t>> cascadeEdges_{};
79
84 double &DM(unsigned i, unsigned j) {
85 return compressedDM_[j * (j - 1) / 2 + i];
86 }
87
88 void initialize();
89 void initializeWithBound();
90
91 void executeKruskal();
92 void symbolicPerturbation(double eps
93 = std::numeric_limits<float>::epsilon());
94 void apparentPairs();
95
96 void pairCells();
97 id_t eliminateBoundaries(id_t s);
98 };
99} // namespace ttk::rpd
void getDiagram(MultidimensionalDiagram &diagrams) const
void getCascades(std::vector< Cascade > &cascades, EdgeSets3 &critical) const
void getDiagramAndGenerators(MultidimensionalDiagram &diagrams, std::vector< Generator1 > &generators) const
PairCells(const PointCloud &points, bool distanceMatrix=false, double upperBound=inf, bool parallelSort=false, bool parallelMatrixConstruction=false)
Definition PairCells.cpp:25
void enrichCascades(std::set< Edge > &cascadeSet, EdgeSets4 &critical, std::vector< int > const &globalIndices) const
std::array< EdgeSet, 4 > EdgeSets4
constexpr value_t inf
std::vector< std::vector< value_t > > PointCloud
std::vector< Diagram > MultidimensionalDiagram
std::array< EdgeSet, 3 > EdgeSets3