summaryrefslogtreecommitdiff
path: root/GudhUI/utils/Persistence_compute.h
diff options
context:
space:
mode:
authorGard Spreemann <gspreemann@gmail.com>2017-04-20 11:15:58 +0200
committerGard Spreemann <gspreemann@gmail.com>2017-04-20 11:15:58 +0200
commiteadd3e18b55fc3b7a7d0420015902df2d58dcea5 (patch)
treece025060ea9045415b1f738886c8c70ed32218e8 /GudhUI/utils/Persistence_compute.h
parent5638527781e1d8cd916cd28f9d375eef7b5d820b (diff)
parent8d7329f3e5ad843e553c3c5503cecc28ef2eead6 (diff)
Merge tag 'upstream/2.0.0' into dfsg/latest
Upstream's 2.0.0 release.
Diffstat (limited to 'GudhUI/utils/Persistence_compute.h')
-rw-r--r--GudhUI/utils/Persistence_compute.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/GudhUI/utils/Persistence_compute.h b/GudhUI/utils/Persistence_compute.h
index 97165490..2dc03c8e 100644
--- a/GudhUI/utils/Persistence_compute.h
+++ b/GudhUI/utils/Persistence_compute.h
@@ -29,6 +29,7 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/distance_functions.h>
#include <gudhi/Persistent_cohomology.h>
+#include <gudhi/Rips_complex.h>
#include <vector>
@@ -69,21 +70,23 @@ template<typename SkBlComplex> class Persistence_compute {
points.emplace_back(std::move(pt_to_add));
}
+ using Simplex_tree = Gudhi::Simplex_tree<>;
+ using Filtration_value = Simplex_tree::Filtration_value;
+ using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>;
+ using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+ using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
- Graph_t prox_graph = compute_proximity_graph(points, params.threshold, euclidean_distance<Point_t>);
- Gudhi::Simplex_tree<> st;
- st.insert_graph(prox_graph);
- st.expansion(params.max_dim);
+ Rips_complex rips_complex(points, params.threshold, Euclidean_distance());
- Gudhi::persistent_cohomology::Persistent_cohomology< Gudhi::Simplex_tree<>,
- Gudhi::persistent_cohomology::Field_Zp > pcoh(st);
+ Simplex_tree st;
+ rips_complex.create_complex(st, params.max_dim);
+ Persistent_cohomology pcoh(st);
// initializes the coefficient field for homology
pcoh.init_coefficients(params.p);
// put params.min_pers
pcoh.compute_persistent_cohomology(params.min_pers);
stream << "persistence: \n";
stream << "p dimension birth death: \n";
-
pcoh.output_diagram(stream);
}
};