From be9d2cf61fd43858d60ba055a0a44202e022a8f9 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sat, 13 Jul 2019 15:20:47 -0400 Subject: [PATCH] Drop empty templates. --- ripser/ripser.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/ripser/ripser.cpp b/ripser/ripser.cpp index 6d3d62d..9a1c064 100644 --- a/ripser/ripser.cpp +++ b/ripser/ripser.cpp @@ -248,7 +248,7 @@ class sparse_distance_matrix { size_t size() const { return neighbors.size(); } }; -template <> void compressed_distance_matrix::init_rows() { +void compressed_distance_matrix::init_rows() { value_t* pointer = &distances[0]; for (size_t i = 1; i < size(); ++i) { rows[i] = pointer; @@ -256,7 +256,7 @@ template <> void compressed_distance_matrix::init_rows() { } } -template <> void compressed_distance_matrix::init_rows() { +void compressed_distance_matrix::init_rows() { value_t* pointer = &distances[0] - 1; for (size_t i = 0; i < size() - 1; ++i) { rows[i] = pointer; @@ -264,13 +264,11 @@ template <> void compressed_distance_matrix::init_rows() { } } -template <> value_t compressed_distance_matrix::operator()(const index_t i, const index_t j) const { return i == j ? 0 : i > j ? rows[j][i] : rows[i][j]; } -template <> value_t compressed_distance_matrix::operator()(const index_t i, const index_t j) const { return i == j ? 0 : i < j ? rows[j][i] : rows[i][j]; @@ -816,7 +814,7 @@ template class ripser { } }; -template <> class ripser::simplex_coboundary_enumerator { +class ripser::simplex_coboundary_enumerator { private: index_t idx_below, idx_above, v, k; std::vector vertices; @@ -855,7 +853,7 @@ template <> class ripser::simplex_coboundary_e } }; -template <> class ripser::simplex_coboundary_enumerator { +class ripser::simplex_coboundary_enumerator { private: const ripser& parent; @@ -930,7 +928,7 @@ template <> class ripser::simplex_coboundary_enumerator } }; -template <> std::vector ripser::get_edges() { +std::vector ripser::get_edges() { std::vector edges; for (index_t index = binomial_coeff(n, 2); index-- > 0;) { value_t diameter = compute_diameter(index, 1); @@ -939,7 +937,7 @@ template <> std::vector ripser std::vector ripser::get_edges() { +std::vector ripser::get_edges() { std::vector edges; for (index_t i = 0; i < n; ++i) for (auto n : dist.neighbors[i]) { @@ -949,17 +947,16 @@ template <> std::vector ripser::get_ed return edges; } -template <> value_t ripser::get_vertex_birth(index_t i) { +value_t ripser::get_vertex_birth(index_t i) { //TODO: Dummy for now; nonzero vertex births are only done through //sparse matrices at the moment return 0.0; } -template <> value_t ripser::get_vertex_birth(index_t i) { +value_t ripser::get_vertex_birth(index_t i) { return dist.vertex_births[i]; } -template <> void ripser::assemble_columns_to_reduce( std::vector& simplices, std::vector& columns_to_reduce, hash_map& pivot_column_index, index_t dim) { @@ -978,7 +975,6 @@ void ripser::assemble_columns_to_reduce( greater_diameter_or_smaller_index()); } -template <> void ripser::assemble_columns_to_reduce( std::vector& simplices, std::vector& columns_to_reduce, hash_map& pivot_column_index, index_t dim) {