From dac3c59f13ba692c1d7770afa7a212d52c1a29d6 Mon Sep 17 00:00:00 2001 From: Ulrich Bauer Date: Sat, 13 Jul 2019 17:03:35 +0200 Subject: added missing headers --- ripser.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ripser.cpp b/ripser.cpp index 74e9b2e..70430eb 100644 --- a/ripser.cpp +++ b/ripser.cpp @@ -43,6 +43,8 @@ //#define USE_GOOGLE_HASHMAP +#include +#include #include #include #include @@ -146,7 +148,6 @@ index_t get_index(const entry_t& e) { return e.index; } index_t get_coefficient(const entry_t& e) { return e.coefficient; } void set_coefficient(entry_t& e, const coefficient_t c) { e.coefficient = c; } - std::ostream& operator<<(std::ostream& stream, const entry_t& e) { stream << get_index(e) << ":" << get_coefficient(e); return stream; @@ -383,19 +384,20 @@ template class ripser { const binomial_coeff_table binomial_coeff; const std::vector multiplicative_inverse; mutable std::vector coface_entries; - + struct entry_hash { - std::size_t operator()(const entry_t& e) const { return std::hash()(::get_index(e)); } + std::size_t operator()(const entry_t& e) const { + return std::hash()(::get_index(e)); + } }; - + struct equal_index { bool operator()(const entry_t& e, const entry_t& f) const { return ::get_index(e) == ::get_index(f); } }; - - 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, @@ -520,7 +522,7 @@ public: break; else set_coefficient(pivot, - (get_coefficient(pivot) + get_coefficient(column.top())) % modulus); + (get_coefficient(pivot) + get_coefficient(column.top())) % modulus); column.pop(); } if (get_coefficient(pivot) == 0) pivot = -1; @@ -537,13 +539,13 @@ public: #endif return pivot; } - + template diameter_entry_t get_pivot(Column& column) { diameter_entry_t result = pop_pivot(column); if (get_index(result) != -1) column.push(result); return result; } - + template diameter_entry_t init_coboundary_and_get_pivot(const diameter_entry_t simplex, Column& working_coboundary, const index_t& dim, -- cgit v1.2.3