diff options
author | Ulrich Bauer <mail@ulrich-bauer.org> | 2017-09-01 13:41:59 +0200 |
---|---|---|
committer | Ulrich Bauer <mail@ulrich-bauer.org> | 2017-09-01 13:41:59 +0200 |
commit | 991d4e17c873d64d2ad3c262dbcdaea59157ed50 (patch) | |
tree | f95140bac6190ae57374d5bf246ce484233a9a28 | |
parent | 0969baa58afd624a32fa73a1a7993d2d256bfa6d (diff) |
clarified code setting coefficient for column addition
-rw-r--r-- | ripser.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -550,10 +550,13 @@ public: #endif index_t j = i; + + diameter_entry_t pivot; - // start with a dummy pivot entry with coefficient -1 in order to initialize + + // start with coefficient 1 in order to initialize // working_coboundary with the coboundary of the simplex with index column_to_reduce - diameter_entry_t pivot(0, -1, -1 + modulus); + coefficient_t factor = 1; #ifdef ASSEMBLE_REDUCTION_MATRIX // initialize reduction_coefficients as identity matrix @@ -566,7 +569,6 @@ public: bool might_be_apparent_pair = (i == j); do { - const coefficient_t factor = modulus - get_coefficient(pivot); #ifdef ASSEMBLE_REDUCTION_MATRIX #ifdef USE_COEFFICIENTS @@ -624,6 +626,7 @@ public: if (pair != pivot_column_index.end()) { j = pair->second; + factor = modulus - get_coefficient(pivot); continue; } } else { |