summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Bauer <mail@ulrich-bauer.org>2019-07-13 18:20:33 +0200
committerUlrich Bauer <mail@ulrich-bauer.org>2019-07-13 18:20:33 +0200
commitac9b1eeb75da3a55c72d73a35cbe18195c92b881 (patch)
tree9732420ea80e07e417baf0c813852c0364e38969
parent30a1d9fd63efbe89f2d2276109d8b95b966501fa (diff)
fixed pop_pivot for Z/2Z coefficients
-rw-r--r--ripser.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/ripser.cpp b/ripser.cpp
index 51b3d9e..e166080 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -531,10 +531,8 @@ public:
while (!column.empty()) {
pivot = column.top();
column.pop();
- if (!column.empty()) {
- if (get_index(column.top()) != get_index(pivot)) return pivot;
- column.pop();
- }
+ if (column.empty() || get_index(column.top()) != get_index(pivot)) return pivot;
+ column.pop();
}
pivot = -1;
#endif