summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Bauer <mail@ulrich-bauer.org>2017-09-01 13:41:59 +0200
committerUlrich Bauer <mail@ulrich-bauer.org>2017-09-01 13:41:59 +0200
commit991d4e17c873d64d2ad3c262dbcdaea59157ed50 (patch)
treef95140bac6190ae57374d5bf246ce484233a9a28
parent0969baa58afd624a32fa73a1a7993d2d256bfa6d (diff)
clarified code setting coefficient for column addition
-rw-r--r--ripser.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/ripser.cpp b/ripser.cpp
index fceba33..49a1840 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -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 {