TTK
Loading...
Searching...
No Matches
ripser.h
Go to the documentation of this file.
1
4
5#pragma once
6
8
9namespace ripser {
10
11 using value_t = double;
12#if defined(TTK_ENABLE_RIPSER_128BITS_IDS) \
13 && (defined(__GNUC__) || defined(__clang__))
14 using index_t = __int128;
15#else
16 using index_t = int64_t;
17#endif
18 using coefficient_t = uint16_t;
19
20 template <typename PersistenceType>
21 void ripser(std::vector<std::vector<value_t>> points,
22 PersistenceType &ph,
23 value_t threshold,
24 index_t dim_max,
25 bool distanceMatrix,
26 bool criticalEdgesOnly = true,
27 bool infinitePairs = true,
28 coefficient_t modulus = 2);
29
30 template <typename PersistenceType>
31 void ripser(float *data,
32 int n,
33 int dim,
34 PersistenceType &ph,
35 value_t threshold,
36 index_t dim_max,
37 bool criticalEdgesOnly = true,
38 bool infinitePairs = true,
39 coefficient_t modulus = 2) {
40
41 std::vector<std::vector<value_t>> points(n);
42 for(int i = 0; i < n; ++i) {
43 for(int j = 0; j < dim; ++j)
44 points[i].push_back(data[dim * i + j]);
45 }
46
47 ripser(points, ph, threshold, dim_max, false, criticalEdgesOnly,
48 infinitePairs, modulus);
49 }
50
51} // namespace ripser
Definition ripser.h:9
uint16_t coefficient_t
Definition ripser.h:18
int64_t index_t
Definition ripser.h:16
double value_t
Definition ripser.h:11