diff options
author | mathieu <mathieu.carriere3@gmail.com> | 2020-01-16 15:58:15 -0500 |
---|---|---|
committer | mathieu <mathieu.carriere3@gmail.com> | 2020-01-16 15:58:15 -0500 |
commit | 5694670b3e20f0cb935a751614ef12b6009a60c0 (patch) | |
tree | 9a39363136004db0eb6195d659875ff75ee72cef /src/python/include/Persistent_cohomology_interface.h | |
parent | 436a7fbe36a9de6a969afd5978c3d496773a8690 (diff) |
fix to detect infinite persistence
Diffstat (limited to 'src/python/include/Persistent_cohomology_interface.h')
-rw-r--r-- | src/python/include/Persistent_cohomology_interface.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/python/include/Persistent_cohomology_interface.h b/src/python/include/Persistent_cohomology_interface.h index 774eb56a..acc32b21 100644 --- a/src/python/include/Persistent_cohomology_interface.h +++ b/src/python/include/Persistent_cohomology_interface.h @@ -124,16 +124,15 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol std::vector<std::pair<int, std::pair<std::pair<double, int>, std::pair<double, int>>>> persistence; for (auto pair : persistent_pairs) { - int splx0, splx1; - double f0 = stptr_->filtration(get<0>(pair)); // Recursively get the top-dimensional cells / cofaces associated to the persistence generator std::vector<int> faces0; top_dimensional_cofaces(faces0, stptr_->key(get<0>(pair))); // Find the top-dimensional cell / coface with the same filtration value int cf; for (int i = 0; i < faces0.size(); i++){ if (stptr_->filtration(faces0[i]) == f0){cf = i; break;}} // Retrieve the index of the corresponding top-dimensional cell in the input data - splx0 = order[faces0[cf]]; + int splx0 = order[faces0[cf]]; + int splx1 = -1; if (isfinite(stptr_->filtration(get<1>(pair)))){ double f1 = stptr_->filtration(get<1>(pair)); // Recursively get the top-dimensional cells / cofaces associated to the persistence generator |