From 7ab2df354dc78e508b294735cd706e9a665561a0 Mon Sep 17 00:00:00 2001 From: Ulrich Bauer Date: Sat, 20 Jul 2019 10:37:15 +0200 Subject: fixed warnings --- Makefile | 6 +++--- ripser.cpp | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 4967c0d..ab410bd 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,13 @@ all: ripser ripser-coeff ripser-debug ripser: ripser.cpp - c++ -std=c++11 ripser.cpp -o ripser -Ofast -D NDEBUG + c++ -std=c++11 -Wall ripser.cpp -o ripser -Ofast -D NDEBUG ripser-coeff: ripser.cpp - c++ -std=c++11 ripser.cpp -o ripser-coeff -Ofast -D NDEBUG -D USE_COEFFICIENTS + c++ -std=c++11 -Wall ripser.cpp -o ripser-coeff -Ofast -D NDEBUG -D USE_COEFFICIENTS ripser-debug: ripser.cpp - c++ -std=c++11 ripser.cpp -o ripser-debug -g + c++ -std=c++11 -Wall ripser.cpp -o ripser-debug -g clean: diff --git a/ripser.cpp b/ripser.cpp index e166080..8c345cc 100644 --- a/ripser.cpp +++ b/ripser.cpp @@ -72,7 +72,9 @@ typedef float value_t; typedef int64_t index_t; typedef uint16_t coefficient_t; +#ifdef INDICATE_PROGRESS static const std::chrono::milliseconds time_step(40); +#endif static const std::string clear_line("\r\033[K"); @@ -436,8 +438,8 @@ public: #ifdef INDICATE_PROGRESS std::cerr << clear_line << "assembling columns" << std::flush; -#endif std::chrono::steady_clock::time_point next = std::chrono::steady_clock::now() + time_step; +#endif --dim; columns_to_reduce.clear(); @@ -603,8 +605,9 @@ public: compressed_sparse_matrix reduction_matrix; +#ifdef INDICATE_PROGRESS std::chrono::steady_clock::time_point next = std::chrono::steady_clock::now() + time_step; - +#endif for (index_t index_column_to_reduce = 0; index_column_to_reduce < columns_to_reduce.size(); ++index_column_to_reduce) { @@ -740,7 +743,7 @@ public: template <> class ripser::simplex_coboundary_enumerator { const ripser& parent; - index_t idx_below, idx_above, v, k, max_vertex_below; + index_t idx_below, idx_above, k; std::vector vertices; const diameter_entry_t simplex; const coefficient_t modulus; @@ -753,9 +756,9 @@ template <> class ripser::simplex_coboundary_enumerator public: simplex_coboundary_enumerator(const diameter_entry_t _simplex, const index_t _dim, const ripser& _parent) - : parent(_parent), idx_below(get_index(_simplex)), idx_above(0), v(parent.n - 1), - k(_dim + 1), max_vertex_below(parent.n - 1), simplex(_simplex), modulus(parent.modulus), - dist(parent.dist), binomial_coeff(parent.binomial_coeff), vertices(_dim + 1), + : parent(_parent), idx_below(get_index(_simplex)), idx_above(0), + k(_dim + 1), + vertices(_dim + 1), simplex(_simplex), modulus(parent.modulus), dist(parent.dist), binomial_coeff(parent.binomial_coeff), neighbor_it(dist.neighbor_it), neighbor_end(dist.neighbor_end) { neighbor_it.clear(); neighbor_end.clear(); -- cgit v1.2.3