summaryrefslogtreecommitdiff
path: root/src/python/include/Persistent_cohomology_interface.h
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2020-04-29 10:14:45 +0200
committerMarc Glisse <marc.glisse@inria.fr>2020-04-29 10:14:45 +0200
commit12dcefe5578c0eb9707eceb878bd62c053c95e90 (patch)
treeb9959288b84affa3f9639ef5367e44fa552d2286 /src/python/include/Persistent_cohomology_interface.h
parent1fc55e54ed2f24969a691914edee642f97142fa9 (diff)
parent0fb22e4c499b665ad505e5d9d2c325f7561f69c4 (diff)
Merge remote-tracking branch 'origin/master' into gen2
Diffstat (limited to 'src/python/include/Persistent_cohomology_interface.h')
-rw-r--r--src/python/include/Persistent_cohomology_interface.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/python/include/Persistent_cohomology_interface.h b/src/python/include/Persistent_cohomology_interface.h
index 3074389c..0de9bd5c 100644
--- a/src/python/include/Persistent_cohomology_interface.h
+++ b/src/python/include/Persistent_cohomology_interface.h
@@ -42,21 +42,19 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol
};
public:
- Persistent_cohomology_interface(FilteredComplex* stptr)
- : Base(*stptr),
- stptr_(stptr) { }
-
- Persistent_cohomology_interface(FilteredComplex* stptr, bool persistence_dim_max)
+ Persistent_cohomology_interface(FilteredComplex* stptr, bool persistence_dim_max=false)
: Base(*stptr, persistence_dim_max),
stptr_(stptr) { }
- std::vector<std::pair<int, std::pair<double, double>>> get_persistence(int homology_coeff_field,
- double min_persistence) {
+ // TODO: move to the constructors?
+ void compute_persistence(int homology_coeff_field, double min_persistence) {
Base::init_coefficients(homology_coeff_field);
Base::compute_persistent_cohomology(min_persistence);
+ }
- auto const& persistent_pairs = Base::get_persistent_pairs();
+ std::vector<std::pair<int, std::pair<double, double>>> get_persistence() {
std::vector<std::pair<int, std::pair<double, double>>> persistence;
+ auto const& persistent_pairs = Base::get_persistent_pairs();
persistence.reserve(persistent_pairs.size());
for (auto pair : persistent_pairs) {
persistence.emplace_back(stptr_->dimension(get<0>(pair)),