diff options
author | Ulrich Bauer <mail@ulrich-bauer.org> | 2019-08-19 12:49:33 +0200 |
---|---|---|
committer | Ulrich Bauer <mail@ulrich-bauer.org> | 2019-08-19 12:49:33 +0200 |
commit | 3c6186b8450ef1c357b21042d9e963060a904edc (patch) | |
tree | 148a114386bb98d8532953b3c2055beee76119c4 | |
parent | 3fd98444e764f490752aac427011180c19e69e31 (diff) |
code cleanup pop_pivot
-rw-r--r-- | ripser.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -521,13 +521,13 @@ public: if (get_coefficient(pivot) == 0) pivot = column.top(); else if (get_index(column.top()) != get_index(pivot)) - break; + return pivot; else set_coefficient(pivot, (get_coefficient(pivot) + get_coefficient(column.top())) % modulus); column.pop(); } - if (get_coefficient(pivot) == 0) pivot = -1; + return (get_coefficient(pivot) == 0) ? -1 : pivot; #else while (!column.empty()) { pivot = column.top(); @@ -535,9 +535,8 @@ public: if (column.empty() || get_index(column.top()) != get_index(pivot)) return pivot; column.pop(); } - pivot = -1; + return -1; #endif - return pivot; } template <typename Column> diameter_entry_t get_pivot(Column& column) { |