From a5b23f2160fa05c69dfa2698c5a7d59e44f671f4 Mon Sep 17 00:00:00 2001 From: Ulrich Bauer Date: Wed, 28 Aug 2019 14:30:41 +0200 Subject: renamed add_coboundary methods pivot hash map has size_t values --- ripser.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ripser.cpp b/ripser.cpp index 5549016..9479514 100644 --- a/ripser.cpp +++ b/ripser.cpp @@ -399,7 +399,7 @@ template class ripser { } }; - typedef hash_map entry_hash_map; + typedef hash_map entry_hash_map; public: ripser(DistanceMatrix&& _dist, index_t _dim_max, value_t _threshold, float _ratio, @@ -568,8 +568,8 @@ public: } template - void add_coboundary(const diameter_entry_t simplex, Column& working_reduction_column, - Column& working_coboundary, const index_t& dim) { + void add_simplex_coboundary(const diameter_entry_t simplex, const index_t& dim, + Column& working_reduction_column, Column& working_coboundary) { working_reduction_column.push(simplex); simplex_coboundary_enumerator cofacets(simplex, dim, *this); while (cofacets.has_next()) { @@ -581,16 +581,15 @@ public: template void add_coboundary(compressed_sparse_matrix& reduction_matrix, const std::vector& columns_to_reduce, - const index_t index_column_to_add, const coefficient_t factor, - Column& working_reduction_column, Column& working_coboundary, - const index_t& dim) { + const size_t index_column_to_add, const coefficient_t factor, const size_t& dim, + Column& working_reduction_column, Column& working_coboundary) { diameter_entry_t column_to_add(columns_to_reduce[index_column_to_add], factor); - add_coboundary(column_to_add, working_reduction_column, working_coboundary, dim); + add_simplex_coboundary(column_to_add, dim, working_reduction_column, working_coboundary); - for (auto simplex : reduction_matrix.subrange(index_column_to_add)) { + for (diameter_entry_t simplex : reduction_matrix.subrange(index_column_to_add)) { set_coefficient(simplex, get_coefficient(simplex) * factor % modulus); working_reduction_column.push(simplex); - add_coboundary(simplex, working_reduction_column, working_coboundary, dim); + add_simplex_coboundary(simplex, dim, working_reduction_column, working_coboundary); } } @@ -641,7 +640,7 @@ public: modulus; add_coboundary(reduction_matrix, columns_to_reduce, index_column_to_add, - factor, working_reduction_column, working_coboundary, dim); + factor, dim, working_reduction_column, working_coboundary); pivot = get_pivot(working_coboundary); } else { -- cgit v1.2.3