summaryrefslogtreecommitdiff
path: root/src/python/include
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2020-04-05 00:35:23 +0200
committerMarc Glisse <marc.glisse@inria.fr>2020-04-05 00:35:23 +0200
commit3ca13b31e5f48fbaef2ba7db980643716c18725c (patch)
treee8971fc9a5262c17ccb1104d262dccfedd98dc70 /src/python/include
parentb2cfc0691147ca122861bc423d41495c4b444dde (diff)
compute_persistence in python
Also simplify references, and replace print with assert for errors
Diffstat (limited to 'src/python/include')
-rw-r--r--src/python/include/Persistent_cohomology_interface.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/python/include/Persistent_cohomology_interface.h b/src/python/include/Persistent_cohomology_interface.h
index a29ebbee..e2b69a52 100644
--- a/src/python/include/Persistent_cohomology_interface.h
+++ b/src/python/include/Persistent_cohomology_interface.h
@@ -43,25 +43,16 @@ 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) { }
+ // 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);
}
- void maybe_compute_persistence(int homology_coeff_field, double min_persistence) {
- // Currently get_persistent_pairs safely returns an empty vector before compute_persistent_cohomology
- if(Base::get_persistent_pairs().empty())
- compute_persistence(homology_coeff_field, min_persistence);
- }
-
std::vector<std::pair<int, std::pair<double, double>>> get_persistence() {
// Custom sort and output persistence
cmp_intervals_by_dim_then_length cmp(stptr_);