summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Bauer <mail@ulrich-bauer.org>2016-11-28 14:13:46 -0500
committerUlrich Bauer <mail@ulrich-bauer.org>2016-11-28 14:13:46 -0500
commit8521d24c4584a6eb1149a604309ffa987862414f (patch)
tree7f9cab24a82218119b9ca893af910bb104f3863c
parenteb8c26dc3bad09678290c58d3637cb8336a37704 (diff)
allow for negative edge filtration values
-rw-r--r--ripser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ripser.cpp b/ripser.cpp
index 72e784c..efa672e 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -403,7 +403,7 @@ public:
}
value_t compute_diameter(const index_t index, index_t dim) const {
- value_t diam = 0;
+ value_t diam = -std::numeric_limits<value_t>::infinity();
vertices.clear();
get_simplex_vertices(index, dim, dist.size(), std::back_inserter(vertices));
@@ -682,7 +682,7 @@ public:
if (u != v) {
#ifdef PRINT_PERSISTENCE_PAIRS
- if (get_diameter(e) > 0) std::cout << " [0," << get_diameter(e) << ")" << std::endl;
+ if (get_diameter(e) != 0) std::cout << " [0," << get_diameter(e) << ")" << std::endl;
#endif
dset.link(u, v);
} else