summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Bauer <mail@ulrich-bauer.org>2019-07-26 09:53:58 +0200
committerUlrich Bauer <mail@ulrich-bauer.org>2019-07-26 09:53:58 +0200
commit63900ffee56d2fec6e847977cd1380b952e1bfb4 (patch)
tree78507071fd71be2ff36161303f4be24aad88907d
parentd4a5a8806e1467c63944f54bbfd94557bd417b2c (diff)
parent7ab2df354dc78e508b294735cd706e9a665561a0 (diff)
Merge commit '7ab2df354dc78e508b294735cd706e9a665561a0' into dev
* commit '7ab2df354dc78e508b294735cd706e9a665561a0': fixed warnings
-rw-r--r--Makefile6
-rw-r--r--ripser.cpp15
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<diameter_entry_t> 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<sparse_distance_matrix>::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<index_t> vertices;
const diameter_entry_t simplex;
const coefficient_t modulus;
@@ -753,9 +756,9 @@ template <> class ripser<sparse_distance_matrix>::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();